From b5c5eb130ca0848124f9d136af4be142ad5aac07 Mon Sep 17 00:00:00 2001
From: binxie <137736985@qq.com>
Date: 星期一, 26 六月 2023 14:42:02 +0800
Subject: [PATCH] backup0626
---
force-app/main/default/lwc/lexNewOrder/lexNewOrder.js | 16
force-app/main/default/lwc/lexCustomLightningDatatable/lexCustomLightningDatatable.html | 4
manifest/LEXC01packagelexcommunitynew.xml | 7
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 | 626
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 | 5
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/aura/CreateTarget/CreateTargetHelper.js | 12
force-app/main/default/lwc/customShipmentNumberComp/customShipmentNumberComp.js | 48
force-app/main/default/lwc/lexRemoveBox/lexRemoveBox.html | 360
force-app/main/default/aura/CreateTarget/CreateTarget.cmp-meta.xml | 2
force-app/main/default/lwc/lexCustomDiffReasonComp/lexCustomDiffReasonComp.html | 12
force-app/main/default/aura/RetrospectiveWeeklyReport/RetrospectiveWeeklyReportHelper.js | 66
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/lexArriveGoods/lexArriveGoods.js-meta.xml | 4
force-app/main/default/lwc/lexCancelRemoveBox/lexCancelRemoveBox.js | 411
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/aura/WeeklyReport/WeeklyReport.cmp | 4
force-app/main/default/lwc/customShipmentNumberComp/customShipmentNumberComp.html | 17
force-app/main/default/lwc/lexDealerInquiryModifyState/lexDealerInquiryModifyState.js | 773
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/pages/DealerInquiryModifyState.page-meta.xml | 2
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 | 457
force-app/main/default/lwc/lexLicenceReminder/lexLicenceReminder.html | 20
force-app/main/default/aura/WeeklyReport/WeeklyReport.css | 3
force-app/main/default/lwc/lexArriveGsDetails/lexArriveGsDetails.js | 298
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 | 2198 +--
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/classes/DealerInquiryModifyStateController.cls | 14
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/pages/DealerInquiryModifyState.page | 710
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/lwc/lexArriveGoods/lexArriveGoods.css | 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 | 1088 -
force-app/main/default/lwc/lexArriveGoods/lexArriveGoods.html | 575
force-app/main/default/lwc/lexCustomDiffReasonComp/lexCustomDiffReasonComp.js | 35
force-app/main/default/labels/CustomLabels.labels-meta.xml | 4
force-app/main/default/lwc/lexArriveGoods/lexArriveGoods.js | 1199 -
force-app/main/default/lwc/lexTableCellIcon/lexTableCellIcon.js | 28
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 | 333
force-app/main/default/lwc/lexConsumable/lexConsumable.js | 3036 ++--
force-app/main/default/lwc/lexConsumable/lexConsumable.html | 906 -
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/classes/ArriveGoodsControllerTest.cls | 6464 ++++------
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
force-app/main/default/aura/CreateTarget/CreateTarget.cmp | 13
143 files changed, 13,934 insertions(+), 21,228 deletions(-)
diff --git a/.sf/config.json b/.sf/config.json
index 1a4cc75..3debff0 100644
--- a/.sf/config.json
+++ b/.sf/config.json
@@ -1,3 +1,3 @@
{
- "target-org": "OlympusDev"
+ "target-org": "OlympusStageEnv"
}
\ No newline at end of file
diff --git a/force-app/main/default/aura/CreateTarget/CreateTarget.cmp b/force-app/main/default/aura/CreateTarget/CreateTarget.cmp
index 193e849..a3de553 100644
--- a/force-app/main/default/aura/CreateTarget/CreateTarget.cmp
+++ b/force-app/main/default/aura/CreateTarget/CreateTarget.cmp
@@ -1,4 +1,4 @@
-<aura:component controller="CreateTargetCmp" implements="force:appHostable,forceCommunity:availableForAllPageTypes,force:hasRecordId" access="global" >
+<aura:component controller="CreateTargetCmp" implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,force:lightningQuickAction,forceCommunity:availableForAllPageTypes" access="global" >
<aura:handler name="init" value="{!this}" action="{!c.doInit}"/>
<aura:attribute name="recordId" type="Id" />
<aura:attribute name="hospital" type="string" default=""/>
@@ -44,7 +44,6 @@
<div class="button_area">
<ui:button label="{!v.button_text}" press="{!c.toggle_report}"/>
</div>
-
<div aura:id="modal_window" role="dialog" tabindex="-1" class="disp_none slds-modal slds-fade-in-open slds-modal--large" aria-labelledby="headerTarget">
<div class="slds-modal__container">
<div class="slds-modal__header">
@@ -60,11 +59,11 @@
<div class="slds-form-element__group">
<div class="slds-form-element__row">
<div class="slds-form-element slds-size--1-of-2">
- <label class="slds-form-element__label" for="input-hos">鍖婚櫌</label>
- <force:inputField value="{!v.record.Agency_Hospital__c}" aura:id="input-hos"/>
- <!-- <lightning:recordEditForm objectApiName="Agency_Opportunity__c" recordId="{!v.record.Id}">
- <lightning:inputField fieldName="Agency_Hospital__c"/>
- </lightning:recordEditForm> -->
+ <label class="slds-form-element__label" for="input-hos">鍖婚櫌</label>
+ <!-- <force:inputField value="{!v.record.Agency_Hospital__c}" aura:id="input-hos"/> -->
+ <lightning:recordEditForm objectApiName="Agency_Opportunity__c">
+ <lightning:inputField variant="label-hidden" fieldName="Agency_Hospital__c" value="{!v.record.Agency_Hospital__c}" aura:id="input-hos"/>
+ </lightning:recordEditForm>
</div>
</div>
<!-- <h4 class="slds-section__title">璁块棶鐩爣</h4>
diff --git a/force-app/main/default/aura/CreateTarget/CreateTarget.cmp-meta.xml b/force-app/main/default/aura/CreateTarget/CreateTarget.cmp-meta.xml
index 5a95bf7..e7c0133 100644
--- a/force-app/main/default/aura/CreateTarget/CreateTarget.cmp-meta.xml
+++ b/force-app/main/default/aura/CreateTarget/CreateTarget.cmp-meta.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<AuraDefinitionBundle xmlns="http://soap.sforce.com/2006/04/metadata">
- <apiVersion>57.0</apiVersion>
+ <apiVersion>42.0</apiVersion>
<description>A Lightning Component Bundle</description>
</AuraDefinitionBundle>
diff --git a/force-app/main/default/aura/CreateTarget/CreateTargetHelper.js b/force-app/main/default/aura/CreateTarget/CreateTargetHelper.js
index b46d9ab..39a5acc 100644
--- a/force-app/main/default/aura/CreateTarget/CreateTargetHelper.js
+++ b/force-app/main/default/aura/CreateTarget/CreateTargetHelper.js
@@ -15,8 +15,9 @@
var select_ah_name = ah.Name;
// component.set('v.record.Agency_Hospital__c', select_ah);
//add by Deloitte 2023-6-8
- let agencyHosp = component.get('v.record');
- agencyHosp.Agency_Hospital__c = select_ah;
+ let agency = component.get("v.record");
+ agency.Agency_Hospital__c = select_ah;
+ // component.set("v.record", agency);
// alert(JSON.stringify(component.find('input-hos').get("v.body")[0].get('v.values')));
if ($A.get("$Browser.formFactor") == 'DESKTOP') {
console.log("flag1");
@@ -109,13 +110,6 @@
}
});
$A.enqueueAction(action);
-
- var modal_window = component.find('modal_window');
- var modal_bg = component.find('modal_bg');
-
- if ($A.util.hasClass(modal_window, 'disp_none') && !component.get("v.recordId")) {
- $A.get('e.force:refreshView').fire();
- }
},
toggle_report : function(component, event, helper) {
diff --git a/force-app/main/default/aura/RetrospectiveWeeklyReport/RetrospectiveWeeklyReportHelper.js b/force-app/main/default/aura/RetrospectiveWeeklyReport/RetrospectiveWeeklyReportHelper.js
index c3ae9e8..bc0f6c7 100644
--- a/force-app/main/default/aura/RetrospectiveWeeklyReport/RetrospectiveWeeklyReportHelper.js
+++ b/force-app/main/default/aura/RetrospectiveWeeklyReport/RetrospectiveWeeklyReportHelper.js
@@ -40,6 +40,46 @@
});
$A.enqueueAction(action);
},
+ doinitSave: function (component, event, helper) {
+ document.title = "杩芥函鏃ユ姤";
+ component.set('v.loginEdit', true);
+ this.report_date_list(component, event, helper, 5);
+ var action = component.get('c.getalldata');
+ action.setCallback(this, function (response) {
+ var state = response.getState();
+ if (state == 'SUCCESS') {
+ var res = response.getReturnValue();
+ component.set('v.alldata', res.reports);
+ component.set('v.fieldsmap', res.fieldsMap);
+ component.set('v.allselectlist', res.allselectlist);
+ component.set('v.doclist', res.doclist);
+ //fy
+
+ var xx = res.UserProType;
+ component.set('v.UserProType', res.UserProType);
+ var gg = component.get('v.UserProType');
+ //fy
+ component.find('select_agency_person').set('v.options', this.conv_selected(res.allselectlist.AgencyPerson__c));
+ component.find('select_DealerPersonnel').set('v.options', this.conv_selected(res.allselectlist.DealerPersonnel__c));
+ component.find('select_purpose_type').set('v.options', this.conv_selected(res.allselectlist.WorkRecord__c));
+ component.find('select_ProductClassification').set('v.options', this.conv_selected(res.allselectlist.ProductClassification__c));
+ component.find('select_stageName').set('v.options', this.conv_selected(res.allselectlist.StageName__c));
+ component.set('v.selected_agency_person', res.allselectlist.AgencyPerson__c[0].label);
+ component.set('v.dialog_type', '鏂板缓');
+ this.get_reports(component, event, helper, component.find('select_date').get('v.value'), component.find('select_agency_person').get('v.value'));
+
+ component.set('v.PIConfig', res.PIConfig);// 20220222 PI鏀归�� by Bright
+ component.set('v.loginEdit', false);
+ }
+ else {
+ //component.set('v.errorMessage', 'doinit failed.');
+ this.error('doinit failed.');
+ this.showErrorToast(component);
+ component.set('v.loginEdit', false);
+ }
+ });
+ $A.enqueueAction(action);
+ },
//鍏朵粬鍝佺墝浜у搧绫诲埆 涓嬫媺妗嗚祴鍊�
selectProductCcategory: function (component) {
var select_ProductClassification = component.find('select_ProductClassification').get('v.value');
@@ -76,7 +116,7 @@
"date_str": date_str,
"person_str": person_str,
});
- component.set('v.login', true);
+ component.set('v.loginEdit', true);
action.setCallback(this, function (response) {
var state = response.getState();
@@ -145,15 +185,15 @@
component.set('v.report_count', res.reports.length);
}
//fy 20220414 end
- component.set('v.login', false);
+ component.set('v.loginEdit', false);
}, staticResourceAgencyContact.token);
} else {
- component.set('v.login', false);
+ component.set('v.loginEdit', false);
}
}
} else {
component.set('v.list_message', 'no_data');
- component.set('v.login', false);
+ component.set('v.loginEdit', false);
}
}
@@ -161,7 +201,7 @@
//component.set('v.errorMessage', 'get_reports failed.');
this.error('get_reports failed.');
this.showErrorToast(component);
- component.set('v.login', false);
+ component.set('v.loginEdit', false);
}
});
$A.enqueueAction(action);
@@ -1013,7 +1053,7 @@
return false;
}
// 淇濆瓨鍑︾悊
- component.set('v.login', true);
+ component.set('v.loginEdit', true);
if (component.get('v.mode') == 'edit') {
var Agency_Report__c = component.get('v.select_report_data').Id;
var action = component.get('c.editAgencyReport');
@@ -1047,6 +1087,7 @@
action.setCallback(this, function (response) {
var state = response.getState();
if (state == 'SUCCESS') {
+ debugger
component.set('v.successMessage', '缂栬緫淇濆瓨鎴愬姛');
this.showSuccessToast(component);
var report_id = response.getReturnValue();
@@ -1063,14 +1104,14 @@
component.set('v.update_select_report_data_id', report_id);
this.get_reports(component, event, helper, component.get('v.select_report_data').Submit_date__c, component.get('v.select_report_data').Person_In_Charge2__c);
component.find('save_button').set('v.disabled', false);
- component.set('v.login', false);
+ component.set('v.loginEdit', false);
}
else {
//component.set('v.errorMessage', 'save_report failed.');
this.error('save_report failed.');
this.showErrorToast(component);
component.find('save_button').set('v.disabled', false);
- component.set('v.login', false);
+ component.set('v.loginEdit', false);
}
});
$A.enqueueAction(action);
@@ -1143,15 +1184,16 @@
this.error('get_reports_now failed.');
this.showErrorToast(component);
component.find('save_button').set('v.disabled', false);
- component.set('v.login', false);
+ component.set('v.loginEdit', false);
}
});
$A.enqueueAction(action2);
this.allclear(component);
component.find('select_WorkMark').set('v.value', false);
component.find('save_button').set('v.disabled', false);
- component.set('v.login', false);
- this.doinit(component, event, helper);
+ component.set('v.loginEdit', false);
+ debugger
+ this.doinitSave(component, event, helper);
}
else {
var error = response.getError();
@@ -1159,7 +1201,7 @@
this.error('淇濆瓨鏃ユ姤澶辫触');
this.showErrorToast(component);
component.find('save_button').set('v.disabled', false);
- component.set('v.login', false);
+ component.set('v.loginEdit', false);
}
});
$A.enqueueAction(action);
diff --git a/force-app/main/default/aura/WeeklyReport/WeeklyReport.cmp b/force-app/main/default/aura/WeeklyReport/WeeklyReport.cmp
index d2795b4..b21a79e 100644
--- a/force-app/main/default/aura/WeeklyReport/WeeklyReport.cmp
+++ b/force-app/main/default/aura/WeeklyReport/WeeklyReport.cmp
@@ -354,7 +354,9 @@
</div>
<!-- 鍖婚櫌 -->
<div aura:id="hospital_list" class="slds-form-element slds-lookup slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-5 marginTop" data-select="single">
- <ui:inputText aura:id="hospital_input_text" label="鍖婚櫌" class="field" value="{!v.hospital}" updateOn="keyup"/>
+ <!-- <ui:inputText aura:id="hospital_input_text" label="鍖婚櫌" class="field" value="{!v.hospital}" updateOn="keyup"/> -->
+ 鍖婚櫌
+ <lightning:input aura:id="hospital_input_text" class="field" value="{!v.hospital}" variant="label-hidden" updateOn="keyup"/>
<div class="slds-lookup__menu" id="lookup-66">
<ul class="slds-lookup__list" role="listbox">
<aura:iteration var="hospital" items="{!v.hospitalList}">
diff --git a/force-app/main/default/aura/WeeklyReport/WeeklyReport.css b/force-app/main/default/aura/WeeklyReport/WeeklyReport.css
index 6ba5412..271d3f3 100644
--- a/force-app/main/default/aura/WeeklyReport/WeeklyReport.css
+++ b/force-app/main/default/aura/WeeklyReport/WeeklyReport.css
@@ -152,4 +152,7 @@
.THIS .marginTop{
margin-top: 10px;
}
+.THIS .custom-input .uiInput {
+ height: 2rem; /* 璋冩暣楂樺害涓轰綘闇�瑕佺殑鍊硷紝濡� 2rem */
+}
/* add by Deloitte-Link 2023-6-19 end*/
\ No newline at end of file
diff --git a/force-app/main/default/classes/ArriveGoodsControllerTest.cls b/force-app/main/default/classes/ArriveGoodsControllerTest.cls
index 786dab4..b5213ac 100644
--- a/force-app/main/default/classes/ArriveGoodsControllerTest.cls
+++ b/force-app/main/default/classes/ArriveGoodsControllerTest.cls
@@ -1,1297 +1,863 @@
@isTest
private class ArriveGoodsControllerTest {
- @isTest
- static void myUnitTest() {
- // // TO DO: implement unit test
- List<RecordType> rectCo = [
- SELECT Id
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '璨╁2搴�'
- ];
- if (rectCo.size() == 0) {
- return;
- }
- // Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET Email)'];
- Profile prof = [
- SELECT Id
- FROM Profile
- WHERE Name = '901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'
- ];
+ @isTest
+ static void myUnitTest() {
+ // // TO DO: implement unit test
+ List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '璨╁2搴�'];
+ if (rectCo.size() == 0) {
+ return;
+ }
+ // Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET Email)'];
+ Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'];
- Account myAccount2 = new Account(
- name = 'Testaccount002',
- Dealer_discount__c = 20,
- RecordTypeId = rectCo[0].Id,
- AgentCode_Ext__c = '9999900'
- );
- Account myAccount1 = new Account(
- name = 'Testaccount001',
- Dealer_discount__c = 30,
- RecordTypeId = rectCo[0].Id
- );
- insert new List<account>{ myAccount1, myAccount2 };
+ Account myAccount2 = new Account(name='Testaccount002',Dealer_discount__c =20,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '9999900');
+ Account myAccount1 = new Account(name='Testaccount001',Dealer_discount__c =30,RecordTypeId = rectCo[0].Id);
+ insert new account[]{myAccount1,myAccount2};
- Contact core = new Contact(
- email = 'jplumber@salesforce.com',
- firstname = 'Joe',
- lastname = 'Plumber',
- accountid = myAccount1.id
- );
- insert core;
- user MyUser_Test = new User(
- ContactId = core.id,
- Alias = 'newUser',
- Email = 'newuser@testorg.com',
- EmailEncodingKey = 'UTF-8',
- LastName = 'TestUser',
- LanguageLocaleKey = 'zh_CN',
- LocaleSidKey = 'zh_CN',
- ProfileId = prof.Id,
- TimeZoneSidKey = 'Asia/Shanghai',
- UserName = 'testUser@testorg.com',
- UserPro_Type__c = 'ET'
- );
- System.runAs(new User(Id = UserInfo.getUserId())) {
- insert MyUser_Test;
- }
+ Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount1.id);
+ insert core;
+ user MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com',UserPro_Type__c = 'ET');
+ System.runAs(new User(Id = UserInfo.getUserId())){
+ insert MyUser_Test;
+ }
- // User MyUser_Test = [select id,Contact.accountid from User WHERE ProfileId = :prof.Id and IsActive = true and UserPro_Type__c = 'ET' limit 1 ];
- // Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false);
- // Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false);
- // insert new Product2[] {prod01,prod02};
- System.runAs(MyUser_Test) {
- Product2 prod01 = new Product2(
- Name = 'Test01',
- ProductCode = 'Test01',
- Asset_Model_No__c = 'Test01',
- SFDA_Status__c = '鏈夊姽',
- JANCODE__c = '04953170200311',
- Dealer_special_Object__c = true,
- Manual_Entry__c = false
- );
- Product2 prod02 = new Product2(
- Name = 'Test02',
- ProductCode = 'Test02',
- Asset_Model_No__c = 'Test02',
- SFDA_Status__c = '鏈夊姽',
- JANCODE__c = '04953170200312',
- Dealer_special_Object__c = true,
- Manual_Entry__c = false
- );
- insert new List<Product2>{ prod01, prod02 };
- Product2__c pro1 = new Product2__c(
- Name = 'Pro001',
- OT_CODE_Text__c = 'Test001',
- Product2__c = prod01.Id
- );
- Product2__c pro2 = new Product2__c(
- Name = 'Pro002',
- OT_CODE_Text__c = 'Test002',
- Product2__c = prod02.Id
- );
- insert new List<Product2__c>{ pro1, pro2 };
- //璁㈠崟
- Consumable_order__c Order1 = new Consumable_order__c();
- Order1.Name = 'OCM_01_001';
- Order1.Order_status__c = '鎵瑰噯';
- Order1.Order_type__c = '璁㈠崟';
- // Order1.Dealer_Info__c = myAccount1.id;
- Order1.Dealer_Info__c = myAccount1.id;
- Order1.RecordTypeid = System.Label.RT_ConOrder_Delivery;
- Order1.Total_num__c = 3;
- Order1.OrderNumber_arrived__c = 1;
- Order1.Delivery_detail_count__c = 1;
- Order1.Order_ProType__c = 'ET';
- insert Order1;
+ // User MyUser_Test = [select id,Contact.accountid from User WHERE ProfileId = :prof.Id and IsActive = true and UserPro_Type__c = 'ET' limit 1 ];
+ // Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ // Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ // insert new Product2[] {prod01,prod02};
+ system.runAs(MyUser_Test){
+ Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ insert new Product2[] {prod01,prod02};
+ Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='Test001',Product2__c = prod01.Id);
+ Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='Test002',Product2__c = prod02.Id);
+ insert new Product2__c[] {pro1, pro2};
+ //璁㈠崟
+ Consumable_order__c Order1 = new Consumable_order__c();
+ Order1.Name = 'OCM_01_001';
+ Order1.Order_status__c = '鎵瑰噯';
+ Order1.Order_type__c = '璁㈠崟';
+ // Order1.Dealer_Info__c = myAccount1.id;
+ Order1.Dealer_Info__c = myAccount1.id;
+ Order1.RecordTypeid = System.Label.RT_ConOrder_Delivery;
+ Order1.Total_num__c = 3;
+ Order1.OrderNumber_arrived__c =1;
+ Order1.Delivery_detail_count__c=1;
+ Order1.Order_ProType__c = 'ET';
+ insert Order1;
- //璁㈠崟鏄庣粏
- //fahuo
- Consumable_orderdetails__c Orderdet = new Consumable_orderdetails__c();
- Orderdet.Name = 'OCM_01_00101';
- Orderdet.Consumable_order__c = Order1.Id;
- Orderdet.RecordTypeId = System.Label.RT_ConOrderDetail1_Order;
- Orderdet.Consumable_Product__c = pro1.Id;
- Orderdet.Consumable_count__c = 40;
- insert Orderdet;
+ //璁㈠崟鏄庣粏
+ //fahuo
+ Consumable_orderdetails__c Orderdet = new Consumable_orderdetails__c();
+ Orderdet.Name = 'OCM_01_00101';
+ Orderdet.Consumable_order__c = Order1.Id;
+ Orderdet.RecordTypeId = System.Label.RT_ConOrderDetail1_Order;
+ Orderdet.Consumable_Product__c = pro1.Id;
+ Orderdet.Consumable_count__c = 40;
+ insert Orderdet;
- //鍙戣揣鏄庣粏
- //鍒拌揣姝g‘淇℃伅
- Consumable_order_details2__c Orderdet1 = new Consumable_order_details2__c();
- Orderdet1.Name = 'OCM_01_001002';
- Orderdet1.Consumable_order_minor__c = Order1.Id;
- Orderdet1.Consumable_Product__c = pro1.Id;
- Orderdet1.Asset_Model_No__c = 'Test01';
- Orderdet1.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- Orderdet1.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRA';
- Orderdet1.TracingCode__c = 'BXJRA';
+ //鍙戣揣鏄庣粏
+ //鍒拌揣姝g‘淇℃伅
+ Consumable_order_details2__c Orderdet1 = new Consumable_order_details2__c();
+ Orderdet1.Name = 'OCM_01_001002';
+ Orderdet1.Consumable_order_minor__c = Order1.Id;
+ Orderdet1.Consumable_Product__c = pro1.Id;
+ Orderdet1.Asset_Model_No__c = 'Test01';
+ Orderdet1.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
+ Orderdet1.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRA';
+ Orderdet1.TracingCode__c = 'BXJRA';
- //鍙栨秷浜у搧
- Consumable_order_details2__c Orderdet2 = new Consumable_order_details2__c();
- Orderdet2.Name = 'OCM_01_001003';
- Orderdet2.Consumable_order_minor__c = Order1.Id;
- Orderdet2.Consumable_Product__c = pro1.Id;
- Orderdet2.Asset_Model_No__c = 'Test01';
- //Orderdet2.Consumable_Arrived_order__c = Order1.Id;
- Orderdet2.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- Orderdet2.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRB';
- Orderdet2.Cancellation_Date__c = Date.today();
- Orderdet2.TracingCode__c = 'BXJRB';
- //閿�鍞骇鍝�
- Consumable_order_details2__c Orderdet3 = new Consumable_order_details2__c();
- Orderdet3.Name = 'OCM_01_001004';
- Orderdet3.Consumable_order_minor__c = Order1.Id;
- Orderdet3.Consumable_Product__c = pro1.Id;
- Orderdet3.Asset_Model_No__c = 'Test01';
- Orderdet3.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- Orderdet3.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRC';
- Orderdet3.Used_date__c = Date.today();
- Orderdet3.Arrive_date__c = Date.today();
- Orderdet3.TracingCode__c = 'BXJRC';
- //Orderdet3.Box_Piece__c = '鐩�';
+ //鍙栨秷浜у搧
+ Consumable_order_details2__c Orderdet2 = new Consumable_order_details2__c();
+ Orderdet2.Name = 'OCM_01_001003';
+ Orderdet2.Consumable_order_minor__c = Order1.Id;
+ Orderdet2.Consumable_Product__c = pro1.Id;
+ Orderdet2.Asset_Model_No__c = 'Test01';
+ //Orderdet2.Consumable_Arrived_order__c = Order1.Id;
+ Orderdet2.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
+ Orderdet2.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRB';
+ Orderdet2.Cancellation_Date__c= Date.today();
+ Orderdet2.TracingCode__c = 'BXJRB';
+ //閿�鍞骇鍝�
+ Consumable_order_details2__c Orderdet3 = new Consumable_order_details2__c();
+ Orderdet3.Name = 'OCM_01_001004';
+ Orderdet3.Consumable_order_minor__c = Order1.Id;
+ Orderdet3.Consumable_Product__c = pro1.Id;
+ Orderdet3.Asset_Model_No__c = 'Test01';
+ Orderdet3.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
+ Orderdet3.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRC';
+ Orderdet3.Used_date__c = Date.today();
+ Orderdet3.Arrive_date__c = Date.today();
+ Orderdet3.TracingCode__c = 'BXJRC';
+ //Orderdet3.Box_Piece__c = '鐩�';
- //鍑哄簱浜у搧
- Consumable_order_details2__c Orderdet4 = new Consumable_order_details2__c();
- Orderdet4.Name = 'OCM_01_001005';
- Orderdet4.Consumable_order_minor__c = Order1.Id;
- Orderdet4.Consumable_Product__c = pro1.Id;
- Orderdet4.Asset_Model_No__c = 'Test01';
- Orderdet4.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- Orderdet4.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRD';
- Orderdet4.Send_Date__c = Date.today();
- Orderdet4.Arrive_date__c = Date.today();
- Orderdet4.TracingCode__c = 'BXJRD';
- //宸插埌璐т骇鍝�
- Consumable_order_details2__c Orderdet5 = new Consumable_order_details2__c();
- Orderdet5.Name = 'OCM_01_001006';
- Orderdet5.Consumable_order_minor__c = Order1.Id;
- Orderdet5.Consumable_Product__c = pro1.Id;
- Orderdet5.Asset_Model_No__c = 'Test01';
- Orderdet5.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- Orderdet5.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRE';
- Orderdet5.Arrive_date__c = Date.today();
- Orderdet5.TracingCode__c = 'BXJRE';
+ //鍑哄簱浜у搧
+ Consumable_order_details2__c Orderdet4 = new Consumable_order_details2__c();
+ Orderdet4.Name = 'OCM_01_001005';
+ Orderdet4.Consumable_order_minor__c = Order1.Id;
+ Orderdet4.Consumable_Product__c = pro1.Id;
+ Orderdet4.Asset_Model_No__c = 'Test01';
+ Orderdet4.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
+ Orderdet4.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRD';
+ Orderdet4.Send_Date__c = Date.today();
+ Orderdet4.Arrive_date__c = Date.today();
+ Orderdet4.TracingCode__c = 'BXJRD';
- //鍙戣揣鏄庣粏
- //绠$悊缂栫爜鍖呭惈鏁板瓧
- Consumable_order_details2__c Orderdet6 = new Consumable_order_details2__c();
- Orderdet6.Name = 'OCM_01_001002';
- Orderdet6.Consumable_order_minor__c = Order1.Id;
- Orderdet6.Consumable_Product__c = pro1.Id;
- Orderdet6.Asset_Model_No__c = 'Test01';
- Orderdet6.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- Orderdet6.Bar_Code__c = '01049531702003111115120017181000105ZK250BX123';
- Orderdet6.TracingCode__c = 'BX123';
+ //宸插埌璐т骇鍝�
+ Consumable_order_details2__c Orderdet5 = new Consumable_order_details2__c();
+ Orderdet5.Name = 'OCM_01_001006';
+ Orderdet5.Consumable_order_minor__c = Order1.Id;
+ Orderdet5.Consumable_Product__c = pro1.Id;
+ Orderdet5.Asset_Model_No__c = 'Test01';
+ Orderdet5.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
+ Orderdet5.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRE';
+ Orderdet5.Arrive_date__c = Date.today();
+ Orderdet5.TracingCode__c = 'BXJRE';
- //鍙戦敊搴� 鏈埌璐�
- Consumable_order_details2__c Orderdets8 = new Consumable_order_details2__c();
- Orderdets8.Name = 'OCM_01_001011';
- Orderdets8.Consumable_order_minor__c = Order1.Id;
- Orderdets8.Consumable_Product__c = pro1.Id;
- Orderdets8.Asset_Model_No__c = 'Test01';
- Orderdets8.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- Orderdets8.Bar_Code__c = '01049531702003111115120017181000105ZK250BXsys';
- Orderdets8.Box_Piece__c = '鐩�';
- Orderdets8.TracingCode__c = 'BXsys';
+ //鍙戣揣鏄庣粏
+ //绠$悊缂栫爜鍖呭惈鏁板瓧
+ Consumable_order_details2__c Orderdet6 = new Consumable_order_details2__c();
+ Orderdet6.Name = 'OCM_01_001002';
+ Orderdet6.Consumable_order_minor__c = Order1.Id;
+ Orderdet6.Consumable_Product__c = pro1.Id;
+ Orderdet6.Asset_Model_No__c = 'Test01';
+ Orderdet6.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
+ Orderdet6.Bar_Code__c = '01049531702003111115120017181000105ZK250BX123';
+ Orderdet6.TracingCode__c = 'BX123';
- insert new List<Consumable_order_details2__c>{
- Orderdet1,
- Orderdet2,
- Orderdet3,
- Orderdet4,
- Orderdet5,
- Orderdet6,
- Orderdets8
- };
+ //鍙戦敊搴� 鏈埌璐�
+ Consumable_order_details2__c Orderdets8 = new Consumable_order_details2__c();
+ Orderdets8.Name = 'OCM_01_001011';
+ Orderdets8.Consumable_order_minor__c = Order1.Id;
+ Orderdets8.Consumable_Product__c = pro1.Id;
+ Orderdets8.Asset_Model_No__c = 'Test01';
+ Orderdets8.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
+ Orderdets8.Bar_Code__c = '01049531702003111115120017181000105ZK250BXsys';
+ Orderdets8.Box_Piece__c = '鐩�';
+ Orderdets8.TracingCode__c = 'BXsys';
- List<Consumable_orderdetails__c> cod1 = [
- SELECT Id
- FROM Consumable_orderdetails__c
- WHERE Consumable_order__c = :Order1.Id
- ];
- System.assertEquals(1, cod1.size());
+ insert new Consumable_order_details2__c[] {Orderdet1, Orderdet2,Orderdet3,Orderdet4,Orderdet5,Orderdet6,Orderdets8};
- PageReference page = new PageReference(
- '/apex/ArriveGoods?Esetid=' + Order1.Id
- );
+ List<Consumable_orderdetails__c> cod1 = [select Id from Consumable_orderdetails__c WHERE Consumable_order__c = :Order1.Id];
+ System.assertEquals(1, cod1.size());
- System.Test.setCurrentPage(page);
- ArriveGoodsController Controller = new ArriveGoodsController();
- //鍒濆鍖栨祴璇�
- System.Test.startTest();
- Controller.init();
- //鎺掑簭
- Controller.barcode = '';
- Controller.SearchPro();
- Controller.barcode = '01049531702003111115120017181000105ZK250BXJRA\n01049531702003111115120017181000105ZK250BXsys\n01049531702003111115120017181000105ZK250BXsun\n01049531702003111115120017181000105ZK250BXJRB\n01049531702003111115120017181000105ZK250BXJRC\n01049531702003111115120017181000105ZK250BX111\n01049531702003111115120017181000105ZK250BXJRD\n01049531702003111115120017181000105ZK250BXJRE\n01049531702003111115120017181000105ZK250BXJRF\n01049531702003111115120017181000105ZK250BXJRG\n01049531702003111115120017181000105ZK250BX123';
- Controller.SearchPro();
+ PageReference page = new PageReference('/apex/ArriveGoods?Esetid=' + Order1.Id);
- // System.assertEquals(3, controller.ConsumableorderdetailsRecordsdummy.size()); //tcm
- Controller.ArriveGoodsConfim();
- System.Test.stopTest();
- }
- }
- //閫夋嫨绛夊緟鍏ュ簱,鍖呮嫭01 鍜�241
- @isTest
- static void arriveWithID() {
- // // TO DO: implement unit test
- List<RecordType> rectCo = [
- SELECT Id
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '璨╁2搴�'
- ];
- if (rectCo.size() == 0) {
- return;
- }
- // Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET Email)'];
- Profile prof = [
- SELECT Id
- FROM Profile
- WHERE Name = '901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'
- ];
+ System.Test.setCurrentPage(page);
+ ArriveGoodsController Controller = new ArriveGoodsController();
+ //鍒濆鍖栨祴璇�
+ System.Test.startTest();
+ Controller.init();
+ //鎺掑簭
+ Controller.barcode = '';
+ Controller.SearchPro();
+ Controller.barcode = '01049531702003111115120017181000105ZK250BXJRA\n01049531702003111115120017181000105ZK250BXsys\n01049531702003111115120017181000105ZK250BXsun\n01049531702003111115120017181000105ZK250BXJRB\n01049531702003111115120017181000105ZK250BXJRC\n01049531702003111115120017181000105ZK250BX111\n01049531702003111115120017181000105ZK250BXJRD\n01049531702003111115120017181000105ZK250BXJRE\n01049531702003111115120017181000105ZK250BXJRF\n01049531702003111115120017181000105ZK250BXJRG\n01049531702003111115120017181000105ZK250BX123';
+ Controller.SearchPro();
- Account myAccount2 = new Account(
- name = 'Testaccount002',
- Dealer_discount__c = 20,
- RecordTypeId = rectCo[0].Id,
- AgentCode_Ext__c = '9999900'
- );
- Account myAccount1 = new Account(
- name = 'Testaccount001',
- Dealer_discount__c = 30,
- RecordTypeId = rectCo[0].Id
- );
- insert new List<account>{ myAccount1, myAccount2 };
+ // System.assertEquals(3, controller.ConsumableorderdetailsRecordsdummy.size()); //tcm
+ Controller.ArriveGoodsConfim();
+ System.Test.stopTest();
+ }
+ }
+ //閫夋嫨绛夊緟鍏ュ簱,鍖呮嫭01 鍜�241
+ @isTest
+ static void arriveWithID() {
+ // // TO DO: implement unit test
+ List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '璨╁2搴�'];
+ if (rectCo.size() == 0) {
+ return;
+ }
+ // Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET Email)'];
+ Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'];
- Contact core = new Contact(
- email = 'jplumber@salesforce.com',
- firstname = 'Joe',
- lastname = 'Plumber',
- accountid = myAccount1.id
- );
- insert core;
- user MyUser_Test = new User(
- ContactId = core.id,
- Alias = 'newUser',
- Email = 'newuser@testorg.com',
- EmailEncodingKey = 'UTF-8',
- LastName = 'TestUser',
- LanguageLocaleKey = 'zh_CN',
- LocaleSidKey = 'zh_CN',
- ProfileId = prof.Id,
- TimeZoneSidKey = 'Asia/Shanghai',
- UserName = 'testUser@testorg.com',
- UserPro_Type__c = 'ET'
- );
- System.runAs(new User(Id = UserInfo.getUserId())) {
- insert MyUser_Test;
- }
- // User MyUser_Test = [select id,Contact.accountid from User WHERE ProfileId = :prof.Id and IsActive = true and UserPro_Type__c = 'ET' limit 1 ];
- // Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false);
- // Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false);
- // insert new Product2[] {prod01,prod02};
- System.runAs(MyUser_Test) {
- Product2 prod01 = new Product2(
- Name = 'Test01',
- ProductCode = 'Test01',
- Asset_Model_No__c = 'Test01',
- SFDA_Status__c = '鏈夊姽',
- JANCODE__c = '04953170200311',
- Dealer_special_Object__c = true,
- Manual_Entry__c = false
- );
- Product2 prod02 = new Product2(
- Name = 'Test02',
- ProductCode = 'Test02',
- Asset_Model_No__c = 'Test02',
- SFDA_Status__c = '鏈夊姽',
- JANCODE__c = '04953170200312',
- Dealer_special_Object__c = true,
- Manual_Entry__c = false
- );
- insert new List<Product2>{ prod01, prod02 };
- Product2__c pro1 = new Product2__c(
- Name = 'Pro001',
- OT_CODE_Text__c = 'N3047730',
- Product2__c = prod01.Id
- );
- Product2__c pro2 = new Product2__c(
- Name = 'Pro002',
- OT_CODE_Text__c = 'N3047731',
- Product2__c = prod02.Id
- );
- insert new List<Product2__c>{ pro1, pro2 };
- //璁㈠崟
+ Account myAccount2 = new Account(name='Testaccount002',Dealer_discount__c =20,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '9999900');
+ Account myAccount1 = new Account(name='Testaccount001',Dealer_discount__c =30,RecordTypeId = rectCo[0].Id);
+ insert new account[]{myAccount1,myAccount2};
- Consumable_order__c Order1 = new Consumable_order__c();
- Order1.Name = 'OCM_01_001';
- Order1.Order_status__c = '鎵瑰噯';
- Order1.Order_type__c = '璁㈠崟';
- Order1.Dealer_Info__c = myAccount1.id;
- Order1.RecordTypeid = System.Label.RT_ConOrder_Delivery;
- Order1.Order_ProType__c = 'ET';
- insert Order1;
+ Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount1.id);
+ insert core;
+ user MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com',UserPro_Type__c = 'ET');
+ System.runAs(new User(Id = UserInfo.getUserId())){
+ insert MyUser_Test;
+ }
- //璁㈠崟鏄庣粏
- //fahuo
- Consumable_orderdetails__c Orderdet = new Consumable_orderdetails__c();
- Orderdet.Name = 'OCM_01_00101';
- Orderdet.Consumable_order__c = Order1.Id;
- Orderdet.RecordTypeId = System.Label.RT_ConOrderDetail1_Order;
- Orderdet.Consumable_Product__c = pro1.Id;
- Orderdet.Consumable_count__c = 4;
- insert Orderdet;
+ // User MyUser_Test = [select id,Contact.accountid from User WHERE ProfileId = :prof.Id and IsActive = true and UserPro_Type__c = 'ET' limit 1 ];
+ // Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ // Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ // insert new Product2[] {prod01,prod02};
+ system.runAs(MyUser_Test){
+ Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ insert new Product2[] {prod01,prod02};
+ Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='N3047730',Product2__c = prod01.Id);
+ Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='N3047731',Product2__c = prod02.Id);
+ insert new Product2__c[] {pro1, pro2};
+ //璁㈠崟
- //鍙戣揣鏄庣粏
- //fahuo
- Consumable_order_details2__c Orderdet1 = new Consumable_order_details2__c();
- Orderdet1.Name = 'OCM_01_001001';
- Orderdet1.Consumable_order_minor__c = Order1.Id;
- Orderdet1.Consumable_Product__c = pro1.Id;
- Orderdet1.Asset_Model_No__c = 'Test01';
- Orderdet1.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- Orderdet1.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRF';
- Orderdet1.TracingCode__c = 'BXJRF';
- Orderdet1.SerialLotNo__c = '5ZK';
+ Consumable_order__c Order1 = new Consumable_order__c();
+ Order1.Name = 'OCM_01_001';
+ Order1.Order_status__c = '鎵瑰噯';
+ Order1.Order_type__c = '璁㈠崟';
+ Order1.Dealer_Info__c = myAccount1.id;
+ Order1.RecordTypeid = System.Label.RT_ConOrder_Delivery;
+ Order1.Order_ProType__c = 'ET';
+ insert Order1;
- insert Orderdet1;
+ //璁㈠崟鏄庣粏
+ //fahuo
+ Consumable_orderdetails__c Orderdet = new Consumable_orderdetails__c();
+ Orderdet.Name = 'OCM_01_00101';
+ Orderdet.Consumable_order__c = Order1.Id;
+ Orderdet.RecordTypeId = System.Label.RT_ConOrderDetail1_Order;
+ Orderdet.Consumable_Product__c = pro1.Id;
+ Orderdet.Consumable_count__c = 4;
+ insert Orderdet;
- PageReference page = new PageReference(
- '/apex/ArriveGoods?ESetid=' + Order1.Id
- );
- System.Test.setCurrentPage(page);
- ArriveGoodsController Controller = new ArriveGoodsController();
- //鍒濆鍖栨祴璇�
- System.Test.startTest();
- Controller.init();
- Controller.barcode = '01049531702003111115120017181000105ZK250BXJRF\n01049531702003111115120017181000105ZK250BXJRA\n241N30477301115120017181000105ZK250BXJRI\n241N30477301115120017181000105ZK250\n01049531702003111115120017181000105ZK250';
- Controller.SearchPro();
- // System.assertEquals(1, Controller.ConsumableorderdetailsRecords.size());
- // System.assertEquals(2, Controller.consumableInventory.size());
- Controller.ArriveGoodsConfim();
- List<Consumable_order_details2__c> ins = [
- SELECT Id, Name
- FROM Consumable_order_details2__c
- ];
- // System.assertEquals(3, ins.size());
- System.Test.stopTest();
- }
- }
+ //鍙戣揣鏄庣粏
+ //fahuo
+ Consumable_order_details2__c Orderdet1 = new Consumable_order_details2__c();
+ Orderdet1.Name = 'OCM_01_001001';
+ Orderdet1.Consumable_order_minor__c = Order1.Id;
+ Orderdet1.Consumable_Product__c = pro1.Id;
+ Orderdet1.Asset_Model_No__c = 'Test01';
+ Orderdet1.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
+ Orderdet1.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRF';
+ Orderdet1.TracingCode__c = 'BXJRF';
+ Orderdet1.SerialLotNo__c = '5ZK';
- //浜у搧鐩存帴鍏ュ簱,鍖呮嫭01 鍜�241
- @isTest
- static void arriveWithoutID() {
- // // TO DO: implement unit test
- List<RecordType> rectCo = [
- SELECT Id
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '璨╁2搴�'
- ];
- if (rectCo.size() == 0) {
- return;
- }
- // Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET Email)'];
- Profile prof = [
- SELECT Id
- FROM Profile
- WHERE Name = '901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'
- ];
+ insert Orderdet1;
- Account myAccount2 = new Account(
- name = 'Testaccount002',
- Dealer_discount__c = 20,
- RecordTypeId = rectCo[0].Id,
- AgentCode_Ext__c = '9999900'
- );
- Account myAccount1 = new Account(
- name = 'Testaccount001',
- Dealer_discount__c = 30,
- RecordTypeId = rectCo[0].Id
- );
- insert new List<account>{ myAccount1, myAccount2 };
+ PageReference page = new PageReference('/apex/ArriveGoods?ESetid=' + Order1.Id);
+ System.Test.setCurrentPage(page);
+ ArriveGoodsController Controller = new ArriveGoodsController();
+ //鍒濆鍖栨祴璇�
+ System.Test.startTest();
+ Controller.init();
+ Controller.barcode = '01049531702003111115120017181000105ZK250BXJRF\n01049531702003111115120017181000105ZK250BXJRA\n241N30477301115120017181000105ZK250BXJRI\n241N30477301115120017181000105ZK250\n01049531702003111115120017181000105ZK250';
+ Controller.SearchPro();
+ // System.assertEquals(1, Controller.ConsumableorderdetailsRecords.size());
+ // System.assertEquals(2, Controller.consumableInventory.size());
+ Controller.ArriveGoodsConfim();
+ List<Consumable_order_details2__c> ins = [SELECT Id,Name FROM Consumable_order_details2__c];
+ // System.assertEquals(3, ins.size());
+ System.Test.stopTest();
+ }
+ }
- Contact core = new Contact(
- email = 'jplumber@salesforce.com',
- firstname = 'Joe',
- lastname = 'Plumber',
- accountid = myAccount1.id
- );
- insert core;
- user MyUser_Test = new User(
- ContactId = core.id,
- Alias = 'newUser',
- Email = 'newuser@testorg.com',
- EmailEncodingKey = 'UTF-8',
- LastName = 'TestUser',
- LanguageLocaleKey = 'zh_CN',
- LocaleSidKey = 'zh_CN',
- ProfileId = prof.Id,
- TimeZoneSidKey = 'Asia/Shanghai',
- UserName = 'testUser@testorg.com',
- UserPro_Type__c = 'ET'
- );
- System.runAs(new User(Id = UserInfo.getUserId())) {
- insert MyUser_Test;
- }
- // User MyUser_Test = [select id,Contact.accountid from User WHERE ProfileId = :prof.Id and IsActive = true and UserPro_Type__c = 'ET' limit 1 ];
- // Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',ProductCode_Ext__c = 'Test01',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false);
- // Product2 prod02 = new Product2(Name='Test02',ProductCode='N3047731',ProductCode_Ext__c = 'Test02',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false);
- // insert new Product2[] {prod01,prod02};
- System.runAs(MyUser_Test) {
- Product2 prod01 = new Product2(
- Name = 'Test01',
- ProductCode = 'Test01',
- Asset_Model_No__c = 'Test01',
- SFDA_Status__c = '鏈夊姽',
- JANCODE__c = '04953170200311',
- Dealer_special_Object__c = true,
- Manual_Entry__c = false
- );
- Product2 prod02 = new Product2(
- Name = 'Test02',
- ProductCode = 'Test02',
- Asset_Model_No__c = 'Test02',
- SFDA_Status__c = '鏈夊姽',
- JANCODE__c = '04953170200312',
- Dealer_special_Object__c = true,
- Manual_Entry__c = false
- );
- insert new List<Product2>{ prod01, prod02 };
- Product2__c pro1 = new Product2__c(
- Name = 'Pro001',
- OT_CODE_Text__c = 'Test01',
- Product2__c = prod01.Id
- );
- Product2__c pro2 = new Product2__c(
- Name = 'Pro002',
- OT_CODE_Text__c = 'N3047731',
- Product2__c = prod02.Id
- );
- insert new List<Product2__c>{ pro1, pro2 };
- PageReference page = new PageReference('/apex/ArriveGoods?ArrType=Arr');
- System.Test.setCurrentPage(page);
- ArriveGoodsController Controller = new ArriveGoodsController();
- //鍒濆鍖栨祴璇�
- System.Test.startTest();
- Controller.init();
- //鎺掑簭
- Controller.barcode = '';
- Controller.SearchPro();
- Controller.barcode = '01049531702003111115120017181000105ZK250BXJRF\n241N30477311115120017181000105ZK250BXJRA\n241Test021115120017181000105ZK250\n01049531702003111115120017181000105ZK250';
- Controller.SearchPro();
- Controller.ArriveGoodsConfim();
- List<Consumable_order_details2__c> ins = [
- SELECT Id, Name
- FROM Consumable_order_details2__c
- WHERE
- Bar_Code__c IN (
- '01049531702003111115120017181000105ZK250BXJRF',
- '241N30477311115120017181000105ZK250BXJRA'
- )
- ];
- // System.assertEquals(2, ins.size());
- System.Test.stopTest();
- }
- }
- //鏁翠綋鍒拌揣
- @isTest
- static void ArriveTest() {
- // // TO DO: implement unit test
- List<RecordType> rectCo = [
- SELECT Id
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '璨╁2搴�'
- ];
- if (rectCo.size() == 0) {
- return;
- }
- // Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET Email)'];
- Profile prof = [
- SELECT Id
- FROM Profile
- WHERE Name = '901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'
- ];
+ //浜у搧鐩存帴鍏ュ簱,鍖呮嫭01 鍜�241
+ @isTest
+ static void arriveWithoutID() {
+ // // TO DO: implement unit test
+ List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '璨╁2搴�'];
+ if (rectCo.size() == 0) {
+ return;
+ }
+ // Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET Email)'];
+ Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'];
- Oly_TriggerHandler.bypass('ConsumableAssetHander');
- Account myAccount2 = new Account(
- name = 'Testaccount002',
- Dealer_discount__c = 20,
- RecordTypeId = rectCo[0].Id,
- AgentCode_Ext__c = '9999900'
- );
- Account myAccount1 = new Account(
- name = 'Testaccount001',
- Dealer_discount__c = 30,
- RecordTypeId = rectCo[0].Id
- );
- insert new List<account>{ myAccount1, myAccount2 };
- Contact core = new Contact(
- email = 'jplumber@salesforce.com',
- firstname = 'Joe',
- lastname = 'Plumber',
- accountid = myAccount1.id
- );
- insert core;
- user MyUser_Test = new User(
- ContactId = core.id,
- Alias = 'newUser',
- Email = 'newuser@testorg.com',
- EmailEncodingKey = 'UTF-8',
- LastName = 'TestUser',
- LanguageLocaleKey = 'zh_CN',
- LocaleSidKey = 'zh_CN',
- ProfileId = prof.Id,
- TimeZoneSidKey = 'Asia/Shanghai',
- UserName = 'testUser@testorg.com',
- UserPro_Type__c = 'ET'
- );
- System.runAs(new User(Id = UserInfo.getUserId())) {
- insert MyUser_Test;
- }
- // User MyUser_Test = [select id,Contact.accountid from User WHERE ProfileId = :prof.Id and IsActive = true and UserPro_Type__c = 'ET' limit 1 ];
- // Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false);
- // Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false);
- // insert new Product2[] {prod01,prod02};
- System.runAs(MyUser_Test) {
- Product2 prod01 = new Product2(
- Name = 'Test01',
- ProductCode = 'Test01',
- Asset_Model_No__c = 'Test01',
- SFDA_Status__c = '鏈夊姽',
- JANCODE__c = '04953170200311',
- Dealer_special_Object__c = true,
- Manual_Entry__c = false
- );
- Product2 prod02 = new Product2(
- Name = 'Test02',
- ProductCode = 'Test02',
- Asset_Model_No__c = 'Test02',
- SFDA_Status__c = '鏈夊姽',
- JANCODE__c = '04953170200312',
- Dealer_special_Object__c = true,
- Manual_Entry__c = false
- );
- insert new List<Product2>{ prod01, prod02 };
- Product2__c pro1 = new Product2__c(
- Name = 'Pro001',
- OT_CODE_Text__c = 'Test001',
- Product2__c = prod01.Id
- );
- insert new List<Product2__c>{ pro1 };
- // Account myAccount1 = new Account(name='Testaccount001',Dealer_discount__c =30,RecordTypeId = rectCo[0].Id);
- // insert myAccount1;
- Consumable_order__c Order2 = new Consumable_order__c();
- Order2.Name = 'OCM_02_001';
- Order2.Order_status__c = '鎵瑰噯';
- Order2.Order_type__c = '璁㈠崟';
- Order2.Dealer_Info__c = myAccount1.Id;
- Order2.RecordTypeid = System.Label.RT_ConOrder_Delivery;
- insert Order2;
- //鍙戦敊搴� 鏈埌璐�
- Consumable_order_details2__c Orderdets8 = new Consumable_order_details2__c();
- Orderdets8.Name = 'OCM_01_001011';
- Orderdets8.Consumable_order_minor__c = Order2.Id;
- Orderdets8.Consumable_Product__c = pro1.Id;
- Orderdets8.Asset_Model_No__c = 'Test01';
- Orderdets8.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- Orderdets8.Bar_Code__c = '01049531702003111115120017181000105ZK250BXsys';
- Orderdets8.Box_Piece__c = '鐩�';
- Orderdets8.TracingCode__c = 'BXsys';
- Orderdets8.SerialLotNo__c = '5ZK';
- insert Orderdets8;
+ Account myAccount2 = new Account(name='Testaccount002',Dealer_discount__c =20,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '9999900');
+ Account myAccount1 = new Account(name='Testaccount001',Dealer_discount__c =30,RecordTypeId = rectCo[0].Id);
+ insert new account[]{myAccount1,myAccount2};
- Consumable_order__c Order1 = new Consumable_order__c();
- Order1.Name = 'OCM_01_001';
- Order1.Order_status__c = '鎵瑰噯';
- Order1.Order_type__c = '璁㈠崟';
- Order1.Dealer_Info__c = myAccount1.id;
- Order1.Order_ProType__c = 'ET';
- Order1.RecordTypeid = System.Label.RT_ConOrder_Delivery;
- insert Order1;
- //璁㈠崟鏄庣粏
- //fahuo
- Consumable_orderdetails__c Orderdet = new Consumable_orderdetails__c();
- Orderdet.Name = 'OCM_01_00101';
- Orderdet.Consumable_order__c = Order1.Id;
- Orderdet.RecordTypeId = System.Label.RT_ConOrderDetail1_Order;
- Orderdet.Consumable_Product__c = pro1.Id;
- Orderdet.Consumable_count__c = 4;
- insert Orderdet;
+ Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount1.id);
+ insert core;
+ user MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com',UserPro_Type__c = 'ET');
+ System.runAs(new User(Id = UserInfo.getUserId())){
+ insert MyUser_Test;
+ }
- //鍒拌揣姝g‘淇℃伅
- Consumable_order_details2__c Orderdet1 = new Consumable_order_details2__c();
- Orderdet1.Name = 'OCM_01_001002';
- Orderdet1.Consumable_order_minor__c = Order1.Id;
- Orderdet1.Consumable_Product__c = pro1.Id;
- Orderdet1.Asset_Model_No__c = 'Test01';
- Orderdet1.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- Orderdet1.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRA';
- Orderdet1.Box_Piece__c = '鐩�';
- Orderdet1.TracingCode__c = 'BXJRA';
- Orderdet1.SerialLotNo__c = '5ZK';
- //娌″埌璐�
- Consumable_order_details2__c Orderdet2 = new Consumable_order_details2__c();
- Orderdet2.Name = 'OCM_01_001003';
- Orderdet2.Consumable_order_minor__c = Order1.Id;
- Orderdet2.Consumable_Product__c = pro1.Id;
- Orderdet2.Asset_Model_No__c = 'Test01';
- Orderdet2.Consumable_Arrived_order__c = Order1.Id;
- Orderdet2.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- Orderdet2.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRB';
- Orderdet2.Box_Piece__c = '鐩�';
- Orderdet2.TracingCode__c = 'BXJRB';
- Orderdet2.SerialLotNo__c = '5ZK';
- //閿�鍞骇鍝�
- Consumable_order_details2__c Orderdet3 = new Consumable_order_details2__c();
- Orderdet3.Name = 'OCM_01_001004';
- Orderdet3.Consumable_order_minor__c = Order1.Id;
- Orderdet3.Consumable_Product__c = pro1.Id;
- Orderdet3.Asset_Model_No__c = 'Test01';
- Orderdet3.Consumable_Arrived_order__c = Order1.Id;
- //Orderdet3.IsArrival__c = true;
- Orderdet3.Consumable_Sale_order__c = Order1.Id;
- Orderdet3.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- Orderdet3.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRC';
- Orderdet3.Used_date__c = Date.today();
- Orderdet3.Arrive_date__c = Date.today();
- Orderdet3.Box_Piece__c = '鐩�';
- Orderdet3.TracingCode__c = 'BXJRC';
- Orderdet3.SerialLotNo__c = '5ZK';
- //Orderdet3.Box_Piece__c = '涓�';
+ // User MyUser_Test = [select id,Contact.accountid from User WHERE ProfileId = :prof.Id and IsActive = true and UserPro_Type__c = 'ET' limit 1 ];
+ // Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',ProductCode_Ext__c = 'Test01',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ // Product2 prod02 = new Product2(Name='Test02',ProductCode='N3047731',ProductCode_Ext__c = 'Test02',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ // insert new Product2[] {prod01,prod02};
+ system.runAs(MyUser_Test){
+ Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ insert new Product2[] {prod01,prod02};
+ Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='Test01',Product2__c = prod01.Id);
+ Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='N3047731',Product2__c = prod02.Id);
+ insert new Product2__c[] {pro1, pro2};
+ PageReference page = new PageReference('/apex/ArriveGoods?ArrType=Arr');
+ System.Test.setCurrentPage(page);
+ ArriveGoodsController Controller = new ArriveGoodsController();
+ //鍒濆鍖栨祴璇�
+ System.Test.startTest();
+ Controller.init();
+ //鎺掑簭
+ Controller.barcode = '';
+ Controller.SearchPro();
+ Controller.barcode = '01049531702003111115120017181000105ZK250BXJRF\n241N30477311115120017181000105ZK250BXJRA\n241Test021115120017181000105ZK250\n01049531702003111115120017181000105ZK250';
+ Controller.SearchPro();
+ Controller.ArriveGoodsConfim();
+ List<Consumable_order_details2__c> ins = [SELECT Id,Name FROM Consumable_order_details2__c WHERE Bar_Code__c in ('01049531702003111115120017181000105ZK250BXJRF','241N30477311115120017181000105ZK250BXJRA')];
+ // System.assertEquals(2, ins.size());
+ System.Test.stopTest();
+ }
+ }
+ //鏁翠綋鍒拌揣
+ @isTest
+ static void ArriveTest() {
+ // // TO DO: implement unit test
+ List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '璨╁2搴�'];
+ if (rectCo.size() == 0) {
+ return;
+ }
+ // Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET Email)'];
+ Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'];
- //鍑哄簱浜у搧
- Consumable_order_details2__c Orderdet4 = new Consumable_order_details2__c();
- Orderdet4.Name = 'OCM_01_001005';
- Orderdet4.Consumable_order_minor__c = Order1.Id;
- Orderdet4.Consumable_Product__c = pro1.Id;
- Orderdet4.Asset_Model_No__c = 'Test01';
- Orderdet4.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- Orderdet4.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRD';
- Orderdet4.Send_Date__c = Date.today();
- Orderdet4.Arrive_date__c = Date.today();
- Orderdet4.Box_Piece__c = '鐩�';
- Orderdet4.TracingCode__c = 'BXJRD';
- Orderdet4.SerialLotNo__c = '5ZK';
- //Orderdet4.Box_Piece__c = '鐩�';
- //Orderdet4.Return_date__c = null;
+ Oly_TriggerHandler.bypass('ConsumableAssetHander');
+ Account myAccount2 = new Account(name='Testaccount002',Dealer_discount__c =20,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '9999900');
+ Account myAccount1 = new Account(name='Testaccount001',Dealer_discount__c =30,RecordTypeId = rectCo[0].Id);
+ insert new account[]{myAccount1,myAccount2};
+ Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount1.id);
+ insert core;
+ user MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com',UserPro_Type__c = 'ET');
+ System.runAs(new User(Id = UserInfo.getUserId())){
+ insert MyUser_Test;
+ }
- //宸插埌璐т骇鍝�
- Consumable_order_details2__c Orderdet5 = new Consumable_order_details2__c();
- Orderdet5.Name = 'OCM_01_001006';
- Orderdet5.Consumable_order_minor__c = Order1.Id;
- Orderdet5.Consumable_Product__c = pro1.Id;
- Orderdet5.Asset_Model_No__c = 'Test01';
- Orderdet5.Consumable_Arrived_order__c = Order1.Id;
- Orderdet5.Consumable_Shipment_order__c = Order1.Id;
- Orderdet5.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- Orderdet5.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRE';
- Orderdet5.Arrive_date__c = Date.today();
- Orderdet5.Box_Piece__c = '鐩�';
- Orderdet5.TracingCode__c = 'BXJRE';
- Orderdet5.SerialLotNo__c = '5ZK';
- insert new List<Consumable_order_details2__c>{
- Orderdet1,
- Orderdet2,
- Orderdet3,
- Orderdet4,
- Orderdet5
- };
+ // User MyUser_Test = [select id,Contact.accountid from User WHERE ProfileId = :prof.Id and IsActive = true and UserPro_Type__c = 'ET' limit 1 ];
+ // Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ // Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ // insert new Product2[] {prod01,prod02};
+ system.runAs(MyUser_Test){
+ Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ insert new Product2[] {prod01,prod02};
+ Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='Test001',Product2__c = prod01.Id);
+ insert new Product2__c[] {pro1};
+ // Account myAccount1 = new Account(name='Testaccount001',Dealer_discount__c =30,RecordTypeId = rectCo[0].Id);
+ // insert myAccount1;
+ Consumable_order__c Order2 = new Consumable_order__c();
+ Order2.Name = 'OCM_02_001';
+ Order2.Order_status__c = '鎵瑰噯';
+ Order2.Order_type__c = '璁㈠崟';
+ Order2.Dealer_Info__c = myAccount1.Id;
+ Order2.RecordTypeid = System.Label.RT_ConOrder_Delivery;
+ insert Order2;
+ //鍙戦敊搴� 鏈埌璐�
+ Consumable_order_details2__c Orderdets8 = new Consumable_order_details2__c();
+ Orderdets8.Name = 'OCM_01_001011';
+ Orderdets8.Consumable_order_minor__c = Order2.Id;
+ Orderdets8.Consumable_Product__c = pro1.Id;
+ Orderdets8.Asset_Model_No__c = 'Test01';
+ Orderdets8.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
+ Orderdets8.Bar_Code__c = '01049531702003111115120017181000105ZK250BXsys';
+ Orderdets8.Box_Piece__c = '鐩�';
+ Orderdets8.TracingCode__c = 'BXsys';
+ Orderdets8.SerialLotNo__c = '5ZK';
+ insert Orderdets8;
- ArriveGoodsController Controller = new ArriveGoodsController();
- PageReference page = new PageReference('/apex/ArriveGoods?ArrType=Arr');
- System.Test.setCurrentPage(page);
- //鍒濆鍖栨祴璇�
- System.Test.startTest();
- Controller.init();
- //鎺掑簭
- Controller.barcode = '01049531702003111115120017181000105ZK250BXJRA\n01049531702003111115120017181000105ZK250BXJRB\n01049531702003111115120017181000105ZK250BXJRC\n01049531702003111115120017181000105ZK250BXJRD\n01049531702003111115120017181000105ZK250BXJRE\n01049531702003111115120017181000105ZK250BX111\n01049531702003111115120017181000105ZK250BXJRF\n01049531702003111115120017181000105ZK250BXJRG\n01049531702003111115120017181000105ZK250BXsys';
- Controller.SearchPro();
+ Consumable_order__c Order1 = new Consumable_order__c();
+ Order1.Name = 'OCM_01_001';
+ Order1.Order_status__c = '鎵瑰噯';
+ Order1.Order_type__c = '璁㈠崟';
+ Order1.Dealer_Info__c = myAccount1.id;
+ Order1.Order_ProType__c = 'ET';
+ Order1.RecordTypeid = System.Label.RT_ConOrder_Delivery;
+ insert Order1;
+ //璁㈠崟鏄庣粏
+ //fahuo
+ Consumable_orderdetails__c Orderdet = new Consumable_orderdetails__c();
+ Orderdet.Name = 'OCM_01_00101';
+ Orderdet.Consumable_order__c = Order1.Id;
+ Orderdet.RecordTypeId = System.Label.RT_ConOrderDetail1_Order;
+ Orderdet.Consumable_Product__c = pro1.Id;
+ Orderdet.Consumable_count__c = 4;
+ insert Orderdet;
- System.assertEquals(
- 'OCM_01_001002',
- controller.ConsumableorderdetailsRecords[0].esd.Name
- );
- // System.assertEquals(2, controller.ConsumableorderdetailsRecordserror.size());
- System.Test.stopTest();
- }
- }
+ //鍒拌揣姝g‘淇℃伅
+ Consumable_order_details2__c Orderdet1 = new Consumable_order_details2__c();
+ Orderdet1.Name = 'OCM_01_001002';
+ Orderdet1.Consumable_order_minor__c = Order1.Id;
+ Orderdet1.Consumable_Product__c = pro1.Id;
+ Orderdet1.Asset_Model_No__c = 'Test01';
+ Orderdet1.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
+ Orderdet1.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRA';
+ Orderdet1.Box_Piece__c = '鐩�';
+ Orderdet1.TracingCode__c = 'BXJRA';
+ Orderdet1.SerialLotNo__c = '5ZK';
+ //娌″埌璐�
+ Consumable_order_details2__c Orderdet2 = new Consumable_order_details2__c();
+ Orderdet2.Name = 'OCM_01_001003';
+ Orderdet2.Consumable_order_minor__c = Order1.Id;
+ Orderdet2.Consumable_Product__c = pro1.Id;
+ Orderdet2.Asset_Model_No__c = 'Test01';
+ Orderdet2.Consumable_Arrived_order__c = Order1.Id;
+ Orderdet2.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
+ Orderdet2.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRB';
+ Orderdet2.Box_Piece__c = '鐩�';
+ Orderdet2.TracingCode__c = 'BXJRB';
+ Orderdet2.SerialLotNo__c = '5ZK';
+ //閿�鍞骇鍝�
+ Consumable_order_details2__c Orderdet3 = new Consumable_order_details2__c();
+ Orderdet3.Name = 'OCM_01_001004';
+ Orderdet3.Consumable_order_minor__c = Order1.Id;
+ Orderdet3.Consumable_Product__c = pro1.Id;
+ Orderdet3.Asset_Model_No__c = 'Test01';
+ Orderdet3.Consumable_Arrived_order__c = Order1.Id;
+ //Orderdet3.IsArrival__c = true;
+ Orderdet3.Consumable_Sale_order__c = Order1.Id;
+ Orderdet3.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
+ Orderdet3.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRC';
+ Orderdet3.Used_date__c = Date.today();
+ Orderdet3.Arrive_date__c = Date.today();
+ Orderdet3.Box_Piece__c = '鐩�';
+ Orderdet3.TracingCode__c = 'BXJRC';
+ Orderdet3.SerialLotNo__c = '5ZK';
+ //Orderdet3.Box_Piece__c = '涓�';
- //鏁翠綋鍒拌揣
- @isTest
- static void ArriveTest1() {
- // // TO DO: implement unit test
- List<RecordType> rectCo = [
- SELECT Id
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '璨╁2搴�'
- ];
- if (rectCo.size() == 0) {
- return;
- }
- // Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET Email)'];
- Profile prof = [
- SELECT Id
- FROM Profile
- WHERE Name = '901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'
- ];
- Oly_TriggerHandler.bypass('ConsumableAssetHander');
- Account myAccount2 = new Account(
- name = 'Testaccount002',
- Dealer_discount__c = 20,
- RecordTypeId = rectCo[0].Id,
- AgentCode_Ext__c = '9999900'
- );
- Account myAccount1 = new Account(
- name = 'Testaccount001',
- Dealer_discount__c = 30,
- RecordTypeId = rectCo[0].Id
- );
- insert new List<account>{ myAccount1, myAccount2 };
+ //鍑哄簱浜у搧
+ Consumable_order_details2__c Orderdet4 = new Consumable_order_details2__c();
+ Orderdet4.Name = 'OCM_01_001005';
+ Orderdet4.Consumable_order_minor__c = Order1.Id;
+ Orderdet4.Consumable_Product__c = pro1.Id;
+ Orderdet4.Asset_Model_No__c = 'Test01';
+ Orderdet4.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
+ Orderdet4.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRD';
+ Orderdet4.Send_Date__c = Date.today();
+ Orderdet4.Arrive_date__c = Date.today();
+ Orderdet4.Box_Piece__c = '鐩�';
+ Orderdet4.TracingCode__c = 'BXJRD';
+ Orderdet4.SerialLotNo__c = '5ZK';
+ //Orderdet4.Box_Piece__c = '鐩�';
+ //Orderdet4.Return_date__c = null;
- Contact core = new Contact(
- email = 'jplumber@salesforce.com',
- firstname = 'Joe',
- lastname = 'Plumber',
- accountid = myAccount1.id
- );
- insert core;
- user MyUser_Test = new User(
- ContactId = core.id,
- Alias = 'newUser',
- Email = 'newuser@testorg.com',
- EmailEncodingKey = 'UTF-8',
- LastName = 'TestUser',
- LanguageLocaleKey = 'zh_CN',
- LocaleSidKey = 'zh_CN',
- ProfileId = prof.Id,
- TimeZoneSidKey = 'Asia/Shanghai',
- UserName = 'testUser@testorg.com',
- UserPro_Type__c = 'ET'
- );
- System.runAs(new User(Id = UserInfo.getUserId())) {
- insert MyUser_Test;
- }
+ //宸插埌璐т骇鍝�
+ Consumable_order_details2__c Orderdet5 = new Consumable_order_details2__c();
+ Orderdet5.Name = 'OCM_01_001006';
+ Orderdet5.Consumable_order_minor__c = Order1.Id;
+ Orderdet5.Consumable_Product__c = pro1.Id;
+ Orderdet5.Asset_Model_No__c = 'Test01';
+ Orderdet5.Consumable_Arrived_order__c = Order1.Id;
+ Orderdet5.Consumable_Shipment_order__c = Order1.Id;
+ Orderdet5.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
+ Orderdet5.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRE';
+ Orderdet5.Arrive_date__c = Date.today();
+ Orderdet5.Box_Piece__c = '鐩�';
+ Orderdet5.TracingCode__c = 'BXJRE';
+ Orderdet5.SerialLotNo__c = '5ZK';
+ insert new Consumable_order_details2__c[] {Orderdet1, Orderdet2,Orderdet3,Orderdet4,Orderdet5};
- // // User MyUser_Test = [select id,Contact.accountid from User WHERE ProfileId = :prof.Id and IsActive = true and UserPro_Type__c = 'ET' limit 1 ];
- // Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false);
- // Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false);
- // insert new Product2[] {prod01,prod02};
- System.runAs(MyUser_Test) {
- Product2 prod01 = new Product2(
- Name = 'Test01',
- ProductCode = 'Test01',
- Asset_Model_No__c = 'Test01',
- SFDA_Status__c = '鏈夊姽',
- JANCODE__c = '04953170200311',
- Dealer_special_Object__c = true,
- Manual_Entry__c = false
- );
- Product2 prod02 = new Product2(
- Name = 'Test02',
- ProductCode = 'Test02',
- Asset_Model_No__c = 'Test02',
- SFDA_Status__c = '鏈夊姽',
- JANCODE__c = '04953170200312',
- Dealer_special_Object__c = true,
- Manual_Entry__c = false
- );
- insert new List<Product2>{ prod01, prod02 };
- Product2__c pro1 = new Product2__c(
- Name = 'Pro001',
- OT_CODE_Text__c = 'Test001',
- Product2__c = prod01.Id
- );
- Product2__c pro2 = new Product2__c(
- Name = 'Pro002',
- OT_CODE_Text__c = 'Test002',
- Product2__c = prod02.Id
- );
- insert new List<Product2__c>{ pro1, pro2 };
- // Account myAccount1 = new Account(name='Testaccount001',Dealer_discount__c =30,RecordTypeId = rectCo[0].Id);
- // insert myAccount1;
- Consumable_order__c Order2 = new Consumable_order__c();
- Order2.Name = 'OCM_02_001';
- Order2.Order_status__c = '鎵瑰噯';
- Order2.Order_type__c = '璁㈠崟';
- Order2.Dealer_Info__c = myAccount1.Id;
- Order2.RecordTypeid = System.Label.RT_ConOrder_Delivery;
- insert Order2;
- //鍙戦敊搴� 鏈埌璐�
- Consumable_order_details2__c Orderdets8 = new Consumable_order_details2__c();
- Orderdets8.Name = 'OCM_01_001011';
- Orderdets8.Consumable_order_minor__c = Order2.Id;
- Orderdets8.Consumable_Product__c = pro1.Id;
- Orderdets8.Asset_Model_No__c = 'Test01';
- Orderdets8.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- Orderdets8.Bar_Code__c = '01049531702003111115120017181000105ZK250BXsys';
- Orderdets8.Box_Piece__c = '鐩�';
- Orderdets8.TracingCode__c = 'BXsys';
- Orderdets8.SerialLotNo__c = '5ZK';
- insert Orderdets8;
- //system.runAs(myUser_Test){
- //璁㈠崟
- Consumable_order__c Order1 = new Consumable_order__c();
- Order1.Name = 'OCM_01_001';
- Order1.Order_status__c = '鎵瑰噯';
- Order1.Order_type__c = '璁㈠崟';
- Order1.Dealer_Info__c = myAccount1.id;
- Order1.Order_ProType__c = 'ET';
- Order1.RecordTypeid = System.Label.RT_ConOrder_Delivery;
- insert Order1;
- //璁㈠崟鏄庣粏
- //fahuo
- Consumable_orderdetails__c Orderdet = new Consumable_orderdetails__c();
- Orderdet.Name = 'OCM_01_00101';
- Orderdet.Consumable_order__c = Order1.Id;
- Orderdet.RecordTypeId = System.Label.RT_ConOrderDetail1_Order;
- Orderdet.Consumable_Product__c = pro1.Id;
- Orderdet.Consumable_count__c = 4;
- insert Orderdet;
+ ArriveGoodsController Controller = new ArriveGoodsController();
+ PageReference page = new PageReference('/apex/ArriveGoods?ArrType=Arr');
+ System.Test.setCurrentPage(page);
+ //鍒濆鍖栨祴璇�
+ System.Test.startTest();
+ Controller.init();
+ //鎺掑簭
+ Controller.barcode = '01049531702003111115120017181000105ZK250BXJRA\n01049531702003111115120017181000105ZK250BXJRB\n01049531702003111115120017181000105ZK250BXJRC\n01049531702003111115120017181000105ZK250BXJRD\n01049531702003111115120017181000105ZK250BXJRE\n01049531702003111115120017181000105ZK250BX111\n01049531702003111115120017181000105ZK250BXJRF\n01049531702003111115120017181000105ZK250BXJRG\n01049531702003111115120017181000105ZK250BXsys';
+ Controller.SearchPro();
- //鍒拌揣姝g‘淇℃伅
- Consumable_order_details2__c Orderdet1 = new Consumable_order_details2__c();
- Orderdet1.Name = 'OCM_01_001002';
- Orderdet1.Consumable_order_minor__c = Order1.Id;
- Orderdet1.Consumable_Product__c = pro1.Id;
- Orderdet1.Asset_Model_No__c = 'Test01';
- Orderdet1.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- Orderdet1.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRA';
- Orderdet1.TracingCode__c = 'BXJRA';
- Orderdet1.SerialLotNo__c = '5ZK';
- //娌″埌璐�
- Consumable_order_details2__c Orderdet2 = new Consumable_order_details2__c();
- Orderdet2.Name = 'OCM_01_001003';
- Orderdet2.Consumable_order_minor__c = Order1.Id;
- Orderdet2.Consumable_Product__c = pro1.Id;
- Orderdet2.Asset_Model_No__c = 'Test01';
- Orderdet2.Consumable_Arrived_order__c = Order1.Id;
- Orderdet2.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- Orderdet2.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRB';
- Orderdet2.TracingCode__c = 'BXJRB';
- Orderdet2.SerialLotNo__c = '5ZK';
- //閿�鍞骇鍝�
- Consumable_order_details2__c Orderdet3 = new Consumable_order_details2__c();
- Orderdet3.Name = 'OCM_01_001004';
- Orderdet3.Consumable_order_minor__c = Order1.Id;
- Orderdet3.Consumable_Product__c = pro1.Id;
- Orderdet3.Asset_Model_No__c = 'Test01';
- Orderdet3.Consumable_Arrived_order__c = Order1.Id;
- Orderdet3.Consumable_Sale_order__c = Order1.Id;
- Orderdet3.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- Orderdet3.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRC';
- Orderdet3.Used_date__c = Date.today();
- Orderdet3.Arrive_date__c = Date.today();
- Orderdet3.TracingCode__c = 'BXJRC';
- Orderdet3.SerialLotNo__c = '5ZK';
+ System.assertEquals('OCM_01_001002', controller.ConsumableorderdetailsRecords[0].esd.Name);
+ // System.assertEquals(2, controller.ConsumableorderdetailsRecordserror.size());
+ System.Test.stopTest();
- //鍑哄簱浜у搧
- Consumable_order_details2__c Orderdet4 = new Consumable_order_details2__c();
- Orderdet4.Name = 'OCM_01_001005';
- Orderdet4.Consumable_order_minor__c = Order1.Id;
- Orderdet4.Consumable_Product__c = pro1.Id;
- Orderdet4.Asset_Model_No__c = 'Test01';
- Orderdet4.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- Orderdet4.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRD';
- Orderdet4.Send_Date__c = Date.today();
- Orderdet4.TracingCode__c = 'BXJRD';
- Orderdet4.SerialLotNo__c = '5ZK';
- //Orderdet4.Box_Piece__c = '鐩�';
- //Orderdet4.Return_date__c = null;
- //宸插埌璐т骇鍝�
- Consumable_order_details2__c Orderdet5 = new Consumable_order_details2__c();
- Orderdet5.Name = 'OCM_01_001006';
- Orderdet5.Consumable_order_minor__c = Order2.Id;
- Orderdet5.Consumable_Product__c = pro1.Id;
- Orderdet5.Asset_Model_No__c = 'Test01';
- Orderdet5.Consumable_Arrived_order__c = Order1.Id;
- Orderdet5.Consumable_Shipment_order__c = Order1.Id;
- Orderdet5.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- Orderdet5.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRE';
- Orderdet5.Arrive_date__c = Date.today();
- Orderdet5.Box_Piece__c = '鐩�';
- Orderdet5.TracingCode__c = 'BXJRE';
- Orderdet5.SerialLotNo__c = '5ZK';
- insert new List<Consumable_order_details2__c>{
- Orderdet1,
- Orderdet2,
- Orderdet3,
- Orderdet4,
- Orderdet5
- };
+ }
+ }
- ArriveGoodsController Controller = new ArriveGoodsController();
- PageReference page = new PageReference('/apex/ArriveGoods?ArrType=Arr');
- System.Test.setCurrentPage(page);
- //鍒濆鍖栨祴璇�
- System.Test.startTest();
- Controller.init();
- //鎺掑簭
- Controller.barcode = '01049531702003111115120017181000105ZK250BXJRA\n01049531702003111115120017181000105ZK250BXJRB\n01049531702003111115120017181000105ZK250BXJRC\n01049531702003111115120017181000105ZK250BXJRD\n01049531702003111115120017181000105ZK250BXJRE\n01049531702003111115120017181000105ZK250BXsun\n01049531702003111115120017181000105ZK250BXJRF\n01049531702003111115120017181000105ZK250BXJRG\n01049531702003111115120017181000105ZK250BXsys';
- Controller.SearchPro();
+ //鏁翠綋鍒拌揣
+ @isTest
+ static void ArriveTest1() {
+ // // TO DO: implement unit test
+ List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '璨╁2搴�'];
+ if (rectCo.size() == 0) {
+ return;
+ }
+ // Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET Email)'];
+ Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'];
- System.assertEquals(
- 'OCM_01_001002',
- controller.ConsumableorderdetailsRecords[0].esd.Name
- );
- // System.assertEquals(1, controller.ConsumableorderdetailsRecordserror.size());
- System.Test.stopTest();
- }
- }
+ Oly_TriggerHandler.bypass('ConsumableAssetHander');
+ Account myAccount2 = new Account(name='Testaccount002',Dealer_discount__c =20,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '9999900');
+ Account myAccount1 = new Account(name='Testaccount001',Dealer_discount__c =30,RecordTypeId = rectCo[0].Id);
+ insert new account[]{myAccount1,myAccount2};
- //杩斿搧
- @isTest
- static void productReturn() {
- // // TO DO: implement unit test
- List<RecordType> rectCo = [
- SELECT Id
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '璨╁2搴�'
- ];
- if (rectCo.size() == 0) {
- return;
- }
- // Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET Email)'];
- Profile prof = [
- SELECT Id
- FROM Profile
- WHERE Name = '901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'
- ];
+ Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount1.id);
+ insert core;
+ user MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com',UserPro_Type__c = 'ET');
+ System.runAs(new User(Id = UserInfo.getUserId())){
+ insert MyUser_Test;
+ }
- Account myAccount2 = new Account(
- name = 'Testaccount002',
- Dealer_discount__c = 20,
- RecordTypeId = rectCo[0].Id,
- AgentCode_Ext__c = '9999900'
- );
- Account myAccount1 = new Account(
- name = 'Testaccount001',
- Dealer_discount__c = 30,
- RecordTypeId = rectCo[0].Id
- );
- insert new List<account>{ myAccount1, myAccount2 };
+ // // User MyUser_Test = [select id,Contact.accountid from User WHERE ProfileId = :prof.Id and IsActive = true and UserPro_Type__c = 'ET' limit 1 ];
+ // Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ // Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ // insert new Product2[] {prod01,prod02};
+ system.runAs(MyUser_Test){
+ Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ insert new Product2[] {prod01,prod02};
+ Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='Test001',Product2__c = prod01.Id);
+ Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='Test002',Product2__c = prod02.Id);
+ insert new Product2__c[] {pro1, pro2};
+ // Account myAccount1 = new Account(name='Testaccount001',Dealer_discount__c =30,RecordTypeId = rectCo[0].Id);
+ // insert myAccount1;
+ Consumable_order__c Order2 = new Consumable_order__c();
+ Order2.Name = 'OCM_02_001';
+ Order2.Order_status__c = '鎵瑰噯';
+ Order2.Order_type__c = '璁㈠崟';
+ Order2.Dealer_Info__c = myAccount1.Id;
+ Order2.RecordTypeid = System.Label.RT_ConOrder_Delivery;
+ insert Order2;
+ //鍙戦敊搴� 鏈埌璐�
+ Consumable_order_details2__c Orderdets8 = new Consumable_order_details2__c();
+ Orderdets8.Name = 'OCM_01_001011';
+ Orderdets8.Consumable_order_minor__c = Order2.Id;
+ Orderdets8.Consumable_Product__c = pro1.Id;
+ Orderdets8.Asset_Model_No__c = 'Test01';
+ Orderdets8.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
+ Orderdets8.Bar_Code__c = '01049531702003111115120017181000105ZK250BXsys';
+ Orderdets8.Box_Piece__c = '鐩�';
+ Orderdets8.TracingCode__c = 'BXsys';
+ Orderdets8.SerialLotNo__c = '5ZK';
+ insert Orderdets8;
- Contact core = new Contact(
- email = 'jplumber@salesforce.com',
- firstname = 'Joe',
- lastname = 'Plumber',
- accountid = myAccount1.id
- );
- insert core;
- user MyUser_Test = new User(
- ContactId = core.id,
- Alias = 'newUser',
- Email = 'newuser@testorg.com',
- EmailEncodingKey = 'UTF-8',
- LastName = 'TestUser',
- LanguageLocaleKey = 'zh_CN',
- LocaleSidKey = 'zh_CN',
- ProfileId = prof.Id,
- TimeZoneSidKey = 'Asia/Shanghai',
- UserName = 'testUser@testorg.com',
- UserPro_Type__c = 'ET'
- );
- System.runAs(new User(Id = UserInfo.getUserId())) {
- insert MyUser_Test;
- }
+ //system.runAs(myUser_Test){
+ //璁㈠崟
- // User MyUser_Test = [select id,Contact.accountid from User WHERE ProfileId = :prof.Id and IsActive = true and UserPro_Type__c = 'ET' limit 1 ];
- // Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false);
- // Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false);
- // insert new Product2[] {prod01,prod02};
- System.runAs(MyUser_Test) {
- Product2 prod01 = new Product2(
- Name = 'Test01',
- ProductCode = 'Test01',
- Asset_Model_No__c = 'Test01',
- SFDA_Status__c = '鏈夊姽',
- JANCODE__c = '04953170200311',
- Dealer_special_Object__c = true,
- Manual_Entry__c = false
- );
- Product2 prod02 = new Product2(
- Name = 'Test02',
- ProductCode = 'Test02',
- Asset_Model_No__c = 'Test02',
- SFDA_Status__c = '鏈夊姽',
- JANCODE__c = '04953170200312',
- Dealer_special_Object__c = true,
- Manual_Entry__c = false
- );
- insert new List<Product2>{ prod01, prod02 };
- Product2__c pro1 = new Product2__c(
- Name = 'Pro001',
- OT_CODE_Text__c = 'Test001',
- Product2__c = prod01.Id
- );
- Product2__c pro2 = new Product2__c(
- Name = 'Pro002',
- OT_CODE_Text__c = 'Test002',
- Product2__c = prod02.Id
- );
- insert new List<Product2__c>{ pro1, pro2 };
- //璁㈠崟
+ Consumable_order__c Order1 = new Consumable_order__c();
+ Order1.Name = 'OCM_01_001';
+ Order1.Order_status__c = '鎵瑰噯';
+ Order1.Order_type__c = '璁㈠崟';
+ Order1.Dealer_Info__c = myAccount1.id;
+ Order1.Order_ProType__c = 'ET';
+ Order1.RecordTypeid = System.Label.RT_ConOrder_Delivery;
+ insert Order1;
+ //璁㈠崟鏄庣粏
+ //fahuo
+ Consumable_orderdetails__c Orderdet = new Consumable_orderdetails__c();
+ Orderdet.Name = 'OCM_01_00101';
+ Orderdet.Consumable_order__c = Order1.Id;
+ Orderdet.RecordTypeId = System.Label.RT_ConOrderDetail1_Order;
+ Orderdet.Consumable_Product__c = pro1.Id;
+ Orderdet.Consumable_count__c = 4;
+ insert Orderdet;
- Consumable_order__c Order1 = new Consumable_order__c();
- Order1.Name = 'OCM_01_001';
- Order1.Order_status__c = '鎵瑰噯';
- Order1.Order_type__c = '璁㈠崟';
- Order1.Dealer_Info__c = myAccount1.id;
- Order1.RecordTypeid = System.Label.RT_ConOrder_Delivery;
- Order1.Order_ProType__c = 'ET';
- //杩斿搧璁㈠崟
+ //鍒拌揣姝g‘淇℃伅
+ Consumable_order_details2__c Orderdet1 = new Consumable_order_details2__c();
+ Orderdet1.Name = 'OCM_01_001002';
+ Orderdet1.Consumable_order_minor__c = Order1.Id;
+ Orderdet1.Consumable_Product__c = pro1.Id;
+ Orderdet1.Asset_Model_No__c = 'Test01';
+ Orderdet1.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
+ Orderdet1.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRA';
+ Orderdet1.TracingCode__c = 'BXJRA';
+ Orderdet1.SerialLotNo__c = '5ZK';
+ //娌″埌璐�
+ Consumable_order_details2__c Orderdet2 = new Consumable_order_details2__c();
+ Orderdet2.Name = 'OCM_01_001003';
+ Orderdet2.Consumable_order_minor__c = Order1.Id;
+ Orderdet2.Consumable_Product__c = pro1.Id;
+ Orderdet2.Asset_Model_No__c = 'Test01';
+ Orderdet2.Consumable_Arrived_order__c = Order1.Id;
+ Orderdet2.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
+ Orderdet2.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRB';
+ Orderdet2.TracingCode__c = 'BXJRB';
+ Orderdet2.SerialLotNo__c = '5ZK';
+ //閿�鍞骇鍝�
+ Consumable_order_details2__c Orderdet3 = new Consumable_order_details2__c();
+ Orderdet3.Name = 'OCM_01_001004';
+ Orderdet3.Consumable_order_minor__c = Order1.Id;
+ Orderdet3.Consumable_Product__c = pro1.Id;
+ Orderdet3.Asset_Model_No__c = 'Test01';
+ Orderdet3.Consumable_Arrived_order__c = Order1.Id;
+ Orderdet3.Consumable_Sale_order__c = Order1.Id;
+ Orderdet3.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
+ Orderdet3.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRC';
+ Orderdet3.Used_date__c = Date.today();
+ Orderdet3.Arrive_date__c = Date.today();
+ Orderdet3.TracingCode__c = 'BXJRC';
+ Orderdet3.SerialLotNo__c = '5ZK';
- Consumable_order__c Order2 = new Consumable_order__c();
- Order2.Name = 'OCM_01_002';
- Order2.Order_status__c = '鎵瑰噯';
- Order2.Order_type__c = '杩斿搧';
- Order2.Dealer_Info__c = myAccount1.id;
- Order2.RecordTypeid = System.Label.Dealer_Returned_Label;
- insert Order1;
- insert Order2;
- //璁㈠崟鏄庣粏
- //fahuo
- Consumable_orderdetails__c Orderdet = new Consumable_orderdetails__c();
- Orderdet.Name = 'OCM_01_00101';
- Orderdet.Consumable_order__c = Order1.Id;
- Orderdet.RecordTypeId = System.Label.RT_ConOrderDetail1_Order;
- Orderdet.Consumable_Product__c = pro1.Id;
- Orderdet.Consumable_count__c = 4;
- insert Orderdet;
+ //鍑哄簱浜у搧
+ Consumable_order_details2__c Orderdet4 = new Consumable_order_details2__c();
+ Orderdet4.Name = 'OCM_01_001005';
+ Orderdet4.Consumable_order_minor__c = Order1.Id;
+ Orderdet4.Consumable_Product__c = pro1.Id;
+ Orderdet4.Asset_Model_No__c = 'Test01';
+ Orderdet4.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
+ Orderdet4.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRD';
+ Orderdet4.Send_Date__c = Date.today();
+ Orderdet4.TracingCode__c = 'BXJRD';
+ Orderdet4.SerialLotNo__c = '5ZK';
+ //Orderdet4.Box_Piece__c = '鐩�';
+ //Orderdet4.Return_date__c = null;
- //鍙戣揣鏄庣粏
- //fahuo
- Consumable_order_details2__c Orderdet1 = new Consumable_order_details2__c();
- Orderdet1.Name = 'OCM_01_001001';
- Orderdet1.Consumable_order_minor__c = Order1.Id;
- Orderdet1.Consumable_Product__c = pro1.Id;
- Orderdet1.Asset_Model_No__c = 'Pro001';
- Orderdet1.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- Orderdet1.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRF';
- Orderdet1.TracingCode__c = 'BXJRF';
- //daohuo
- Consumable_order_details2__c Orderdet2 = new Consumable_order_details2__c();
- Orderdet2.Name = 'OCM_01_001002';
- Orderdet2.Consumable_order_minor__c = Order1.Id;
- Orderdet2.Consumable_Product__c = pro1.Id;
- Orderdet2.Asset_Model_No__c = 'Pro001';
- Orderdet2.Consumable_Arrived_order__c = Order1.Id;
- //Orderdet2.IsArrival__c = true;
- Orderdet2.Arrive_date__c = Date.today();
- Orderdet2.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- Orderdet2.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRI';
- Orderdet2.TracingCode__c = 'BXJRF';
- //sale
- Consumable_order_details2__c Orderdet3 = new Consumable_order_details2__c();
- Orderdet3.Name = 'OCM_01_001003';
- Orderdet3.Consumable_order_minor__c = Order1.Id;
- Orderdet3.Consumable_Product__c = pro1.Id;
- Orderdet3.Asset_Model_No__c = 'Pro001';
- Orderdet3.Consumable_Arrived_order__c = Order1.Id;
- //Orderdet3.IsArrival__c = true;
- Orderdet3.Arrive_date__c = Date.today();
- Orderdet3.Used_date__c = Date.today();
- Orderdet3.Consumable_Sale_order__c = Order1.Id;
- Orderdet3.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- Orderdet3.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRJ';
- Orderdet3.Box_Piece__c = '鐩�';
- Orderdet3.TracingCode__c = 'BXJRF';
- //鍑哄簱
- Consumable_order_details2__c Orderdet4 = new Consumable_order_details2__c();
- Orderdet4.Name = 'OCM_01_001004';
- Orderdet4.Consumable_order_minor__c = Order1.Id;
- Orderdet4.Consumable_Product__c = pro1.Id;
- Orderdet4.Asset_Model_No__c = 'Pro001';
- Orderdet4.Consumable_Arrived_order__c = Order1.Id;
- //Orderdet4.IsArrival__c = true;
- Orderdet4.Arrive_date__c = Date.today();
- Orderdet4.Send_Date__c = Date.today();
- Orderdet4.Consumable_Shipment_order__c = Order1.Id;
- Orderdet4.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- Orderdet4.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRN';
- Orderdet4.Box_Piece__c = '涓�';
- Orderdet4.TracingCode__c = 'BXJRF';
- //quxiao
- Consumable_order_details2__c Orderdet5 = new Consumable_order_details2__c();
- Orderdet5.Name = 'OCM_01_001005';
- Orderdet5.Consumable_order_minor__c = Order1.Id;
- Orderdet5.Consumable_Product__c = pro1.Id;
- Orderdet5.Asset_Model_No__c = 'Pro001';
- Orderdet5.Cancellation_Date__c = Date.today();
- Orderdet5.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- Orderdet5.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRZ';
- Orderdet5.Box_Piece__c = '鐩�';
- Orderdet5.TracingCode__c = 'BXJRF';
- //fanpin
- Consumable_order_details2__c Orderdet6 = new Consumable_order_details2__c();
- Orderdet6.Name = 'OCM_01_001006';
- Orderdet6.Consumable_order_minor__c = Order1.Id;
- Orderdet6.Consumable_Product__c = pro1.Id;
- Orderdet6.Asset_Model_No__c = 'Pro001';
- Orderdet6.Consumable_Return_order__c = Order2.Id;
- Orderdet6.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- Orderdet6.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRA';
- Orderdet6.Box_Piece__c = '涓�';
- Orderdet6.TracingCode__c = 'BXJRF';
+ //宸插埌璐т骇鍝�
+ Consumable_order_details2__c Orderdet5 = new Consumable_order_details2__c();
+ Orderdet5.Name = 'OCM_01_001006';
+ Orderdet5.Consumable_order_minor__c = Order2.Id;
+ Orderdet5.Consumable_Product__c = pro1.Id;
+ Orderdet5.Asset_Model_No__c = 'Test01';
+ Orderdet5.Consumable_Arrived_order__c = Order1.Id;
+ Orderdet5.Consumable_Shipment_order__c = Order1.Id;
+ Orderdet5.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
+ Orderdet5.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRE';
+ Orderdet5.Arrive_date__c = Date.today();
+ Orderdet5.Box_Piece__c = '鐩�';
+ Orderdet5.TracingCode__c = 'BXJRE';
+ Orderdet5.SerialLotNo__c = '5ZK';
+ insert new Consumable_order_details2__c[] {Orderdet1, Orderdet2,Orderdet3,Orderdet4,Orderdet5};
- insert new List<Consumable_order_details2__c>{
- Orderdet1,
- Orderdet2,
- Orderdet3,
- Orderdet4,
- Orderdet5,
- Orderdet6
- };
- PageReference page = new PageReference('/apex/ArriveGoods?ArrType=ReG');
- System.Test.setCurrentPage(page);
- ArriveGoodsController Controller = new ArriveGoodsController();
- //鍒濆鍖栨祴璇�
- System.Test.startTest();
- Controller.init();
- //鎺掑簭
- Controller.barcode = '01049531702003111115120017181000105ZK250BXJRN\n01049531702003111115120017181000105ZK250BXJRF\n01049531702003111115120017181000105ZK250BXJRI\n01049531702003111115120017181000105ZK250BXJRN\n01049531702003111115120017181000105ZK250BXJRZ\n01049531702003111115120017181000105ZK250BXJRA\n01049531702003111115120017181000105ZK250BXJRI';
- Controller.SearchPro();
- //System.assertEquals(1, controller.ShowGoodsofReturnList.size());
- //System.assertEquals('OCM_01_001003', controller.ShowGoodsofReturnList[0].esd.Name);
- //System.assertEquals('OCM_01_001004', controller.ShowGoodsofReturnList[1].esd.Name);
- // System.assertEquals(5, controller.ConsumableorderdetailsRecordserror.size()); //tcm
- //System.assertEquals('Test01', controller.ConsumableorderdetailsRecordserror[1].Prod.Name__c);
- //System.assertEquals('OCM_01_001002', controller.ConsumableorderdetailsRecordserror[2].esd.Name);
- //System.assertEquals('OCM_02_001001', controller.ConsumableorderdetailsRecordserror[3].esd.Name);
- Controller.GoodsReturnCheck();
- controller.ShowGoodsofReturnList[0].esd.Return_reason__c = '澶氬彂';
- controller.ShowGoodsofReturnList[0].esd.Rrturn_count__c = 1;
- //System.assertEquals(1, controller.ShowGoodsofReturnList.size());
- Controller.UpdateGoodsOfReturn();
- Controller.ToReturnGoodsPage();
- Controller.geterrorsize();
- System.Test.stopTest();
- }
- }
- //杩斿搧
- @isTest
- static void productReturn_new() {
- // // TO DO: implement unit test
- List<RecordType> rectCo = [
- SELECT Id
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '璨╁2搴�'
- ];
- if (rectCo.size() == 0) {
- return;
- }
- // Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET Email)'];
- Profile prof = [
- SELECT Id
- FROM Profile
- WHERE Name = '901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'
- ];
- Account myAccount2 = new Account(
- name = 'Testaccount002',
- Dealer_discount__c = 20,
- RecordTypeId = rectCo[0].Id,
- AgentCode_Ext__c = '9999900'
- );
- Account myAccount1 = new Account(
- name = 'Testaccount001',
- Dealer_discount__c = 30,
- RecordTypeId = rectCo[0].Id
- );
- insert new List<account>{ myAccount1, myAccount2 };
+ ArriveGoodsController Controller = new ArriveGoodsController();
+ PageReference page = new PageReference('/apex/ArriveGoods?ArrType=Arr');
+ System.Test.setCurrentPage(page);
+ //鍒濆鍖栨祴璇�
+ System.Test.startTest();
+ Controller.init();
+ //鎺掑簭
+ Controller.barcode = '01049531702003111115120017181000105ZK250BXJRA\n01049531702003111115120017181000105ZK250BXJRB\n01049531702003111115120017181000105ZK250BXJRC\n01049531702003111115120017181000105ZK250BXJRD\n01049531702003111115120017181000105ZK250BXJRE\n01049531702003111115120017181000105ZK250BXsun\n01049531702003111115120017181000105ZK250BXJRF\n01049531702003111115120017181000105ZK250BXJRG\n01049531702003111115120017181000105ZK250BXsys';
+ Controller.SearchPro();
- Contact core = new Contact(
- email = 'jplumber@salesforce.com',
- firstname = 'Joe',
- lastname = 'Plumber',
- accountid = myAccount1.id
- );
- insert core;
- user MyUser_Test = new User(
- ContactId = core.id,
- Alias = 'newUser',
- Email = 'newuser@testorg.com',
- EmailEncodingKey = 'UTF-8',
- LastName = 'TestUser',
- LanguageLocaleKey = 'zh_CN',
- LocaleSidKey = 'zh_CN',
- ProfileId = prof.Id,
- TimeZoneSidKey = 'Asia/Shanghai',
- UserName = 'testUser@testorg.com',
- UserPro_Type__c = 'ET'
- );
- System.runAs(new User(Id = UserInfo.getUserId())) {
- insert MyUser_Test;
- }
+ System.assertEquals('OCM_01_001002', controller.ConsumableorderdetailsRecords[0].esd.Name);
+ // System.assertEquals(1, controller.ConsumableorderdetailsRecordserror.size());
+ System.Test.stopTest();
- // User MyUser_Test = [select id,Contact.accountid from User WHERE ProfileId = :prof.Id and IsActive = true and UserPro_Type__c = 'ET' limit 1 ];
- // Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false);
- // Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false);
- // insert new Product2[] {prod01,prod02};
- System.runAs(MyUser_Test) {
- Product2 prod01 = new Product2(
- Name = 'Test01',
- ProductCode = 'Test01',
- Asset_Model_No__c = 'Test01',
- SFDA_Status__c = '鏈夊姽',
- JANCODE__c = '04953170200311',
- Dealer_special_Object__c = true,
- Manual_Entry__c = false
- );
- Product2 prod02 = new Product2(
- Name = 'Test02',
- ProductCode = 'Test02',
- Asset_Model_No__c = 'Test02',
- SFDA_Status__c = '鏈夊姽',
- JANCODE__c = '04953170200312',
- Dealer_special_Object__c = true,
- Manual_Entry__c = false
- );
- insert new List<Product2>{ prod01, prod02 };
- Product2__c pro1 = new Product2__c(
- Name = 'Pro001',
- OT_CODE_Text__c = 'Test001',
- Product2__c = prod01.Id
- );
- Product2__c pro2 = new Product2__c(
- Name = 'Pro002',
- OT_CODE_Text__c = 'Test002',
- Product2__c = prod02.Id
- );
- insert new List<Product2__c>{ pro1, pro2 };
- //璁㈠崟
- Consumable_order__c Order1 = new Consumable_order__c();
- Order1.Name = 'OCM_01_001';
- Order1.Order_status__c = '鎵瑰噯';
- Order1.Order_type__c = '璁㈠崟';
- Order1.Dealer_Info__c = myAccount1.id;
- Order1.RecordTypeid = System.Label.RT_ConOrder_Delivery;
- Order1.Order_ProType__c = 'ET';
- insert Order1;
- //Consumable_order__c coc = [select Dealer_Info__r.name from Consumable_order__c where Id =:Order1.Id];
- //system.assertEquals('qeee',coc.Dealer_Info__r.name);
- //璁㈠崟鏄庣粏
- //fahuo
- Consumable_orderdetails__c Orderdet = new Consumable_orderdetails__c();
- Orderdet.Name = 'OCM_01_001001';
- Orderdet.Consumable_order__c = Order1.Id;
- Orderdet.RecordTypeId = System.Label.RT_ConOrderDetail1_Order;
- Orderdet.Consumable_Product__c = pro1.Id;
- Orderdet.Consumable_count__c = 4;
- insert Orderdet;
+ }
+ }
- //鍙戣揣鏄庣粏
- //fahuo
- /*Consumable_order_details2__c Orderdet1 = new Consumable_order_details2__c();
+
+
+
+ //杩斿搧
+ @isTest
+ static void productReturn() {
+ // // TO DO: implement unit test
+ List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '璨╁2搴�'];
+ if (rectCo.size() == 0) {
+ return;
+ }
+ // Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET Email)'];
+ Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'];
+
+
+ Account myAccount2 = new Account(name='Testaccount002',Dealer_discount__c =20,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '9999900');
+ Account myAccount1 = new Account(name='Testaccount001',Dealer_discount__c =30,RecordTypeId = rectCo[0].Id);
+ insert new account[]{myAccount1,myAccount2};
+
+ Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount1.id);
+ insert core;
+ user MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com',UserPro_Type__c = 'ET');
+ System.runAs(new User(Id = UserInfo.getUserId())){
+ insert MyUser_Test;
+ }
+
+ // User MyUser_Test = [select id,Contact.accountid from User WHERE ProfileId = :prof.Id and IsActive = true and UserPro_Type__c = 'ET' limit 1 ];
+ // Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ // Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ // insert new Product2[] {prod01,prod02};
+ system.runAs(MyUser_Test){
+ Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ insert new Product2[] {prod01,prod02};
+ Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='Test001',Product2__c = prod01.Id);
+ Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='Test002',Product2__c = prod02.Id);
+ insert new Product2__c[] {pro1, pro2};
+ //璁㈠崟
+
+ Consumable_order__c Order1 = new Consumable_order__c();
+ Order1.Name = 'OCM_01_001';
+ Order1.Order_status__c = '鎵瑰噯';
+ Order1.Order_type__c = '璁㈠崟';
+ Order1.Dealer_Info__c = myAccount1.id;
+ Order1.RecordTypeid = System.Label.RT_ConOrder_Delivery;
+ Order1.Order_ProType__c = 'ET';
+ //杩斿搧璁㈠崟
+
+ Consumable_order__c Order2 = new Consumable_order__c();
+ Order2.Name = 'OCM_01_002';
+ Order2.Order_status__c = '鎵瑰噯';
+ Order2.Order_type__c = '杩斿搧';
+ Order2.Dealer_Info__c = myAccount1.id;
+ Order2.RecordTypeid = System.Label.Dealer_Returned_Label;
+ insert Order1;
+ insert Order2;
+
+ //璁㈠崟鏄庣粏
+ //fahuo
+ Consumable_orderdetails__c Orderdet = new Consumable_orderdetails__c();
+ Orderdet.Name = 'OCM_01_00101';
+ Orderdet.Consumable_order__c = Order1.Id;
+ Orderdet.RecordTypeId = System.Label.RT_ConOrderDetail1_Order;
+ Orderdet.Consumable_Product__c = pro1.Id;
+ Orderdet.Consumable_count__c = 4;
+ insert Orderdet;
+
+ //鍙戣揣鏄庣粏
+ //fahuo
+ Consumable_order_details2__c Orderdet1 = new Consumable_order_details2__c();
+ Orderdet1.Name = 'OCM_01_001001';
+ Orderdet1.Consumable_order_minor__c = Order1.Id;
+ Orderdet1.Consumable_Product__c = pro1.Id;
+ Orderdet1.Asset_Model_No__c = 'Pro001';
+ Orderdet1.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
+ Orderdet1.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRF';
+ Orderdet1.TracingCode__c = 'BXJRF';
+ //daohuo
+ Consumable_order_details2__c Orderdet2 = new Consumable_order_details2__c();
+ Orderdet2.Name = 'OCM_01_001002';
+ Orderdet2.Consumable_order_minor__c = Order1.Id;
+ Orderdet2.Consumable_Product__c = pro1.Id;
+ Orderdet2.Asset_Model_No__c = 'Pro001';
+ Orderdet2.Consumable_Arrived_order__c = Order1.Id;
+ //Orderdet2.IsArrival__c = true;
+ Orderdet2.Arrive_date__c = Date.today();
+ Orderdet2.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
+ Orderdet2.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRI';
+ Orderdet2.TracingCode__c = 'BXJRF';
+ //sale
+ Consumable_order_details2__c Orderdet3 = new Consumable_order_details2__c();
+ Orderdet3.Name = 'OCM_01_001003';
+ Orderdet3.Consumable_order_minor__c = Order1.Id;
+ Orderdet3.Consumable_Product__c = pro1.Id;
+ Orderdet3.Asset_Model_No__c = 'Pro001';
+ Orderdet3.Consumable_Arrived_order__c = Order1.Id;
+ //Orderdet3.IsArrival__c = true;
+ Orderdet3.Arrive_date__c = Date.today();
+ Orderdet3.Used_date__c = Date.today();
+ Orderdet3.Consumable_Sale_order__c = Order1.Id;
+ Orderdet3.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
+ Orderdet3.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRJ';
+ Orderdet3.Box_Piece__c ='鐩�';
+ Orderdet3.TracingCode__c = 'BXJRF';
+ //鍑哄簱
+ Consumable_order_details2__c Orderdet4 = new Consumable_order_details2__c();
+ Orderdet4.Name = 'OCM_01_001004';
+ Orderdet4.Consumable_order_minor__c = Order1.Id;
+ Orderdet4.Consumable_Product__c = pro1.Id;
+ Orderdet4.Asset_Model_No__c = 'Pro001';
+ Orderdet4.Consumable_Arrived_order__c = Order1.Id;
+ //Orderdet4.IsArrival__c = true;
+ Orderdet4.Arrive_date__c = Date.today();
+ Orderdet4.Send_Date__c = Date.today();
+ Orderdet4.Consumable_Shipment_order__c = Order1.Id;
+ Orderdet4.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
+ Orderdet4.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRN';
+ Orderdet4.Box_Piece__c ='涓�';
+ Orderdet4.TracingCode__c = 'BXJRF';
+ //quxiao
+ Consumable_order_details2__c Orderdet5 = new Consumable_order_details2__c();
+ Orderdet5.Name = 'OCM_01_001005';
+ Orderdet5.Consumable_order_minor__c = Order1.Id;
+ Orderdet5.Consumable_Product__c = pro1.Id;
+ Orderdet5.Asset_Model_No__c = 'Pro001';
+ Orderdet5.Cancellation_Date__c = Date.today();
+ Orderdet5.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
+ Orderdet5.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRZ';
+ Orderdet5.Box_Piece__c ='鐩�';
+ Orderdet5.TracingCode__c = 'BXJRF';
+ //fanpin
+ Consumable_order_details2__c Orderdet6 = new Consumable_order_details2__c();
+ Orderdet6.Name = 'OCM_01_001006';
+ Orderdet6.Consumable_order_minor__c = Order1.Id;
+ Orderdet6.Consumable_Product__c = pro1.Id;
+ Orderdet6.Asset_Model_No__c = 'Pro001';
+ Orderdet6.Consumable_Return_order__c = Order2.Id;
+ Orderdet6.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
+ Orderdet6.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRA';
+ Orderdet6.Box_Piece__c ='涓�';
+ Orderdet6.TracingCode__c = 'BXJRF';
+
+ insert new Consumable_order_details2__c[] {Orderdet1, Orderdet2,Orderdet3,Orderdet4,Orderdet5,Orderdet6};
+ PageReference page = new PageReference('/apex/ArriveGoods?ArrType=ReG');
+ System.Test.setCurrentPage(page);
+ ArriveGoodsController Controller = new ArriveGoodsController();
+ //鍒濆鍖栨祴璇�
+ System.Test.startTest();
+ Controller.init();
+ //鎺掑簭
+ Controller.barcode = '01049531702003111115120017181000105ZK250BXJRN\n01049531702003111115120017181000105ZK250BXJRF\n01049531702003111115120017181000105ZK250BXJRI\n01049531702003111115120017181000105ZK250BXJRN\n01049531702003111115120017181000105ZK250BXJRZ\n01049531702003111115120017181000105ZK250BXJRA\n01049531702003111115120017181000105ZK250BXJRI';
+ Controller.SearchPro();
+ //System.assertEquals(1, controller.ShowGoodsofReturnList.size());
+ //System.assertEquals('OCM_01_001003', controller.ShowGoodsofReturnList[0].esd.Name);
+ //System.assertEquals('OCM_01_001004', controller.ShowGoodsofReturnList[1].esd.Name);
+ // System.assertEquals(5, controller.ConsumableorderdetailsRecordserror.size()); //tcm
+ //System.assertEquals('Test01', controller.ConsumableorderdetailsRecordserror[1].Prod.Name__c);
+ //System.assertEquals('OCM_01_001002', controller.ConsumableorderdetailsRecordserror[2].esd.Name);
+ //System.assertEquals('OCM_02_001001', controller.ConsumableorderdetailsRecordserror[3].esd.Name);
+ Controller.GoodsReturnCheck();
+ controller.ShowGoodsofReturnList[0].esd.Return_reason__c='澶氬彂';
+ controller.ShowGoodsofReturnList[0].esd.Rrturn_count__c =1;
+ //System.assertEquals(1, controller.ShowGoodsofReturnList.size());
+ Controller.UpdateGoodsOfReturn();
+ Controller.ToReturnGoodsPage();
+ Controller.geterrorsize();
+ System.Test.stopTest();
+
+ }
+ }
+
+ //杩斿搧
+ @isTest
+ static void productReturn_new() {
+ // // TO DO: implement unit test
+ List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '璨╁2搴�'];
+ if (rectCo.size() == 0) {
+ return;
+ }
+ // Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET Email)'];
+ Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'];
+
+
+ Account myAccount2 = new Account(name='Testaccount002',Dealer_discount__c =20,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '9999900');
+ Account myAccount1 = new Account(name='Testaccount001',Dealer_discount__c =30,RecordTypeId = rectCo[0].Id);
+ insert new account[]{myAccount1,myAccount2};
+
+ Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount1.id);
+ insert core;
+ user MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com',UserPro_Type__c = 'ET');
+ System.runAs(new User(Id = UserInfo.getUserId())){
+ insert MyUser_Test;
+ }
+
+ // User MyUser_Test = [select id,Contact.accountid from User WHERE ProfileId = :prof.Id and IsActive = true and UserPro_Type__c = 'ET' limit 1 ];
+ // Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ // Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ // insert new Product2[] {prod01,prod02};
+ system.runAs(MyUser_Test){
+ Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ insert new Product2[] {prod01,prod02};
+ Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='Test001',Product2__c = prod01.Id);
+ Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='Test002',Product2__c = prod02.Id);
+ insert new Product2__c[] {pro1, pro2};
+ //璁㈠崟
+ Consumable_order__c Order1 = new Consumable_order__c();
+ Order1.Name = 'OCM_01_001';
+ Order1.Order_status__c = '鎵瑰噯';
+ Order1.Order_type__c = '璁㈠崟';
+ Order1.Dealer_Info__c = myAccount1.id;
+ Order1.RecordTypeid = System.Label.RT_ConOrder_Delivery;
+ Order1.Order_ProType__c = 'ET';
+ insert Order1;
+ //Consumable_order__c coc = [select Dealer_Info__r.name from Consumable_order__c where Id =:Order1.Id];
+ //system.assertEquals('qeee',coc.Dealer_Info__r.name);
+
+ //璁㈠崟鏄庣粏
+ //fahuo
+ Consumable_orderdetails__c Orderdet = new Consumable_orderdetails__c();
+ Orderdet.Name = 'OCM_01_001001';
+ Orderdet.Consumable_order__c = Order1.Id;
+ Orderdet.RecordTypeId = System.Label.RT_ConOrderDetail1_Order;
+ Orderdet.Consumable_Product__c = pro1.Id;
+ Orderdet.Consumable_count__c = 4;
+ insert Orderdet;
+
+ //鍙戣揣鏄庣粏
+ //fahuo
+ /*Consumable_order_details2__c Orderdet1 = new Consumable_order_details2__c();
Orderdet1.Name = 'OCM_01_001001';
Orderdet1.Consumable_order_minor__c = Order1.Id;
Orderdet1.Consumable_Product__c = pro1.Id;
@@ -1313,2747 +879,2033 @@
//Orderdet2.Send_Date__c = Date.today();
//Orderdet2.Used_date__c= Date.today();
Orderdet2.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRF';*/
- //sale
- Consumable_order_details2__c Orderdet3 = new Consumable_order_details2__c();
- Orderdet3.Name = 'OCM_01_001003';
- Orderdet3.Consumable_order_minor__c = Order1.Id;
- Orderdet3.Consumable_Product__c = pro1.Id;
- Orderdet3.Asset_Model_No__c = 'Pro001';
- Orderdet3.Consumable_Arrived_order__c = Order1.Id;
- //Orderdet3.IsArrival__c = true;
- Orderdet3.Consumable_Sale_order__c = Order1.Id;
- Orderdet3.Box_Piece__c = '鐩�';
- Orderdet3.Used_date__c = Date.today();
- Orderdet3.Arrive_date__c = Date.today();
- Orderdet3.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- Orderdet3.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRF';
- Orderdet3.TracingCode__c = 'BXJRF';
- Orderdet3.SerialLotNo__c = '5ZK';
- //鍑哄簱
- Consumable_order_details2__c Orderdet4 = new Consumable_order_details2__c();
- Orderdet4.Name = 'OCM_01_001004';
- Orderdet4.Consumable_order_minor__c = Order1.Id;
- Orderdet4.Consumable_Product__c = pro1.Id;
- Orderdet4.Asset_Model_No__c = 'Pro001';
- Orderdet4.Consumable_Arrived_order__c = Order1.Id;
- //Orderdet4.IsArrival__c = true;
- Orderdet4.Consumable_Shipment_order__c = Order1.Id;
- Orderdet4.Box_Piece__c = '涓�';
- Orderdet4.Send_Date__c = Date.today();
- Orderdet4.Arrive_date__c = Date.today();
- Orderdet4.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- Orderdet4.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRN';
- Orderdet4.TracingCode__c = 'BXJRN';
- Orderdet4.SerialLotNo__c = '5ZK';
- //quxiao
- Consumable_order_details2__c Orderdet5 = new Consumable_order_details2__c();
- Orderdet5.Name = 'OCM_01_001005';
- Orderdet5.Consumable_order_minor__c = Order1.Id;
- Orderdet5.Consumable_Product__c = pro1.Id;
- Orderdet5.Asset_Model_No__c = 'Pro001';
- Orderdet5.Cancellation_Date__c = Date.today();
- Orderdet5.Cancellation_Flag__c = true;
- Orderdet5.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- Orderdet5.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRZ';
- Orderdet5.Box_Piece__c = '涓�';
- Orderdet5.TracingCode__c = 'BXJRZ';
- Orderdet5.SerialLotNo__c = '5ZK';
- insert new List<Consumable_order_details2__c>{
- Orderdet3,
- Orderdet4,
- Orderdet5
- };
+ //sale
+ Consumable_order_details2__c Orderdet3 = new Consumable_order_details2__c();
+ Orderdet3.Name = 'OCM_01_001003';
+ Orderdet3.Consumable_order_minor__c = Order1.Id;
+ Orderdet3.Consumable_Product__c = pro1.Id;
+ Orderdet3.Asset_Model_No__c = 'Pro001';
+ Orderdet3.Consumable_Arrived_order__c = Order1.Id;
+ //Orderdet3.IsArrival__c = true;
+ Orderdet3.Consumable_Sale_order__c = Order1.Id;
+ Orderdet3.Box_Piece__c ='鐩�';
+ Orderdet3.Used_date__c= Date.today();
+ Orderdet3.Arrive_date__c = Date.today();
+ Orderdet3.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
+ Orderdet3.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRF';
+ Orderdet3.TracingCode__c = 'BXJRF';
+ Orderdet3.SerialLotNo__c = '5ZK';
+ //鍑哄簱
+ Consumable_order_details2__c Orderdet4 = new Consumable_order_details2__c();
+ Orderdet4.Name = 'OCM_01_001004';
+ Orderdet4.Consumable_order_minor__c = Order1.Id;
+ Orderdet4.Consumable_Product__c = pro1.Id;
+ Orderdet4.Asset_Model_No__c = 'Pro001';
+ Orderdet4.Consumable_Arrived_order__c = Order1.Id;
+ //Orderdet4.IsArrival__c = true;
+ Orderdet4.Consumable_Shipment_order__c = Order1.Id;
+ Orderdet4.Box_Piece__c ='涓�';
+ Orderdet4.Send_Date__c = Date.today();
+ Orderdet4.Arrive_date__c = Date.today();
+ Orderdet4.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
+ Orderdet4.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRN';
+ Orderdet4.TracingCode__c = 'BXJRN';
+ Orderdet4.SerialLotNo__c = '5ZK';
+ //quxiao
+ Consumable_order_details2__c Orderdet5 = new Consumable_order_details2__c();
+ Orderdet5.Name = 'OCM_01_001005';
+ Orderdet5.Consumable_order_minor__c = Order1.Id;
+ Orderdet5.Consumable_Product__c = pro1.Id;
+ Orderdet5.Asset_Model_No__c = 'Pro001';
+ Orderdet5.Cancellation_Date__c = Date.today();
+ Orderdet5.Cancellation_Flag__c = true;
+ Orderdet5.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
+ Orderdet5.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRZ';
+ Orderdet5.Box_Piece__c ='涓�';
+ Orderdet5.TracingCode__c = 'BXJRZ';
+ Orderdet5.SerialLotNo__c = '5ZK';
+ insert new Consumable_order_details2__c[] {Orderdet3,Orderdet4,Orderdet5};
- PageReference page = new PageReference('/apex/ArriveGoods?ArrType=ReG');
- System.Test.setCurrentPage(page);
- ArriveGoodsController Controller = new ArriveGoodsController();
- //鍒濆鍖栨祴璇�
- System.Test.startTest();
- Controller.init();
- //鎺掑簭
- Controller.barcode = '01049531702003111115120017181000105ZK250BXJRF\n01049531702003111115120017181000105ZK250BXJRN\n01049531702003111115120017181000105ZK250BXJRZ\n01049531702003111115120017181000105ZK250BXJRR';
- Controller.SearchPro();
- // System.assertEquals(1, controller.ConsumableorderdetailsRecordserror.size());
- System.assertEquals(2, controller.ShowGoodsofReturnList.size());
- controller.ShowGoodsofReturnList[0].esd.Return_reason__c = '澶氬彂';
- controller.ShowGoodsofReturnList[1].esd.Return_reason__c = '澶氬彂';
- controller.ShowGoodsofReturnList[0].esd.Rrturn_count__c = 1;
- Controller.UpdateGoodsOfReturn();
+ PageReference page = new PageReference('/apex/ArriveGoods?ArrType=ReG');
+ System.Test.setCurrentPage(page);
+ ArriveGoodsController Controller = new ArriveGoodsController();
+ //鍒濆鍖栨祴璇�
+ System.Test.startTest();
+ Controller.init();
+ //鎺掑簭
+ Controller.barcode = '01049531702003111115120017181000105ZK250BXJRF\n01049531702003111115120017181000105ZK250BXJRN\n01049531702003111115120017181000105ZK250BXJRZ\n01049531702003111115120017181000105ZK250BXJRR';
+ Controller.SearchPro();
+ // System.assertEquals(1, controller.ConsumableorderdetailsRecordserror.size());
+ System.assertEquals(2, controller.ShowGoodsofReturnList.size());
+ controller.ShowGoodsofReturnList[0].esd.Return_reason__c='澶氬彂';
+ controller.ShowGoodsofReturnList[1].esd.Return_reason__c='澶氬彂';
+ controller.ShowGoodsofReturnList[0].esd.Rrturn_count__c =1;
+ Controller.UpdateGoodsOfReturn();
- list<String> list1 = new List<String>();
- list1.add(Controller.barcode = '01234567898');
- Controller.inventoryEntryNoESetId(list1);
+ list<String> list1 = new list<String>();
+ list1.add(Controller.barcode = '01234567898');
+ Controller.inventoryEntryNoESetId(list1);
- list1.clear();
- list1.add(Controller.barcode = '012345678901234A67');
- Controller.inventoryEntryNoESetId(list1);
+ list1.clear();
+ list1.add(Controller.barcode = '012345678901234A67');
+ Controller.inventoryEntryNoESetId(list1);
- list1.clear();
- list1.add(Controller.barcode = '0123456789012345117AA01');
- Controller.inventoryEntryNoESetId(list1);
+ list1.clear();
+ list1.add(Controller.barcode = '0123456789012345117AA01');
+ Controller.inventoryEntryNoESetId(list1);
- list1.clear();
- list1.add(Controller.barcode = '01234567890123456789012349990001');
- Controller.inventoryEntryNoESetId(list1);
+ list1.clear();
+ list1.add(Controller.barcode = '01234567890123456789012349990001');
+ Controller.inventoryEntryNoESetId(list1);
- list1.clear();
- list1.add(Controller.barcode = '0123456789012345177AA0000000000001');
- Controller.inventoryEntryNoESetId(list1);
+ list1.clear();
+ list1.add(Controller.barcode = '0123456789012345177AA0000000000001');
+ Controller.inventoryEntryNoESetId(list1);
- list1.clear();
- list1.add(Controller.barcode = '0123456789012345177AA1111111111111');
- Controller.inventoryEntryNoESetId(list1);
+ list1.clear();
+ list1.add(Controller.barcode = '0123456789012345177AA1111111111111');
+ Controller.inventoryEntryNoESetId(list1);
- list1.clear();
- list1.add(Controller.barcode = '241345');
- Controller.inventoryEntryNoESetId(list1);
+ list1.clear();
+ list1.add(Controller.barcode = '241345');
+ Controller.inventoryEntryNoESetId(list1);
- list1.clear();
- list1.add(Controller.barcode = '2413456');
- Controller.inventoryEntryNoESetId(list1);
+ list1.clear();
+ list1.add(Controller.barcode = '2413456');
+ Controller.inventoryEntryNoESetId(list1);
- list1.clear();
- list1.add(Controller.barcode = '24134567');
- Controller.inventoryEntryNoESetId(list1);
+ list1.clear();
+ list1.add(Controller.barcode = '24134567');
+ Controller.inventoryEntryNoESetId(list1);
- list1.clear();
- list1.add(Controller.barcode = '241345678');
- Controller.inventoryEntryNoESetId(list1);
+ list1.clear();
+ list1.add(Controller.barcode = '241345678');
+ Controller.inventoryEntryNoESetId(list1);
- list1.clear();
- list1.add(Controller.barcode = '2413456789');
- Controller.inventoryEntryNoESetId(list1);
+ list1.clear();
+ list1.add(Controller.barcode = '2413456789');
+ Controller.inventoryEntryNoESetId(list1);
- list1.clear();
- list1.add(Controller.barcode = '24134567890');
- Controller.inventoryEntryNoESetId(list1);
+ list1.clear();
+ list1.add(Controller.barcode = '24134567890');
+ Controller.inventoryEntryNoESetId(list1);
- list1.clear();
- list1.add(Controller.barcode = '241345678901');
- Controller.inventoryEntryNoESetId(list1);
+ list1.clear();
+ list1.add(Controller.barcode = '241345678901');
+ Controller.inventoryEntryNoESetId(list1);
- list1.clear();
- list1.add(Controller.barcode = '0112345678901231177890121215678901234');
- Controller.inventoryEntryNoESetId(list1);
+ list1.clear();
+ list1.add(Controller.barcode = '0112345678901231177890121215678901234');
+ Controller.inventoryEntryNoESetId(list1);
- list1.clear();
- list1.add(Controller.barcode = '0112345678901231106789012105678901234');
- Controller.inventoryEntryNoESetId(list1);
- list1.clear();
- list1.add(Controller.barcode = '0112345678901231106789012105625001234');
- Controller.inventoryEntryNoESetId(list1);
- System.Test.stopTest();
- }
- }
+ list1.clear();
+ list1.add(Controller.barcode = '0112345678901231106789012105678901234');
+ Controller.inventoryEntryNoESetId(list1);
+ list1.clear();
+ list1.add(Controller.barcode = '0112345678901231106789012105625001234');
+ Controller.inventoryEntryNoESetId(list1);
+ System.Test.stopTest();
- //鐩存帴鍒拌揣
- @isTest
- static void arrivedirect() {
- // // TO DO: implement unit test
- List<RecordType> rectCo = [
- SELECT Id
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '璨╁2搴�'
- ];
- if (rectCo.size() == 0) {
- return;
- }
- // Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET Email)'];
- Profile prof = [
- SELECT Id
- FROM Profile
- WHERE Name = '901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'
- ];
+ }
+ }
- Account myAccount2 = new Account(
- name = 'Testaccount002',
- Dealer_discount__c = 20,
- RecordTypeId = rectCo[0].Id,
- AgentCode_Ext__c = '9999900'
- );
- Account myAccount1 = new Account(
- name = 'Testaccount001',
- Dealer_discount__c = 30,
- RecordTypeId = rectCo[0].Id
- );
- insert new List<account>{ myAccount1, myAccount2 };
+ //鐩存帴鍒拌揣
+ @isTest
+ static void arrivedirect() {
+ // // TO DO: implement unit test
+ List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '璨╁2搴�'];
+ if (rectCo.size() == 0) {
+ return;
+ }
+ // Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET Email)'];
+ Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'];
- Contact core = new Contact(
- email = 'jplumber@salesforce.com',
- firstname = 'Joe',
- lastname = 'Plumber',
- accountid = myAccount1.id
- );
- insert core;
- user MyUser_Test = new User(
- ContactId = core.id,
- Alias = 'newUser',
- Email = 'newuser@testorg.com',
- EmailEncodingKey = 'UTF-8',
- LastName = 'TestUser',
- LanguageLocaleKey = 'zh_CN',
- LocaleSidKey = 'zh_CN',
- ProfileId = prof.Id,
- TimeZoneSidKey = 'Asia/Shanghai',
- UserName = 'testUser@testorg.com',
- UserPro_Type__c = 'ET'
- );
- System.runAs(new User(Id = UserInfo.getUserId())) {
- insert MyUser_Test;
- }
- // User MyUser_Test = [select id,Contact.accountid from User WHERE ProfileId = :prof.Id and IsActive = true and UserPro_Type__c = 'ET' limit 1 ];
- // Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false);
- // Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false);
- // insert new Product2[] {prod01,prod02};
- System.runAs(MyUser_Test) {
- Product2 prod01 = new Product2(
- Name = 'Test01',
- ProductCode = 'Test01',
- Asset_Model_No__c = 'Test01',
- SFDA_Status__c = '鏈夊姽',
- JANCODE__c = '04953170200311',
- Dealer_special_Object__c = true,
- Manual_Entry__c = false
- );
- Product2 prod02 = new Product2(
- Name = 'Test02',
- ProductCode = 'Test02',
- Asset_Model_No__c = 'Test02',
- SFDA_Status__c = '鏈夊姽',
- JANCODE__c = '04953170200312',
- Dealer_special_Object__c = true,
- Manual_Entry__c = false
- );
- insert new List<Product2>{ prod01, prod02 };
- Product2__c pro1 = new Product2__c(
- Name = 'Pro001',
- OT_CODE_Text__c = '2344',
- Product2__c = prod01.Id
- );
- Product2__c pro2 = new Product2__c(
- Name = 'Pro002',
- OT_CODE_Text__c = '82324',
- Product2__c = prod02.Id
- );
- insert new List<Product2__c>{ pro1, pro2 };
- //浜у搧娉ㄥ唽璇�
- Product_Register__c prc = new Product_Register__c(
- Name = '鍥芥娉ㄨ繘20162220210',
- MedPrdClass__c = '3',
- ValidFrom__c = date.newinstance(2018, 7, 22),
- ValidTo__c = date.newinstance(2028, 7, 22),
- RegisterNoClass_Old__c = '6815',
- RegisterNoClass_New__c = '6815',
- RegisterNoStatus__c = '鏈夋晥'
- );
- insert prc;
- //鏂版棫鍏崇郴瀵圭収琛�
- //Product_Register_contrast__c prcc = new Product_Register_contrast__c(
- // Name = 'Test20181204',
- // Register_new__c = '314',
- // Register_old__c = '36815'
- // );
- //insert prcc;
- //浜у搧-浜у搧娉ㄥ唽璇佸叧绯� prod01
- Product_Register_Link__c prlc = new Product_Register_Link__c(
- Product2__c = prod01.Id,
- Product_Register__c = prc.Id
- );
- insert prlc;
- //浜у搧-浜у搧娉ㄥ唽璇佸叧绯� prod02
- Product_Register_Link__c prlc2 = new Product_Register_Link__c(
- Product2__c = prod02.Id,
- Product_Register__c = prc.Id
- );
- insert prlc2;
- //璁㈠崟
+ Account myAccount2 = new Account(name='Testaccount002',Dealer_discount__c =20,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '9999900');
+ Account myAccount1 = new Account(name='Testaccount001',Dealer_discount__c =30,RecordTypeId = rectCo[0].Id);
+ insert new account[]{myAccount1,myAccount2};
- Consumable_order__c Order1 = new Consumable_order__c();
- Order1.Name = 'OCM_01_001';
- Order1.Order_status__c = '鎵瑰噯';
- Order1.Order_type__c = '璁㈠崟';
- Order1.Dealer_Info__c = myAccount1.id;
- Order1.RecordTypeid = System.Label.RT_ConOrder_Delivery;
- insert Order1;
+ Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount1.id);
+ insert core;
+ user MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com',UserPro_Type__c = 'ET');
+ System.runAs(new User(Id = UserInfo.getUserId())){
+ insert MyUser_Test;
+ }
- //璁㈠崟鏄庣粏
- //fahuo
- Consumable_orderdetails__c Orderdet = new Consumable_orderdetails__c();
- Orderdet.Name = 'OCM_01_00101';
- Orderdet.Consumable_order__c = Order1.Id;
- Orderdet.RecordTypeId = System.Label.RT_ConOrderDetail1_Order;
- Orderdet.Consumable_Product__c = pro1.Id;
- Orderdet.Consumable_count__c = 4;
- insert Orderdet;
+ // User MyUser_Test = [select id,Contact.accountid from User WHERE ProfileId = :prof.Id and IsActive = true and UserPro_Type__c = 'ET' limit 1 ];
+ // Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ // Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ // insert new Product2[] {prod01,prod02};
+ system.runAs(MyUser_Test){
+ Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ insert new Product2[] {prod01,prod02};
+ Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='2344',Product2__c = prod01.Id);
+ Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='82324',Product2__c = prod02.Id);
+ insert new Product2__c[] {pro1, pro2};
+ //浜у搧娉ㄥ唽璇�
+ Product_Register__c prc = new Product_Register__c(Name = '鍥芥娉ㄨ繘20162220210',
+ MedPrdClass__c = '3',
+ ValidFrom__c = date.newinstance(2018, 07, 22),
+ ValidTo__c = date.newinstance(2028, 07, 22),
+ RegisterNoClass_Old__c = '6815',
+ RegisterNoClass_New__c = '6815',
+ RegisterNoStatus__c = '鏈夋晥'
+ );
+ insert prc;
+ //鏂版棫鍏崇郴瀵圭収琛�
+ //Product_Register_contrast__c prcc = new Product_Register_contrast__c(
+ // Name = 'Test20181204',
+ // Register_new__c = '314',
+ // Register_old__c = '36815'
+ // );
+ //insert prcc;
+ //浜у搧-浜у搧娉ㄥ唽璇佸叧绯� prod01
+ Product_Register_Link__c prlc = new Product_Register_Link__c(
+ Product2__c = prod01.Id,
+ Product_Register__c = prc.Id
+ );
+ insert prlc;
+ //浜у搧-浜у搧娉ㄥ唽璇佸叧绯� prod02
+ Product_Register_Link__c prlc2 = new Product_Register_Link__c(
+ Product2__c = prod02.Id,
+ Product_Register__c = prc.Id
+ );
+ insert prlc2;
+ //璁㈠崟
- //鍙戣揣鏄庣粏
- //fahuo
- Consumable_order_details2__c Orderdet1 = new Consumable_order_details2__c();
- Orderdet1.Name = 'OCM_01_001001';
- Orderdet1.Consumable_order_minor__c = Order1.Id;
- Orderdet1.Consumable_Product__c = pro1.Id;
- Orderdet1.Asset_Model_No__c = 'Test01';
- Orderdet1.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- Orderdet1.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRF';
- //daohuo
- Consumable_order_details2__c Orderdet2 = new Consumable_order_details2__c();
- Orderdet2.Name = 'OCM_01_001002';
- Orderdet2.Consumable_order_minor__c = Order1.Id;
- Orderdet2.Consumable_Product__c = pro1.Id;
- Orderdet2.Asset_Model_No__c = 'Test01';
- Orderdet2.Consumable_Arrived_order__c = Order1.Id;
- //Orderdet2.IsArrival__c = true;
- Orderdet2.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- Orderdet2.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRI';
- //sale
- Consumable_order_details2__c Orderdet3 = new Consumable_order_details2__c();
- Orderdet3.Name = 'OCM_01_001003';
- Orderdet3.Consumable_order_minor__c = Order1.Id;
- Orderdet3.Consumable_Product__c = pro1.Id;
- Orderdet3.Asset_Model_No__c = 'Test01';
- Orderdet3.Consumable_Arrived_order__c = Order1.Id;
- //Orderdet3.IsArrival__c = true;
- Orderdet3.Consumable_Sale_order__c = Order1.Id;
- Orderdet3.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- Orderdet3.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRJ';
- //鍑哄簱
- Consumable_order_details2__c Orderdet4 = new Consumable_order_details2__c();
- Orderdet4.Name = 'OCM_01_001004';
- Orderdet4.Consumable_order_minor__c = Order1.Id;
- Orderdet4.Consumable_Product__c = pro1.Id;
- Orderdet4.Asset_Model_No__c = 'Test01';
- Orderdet4.Consumable_Arrived_order__c = Order1.Id;
- //Orderdet4.IsArrival__c = true;
- Orderdet4.Consumable_Shipment_order__c = Order1.Id;
- Orderdet4.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- Orderdet4.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRN';
- //List<Product2> proList = [select name,Estimation_Entry_Possibility__c from Product2 where id = :prod01.Id];
- //System.assertEquals('鈼�', proList[0].Estimation_Entry_Possibility__c);
+ Consumable_order__c Order1 = new Consumable_order__c();
+ Order1.Name = 'OCM_01_001';
+ Order1.Order_status__c = '鎵瑰噯';
+ Order1.Order_type__c = '璁㈠崟';
+ Order1.Dealer_Info__c = myAccount1.id;
+ Order1.RecordTypeid = System.Label.RT_ConOrder_Delivery;
+ insert Order1;
- insert new List<Consumable_order_details2__c>{
- Orderdet1,
- Orderdet2,
- Orderdet3,
- Orderdet4
- };
- PageReference page = new PageReference(
- '/apex/ArriveGoods?Esetid=' + Order1.Id
- );
- System.Test.setCurrentPage(page);
- ArriveGoodsController Controller = new ArriveGoodsController();
- //鍒濆鍖栨祴璇�
- System.Test.startTest();
- Controller.init();
- Controller.barcode = '01049531702003111115120017181000105ZK250BXJRF\n01049531702003111115120017181000105ZK250BXJRI\n01049531702003111115120017181000105ZK250BXJRN';
- Controller.SearchPro();
- //System.assertEquals(1, controller.consumableInventory.size());
+ //璁㈠崟鏄庣粏
+ //fahuo
+ Consumable_orderdetails__c Orderdet = new Consumable_orderdetails__c();
+ Orderdet.Name = 'OCM_01_00101';
+ Orderdet.Consumable_order__c = Order1.Id;
+ Orderdet.RecordTypeId = System.Label.RT_ConOrderDetail1_Order;
+ Orderdet.Consumable_Product__c = pro1.Id;
+ Orderdet.Consumable_count__c = 4;
+ insert Orderdet;
- System.Test.stopTest();
- }
- }
+ //鍙戣揣鏄庣粏
+ //fahuo
+ Consumable_order_details2__c Orderdet1 = new Consumable_order_details2__c();
+ Orderdet1.Name = 'OCM_01_001001';
+ Orderdet1.Consumable_order_minor__c = Order1.Id;
+ Orderdet1.Consumable_Product__c = pro1.Id;
+ Orderdet1.Asset_Model_No__c = 'Test01';
+ Orderdet1.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
+ Orderdet1.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRF';
+ //daohuo
+ Consumable_order_details2__c Orderdet2 = new Consumable_order_details2__c();
+ Orderdet2.Name = 'OCM_01_001002';
+ Orderdet2.Consumable_order_minor__c = Order1.Id;
+ Orderdet2.Consumable_Product__c = pro1.Id;
+ Orderdet2.Asset_Model_No__c = 'Test01';
+ Orderdet2.Consumable_Arrived_order__c = Order1.Id;
+ //Orderdet2.IsArrival__c = true;
+ Orderdet2.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
+ Orderdet2.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRI';
+ //sale
+ Consumable_order_details2__c Orderdet3 = new Consumable_order_details2__c();
+ Orderdet3.Name = 'OCM_01_001003';
+ Orderdet3.Consumable_order_minor__c = Order1.Id;
+ Orderdet3.Consumable_Product__c = pro1.Id;
+ Orderdet3.Asset_Model_No__c = 'Test01';
+ Orderdet3.Consumable_Arrived_order__c = Order1.Id;
+ //Orderdet3.IsArrival__c = true;
+ Orderdet3.Consumable_Sale_order__c = Order1.Id;
+ Orderdet3.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
+ Orderdet3.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRJ';
+ //鍑哄簱
+ Consumable_order_details2__c Orderdet4 = new Consumable_order_details2__c();
+ Orderdet4.Name = 'OCM_01_001004';
+ Orderdet4.Consumable_order_minor__c = Order1.Id;
+ Orderdet4.Consumable_Product__c = pro1.Id;
+ Orderdet4.Asset_Model_No__c = 'Test01';
+ Orderdet4.Consumable_Arrived_order__c = Order1.Id;
+ //Orderdet4.IsArrival__c = true;
+ Orderdet4.Consumable_Shipment_order__c = Order1.Id;
+ Orderdet4.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
+ Orderdet4.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRN';
+ //List<Product2> proList = [select name,Estimation_Entry_Possibility__c from Product2 where id = :prod01.Id];
+ //System.assertEquals('鈼�', proList[0].Estimation_Entry_Possibility__c);
- //鐩存帴鍒拌揣
- @isTest
- static void arrivedirect241() {
- // // TO DO: implement unit test
- List<RecordType> rectCo = [
- SELECT Id
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '璨╁2搴�'
- ];
- if (rectCo.size() == 0) {
- return;
- }
- // Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET Email)'];
- Profile prof = [
- SELECT Id
- FROM Profile
- WHERE Name = '901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'
- ];
+ insert new Consumable_order_details2__c[] {Orderdet1, Orderdet2,Orderdet3,Orderdet4};
+ PageReference page = new PageReference('/apex/ArriveGoods?Esetid=' + Order1.Id);
+ System.Test.setCurrentPage(page);
+ ArriveGoodsController Controller = new ArriveGoodsController();
+ //鍒濆鍖栨祴璇�
+ System.Test.startTest();
+ Controller.init();
+ Controller.barcode = '01049531702003111115120017181000105ZK250BXJRF\n01049531702003111115120017181000105ZK250BXJRI\n01049531702003111115120017181000105ZK250BXJRN';
+ Controller.SearchPro();
+ //System.assertEquals(1, controller.consumableInventory.size());
- Account myAccount2 = new Account(
- name = 'Testaccount002',
- Dealer_discount__c = 20,
- RecordTypeId = rectCo[0].Id,
- AgentCode_Ext__c = '9999900'
- );
- Account myAccount1 = new Account(
- name = 'Testaccount001',
- Dealer_discount__c = 30,
- RecordTypeId = rectCo[0].Id
- );
- insert new List<account>{ myAccount1, myAccount2 };
- Contact core = new Contact(
- email = 'jplumber@salesforce.com',
- firstname = 'Joe',
- lastname = 'Plumber',
- accountid = myAccount1.id
- );
- insert core;
- user MyUser_Test = new User(
- ContactId = core.id,
- Alias = 'newUser',
- Email = 'newuser@testorg.com',
- EmailEncodingKey = 'UTF-8',
- LastName = 'TestUser',
- LanguageLocaleKey = 'zh_CN',
- LocaleSidKey = 'zh_CN',
- ProfileId = prof.Id,
- TimeZoneSidKey = 'Asia/Shanghai',
- UserName = 'testUser@testorg.com',
- UserPro_Type__c = 'ET'
- );
- System.runAs(new User(Id = UserInfo.getUserId())) {
- insert MyUser_Test;
- }
+ System.Test.stopTest();
+ }
+ }
- // User MyUser_Test = [select id,Contact.accountid from User WHERE ProfileId = :prof.Id and IsActive = true and UserPro_Type__c = 'ET' limit 1 ];
- // Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false);
- // Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false);
- // insert new Product2[] {prod01,prod02};
- System.runAs(MyUser_Test) {
- Product2 prod01 = new Product2(
- Name = 'Test01',
- ProductCode = 'Test01',
- Asset_Model_No__c = 'Test01',
- SFDA_Status__c = '鏈夊姽',
- JANCODE__c = '04953170200311',
- Dealer_special_Object__c = true,
- Manual_Entry__c = false
- );
- Product2 prod02 = new Product2(
- Name = 'Test02',
- ProductCode = 'Test02',
- Asset_Model_No__c = 'Test02',
- SFDA_Status__c = '鏈夊姽',
- JANCODE__c = '04953170200312',
- Dealer_special_Object__c = true,
- Manual_Entry__c = false
- );
- insert new List<Product2>{ prod01, prod02 };
- Product2__c pro1 = new Product2__c(
- Name = 'Pro001',
- OT_CODE_Text__c = 'Test001',
- Product2__c = prod01.Id
- );
- Product2__c pro2 = new Product2__c(
- Name = 'Pro002',
- OT_CODE_Text__c = 'Test002',
- Product2__c = prod02.Id
- );
- insert new List<Product2__c>{ pro1, pro2 };
- //浜у搧娉ㄥ唽璇�
- Product_Register__c prc = new Product_Register__c(
- Name = '鍥芥娉ㄨ繘20162220210',
- MedPrdClass__c = '3',
- ValidFrom__c = date.newinstance(2018, 7, 22),
- ValidTo__c = date.newinstance(2028, 7, 22),
- RegisterNoClass_Old__c = '6815',
- RegisterNoClass_New__c = '6815',
- RegisterNoStatus__c = '鏈夋晥'
- );
- insert prc;
- //鏂版棫鍏崇郴瀵圭収琛�
- //Product_Register_contrast__c prcc = new Product_Register_contrast__c(
- // Name = 'Test20181204',
- // Register_new__c = '314',
- // Register_old__c = '36815'
- // );
- //insert prcc;
- //浜у搧-浜у搧娉ㄥ唽璇佸叧绯� prod01
- Product_Register_Link__c prlc = new Product_Register_Link__c(
- Product2__c = prod01.Id,
- Product_Register__c = prc.Id
- );
- insert prlc;
- //浜у搧-浜у搧娉ㄥ唽璇佸叧绯� prod02
- Product_Register_Link__c prlc2 = new Product_Register_Link__c(
- Product2__c = prod02.Id,
- Product_Register__c = prc.Id
- );
- insert prlc2;
- //璁㈠崟
+ //鐩存帴鍒拌揣
+ @isTest
+ static void arrivedirect241() {
+ // // TO DO: implement unit test
+ List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '璨╁2搴�'];
+ if (rectCo.size() == 0) {
+ return;
+ }
+ // Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET Email)'];
+ Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'];
- Consumable_order__c Order1 = new Consumable_order__c();
- Order1.Name = 'OCM_01_001';
- Order1.Order_status__c = '鎵瑰噯';
- Order1.Order_type__c = '璁㈠崟';
- Order1.Dealer_Info__c = myAccount1.id;
- Order1.RecordTypeid = System.Label.RT_ConOrder_Delivery;
- insert Order1;
- Consumable_order__c Order2 = new Consumable_order__c();
- Order2.Name = 'OCM_01_002';
- Order2.Order_status__c = '鎵瑰噯';
- Order2.Order_type__c = '鍒拌揣';
- Order2.Dealer_Info__c = myAccount1.id;
- Order2.RecordTypeid = System.Label.RT_ConOrder_Delivery;
- Order2.Deliver_date__c = Date.today();
- Order2.Order_date__c = Date.today();
- insert Order2;
- Order2 = new Consumable_order__c();
- Order2.Name = 'OCM_01_002';
- Order2.Order_status__c = '鎵瑰噯';
- Order2.Order_type__c = '杩斿搧';
- Order2.Dealer_Info__c = myAccount1.id;
- Order2.RecordTypeid = System.Label.RT_ConOrder_Delivery;
- Order2.Deliver_date__c = Date.today();
- Order2.Order_date__c = Date.today();
- Order2.ReturnGs_Upload_Date__c = Date.today();
- insert Order2;
- //璁㈠崟鏄庣粏
- //fahuo
- Consumable_orderdetails__c Orderdet = new Consumable_orderdetails__c();
- Orderdet.Name = 'OCM_01_00101';
- Orderdet.Consumable_order__c = Order1.Id;
- Orderdet.RecordTypeId = System.Label.RT_ConOrderDetail1_Order;
- Orderdet.Consumable_Product__c = pro1.Id;
- Orderdet.Consumable_count__c = 4;
- insert Orderdet;
+ Account myAccount2 = new Account(name='Testaccount002',Dealer_discount__c =20,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '9999900');
+ Account myAccount1 = new Account(name='Testaccount001',Dealer_discount__c =30,RecordTypeId = rectCo[0].Id);
+ insert new account[]{myAccount1,myAccount2};
+ Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount1.id);
+ insert core;
+ user MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com',UserPro_Type__c = 'ET');
+ System.runAs(new User(Id = UserInfo.getUserId())){
+ insert MyUser_Test;
+ }
- //鍙戣揣鏄庣粏
- //fahuo
- Consumable_order_details2__c Orderdet1 = new Consumable_order_details2__c();
- Orderdet1.Name = 'OCM_01_001001';
- Orderdet1.Consumable_order_minor__c = Order1.Id;
- Orderdet1.Consumable_Product__c = pro1.Id;
- Orderdet1.Asset_Model_No__c = 'Test01';
- Orderdet1.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- Orderdet1.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRF';
- Orderdet1.Arrive_date__c = Date.today();
- Orderdet1.Rrturn_count__c = 1;
- Orderdet1.TracingCode__c = '20170808';
- //daohuo
- Consumable_order_details2__c Orderdet2 = new Consumable_order_details2__c();
- Orderdet2.Name = 'OCM_01_001002';
- Orderdet2.Consumable_order_minor__c = Order2.Id;
- Orderdet2.Consumable_Product__c = pro1.Id;
- Orderdet2.Asset_Model_No__c = 'Test01';
- Orderdet2.Consumable_Arrived_order__c = Order2.Id;
- //Orderdet2.IsArrival__c = true;
- Orderdet2.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- Orderdet2.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRI';
- Orderdet2.Arrive_date__c = Date.today();
- Orderdet2.TracingCode__c = '20170808';
+ // User MyUser_Test = [select id,Contact.accountid from User WHERE ProfileId = :prof.Id and IsActive = true and UserPro_Type__c = 'ET' limit 1 ];
+ // Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ // Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ // insert new Product2[] {prod01,prod02};
+ system.runAs(MyUser_Test){
+ Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ insert new Product2[] {prod01,prod02};
+ Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='Test001',Product2__c = prod01.Id);
+ Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='Test002',Product2__c = prod02.Id);
+ insert new Product2__c[] {pro1, pro2};
+ //浜у搧娉ㄥ唽璇�
+ Product_Register__c prc = new Product_Register__c(Name = '鍥芥娉ㄨ繘20162220210',
+ MedPrdClass__c = '3',
+ ValidFrom__c = date.newinstance(2018, 07, 22),
+ ValidTo__c = date.newinstance(2028, 07, 22),
+ RegisterNoClass_Old__c = '6815',
+ RegisterNoClass_New__c = '6815',
+ RegisterNoStatus__c = '鏈夋晥'
+ );
+ insert prc;
+ //鏂版棫鍏崇郴瀵圭収琛�
+ //Product_Register_contrast__c prcc = new Product_Register_contrast__c(
+ // Name = 'Test20181204',
+ // Register_new__c = '314',
+ // Register_old__c = '36815'
+ // );
+ //insert prcc;
+ //浜у搧-浜у搧娉ㄥ唽璇佸叧绯� prod01
+ Product_Register_Link__c prlc = new Product_Register_Link__c(
+ Product2__c = prod01.Id,
+ Product_Register__c = prc.Id
+ );
+ insert prlc;
+ //浜у搧-浜у搧娉ㄥ唽璇佸叧绯� prod02
+ Product_Register_Link__c prlc2 = new Product_Register_Link__c(
+ Product2__c = prod02.Id,
+ Product_Register__c = prc.Id
+ );
+ insert prlc2;
+ //璁㈠崟
- Consumable_order_details2__c Orderdet3 = new Consumable_order_details2__c();
- Orderdet3.Name = 'OCM_01_001002';
- Orderdet3.Consumable_order_minor__c = Order2.Id;
- Orderdet3.Consumable_Product__c = pro1.Id;
- Orderdet3.Asset_Model_No__c = 'Test01';
- Orderdet3.Consumable_Arrived_order__c = Order2.Id;
- //Orderdet3.IsArrival__c = true;
- Orderdet3.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- Orderdet3.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJR2';
- Orderdet3.Used_date__c = Date.today();
- Orderdet3.TracingCode__c = '20170808';
- //sale
- Consumable_order_details2__c Orderdet4 = new Consumable_order_details2__c();
- Orderdet4.Name = 'OCM_01_001003';
- Orderdet4.Consumable_order_minor__c = Order2.Id;
- Orderdet4.Consumable_Product__c = pro1.Id;
- Orderdet4.Asset_Model_No__c = 'Test01';
- Orderdet4.Consumable_Arrived_order__c = Order2.Id;
- //Orderdet3.IsArrival__c = true;
- Orderdet4.Consumable_Sale_order__c = Order2.Id;
- Orderdet4.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- Orderdet4.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJR3';
- Orderdet4.Used_date__c = Date.today();
- Orderdet4 = new Consumable_order_details2__c();
- Orderdet4.Name = 'OCM_01_001003';
- Orderdet4.Consumable_order_minor__c = Order1.Id;
- Orderdet4.Consumable_Product__c = pro1.Id;
- Orderdet4.Asset_Model_No__c = 'Test01';
- Orderdet4.Consumable_Arrived_order__c = Order1.Id;
- //Orderdet3.IsArrival__c = true;
- Orderdet4.Consumable_Sale_order__c = Order2.Id;
- Orderdet4.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- Orderdet4.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJ13';
- Orderdet4.Used_date__c = Date.today();
- Orderdet4.TracingCode__c = '20170808';
- Consumable_order_details2__c Orderdet5 = new Consumable_order_details2__c();
- Orderdet5.Name = 'OCM_01_001003';
- Orderdet5.Consumable_order_minor__c = Order2.Id;
- Orderdet5.Consumable_Product__c = pro1.Id;
- Orderdet5.Asset_Model_No__c = 'Test01';
- Orderdet5.Consumable_Arrived_order__c = Order2.Id;
- //Orderdet3.IsArrival__c = true;
- Orderdet5.Consumable_Sale_order__c = Order2.Id;
- Orderdet5.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- Orderdet5.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRJ';
- Orderdet5.Arrive_date__c = Date.today().addDays(1);
- Orderdet5.Send_Date__c = null;
- Orderdet5.Used_date__c = null;
- Orderdet5.Lose_Flag__c = false;
- Orderdet5.Return_date__c = null;
- Orderdet5.Cancellation_Date__c = Date.today().addDays(1);
- Orderdet5.Box_Piece__c = '鐩�';
- Orderdet5.TracingCode__c = '20170808';
+ Consumable_order__c Order1 = new Consumable_order__c();
+ Order1.Name = 'OCM_01_001';
+ Order1.Order_status__c = '鎵瑰噯';
+ Order1.Order_type__c = '璁㈠崟';
+ Order1.Dealer_Info__c = myAccount1.id;
+ Order1.RecordTypeid = System.Label.RT_ConOrder_Delivery;
+ insert Order1;
+ Consumable_order__c Order2 = new Consumable_order__c();
+ Order2.Name = 'OCM_01_002';
+ Order2.Order_status__c = '鎵瑰噯';
+ Order2.Order_type__c = '鍒拌揣';
+ Order2.Dealer_Info__c = myAccount1.id;
+ Order2.RecordTypeid = System.Label.RT_ConOrder_Delivery;
+ Order2.Deliver_date__c = Date.today();
+ Order2.Order_date__c = Date.today();
+ insert Order2;
+ Order2 = new Consumable_order__c();
+ Order2.Name = 'OCM_01_002';
+ Order2.Order_status__c = '鎵瑰噯';
+ Order2.Order_type__c = '杩斿搧';
+ Order2.Dealer_Info__c = myAccount1.id;
+ Order2.RecordTypeid = System.Label.RT_ConOrder_Delivery;
+ Order2.Deliver_date__c = Date.today();
+ Order2.Order_date__c = Date.today();
+ Order2.ReturnGs_Upload_Date__c = Date.today();
+ insert Order2;
- //鍑哄簱
- Consumable_order_details2__c Orderdet6 = new Consumable_order_details2__c();
- Orderdet6.Name = 'OCM_01_001004';
- Orderdet6.Consumable_order_minor__c = Order1.Id;
- Orderdet6.Consumable_Product__c = pro1.Id;
- Orderdet6.Asset_Model_No__c = 'Test01';
- Orderdet6.Consumable_Arrived_order__c = Order1.Id;
- //Orderdet4.IsArrival__c = true;
- Orderdet6.Consumable_Shipment_order__c = Order1.Id;
- Orderdet6.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- Orderdet6.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJR4';
- Orderdet6.Send_Date__c = Date.today();
- Orderdet6.Return_date__c = null;
- Orderdet6.Box_Piece__c = '鐩�';
- Orderdet6.Rrturn_count__c = 1;
- Orderdet6.TracingCode__c = '20170808';
+ //璁㈠崟鏄庣粏
+ //fahuo
+ Consumable_orderdetails__c Orderdet = new Consumable_orderdetails__c();
+ Orderdet.Name = 'OCM_01_00101';
+ Orderdet.Consumable_order__c = Order1.Id;
+ Orderdet.RecordTypeId = System.Label.RT_ConOrderDetail1_Order;
+ Orderdet.Consumable_Product__c = pro1.Id;
+ Orderdet.Consumable_count__c = 4;
+ insert Orderdet;
- // 鍗曚綅涓轰釜鐨凚arcode瀵瑰簲鐨勫嚭搴撳崟
- Consumable_order_details2__c Orderdet7 = new Consumable_order_details2__c();
- Orderdet7.Name = 'OCM_01_001004';
- Orderdet7.Consumable_order_minor__c = Order1.Id;
- Orderdet7.Consumable_Product__c = pro1.Id;
- Orderdet7.Asset_Model_No__c = 'Test01';
- Orderdet7.Consumable_Arrived_order__c = Order1.Id;
- //Orderdet4.IsArrival__c = true;
- Orderdet7.Consumable_Shipment_order__c = Order1.Id;
- Orderdet7.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- Orderdet7.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJR1';
- Orderdet7.Send_Date__c = Date.today();
- Orderdet7.Box_Piece__c = '涓�';
- Orderdet7.Used_date__c = Date.today();
- Orderdet7.Return_date__c = null;
- Orderdet7.RemoveBox_No__c = 1;
- Orderdet7.Consumable_ZS_order__c = Order1.Id;
- Orderdet7.Rrturn_count__c = 1;
- Orderdet7.TracingCode__c = '20170808';
+ //鍙戣揣鏄庣粏
+ //fahuo
+ Consumable_order_details2__c Orderdet1 = new Consumable_order_details2__c();
+ Orderdet1.Name = 'OCM_01_001001';
+ Orderdet1.Consumable_order_minor__c = Order1.Id;
+ Orderdet1.Consumable_Product__c = pro1.Id;
+ Orderdet1.Asset_Model_No__c = 'Test01';
+ Orderdet1.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
+ Orderdet1.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRF';
+ Orderdet1.Arrive_date__c = Date.today();
+ Orderdet1.Rrturn_count__c =1;
+ Orderdet1.TracingCode__c = '20170808';
+ //daohuo
+ Consumable_order_details2__c Orderdet2 = new Consumable_order_details2__c();
+ Orderdet2.Name = 'OCM_01_001002';
+ Orderdet2.Consumable_order_minor__c = Order2.Id;
+ Orderdet2.Consumable_Product__c = pro1.Id;
+ Orderdet2.Asset_Model_No__c = 'Test01';
+ Orderdet2.Consumable_Arrived_order__c = Order2.Id;
+ //Orderdet2.IsArrival__c = true;
+ Orderdet2.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
+ Orderdet2.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRI';
+ Orderdet2.Arrive_date__c = Date.today();
+ Orderdet2.TracingCode__c = '20170808';
- Orderdet7 = new Consumable_order_details2__c();
- Orderdet7.Name = 'OCM_01_001004';
- Orderdet7.Consumable_order_minor__c = Order1.Id;
- Orderdet7.Consumable_Product__c = pro1.Id;
- Orderdet7.Asset_Model_No__c = 'Test01';
- Orderdet7.Consumable_Arrived_order__c = Order1.Id;
- Orderdet7.Consumable_Shipment_order__c = Order1.Id;
- Orderdet7.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- Orderdet7.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJR7';
- Orderdet7.Send_Date__c = Date.today();
- Orderdet7.Box_Piece__c = '涓�';
- Orderdet7.Used_date__c = Date.today();
- Orderdet7.Return_date__c = null;
- Orderdet7.RemoveBox_No__c = 1;
- Orderdet7.Consumable_ZS_order__c = Order1.Id;
- Orderdet7.Rrturn_count__c = 0;
- Orderdet7.TracingCode__c = '20170808';
+ Consumable_order_details2__c Orderdet3 = new Consumable_order_details2__c();
+ Orderdet3.Name = 'OCM_01_001002';
+ Orderdet3.Consumable_order_minor__c = Order2.Id;
+ Orderdet3.Consumable_Product__c = pro1.Id;
+ Orderdet3.Asset_Model_No__c = 'Test01';
+ Orderdet3.Consumable_Arrived_order__c = Order2.Id;
+ //Orderdet3.IsArrival__c = true;
+ Orderdet3.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
+ Orderdet3.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJR2';
+ Orderdet3.Used_date__c = Date.today();
+ Orderdet3.TracingCode__c = '20170808';
+ //sale
+ Consumable_order_details2__c Orderdet4 = new Consumable_order_details2__c();
+ Orderdet4.Name = 'OCM_01_001003';
+ Orderdet4.Consumable_order_minor__c = Order2.Id;
+ Orderdet4.Consumable_Product__c = pro1.Id;
+ Orderdet4.Asset_Model_No__c = 'Test01';
+ Orderdet4.Consumable_Arrived_order__c = Order2.Id;
+ //Orderdet3.IsArrival__c = true;
+ Orderdet4.Consumable_Sale_order__c = Order2.Id;
+ Orderdet4.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
+ Orderdet4.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJR3';
+ Orderdet4.Used_date__c =Date.today();
+ Orderdet4 = new Consumable_order_details2__c();
+ Orderdet4.Name = 'OCM_01_001003';
+ Orderdet4.Consumable_order_minor__c = Order1.Id;
+ Orderdet4.Consumable_Product__c = pro1.Id;
+ Orderdet4.Asset_Model_No__c = 'Test01';
+ Orderdet4.Consumable_Arrived_order__c = Order1.Id;
+ //Orderdet3.IsArrival__c = true;
+ Orderdet4.Consumable_Sale_order__c = Order2.Id;
+ Orderdet4.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
+ Orderdet4.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJ13';
+ Orderdet4.Used_date__c =Date.today();
+ Orderdet4.TracingCode__c = '20170808';
+ Consumable_order_details2__c Orderdet5 = new Consumable_order_details2__c();
+ Orderdet5.Name = 'OCM_01_001003';
+ Orderdet5.Consumable_order_minor__c = Order2.Id;
+ Orderdet5.Consumable_Product__c = pro1.Id;
+ Orderdet5.Asset_Model_No__c = 'Test01';
+ Orderdet5.Consumable_Arrived_order__c = Order2.Id;
+ //Orderdet3.IsArrival__c = true;
+ Orderdet5.Consumable_Sale_order__c = Order2.Id;
+ Orderdet5.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
+ Orderdet5.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRJ';
+ Orderdet5.Arrive_date__c = Date.today().addDays(1);
+ Orderdet5.Send_Date__c = null;
+ Orderdet5.Used_date__c = null;
+ Orderdet5.Lose_Flag__c = false;
+ Orderdet5.Return_date__c= null;
+ Orderdet5.Cancellation_Date__c= Date.today().addDays(1);
+ Orderdet5.Box_Piece__c = '鐩�';
+ Orderdet5.TracingCode__c = '20170808';
- Consumable_order_details2__c Orderdet8 = new Consumable_order_details2__c();
- Orderdet8.Name = 'OCM_01_001004';
- Orderdet8.Consumable_order_minor__c = Order1.Id;
- Orderdet8.Consumable_Product__c = pro1.Id;
- Orderdet8.Asset_Model_No__c = 'Test01';
- Orderdet8.Consumable_Arrived_order__c = Order1.Id;
- //Orderdet4.IsArrival__c = true;
- Orderdet8.Consumable_Shipment_order__c = Order1.Id;
- Orderdet8.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- Orderdet8.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJR9';
- Orderdet8.Send_Date__c = Date.today();
- Orderdet8.Box_Piece__c = '涓�';
- Orderdet8.Used_date__c = Date.today();
- Orderdet8.Return_date__c = null;
- Orderdet8.RemoveBox_No__c = 1;
- Orderdet8.Consumable_ZS_order__c = Order1.Id;
- Orderdet8.Rrturn_count__c = null;
- Orderdet8.RemoveBox_date__c = Date.today();
- Orderdet8.Intra_Trade_List_RMB__c = 1;
- Orderdet8.Sterilization_limit__c = Date.today();
- Orderdet8.SerialLotNo__c = '11鎵规';
- Orderdet8.TracingCode__c = '20170808';
- Orderdet8.Arrive_date__c = Date.today();
+ //鍑哄簱
+ Consumable_order_details2__c Orderdet6 = new Consumable_order_details2__c();
+ Orderdet6.Name = 'OCM_01_001004';
+ Orderdet6.Consumable_order_minor__c = Order1.Id;
+ Orderdet6.Consumable_Product__c = pro1.Id;
+ Orderdet6.Asset_Model_No__c = 'Test01';
+ Orderdet6.Consumable_Arrived_order__c = Order1.Id;
+ //Orderdet4.IsArrival__c = true;
+ Orderdet6.Consumable_Shipment_order__c = Order1.Id;
+ Orderdet6.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
+ Orderdet6.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJR4';
+ Orderdet6.Send_Date__c = Date.today();
+ Orderdet6.Return_date__c= null;
+ Orderdet6.Box_Piece__c = '鐩�';
+ Orderdet6.Rrturn_count__c =1;
+ Orderdet6.TracingCode__c = '20170808';
- Consumable_order_details2__c Orderdet9 = new Consumable_order_details2__c();
- Orderdet9.Name = 'OCM_01_001004';
- Orderdet9.Consumable_order_minor__c = Order1.Id;
- Orderdet9.Consumable_Product__c = pro1.Id;
- Orderdet9.Asset_Model_No__c = 'Test01';
- Orderdet9.Consumable_Arrived_order__c = Order1.Id;
- Orderdet9.Consumable_Shipment_order__c = Order1.Id;
- Orderdet9.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- Orderdet9.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJR8';
- Orderdet9.Send_Date__c = Date.today();
- Orderdet9.Box_Piece__c = '涓�';
- Orderdet9.Used_date__c = Date.today();
- Orderdet9.Return_date__c = null;
- Orderdet9.Consumable_ZS_order__c = Order1.Id;
- Orderdet9.Arrive_date__c = Date.today();
- Orderdet9.Rrturn_count__c = 10;
- Orderdet9.TracingCode__c = '20170808';
- Consumable_order_details2__c lose = new Consumable_order_details2__c();
- lose.Name = 'OCM_01_001004';
- lose.Consumable_order_minor__c = Order1.Id;
- lose.Consumable_Product__c = pro1.Id;
- lose.Asset_Model_No__c = 'Test01';
- lose.Consumable_Arrived_order__c = Order1.Id;
- //Orderdet4.IsArrival__c = true;
- lose.Consumable_Shipment_order__c = Order1.Id;
- lose.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- lose.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJR5';
- lose.Send_Date__c = null;
- lose.Arrive_date__c = null;
- lose.Used_date__c = null;
- lose.Box_Piece__c = '鐩�';
- lose.TracingCode__c = '20170808';
- Consumable_order_details2__c lose1 = new Consumable_order_details2__c();
- lose1.Name = 'OCM_01_001004';
- lose1.Consumable_order_minor__c = Order1.Id;
- lose1.Consumable_Product__c = pro1.Id;
- lose1.Asset_Model_No__c = 'Test01';
- lose1.Consumable_Arrived_order__c = Order1.Id;
- //Orderdet4.IsArrival__c = true;
- lose1.Consumable_Shipment_order__c = Order1.Id;
- lose1.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- lose1.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJR6';
- lose1.Send_Date__c = null;
- lose1.Arrive_date__c = Date.today();
- lose1.Used_date__c = null;
- lose1.Box_Piece__c = '鐩�';
- lose1.TracingCode__c = '20170808';
- Consumable_order_details2__c lose2 = new Consumable_order_details2__c();
- lose2.Name = 'OCM_01_001004';
- lose2.Consumable_order_minor__c = Order2.Id;
- lose2.Consumable_Product__c = pro1.Id;
- lose2.Asset_Model_No__c = 'Test01';
- lose2.Consumable_Arrived_order__c = Order2.Id;
- //Orderdet4.IsArrival__c = true;
- lose2.Consumable_Shipment_order__c = Order2.Id;
- lose2.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- lose2.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJR7';
- lose2.Send_Date__c = null;
- lose2.Arrive_date__c = Date.today();
- lose2.Used_date__c = null;
- lose2.Box_Piece__c = '鐩�';
- lose2.Intra_Trade_List_RMB__c = 1;
- lose2.Direct_Arrive_Product__c = true;
- lose2.Sterilization_limit__c = Date.today();
- lose2.SerialLotNo__c = '11鎵规';
- lose2.TracingCode__c = '20170808';
+ // 鍗曚綅涓轰釜鐨凚arcode瀵瑰簲鐨勫嚭搴撳崟
+ Consumable_order_details2__c Orderdet7 = new Consumable_order_details2__c();
+ Orderdet7.Name = 'OCM_01_001004';
+ Orderdet7.Consumable_order_minor__c = Order1.Id;
+ Orderdet7.Consumable_Product__c = pro1.Id;
+ Orderdet7.Asset_Model_No__c = 'Test01';
+ Orderdet7.Consumable_Arrived_order__c = Order1.Id;
+ //Orderdet4.IsArrival__c = true;
+ Orderdet7.Consumable_Shipment_order__c = Order1.Id;
+ Orderdet7.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
+ Orderdet7.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJR1';
+ Orderdet7.Send_Date__c = Date.today();
+ Orderdet7.Box_Piece__c = '涓�';
+ Orderdet7.Used_date__c = Date.today();
+ Orderdet7.Return_date__c= null;
+ Orderdet7.RemoveBox_No__c =1;
+ Orderdet7.Consumable_ZS_order__c= Order1.Id;
+ Orderdet7.Rrturn_count__c =1;
+ Orderdet7.TracingCode__c = '20170808';
- //List<Product2> proList = [select name,Estimation_Entry_Possibility__c from Product2 where id = :prod01.Id];
- //System.assertEquals('鈼�', proList[0].Estimation_Entry_Possibility__c);
+ Orderdet7 = new Consumable_order_details2__c();
+ Orderdet7.Name = 'OCM_01_001004';
+ Orderdet7.Consumable_order_minor__c = Order1.Id;
+ Orderdet7.Consumable_Product__c = pro1.Id;
+ Orderdet7.Asset_Model_No__c = 'Test01';
+ Orderdet7.Consumable_Arrived_order__c = Order1.Id;
+ Orderdet7.Consumable_Shipment_order__c = Order1.Id;
+ Orderdet7.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
+ Orderdet7.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJR7';
+ Orderdet7.Send_Date__c = Date.today();
+ Orderdet7.Box_Piece__c = '涓�';
+ Orderdet7.Used_date__c = Date.today();
+ Orderdet7.Return_date__c= null;
+ Orderdet7.RemoveBox_No__c =1;
+ Orderdet7.Consumable_ZS_order__c= Order1.Id;
+ Orderdet7.Rrturn_count__c =0;
+ Orderdet7.TracingCode__c = '20170808';
- insert new List<Consumable_order_details2__c>{
- Orderdet1,
- Orderdet2,
- Orderdet3,
- Orderdet4,
- Orderdet5,
- Orderdet6,
- Orderdet7,
- Orderdet8,
- Orderdet9,
- lose,
- lose1,
- lose2
- };
- PageReference page = new PageReference(
- '/apex/ArriveGoods?Esetid=' + Order1.Id
- );
- System.Test.setCurrentPage(page);
- ArriveGoodsController Controller = new ArriveGoodsController();
- //鍒濆鍖栨祴璇�
- System.Test.startTest();
- Controller.init();
+ Consumable_order_details2__c Orderdet8 = new Consumable_order_details2__c();
+ Orderdet8.Name = 'OCM_01_001004';
+ Orderdet8.Consumable_order_minor__c = Order1.Id;
+ Orderdet8.Consumable_Product__c = pro1.Id;
+ Orderdet8.Asset_Model_No__c = 'Test01';
+ Orderdet8.Consumable_Arrived_order__c = Order1.Id;
+ //Orderdet4.IsArrival__c = true;
+ Orderdet8.Consumable_Shipment_order__c = Order1.Id;
+ Orderdet8.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
+ Orderdet8.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJR9';
+ Orderdet8.Send_Date__c = Date.today();
+ Orderdet8.Box_Piece__c = '涓�';
+ Orderdet8.Used_date__c = Date.today();
+ Orderdet8.Return_date__c= null;
+ Orderdet8.RemoveBox_No__c =1;
+ Orderdet8.Consumable_ZS_order__c= Order1.Id;
+ Orderdet8.Rrturn_count__c =null;
+ Orderdet8.RemoveBox_date__c = Date.today();
+ Orderdet8.Intra_Trade_List_RMB__c = 1;
+ Orderdet8.Sterilization_limit__c = Date.today();
+ Orderdet8.SerialLotNo__c ='11鎵规';
+ Orderdet8.TracingCode__c = '20170808';
+ Orderdet8.Arrive_date__c = Date.today();
- Controller.barcode = '01049531702003111115120017181000105ZK250BXJRF\n01049531702003111115120017181000105ZK250BXJR3\n01049531702003111115120017181000105ZK250BXJ13\n01049531702003111115120017181000105ZK250BXJRI\n01049531702003111115120017181000105ZK250BXJR2\n01049531702003111115120017181000105ZK250BXJR3\n01049531702003111115120017181000105ZK250BXJR4\n01049531702003111115120017181000105ZK250BXJR1\n01049531702003111115120017181000105ZK250BXJR7\n01049531702003111115120017181000105ZK250BXJR9\n01049531702003111115120017181000105ZK250BXJR8\n01049531702003111115120017181000105ZK250BXJR5\n01049531702003111115120017181000105ZK250BXJR6\n01049531702003111115120017181000105ZK250BXJR7\n01049531702003111115120017181000105ZK250BXAAA\n01049531702003111115120017181000105ZK250BXAAB';
- Controller.SearchPro();
- // System.assertEquals(1, controller.consumableInventory.size());
+ Consumable_order_details2__c Orderdet9 = new Consumable_order_details2__c();
+ Orderdet9.Name = 'OCM_01_001004';
+ Orderdet9.Consumable_order_minor__c = Order1.Id;
+ Orderdet9.Consumable_Product__c = pro1.Id;
+ Orderdet9.Asset_Model_No__c = 'Test01';
+ Orderdet9.Consumable_Arrived_order__c = Order1.Id;
+ Orderdet9.Consumable_Shipment_order__c = Order1.Id;
+ Orderdet9.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
+ Orderdet9.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJR8';
+ Orderdet9.Send_Date__c = Date.today();
+ Orderdet9.Box_Piece__c = '涓�';
+ Orderdet9.Used_date__c = Date.today();
+ Orderdet9.Return_date__c= null;
+ Orderdet9.Consumable_ZS_order__c= Order1.Id;
+ Orderdet9.Arrive_date__c = Date.today();
+ Orderdet9.Rrturn_count__c =10;
+ Orderdet9.TracingCode__c = '20170808';
+ Consumable_order_details2__c lose = new Consumable_order_details2__c();
+ lose.Name = 'OCM_01_001004';
+ lose.Consumable_order_minor__c = Order1.Id;
+ lose.Consumable_Product__c = pro1.Id;
+ lose.Asset_Model_No__c = 'Test01';
+ lose.Consumable_Arrived_order__c = Order1.Id;
+ //Orderdet4.IsArrival__c = true;
+ lose.Consumable_Shipment_order__c = Order1.Id;
+ lose.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
+ lose.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJR5';
+ lose.Send_Date__c = null;
+ lose.Arrive_date__c = null;
+ lose.Used_date__c = null;
+ lose.Box_Piece__c = '鐩�';
+ lose.TracingCode__c = '20170808';
+ Consumable_order_details2__c lose1 = new Consumable_order_details2__c();
+ lose1.Name = 'OCM_01_001004';
+ lose1.Consumable_order_minor__c = Order1.Id;
+ lose1.Consumable_Product__c = pro1.Id;
+ lose1.Asset_Model_No__c = 'Test01';
+ lose1.Consumable_Arrived_order__c = Order1.Id;
+ //Orderdet4.IsArrival__c = true;
+ lose1.Consumable_Shipment_order__c = Order1.Id;
+ lose1.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
+ lose1.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJR6';
+ lose1.Send_Date__c = null;
+ lose1.Arrive_date__c = Date.today();
+ lose1.Used_date__c = null;
+ lose1.Box_Piece__c = '鐩�';
+ lose1.TracingCode__c = '20170808';
+ Consumable_order_details2__c lose2 = new Consumable_order_details2__c();
+ lose2.Name = 'OCM_01_001004';
+ lose2.Consumable_order_minor__c = Order2.Id;
+ lose2.Consumable_Product__c = pro1.Id;
+ lose2.Asset_Model_No__c = 'Test01';
+ lose2.Consumable_Arrived_order__c = Order2.Id;
+ //Orderdet4.IsArrival__c = true;
+ lose2.Consumable_Shipment_order__c = Order2.Id;
+ lose2.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
+ lose2.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJR7';
+ lose2.Send_Date__c = null;
+ lose2.Arrive_date__c = Date.today();
+ lose2.Used_date__c = null;
+ lose2.Box_Piece__c = '鐩�';
+ lose2.Intra_Trade_List_RMB__c = 1;
+ lose2.Direct_Arrive_Product__c = true;
+ lose2.Sterilization_limit__c = Date.today();
+ lose2.SerialLotNo__c ='11鎵规';
+ lose2.TracingCode__c = '20170808';
- System.Test.stopTest();
- }
- }
+ //List<Product2> proList = [select name,Estimation_Entry_Possibility__c from Product2 where id = :prod01.Id];
+ //System.assertEquals('鈼�', proList[0].Estimation_Entry_Possibility__c);
- //杩斿搧 鏄庣粏2涓嶅瓨鍦ㄧ殑瀵瑰簲鐨勫埌璐ц鍗曟槑缁�
- @isTest
- static void productReturn_oldbarcode() {
- // // TO DO: implement unit test
- List<RecordType> rectCo = [
- SELECT Id
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '璨╁2搴�'
- ];
- if (rectCo.size() == 0) {
- return;
- }
- // Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET Email)'];
- Profile prof = [
- SELECT Id
- FROM Profile
- WHERE Name = '901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'
- ];
+ insert new Consumable_order_details2__c[] {Orderdet1, Orderdet2,Orderdet3,Orderdet4,Orderdet5,Orderdet6,Orderdet7,Orderdet8,Orderdet9,lose,lose1,lose2};
+ PageReference page = new PageReference('/apex/ArriveGoods?Esetid=' + Order1.Id);
+ System.Test.setCurrentPage(page);
+ ArriveGoodsController Controller = new ArriveGoodsController();
+ //鍒濆鍖栨祴璇�
+ System.Test.startTest();
+ Controller.init();
- Account myAccount2 = new Account(
- name = 'Testaccount002',
- Dealer_discount__c = 20,
- RecordTypeId = rectCo[0].Id,
- AgentCode_Ext__c = '9999900'
- );
- Account myAccount1 = new Account(
- name = 'Testaccount001',
- Dealer_discount__c = 30,
- RecordTypeId = rectCo[0].Id
- );
- insert new List<account>{ myAccount1, myAccount2 };
+ Controller.barcode = '01049531702003111115120017181000105ZK250BXJRF\n01049531702003111115120017181000105ZK250BXJR3\n01049531702003111115120017181000105ZK250BXJ13\n01049531702003111115120017181000105ZK250BXJRI\n01049531702003111115120017181000105ZK250BXJR2\n01049531702003111115120017181000105ZK250BXJR3\n01049531702003111115120017181000105ZK250BXJR4\n01049531702003111115120017181000105ZK250BXJR1\n01049531702003111115120017181000105ZK250BXJR7\n01049531702003111115120017181000105ZK250BXJR9\n01049531702003111115120017181000105ZK250BXJR8\n01049531702003111115120017181000105ZK250BXJR5\n01049531702003111115120017181000105ZK250BXJR6\n01049531702003111115120017181000105ZK250BXJR7\n01049531702003111115120017181000105ZK250BXAAA\n01049531702003111115120017181000105ZK250BXAAB';
+ Controller.SearchPro();
+ // System.assertEquals(1, controller.consumableInventory.size());
- Contact core = new Contact(
- email = 'jplumber@salesforce.com',
- firstname = 'Joe',
- lastname = 'Plumber',
- accountid = myAccount1.id
- );
- insert core;
- user MyUser_Test = new User(
- ContactId = core.id,
- Alias = 'newUser',
- Email = 'newuser@testorg.com',
- EmailEncodingKey = 'UTF-8',
- LastName = 'TestUser',
- LanguageLocaleKey = 'zh_CN',
- LocaleSidKey = 'zh_CN',
- ProfileId = prof.Id,
- TimeZoneSidKey = 'Asia/Shanghai',
- UserName = 'testUser@testorg.com',
- UserPro_Type__c = 'ET'
- );
- System.runAs(new User(Id = UserInfo.getUserId())) {
- insert MyUser_Test;
- }
+ System.Test.stopTest();
+ }
+ }
- // User MyUser_Test = [select id,Contact.accountid from User WHERE ProfileId = :prof.Id and IsActive = true and UserPro_Type__c = 'ET' limit 1 ];
- // Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false);
- // Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false);
- // insert new Product2[] {prod01,prod02};
- System.runAs(MyUser_Test) {
- Product2 prod01 = new Product2(
- Name = 'Test01',
- ProductCode = 'Test01',
- Asset_Model_No__c = 'Test01',
- SFDA_Status__c = '鏈夊姽',
- JANCODE__c = '04953170200311',
- Dealer_special_Object__c = true,
- Manual_Entry__c = false
- );
- Product2 prod02 = new Product2(
- Name = 'Test02',
- ProductCode = 'Test02',
- Asset_Model_No__c = 'Test02',
- SFDA_Status__c = '鏈夊姽',
- JANCODE__c = '04953170200312',
- Dealer_special_Object__c = true,
- Manual_Entry__c = false
- );
- insert new List<Product2>{ prod01, prod02 };
- Product2__c pro1 = new Product2__c(
- Name = 'Pro001',
- OT_CODE_Text__c = 'Test001',
- Product2__c = prod01.Id
- );
- Product2__c pro2 = new Product2__c(
- Name = 'Pro002',
- OT_CODE_Text__c = 'Test002',
- Product2__c = prod02.Id
- );
- insert new List<Product2__c>{ pro1, pro2 };
- //璁㈠崟
- Consumable_order__c Order1 = new Consumable_order__c();
- Order1.Name = 'OCM_01_001';
- Order1.Order_status__c = '鎵瑰噯';
- Order1.Order_type__c = '璁㈠崟';
- Order1.Dealer_Info__c = myAccount1.id;
- Order1.RecordTypeid = System.Label.RT_ConOrder_Delivery;
+ //杩斿搧 鏄庣粏2涓嶅瓨鍦ㄧ殑瀵瑰簲鐨勫埌璐ц鍗曟槑缁�
+ @isTest
+ static void productReturn_oldbarcode() {
+ // // TO DO: implement unit test
+ List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '璨╁2搴�'];
+ if (rectCo.size() == 0) {
+ return;
+ }
+ // Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET Email)'];
+ Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'];
- //杩斿搧璁㈠崟
- Consumable_order__c Order2 = new Consumable_order__c();
- Order2.Name = 'OCM_01_002';
- Order2.Order_status__c = '鎵瑰噯';
- Order2.Order_type__c = '杩斿搧';
- Order2.Dealer_Info__c = myAccount1.id;
- Order2.RecordTypeid = System.Label.Dealer_Returned_Label;
- insert Order1;
- insert Order2;
+ Account myAccount2 = new Account(name='Testaccount002',Dealer_discount__c =20,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '9999900');
+ Account myAccount1 = new Account(name='Testaccount001',Dealer_discount__c =30,RecordTypeId = rectCo[0].Id);
+ insert new account[]{myAccount1,myAccount2};
- //璁㈠崟鏄庣粏
- //fahuo
- Consumable_orderdetails__c Orderdet = new Consumable_orderdetails__c();
- Orderdet.Name = 'OCM_01_00101';
- Orderdet.Consumable_order__c = Order1.Id;
- Orderdet.RecordTypeId = System.Label.RT_ConOrderDetail1_Order;
- Orderdet.Consumable_Product__c = pro1.Id;
- Orderdet.Consumable_count__c = 4;
- insert Orderdet;
+ Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount1.id);
+ insert core;
+ user MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com',UserPro_Type__c = 'ET');
+ System.runAs(new User(Id = UserInfo.getUserId())){
+ insert MyUser_Test;
+ }
- //鍙戣揣鏄庣粏
- //娌″嚭搴擄紝娌¢攢鍞紝灏辨槸鍦ㄥ簱
- Consumable_order_details2__c Orderdet1 = new Consumable_order_details2__c();
- Orderdet1.Name = 'OCM_01_001001';
- Orderdet1.Consumable_order_minor__c = Order1.Id;
- Orderdet1.Consumable_Product__c = pro1.Id;
- Orderdet1.Asset_Model_No__c = 'Pro001';
- Orderdet1.Arrive_date__c = date.today();
- Orderdet1.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- Orderdet1.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRF';
- Orderdet1.TracingCode__c = 'BXSYS';
+ // User MyUser_Test = [select id,Contact.accountid from User WHERE ProfileId = :prof.Id and IsActive = true and UserPro_Type__c = 'ET' limit 1 ];
+ // Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ // Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ // insert new Product2[] {prod01,prod02};
+ system.runAs(MyUser_Test){
+ Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ insert new Product2[] {prod01,prod02};
+ Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='Test001',Product2__c = prod01.Id);
+ Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='Test002',Product2__c = prod02.Id);
+ insert new Product2__c[] {pro1, pro2};
+ //璁㈠崟
- //daohuo
- Consumable_order_details2__c Orderdet2 = new Consumable_order_details2__c();
- Orderdet2.Name = 'OCM_01_001002';
- Orderdet2.Consumable_order_minor__c = Order1.Id;
- Orderdet2.Consumable_Product__c = pro1.Id;
- Orderdet2.Asset_Model_No__c = 'Pro001';
- Orderdet2.Consumable_Arrived_order__c = Order1.Id;
- Orderdet2.Arrive_date__c = date.today();
- Orderdet2.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- Orderdet2.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRI';
- Orderdet2.TracingCode__c = 'BXSYS';
- //sale
- Consumable_order_details2__c Orderdet3 = new Consumable_order_details2__c();
- Orderdet3.Name = 'OCM_01_001003';
- Orderdet3.Consumable_order_minor__c = Order1.Id;
- Orderdet3.Consumable_Product__c = pro1.Id;
- Orderdet3.Asset_Model_No__c = 'Pro001';
- Orderdet3.Consumable_Arrived_order__c = Order1.Id;
- Orderdet3.Arrive_date__c = date.today();
- Orderdet3.Used_date__c = date.today();
- Orderdet3.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- Orderdet3.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRJ';
- Orderdet3.TracingCode__c = 'BXSYS';
- //鍑哄簱
- Consumable_order_details2__c Orderdet4 = new Consumable_order_details2__c();
- Orderdet4.Name = 'OCM_01_001004';
- Orderdet4.Consumable_order_minor__c = Order1.Id;
- Orderdet4.Consumable_Product__c = pro1.Id;
- Orderdet4.Asset_Model_No__c = 'Pro001';
- Orderdet4.Consumable_Arrived_order__c = Order1.Id;
- Orderdet4.Consumable_Shipment_order__c = Order1.Id;
- Orderdet4.Send_Date__c = date.today();
- Orderdet4.Arrive_date__c = date.today();
- Orderdet4.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- Orderdet4.Bar_Code__c = '01049531702003111115120017181000105ZK250BX222';
- Orderdet4.TracingCode__c = 'BXSYS';
- //quxiao
- Consumable_order_details2__c Orderdet5 = new Consumable_order_details2__c();
- Orderdet5.Name = 'OCM_01_001005';
- Orderdet5.Consumable_order_minor__c = Order1.Id;
- Orderdet5.Consumable_Product__c = pro1.Id;
- Orderdet5.Asset_Model_No__c = 'Pro001';
- Orderdet5.Cancellation_Date__c = Date.today();
- Orderdet5.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- Orderdet5.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRZ';
- Orderdet5.Box_Piece__c = '涓�';
- Orderdet5.TracingCode__c = 'BXSYS';
- //fanpin
- Consumable_order_details2__c Orderdet6 = new Consumable_order_details2__c();
- Orderdet6.Name = 'OCM_01_001006';
- Orderdet6.Consumable_order_minor__c = Order1.Id;
- Orderdet6.Consumable_Product__c = pro1.Id;
- Orderdet6.Asset_Model_No__c = 'Pro001';
- Orderdet6.Consumable_Return_order__c = Order2.Id;
- Orderdet6.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- Orderdet6.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRA';
- Orderdet6.Box_Piece__c = '涓�';
- Orderdet6.TracingCode__c = 'BXSYS';
+ Consumable_order__c Order1 = new Consumable_order__c();
+ Order1.Name = 'OCM_01_001';
+ Order1.Order_status__c = '鎵瑰噯';
+ Order1.Order_type__c = '璁㈠崟';
+ Order1.Dealer_Info__c = myAccount1.id;
+ Order1.RecordTypeid = System.Label.RT_ConOrder_Delivery;
- //鍙戣揣鏄庣粏
- //娌″嚭搴擄紝娌¢攢鍞紝灏辨槸鍦ㄥ簱
- Consumable_order_details2__c Orderdet7 = new Consumable_order_details2__c();
- Orderdet7.Name = 'OCM_01_001001';
- Orderdet7.Consumable_order_minor__c = Order1.Id;
- Orderdet7.Consumable_Product__c = pro1.Id;
- Orderdet7.Asset_Model_No__c = 'Pro001';
- Orderdet7.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- Orderdet7.Bar_Code__c = '01049531702003111115120017181000105ZK250BX333';
- Orderdet7.TracingCode__c = 'BXSYS';
+ //杩斿搧璁㈠崟
- insert new List<Consumable_order_details2__c>{
- Orderdet1,
- Orderdet2,
- Orderdet3,
- Orderdet4,
- Orderdet5,
- Orderdet6,
- Orderdet7
- };
- PageReference page = new PageReference('/apex/ArriveGoods?ArrType=ReG');
- System.Test.setCurrentPage(page);
- ArriveGoodsController Controller = new ArriveGoodsController();
- //鍒濆鍖栨祴璇�
- System.Test.startTest();
- Controller.init();
- //鎺掑簭
- Controller.barcode = '01049531702003111115120017181000105ZK250BXAAA\n01049531702003111115120017181000105ZK250BXJRJ\n01049531702003111115120017181000105ZK250BXJRF\n01049531702003111115120017181000105ZK250BX123\n01049531702003111115120017181000105ZK250BX222';
- Controller.SearchPro();
- //System.assertEquals(1, controller.ShowGoodsofReturnList.size());
- //System.assertEquals('OCM_01_001003', controller.ShowGoodsofReturnList[0].esd.Name);
- //System.assertEquals('OCM_01_001004', controller.ShowGoodsofReturnList[1].esd.Name);
- //System.assertEquals('Test01', controller.ConsumableorderdetailsRecordserror[0].Prod.Name__c);
- //System.assertEquals('Test01', controller.ConsumableorderdetailsRecordserror[1].Prod.Name__c);
- //System.assertEquals('OCM_01_001002', controller.ConsumableorderdetailsRecordserror[2].esd.Name);
- //System.assertEquals('OCM_02_001001', controller.ConsumableorderdetailsRecordserror[3].esd.Name);
- // Controller.GoodsReturnCheck();
- Controller.ArriveGoodsConfim();
- //System.assertEquals(1, controller.ShowGoodsofReturnList.size());
- Controller.UpdateGoodsOfReturn();
+ Consumable_order__c Order2 = new Consumable_order__c();
+ Order2.Name = 'OCM_01_002';
+ Order2.Order_status__c = '鎵瑰噯';
+ Order2.Order_type__c = '杩斿搧';
+ Order2.Dealer_Info__c = myAccount1.id;
+ Order2.RecordTypeid = System.Label.Dealer_Returned_Label;
+ insert Order1;
+ insert Order2;
- controller.getinventorysize();
- System.Test.stopTest();
- }
- }
- @isTest
- static void barcodecheck() {
- // // TO DO: implement unit test
- List<RecordType> rectCo = [
- SELECT Id
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '璨╁2搴�'
- ];
- if (rectCo.size() == 0) {
- return;
- }
- // Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET Email)'];
- Profile prof = [
- SELECT Id
- FROM Profile
- WHERE Name = '901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'
- ];
+ //璁㈠崟鏄庣粏
+ //fahuo
+ Consumable_orderdetails__c Orderdet = new Consumable_orderdetails__c();
+ Orderdet.Name = 'OCM_01_00101';
+ Orderdet.Consumable_order__c = Order1.Id;
+ Orderdet.RecordTypeId = System.Label.RT_ConOrderDetail1_Order;
+ Orderdet.Consumable_Product__c = pro1.Id;
+ Orderdet.Consumable_count__c = 4;
+ insert Orderdet;
- Account myAccount2 = new Account(
- name = 'Testaccount002',
- Dealer_discount__c = 20,
- RecordTypeId = rectCo[0].Id,
- AgentCode_Ext__c = '9999900'
- );
- Account myAccount1 = new Account(
- name = 'Testaccount001',
- Dealer_discount__c = 30,
- RecordTypeId = rectCo[0].Id
- );
- insert new List<account>{ myAccount1, myAccount2 };
+ //鍙戣揣鏄庣粏
+ //娌″嚭搴擄紝娌¢攢鍞紝灏辨槸鍦ㄥ簱
+ Consumable_order_details2__c Orderdet1 = new Consumable_order_details2__c();
+ Orderdet1.Name = 'OCM_01_001001';
+ Orderdet1.Consumable_order_minor__c = Order1.Id;
+ Orderdet1.Consumable_Product__c = pro1.Id;
+ Orderdet1.Asset_Model_No__c = 'Pro001';
+ Orderdet1.Arrive_date__c = date.today();
+ Orderdet1.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
+ Orderdet1.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRF';
+ Orderdet1.TracingCode__c = 'BXSYS';
- Contact core = new Contact(
- email = 'jplumber@salesforce.com',
- firstname = 'Joe',
- lastname = 'Plumber',
- accountid = myAccount1.id
- );
- insert core;
- user MyUser_Test = new User(
- ContactId = core.id,
- Alias = 'newUser',
- Email = 'newuser@testorg.com',
- EmailEncodingKey = 'UTF-8',
- LastName = 'TestUser',
- LanguageLocaleKey = 'zh_CN',
- LocaleSidKey = 'zh_CN',
- ProfileId = prof.Id,
- TimeZoneSidKey = 'Asia/Shanghai',
- UserName = 'testUser@testorg.com',
- UserPro_Type__c = 'ET'
- );
- System.runAs(new User(Id = UserInfo.getUserId())) {
- insert MyUser_Test;
- }
- // User MyUser_Test = [select id,Contact.accountid from User WHERE ProfileId = :prof.Id and IsActive = true and UserPro_Type__c = 'ET' limit 1 ];
- // Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false);
- // Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false);
- // insert new Product2[] {prod01,prod02};
- System.runAs(MyUser_Test) {
- Product2 prod01 = new Product2(
- Name = 'Test01',
- ProductCode = 'Test01',
- Asset_Model_No__c = 'Test01',
- SFDA_Status__c = '鏈夊姽',
- JANCODE__c = '04953170200311',
- Dealer_special_Object__c = true,
- Manual_Entry__c = false
- );
- Product2 prod02 = new Product2(
- Name = 'Test02',
- ProductCode = 'Test02',
- Asset_Model_No__c = 'Test02',
- SFDA_Status__c = '鏈夊姽',
- JANCODE__c = '04953170200312',
- Dealer_special_Object__c = true,
- Manual_Entry__c = false
- );
- insert new List<Product2>{ prod01, prod02 };
- Product2__c pro1 = new Product2__c(
- Name = 'Pro001',
- OT_CODE_Text__c = '2344',
- Product2__c = prod01.Id
- );
- Product2__c pro2 = new Product2__c(
- Name = 'Pro002',
- OT_CODE_Text__c = '8232',
- Product2__c = prod02.Id
- );
- insert new List<Product2__c>{ pro1, pro2 };
- ArriveGoodsController Controller = new ArriveGoodsController();
- //鍒濆鍖栨祴璇�
- list<String> list1 = new List<String>();
- list1.clear();
- list1.add(Controller.barcode = '2413456250BBBBA');
- Controller.inventoryEntry(list1);
+ //daohuo
+ Consumable_order_details2__c Orderdet2 = new Consumable_order_details2__c();
+ Orderdet2.Name = 'OCM_01_001002';
+ Orderdet2.Consumable_order_minor__c = Order1.Id;
+ Orderdet2.Consumable_Product__c = pro1.Id;
+ Orderdet2.Asset_Model_No__c = 'Pro001';
+ Orderdet2.Consumable_Arrived_order__c = Order1.Id;
+ Orderdet2.Arrive_date__c = date.today();
+ Orderdet2.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
+ Orderdet2.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRI';
+ Orderdet2.TracingCode__c = 'BXSYS';
+ //sale
+ Consumable_order_details2__c Orderdet3 = new Consumable_order_details2__c();
+ Orderdet3.Name = 'OCM_01_001003';
+ Orderdet3.Consumable_order_minor__c = Order1.Id;
+ Orderdet3.Consumable_Product__c = pro1.Id;
+ Orderdet3.Asset_Model_No__c = 'Pro001';
+ Orderdet3.Consumable_Arrived_order__c = Order1.Id;
+ Orderdet3.Arrive_date__c = date.today();
+ Orderdet3.Used_date__c = date.today();
+ Orderdet3.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
+ Orderdet3.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRJ';
+ Orderdet3.TracingCode__c = 'BXSYS';
+ //鍑哄簱
+ Consumable_order_details2__c Orderdet4 = new Consumable_order_details2__c();
+ Orderdet4.Name = 'OCM_01_001004';
+ Orderdet4.Consumable_order_minor__c = Order1.Id;
+ Orderdet4.Consumable_Product__c = pro1.Id;
+ Orderdet4.Asset_Model_No__c = 'Pro001';
+ Orderdet4.Consumable_Arrived_order__c = Order1.Id;
+ Orderdet4.Consumable_Shipment_order__c = Order1.Id;
+ Orderdet4.Send_Date__c = date.today();
+ Orderdet4.Arrive_date__c = date.today();
+ Orderdet4.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
+ Orderdet4.Bar_Code__c = '01049531702003111115120017181000105ZK250BX222';
+ Orderdet4.TracingCode__c = 'BXSYS';
+ //quxiao
+ Consumable_order_details2__c Orderdet5 = new Consumable_order_details2__c();
+ Orderdet5.Name = 'OCM_01_001005';
+ Orderdet5.Consumable_order_minor__c = Order1.Id;
+ Orderdet5.Consumable_Product__c = pro1.Id;
+ Orderdet5.Asset_Model_No__c = 'Pro001';
+ Orderdet5.Cancellation_Date__c = Date.today();
+ Orderdet5.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
+ Orderdet5.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRZ';
+ Orderdet5.Box_Piece__c ='涓�';
+ Orderdet5.TracingCode__c = 'BXSYS';
+ //fanpin
+ Consumable_order_details2__c Orderdet6 = new Consumable_order_details2__c();
+ Orderdet6.Name = 'OCM_01_001006';
+ Orderdet6.Consumable_order_minor__c = Order1.Id;
+ Orderdet6.Consumable_Product__c = pro1.Id;
+ Orderdet6.Asset_Model_No__c = 'Pro001';
+ Orderdet6.Consumable_Return_order__c = Order2.Id;
+ Orderdet6.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
+ Orderdet6.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRA';
+ Orderdet6.Box_Piece__c ='涓�';
+ Orderdet6.TracingCode__c = 'BXSYS';
- list1.clear();
- list1.add(Controller.barcode = '241250BBBBZ');
- Controller.inventoryEntry(list1);
+ //鍙戣揣鏄庣粏
+ //娌″嚭搴擄紝娌¢攢鍞紝灏辨槸鍦ㄥ簱
+ Consumable_order_details2__c Orderdet7 = new Consumable_order_details2__c();
+ Orderdet7.Name = 'OCM_01_001001';
+ Orderdet7.Consumable_order_minor__c = Order1.Id;
+ Orderdet7.Consumable_Product__c = pro1.Id;
+ Orderdet7.Asset_Model_No__c = 'Pro001';
+ Orderdet7.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
+ Orderdet7.Bar_Code__c = '01049531702003111115120017181000105ZK250BX333';
+ Orderdet7.TracingCode__c = 'BXSYS';
- list1.clear();
- list1.add(Controller.barcode = '241250');
- Controller.inventoryEntry(list1);
+ insert new Consumable_order_details2__c[] {Orderdet1, Orderdet2,Orderdet3,Orderdet4,Orderdet5,Orderdet6,Orderdet7};
+ PageReference page = new PageReference('/apex/ArriveGoods?ArrType=ReG');
+ System.Test.setCurrentPage(page);
+ ArriveGoodsController Controller = new ArriveGoodsController();
+ //鍒濆鍖栨祴璇�
+ System.Test.startTest();
+ Controller.init();
+ //鎺掑簭
+ Controller.barcode = '01049531702003111115120017181000105ZK250BXAAA\n01049531702003111115120017181000105ZK250BXJRJ\n01049531702003111115120017181000105ZK250BXJRF\n01049531702003111115120017181000105ZK250BX123\n01049531702003111115120017181000105ZK250BX222';
+ Controller.SearchPro();
+ //System.assertEquals(1, controller.ShowGoodsofReturnList.size());
+ //System.assertEquals('OCM_01_001003', controller.ShowGoodsofReturnList[0].esd.Name);
+ //System.assertEquals('OCM_01_001004', controller.ShowGoodsofReturnList[1].esd.Name);
+ //System.assertEquals('Test01', controller.ConsumableorderdetailsRecordserror[0].Prod.Name__c);
+ //System.assertEquals('Test01', controller.ConsumableorderdetailsRecordserror[1].Prod.Name__c);
+ //System.assertEquals('OCM_01_001002', controller.ConsumableorderdetailsRecordserror[2].esd.Name);
+ //System.assertEquals('OCM_02_001001', controller.ConsumableorderdetailsRecordserror[3].esd.Name);
+ // Controller.GoodsReturnCheck();
+ Controller.ArriveGoodsConfim();
+ //System.assertEquals(1, controller.ShowGoodsofReturnList.size());
+ Controller.UpdateGoodsOfReturn();
- list1.clear();
- list1.add(Controller.barcode = '241250BBB');
- Controller.inventoryEntry(list1);
+ controller.getinventorysize();
+ System.Test.stopTest();
- list1.clear();
- list1.add(Controller.barcode = '24134567250BBBBB');
- Controller.inventoryEntry(list1);
+ }
+ }
+ @isTest
+ static void barcodecheck() {
+ // // TO DO: implement unit test
+ List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '璨╁2搴�'];
+ if (rectCo.size() == 0) {
+ return;
+ }
+ // Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET Email)'];
+ Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'];
- list1.clear();
- list1.add(Controller.barcode = '241345678250BBBBC');
- Controller.inventoryEntry(list1);
- list1.clear();
- list1.add(Controller.barcode = '2413456789250BBBBD');
- Controller.inventoryEntry(list1);
+ Account myAccount2 = new Account(name='Testaccount002',Dealer_discount__c =20,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '9999900');
+ Account myAccount1 = new Account(name='Testaccount001',Dealer_discount__c =30,RecordTypeId = rectCo[0].Id);
+ insert new account[]{myAccount1,myAccount2};
- list1.clear();
- list1.add(Controller.barcode = '24134567890250BBBBE');
- Controller.inventoryEntry(list1);
+ Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount1.id);
+ insert core;
+ user MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com',UserPro_Type__c = 'ET');
+ System.runAs(new User(Id = UserInfo.getUserId())){
+ insert MyUser_Test;
+ }
+ // User MyUser_Test = [select id,Contact.accountid from User WHERE ProfileId = :prof.Id and IsActive = true and UserPro_Type__c = 'ET' limit 1 ];
+ // Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ // Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ // insert new Product2[] {prod01,prod02};
+ system.runAs(MyUser_Test){
+ Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ insert new Product2[] {prod01,prod02};
+ Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='2344',Product2__c = prod01.Id);
+ Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='8232',Product2__c = prod02.Id);
+ insert new Product2__c[] {pro1, pro2};
+ ArriveGoodsController Controller = new ArriveGoodsController();
+ //鍒濆鍖栨祴璇�
+ list<String> list1 = new list<String>();
+ list1.clear();
+ list1.add(Controller.barcode = '2413456250BBBBA');
+ Controller.inventoryEntry(list1);
- list1.clear();
- list1.add(Controller.barcode = '241345678901250BBBBF');
- Controller.inventoryEntry(list1);
- list1.clear();
- list1.add(Controller.barcode = '2413456789011250BBBBG');
- Controller.inventoryEntry(list1);
+ list1.clear();
+ list1.add(Controller.barcode = '241250BBBBZ');
+ Controller.inventoryEntry(list1);
- list1.clear();
- list1.add(Controller.barcode = '24134567890111250BBBBH');
- Controller.inventoryEntry(list1);
+ list1.clear();
+ list1.add(Controller.barcode = '241250');
+ Controller.inventoryEntry(list1);
- list1.clear();
- list1.add(Controller.barcode = '0112345678901231712300123250BBBBI');
- Controller.inventoryEntry(list1);
+ list1.clear();
+ list1.add(Controller.barcode = '241250BBB');
+ Controller.inventoryEntry(list1);
- list1.clear();
- list1.add(Controller.barcode = '011234567890250BBBBJ');
- Controller.inventoryEntry(list1);
+ list1.clear();
+ list1.add(Controller.barcode = '24134567250BBBBB');
+ Controller.inventoryEntry(list1);
- list1.clear();
- list1.add(Controller.barcode = '01123456789A0123456250BBBBK');
- Controller.inventoryEntry(list1);
+ list1.clear();
+ list1.add(Controller.barcode = '241345678250BBBBC');
+ Controller.inventoryEntry(list1);
- list1.clear();
- list1.add(Controller.barcode = '011234567890123411AAAA123250BBBBL');
- Controller.inventoryEntry(list1);
+ list1.clear();
+ list1.add(Controller.barcode = '2413456789250BBBBD');
+ Controller.inventoryEntry(list1);
- list1.clear();
- list1.add(
- Controller.barcode = '011234567890123411789012175678901234250BBBBM'
- );
- Controller.inventoryEntry(list1);
+ list1.clear();
+ list1.add(Controller.barcode = '24134567890250BBBBE');
+ Controller.inventoryEntry(list1);
- list1.clear();
- list1.add(
- Controller.barcode = '01123456789012340138901217aaa8001234250BBBBN'
- );
- Controller.inventoryEntry(list1);
+ list1.clear();
+ list1.add(Controller.barcode = '241345678901250BBBBF');
+ Controller.inventoryEntry(list1);
+ list1.clear();
+ list1.add(Controller.barcode = '2413456789011250BBBBG');
+ Controller.inventoryEntry(list1);
- list1.clear();
- list1.add(
- Controller.barcode = '011234567890123456789012104567890250BBBBO'
- );
- Controller.inventoryEntry(list1);
+ list1.clear();
+ list1.add(Controller.barcode = '24134567890111250BBBBH');
+ Controller.inventoryEntry(list1);
- list1.clear();
- list1.add(
- Controller.barcode = '01123456789012341778910034567890250BBBBP'
- );
- Controller.inventoryEntry(list1);
+ list1.clear();
+ list1.add(Controller.barcode = '0112345678901231712300123250BBBBI');
+ Controller.inventoryEntry(list1);
- list1.clear();
- list1.add(
- Controller.barcode = '011234567890123417aa910034567890250BBBBQ'
- );
- Controller.inventoryEntry(list1);
+ list1.clear();
+ list1.add(Controller.barcode = '011234567890250BBBBJ');
+ Controller.inventoryEntry(list1);
- list1.clear();
- list1.add(
- Controller.barcode = '01123456789012341778911134567890250BBBBR'
- );
- Controller.inventoryEntry(list1);
+ list1.clear();
+ list1.add(Controller.barcode = '01123456789A0123456250BBBBK');
+ Controller.inventoryEntry(list1);
- list1.clear();
- list1.add(
- Controller.barcode = '011234567890123417789121105678900000250BBBBS'
- );
- Controller.inventoryEntry(list1);
+ list1.clear();
+ list1.add(Controller.barcode = '011234567890123411AAAA123250BBBBL');
+ Controller.inventoryEntry(list1);
- list1.clear();
- list1.add(
- Controller.barcode = '011234567890123410789121105678900000250BBBBT'
- );
- Controller.inventoryEntry(list1);
+ list1.clear();
+ list1.add(Controller.barcode = '011234567890123411789012175678901234250BBBBM');
+ Controller.inventoryEntry(list1);
- list1.clear();
- list1.add(
- Controller.barcode = '011234567890123411789012171a780012250BBBBU'
- );
- Controller.inventoryEntry(list1);
+ list1.clear();
+ list1.add(Controller.barcode = '01123456789012340138901217aaa8001234250BBBBN');
+ Controller.inventoryEntry(list1);
- list1.clear();
- list1.add(
- Controller.barcode = '0112345678901234110890121012789000250BBBBV'
- );
- Controller.inventoryEntry(list1);
+ list1.clear();
+ list1.add(Controller.barcode = '011234567890123456789012104567890250BBBBO');
+ Controller.inventoryEntry(list1);
- list1.clear();
- list1.add(
- Controller.barcode = '011234567890123417120506105678901234250BBBBW'
- );
- Controller.inventoryEntry(list1);
+ list1.clear();
+ list1.add(Controller.barcode = '01123456789012341778910034567890250BBBBP');
+ Controller.inventoryEntry(list1);
- list1.clear();
- list1.add(
- Controller.barcode = '0112345678901234111202121712050212250BBBBX'
- );
- Controller.inventoryEntry(list1);
+ list1.clear();
+ list1.add(Controller.barcode = '011234567890123417aa910034567890250BBBBQ');
+ Controller.inventoryEntry(list1);
- list1.clear();
- list1.add(
- Controller.barcode = '0112345678901234111202121712a50212250BBBBY'
- );
- Controller.inventoryEntry(list1);
+ list1.clear();
+ list1.add(Controller.barcode = '01123456789012341778911134567890250BBBBR');
+ Controller.inventoryEntry(list1);
- list1.clear();
- list1.add(
- Controller.barcode = '0112345678901234111202121012050212250BBBBZ'
- );
- Controller.inventoryEntry(list1);
- }
- }
- @isTest
- static void barcodechkeck_2() {
- // // TO DO: implement unit test
- List<RecordType> rectCo = [
- SELECT Id
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '璨╁2搴�'
- ];
- if (rectCo.size() == 0) {
- return;
- }
- // Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET Email)'];
- Profile prof = [
- SELECT Id
- FROM Profile
- WHERE Name = '901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'
- ];
+ list1.clear();
+ list1.add(Controller.barcode = '011234567890123417789121105678900000250BBBBS');
+ Controller.inventoryEntry(list1);
- Account myAccount2 = new Account(
- name = 'Testaccount002',
- Dealer_discount__c = 20,
- RecordTypeId = rectCo[0].Id,
- AgentCode_Ext__c = '9999900'
- );
- Account myAccount1 = new Account(
- name = 'Testaccount001',
- Dealer_discount__c = 30,
- RecordTypeId = rectCo[0].Id
- );
- insert new List<account>{ myAccount1, myAccount2 };
+ list1.clear();
+ list1.add(Controller.barcode = '011234567890123410789121105678900000250BBBBT');
+ Controller.inventoryEntry(list1);
- Contact core = new Contact(
- email = 'jplumber@salesforce.com',
- firstname = 'Joe',
- lastname = 'Plumber',
- accountid = myAccount1.id
- );
- insert core;
- user MyUser_Test = new User(
- ContactId = core.id,
- Alias = 'newUser',
- Email = 'newuser@testorg.com',
- EmailEncodingKey = 'UTF-8',
- LastName = 'TestUser',
- LanguageLocaleKey = 'zh_CN',
- LocaleSidKey = 'zh_CN',
- ProfileId = prof.Id,
- TimeZoneSidKey = 'Asia/Shanghai',
- UserName = 'testUser@testorg.com',
- UserPro_Type__c = 'ET'
- );
- System.runAs(new User(Id = UserInfo.getUserId())) {
- insert MyUser_Test;
- }
- // User MyUser_Test = [select id,Contact.accountid from User WHERE ProfileId = :prof.Id and IsActive = true and UserPro_Type__c = 'ET' limit 1 ];
- // Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false);
- // Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false);
- // insert new Product2[] {prod01,prod02};
- System.runAs(MyUser_Test) {
- Product2 prod01 = new Product2(
- Name = 'Test01',
- ProductCode = 'Test01',
- Asset_Model_No__c = 'Test01',
- SFDA_Status__c = '鏈夊姽',
- JANCODE__c = '04953170200311',
- Dealer_special_Object__c = true,
- Manual_Entry__c = false
- );
- Product2 prod02 = new Product2(
- Name = 'Test02',
- ProductCode = 'Test02',
- Asset_Model_No__c = 'Test02',
- SFDA_Status__c = '鏈夊姽',
- JANCODE__c = '04953170200312',
- Dealer_special_Object__c = true,
- Manual_Entry__c = false
- );
- insert new List<Product2>{ prod01, prod02 };
- Product2__c pro1 = new Product2__c(
- Name = 'Pro001',
- OT_CODE_Text__c = '2344',
- Product2__c = prod01.Id
- );
- Product2__c pro2 = new Product2__c(
- Name = 'Pro002',
- OT_CODE_Text__c = '82324',
- Product2__c = prod02.Id
- );
- insert new List<Product2__c>{ pro1, pro2 };
- //浜у搧娉ㄥ唽璇�
- Product_Register__c prc = new Product_Register__c(
- Name = '鍥芥娉ㄨ繘20162220210',
- MedPrdClass__c = '3',
- ValidFrom__c = date.newinstance(2018, 7, 22),
- ValidTo__c = date.newinstance(2028, 7, 22),
- RegisterNoClass_Old__c = '6815',
- RegisterNoClass_New__c = '6815',
- RegisterNoStatus__c = '鏈夋晥'
- );
- insert prc;
- //鏂版棫鍏崇郴瀵圭収琛�
- //Product_Register_contrast__c prcc = new Product_Register_contrast__c(
- // Name = 'Test20181204',
- // Register_new__c = '314',
- // Register_old__c = '36815'
- // );
- //insert prcc;
- //浜у搧-浜у搧娉ㄥ唽璇佸叧绯� prod01
- Product_Register_Link__c prlc = new Product_Register_Link__c(
- Product2__c = prod01.Id,
- Product_Register__c = prc.Id
- );
- insert prlc;
- //浜у搧-浜у搧娉ㄥ唽璇佸叧绯� prod02
- Product_Register_Link__c prlc2 = new Product_Register_Link__c(
- Product2__c = prod02.Id,
- Product_Register__c = prc.Id
- );
- insert prlc2;
- PageReference page = new PageReference('/apex/ArriveGoods?ArrType=ReG');
- System.Test.setCurrentPage(page);
+ list1.clear();
+ list1.add(Controller.barcode = '011234567890123411789012171a780012250BBBBU');
+ Controller.inventoryEntry(list1);
+
+ list1.clear();
+ list1.add(Controller.barcode = '0112345678901234110890121012789000250BBBBV');
+ Controller.inventoryEntry(list1);
+
+ list1.clear();
+ list1.add(Controller.barcode = '011234567890123417120506105678901234250BBBBW');
+ Controller.inventoryEntry(list1);
+
+ list1.clear();
+ list1.add(Controller.barcode = '0112345678901234111202121712050212250BBBBX');
+ Controller.inventoryEntry(list1);
+
+ list1.clear();
+ list1.add(Controller.barcode = '0112345678901234111202121712a50212250BBBBY');
+ Controller.inventoryEntry(list1);
+
+ list1.clear();
+ list1.add(Controller.barcode = '0112345678901234111202121012050212250BBBBZ');
+ Controller.inventoryEntry(list1);
+ }
+ }
+ @isTest
+ static void barcodechkeck_2() {
+ // // TO DO: implement unit test
+ List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '璨╁2搴�'];
+ if (rectCo.size() == 0) {
+ return;
+ }
+ // Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET Email)'];
+ Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'];
+
+
+ Account myAccount2 = new Account(name='Testaccount002',Dealer_discount__c =20,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '9999900');
+ Account myAccount1 = new Account(name='Testaccount001',Dealer_discount__c =30,RecordTypeId = rectCo[0].Id);
+ insert new account[]{myAccount1,myAccount2};
+
+ Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount1.id);
+ insert core;
+ user MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com',UserPro_Type__c = 'ET');
+System.runAs(new User(Id = UserInfo.getUserId())){
+ insert MyUser_Test;
+ }
+ // User MyUser_Test = [select id,Contact.accountid from User WHERE ProfileId = :prof.Id and IsActive = true and UserPro_Type__c = 'ET' limit 1 ];
+ // Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ // Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ // insert new Product2[] {prod01,prod02};
+ system.runAs(MyUser_Test){
+ Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ insert new Product2[] {prod01,prod02};
+ Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='2344',Product2__c = prod01.Id);
+ Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='82324',Product2__c = prod02.Id);
+ insert new Product2__c[] {pro1, pro2};
+ //浜у搧娉ㄥ唽璇�
+ Product_Register__c prc = new Product_Register__c(Name = '鍥芥娉ㄨ繘20162220210',
+ MedPrdClass__c = '3',
+ ValidFrom__c = date.newinstance(2018, 07, 22),
+ ValidTo__c = date.newinstance(2028, 07, 22),
+ RegisterNoClass_Old__c = '6815',
+ RegisterNoClass_New__c = '6815',
+ RegisterNoStatus__c = '鏈夋晥'
+ );
+ insert prc;
+ //鏂版棫鍏崇郴瀵圭収琛�
+ //Product_Register_contrast__c prcc = new Product_Register_contrast__c(
+ // Name = 'Test20181204',
+ // Register_new__c = '314',
+ // Register_old__c = '36815'
+ // );
+ //insert prcc;
+ //浜у搧-浜у搧娉ㄥ唽璇佸叧绯� prod01
+ Product_Register_Link__c prlc = new Product_Register_Link__c(
+ Product2__c = prod01.Id,
+ Product_Register__c = prc.Id
+ );
+ insert prlc;
+ //浜у搧-浜у搧娉ㄥ唽璇佸叧绯� prod02
+ Product_Register_Link__c prlc2 = new Product_Register_Link__c(
+ Product2__c = prod02.Id,
+ Product_Register__c = prc.Id
+ );
+ insert prlc2;
+ PageReference page = new PageReference('/apex/ArriveGoods?ArrType=ReG');
+ System.Test.setCurrentPage(page);
+
+ ArriveGoodsController Controller = new ArriveGoodsController();
+ //List<Product2> proList = [select name,Estimation_Entry_Possibility__c from Product2 where id = :prod01.Id];
+ //System.assertEquals('鈼�', proList[0].Estimation_Entry_Possibility__c);
+ List<Product2__c> product2InStore = [SELECT Id, Name,Name__c,Intra_Trade_List_RMB__c,Asset_Model_No__c,OT_CODE__c
+ FROM Product2__c
+ WHERE Estimation_Entry_Possibility__c = '鈼�'
+ AND Pro2_Dealer_Object__c = true
+ AND OT_CODE__c ='test' ];
+ //System.assertEquals(1, product2InStore.size());
+ list<String> list1 = new list<String>();
+ list1.clear();
+ list1.add(Controller.barcode = '2413456250BBBBA');
+ Controller.inventoryEntryNoESetId(list1);
+
+ list1.clear();
+ list1.add(Controller.barcode = '241250BBBBZ');
+ Controller.inventoryEntryNoESetId(list1);
+
+ list1.clear();
+ list1.add(Controller.barcode = '241250');
+ Controller.inventoryEntryNoESetId(list1);
+
+ list1.clear();
+ list1.add(Controller.barcode = '241250BBZ');
+ Controller.inventoryEntryNoESetId(list1);
+
+ list1.clear();
+ list1.add(Controller.barcode = '24134567250BBBBB');
+ Controller.inventoryEntryNoESetId(list1);
+
+ list1.clear();
+ list1.add(Controller.barcode = '241345678250BBBBC');
+ Controller.inventoryEntryNoESetId(list1);
+
+ list1.clear();
+ list1.add(Controller.barcode = '2413452509250BBBBD');
+ Controller.inventoryEntryNoESetId(list1);
+
+ list1.clear();
+ list1.add(Controller.barcode = '24125090111250BBBBE');
+ Controller.inventoryEntryNoESetId(list1);
+
+ list1.clear();
+ list1.add(Controller.barcode = '241325090111250BBBBF');
+ Controller.inventoryEntryNoESetId(list1);
+ list1.clear();
+ list1.add(Controller.barcode = '2413425090111250BBBBG');
+ Controller.inventoryEntryNoESetId(list1);
+
+ list1.clear();
+ list1.add(Controller.barcode = '24134525090111250BBBBH');
+ Controller.inventoryEntryNoESetId(list1);
+ list1.clear();
+ list1.add(Controller.barcode = '241test1712345678901234567890250BBBBI');
+ Controller.inventoryEntryNoESetId(list1);
+
+ list1.clear();
+ list1.add(Controller.barcode = '241test171234500678901234567890250BBBBJ');
+ Controller.inventoryEntryNoESetId(list1);
+
+ list1.clear();
+ list1.add(Controller.barcode = '241test17120400678901234567890250BBBBK');
+ Controller.inventoryEntryNoESetId(list1);
+
+ list1.clear();
+ list1.add(Controller.barcode = '241test171204110678901234567890250BBBBL');
+ Controller.inventoryEntryNoESetId(list1);
+
+ list1.clear();
+ list1.add(Controller.barcode = '241test171204121078901234567890250BBBBM');
+ Controller.inventoryEntryNoESetId(list1);
+
+ list1.clear();
+ list1.add(Controller.barcode = '241test17120412250BBBBN');
+ Controller.inventoryEntryNoESetId(list1);
+
+ list1.clear();
+ list1.add(Controller.barcode = '241test101204121078901234567890250BBBBO');
+ Controller.inventoryEntryNoESetId(list1);
+
+ list1.clear();
+ list1.add(Controller.barcode = '241test1112a4121078901234567890250BBBBP');
+ Controller.inventoryEntryNoESetId(list1);
+
+ list1.clear();
+ list1.add(Controller.barcode = '241test111204121778900034567890250BBBBQ');
+ Controller.inventoryEntryNoESetId(list1);
+
+
+ list1.clear();
+ list1.add(Controller.barcode = '0111234101204120118901231712a4001234250BBBBR');
+ Controller.inventoryEntryNoESetId(list1);
- ArriveGoodsController Controller = new ArriveGoodsController();
- //List<Product2> proList = [select name,Estimation_Entry_Possibility__c from Product2 where id = :prod01.Id];
- //System.assertEquals('鈼�', proList[0].Estimation_Entry_Possibility__c);
- List<Product2__c> product2InStore = [
- SELECT
- Id,
- Name,
- Name__c,
- Intra_Trade_List_RMB__c,
- Asset_Model_No__c,
- OT_CODE__c
- FROM Product2__c
- WHERE
- Estimation_Entry_Possibility__c = '鈼�'
- AND Pro2_Dealer_Object__c = TRUE
- AND OT_CODE__c = 'test'
- ];
- //System.assertEquals(1, product2InStore.size());
- list<String> list1 = new List<String>();
- list1.clear();
- list1.add(Controller.barcode = '2413456250BBBBA');
- Controller.inventoryEntryNoESetId(list1);
+ list1.clear();
+ list1.add(Controller.barcode = '011123410120412011890123171204011234250BBBBS');
+ Controller.inventoryEntryNoESetId(list1);
- list1.clear();
- list1.add(Controller.barcode = '241250BBBBZ');
- Controller.inventoryEntryNoESetId(list1);
+ list1.clear();
+ list1.add(Controller.barcode = '011test10120412011890123171a04011234250BBBBT');
+ Controller.inventoryEntryNoESetId(list1);
- list1.clear();
- list1.add(Controller.barcode = '241250');
- Controller.inventoryEntryNoESetId(list1);
+ list1.clear();
+ list1.add(Controller.barcode = '0111234101204120118901231012040112342222250BBBBU');
+ Controller.inventoryEntryNoESetId(list1);
- list1.clear();
- list1.add(Controller.barcode = '241250BBZ');
- Controller.inventoryEntryNoESetId(list1);
+ list1.clear();
+ list1.add(Controller.barcode = '011123410120412017120100250AAAAA');
+ Controller.inventoryEntryNoESetId(list1);
- list1.clear();
- list1.add(Controller.barcode = '24134567250BBBBB');
- Controller.inventoryEntryNoESetId(list1);
+ }
+ }
- list1.clear();
- list1.add(Controller.barcode = '241345678250BBBBC');
- Controller.inventoryEntryNoESetId(list1);
+ //鑷姩鍑哄簱
+ @isTest
+ static void addSaleOrderAuto() {
+ // // TO DO: implement unit test
+ List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '璨╁2搴�'];
+ if (rectCo.size() == 0) {
+ return;
+ }
+ // Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET Email)'];
+ Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'];
- list1.clear();
- list1.add(Controller.barcode = '2413452509250BBBBD');
- Controller.inventoryEntryNoESetId(list1);
- list1.clear();
- list1.add(Controller.barcode = '24125090111250BBBBE');
- Controller.inventoryEntryNoESetId(list1);
+ Account myAccount2 = new Account(name='Testaccount002',Dealer_discount__c =20,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '9999900');
+ Account myAccount1 = new Account(name='Testaccount001',Dealer_discount__c =30,RecordTypeId = rectCo[0].Id);
+ insert new account[]{myAccount1,myAccount2};
- list1.clear();
- list1.add(Controller.barcode = '241325090111250BBBBF');
- Controller.inventoryEntryNoESetId(list1);
- list1.clear();
- list1.add(Controller.barcode = '2413425090111250BBBBG');
- Controller.inventoryEntryNoESetId(list1);
+ Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount1.id);
+ insert core;
+ user MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com',UserPro_Type__c = 'ET');
+System.runAs(new User(Id = UserInfo.getUserId())){
+ insert MyUser_Test;
+ }
+ // User MyUser_Test = [select id,Contact.accountid from User WHERE ProfileId = :prof.Id and IsActive = true and UserPro_Type__c = 'ET' limit 1 ];
+ // Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ // Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ // insert new Product2[] {prod01,prod02};
+ system.runAs(MyUser_Test){
+ Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ insert new Product2[] {prod01,prod02};
+ Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='Test001',Product2__c = prod01.Id);
+ insert new Product2__c[] {pro1};
+ // Account myAccount1 = new Account(name='Testaccount001',Dealer_discount__c =30,RecordTypeId = rectCo[0].Id);
+ // insert myAccount1;
+ Consumable_order__c Order2 = new Consumable_order__c();
+ Order2.Name = 'OCM_02_001';
+ Order2.Order_status__c = '鎵瑰噯';
+ Order2.Order_type__c = '璁㈠崟';
+ Order2.Dealer_Info__c = myAccount1.Id;
+ Order2.RecordTypeid = System.Label.RT_ConOrder_Delivery;
+ insert Order2;
+ //鍙戦敊搴� 宸插埌璐�
+ Consumable_order_details2__c Orderdets8 = new Consumable_order_details2__c();
+ Orderdets8.Name = 'OCM_01_001011';
+ Orderdets8.Consumable_order_minor__c = Order2.Id;
+ Orderdets8.Consumable_Product__c = pro1.Id;
+ Orderdets8.Asset_Model_No__c = 'Test01';
+ Orderdets8.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
+ Orderdets8.Bar_Code__c = '01049531702003111115120017181000105ZK250BXSYS';
+ Orderdets8.Box_Piece__c = '鐩�';
+ Orderdets8.Arrive_date__c = Date.today();
+ Orderdets8.TracingCode__c = 'BXSYS';
+ Orderdets8.SerialLotNo__c = '5ZK';
+ insert Orderdets8;
- list1.clear();
- list1.add(Controller.barcode = '24134525090111250BBBBH');
- Controller.inventoryEntryNoESetId(list1);
- list1.clear();
- list1.add(Controller.barcode = '241test1712345678901234567890250BBBBI');
- Controller.inventoryEntryNoESetId(list1);
+ ArriveGoodsController Controller = new ArriveGoodsController();
+ PageReference page = new PageReference('/apex/ArriveGoods?ArrType=Arr');
+ System.Test.setCurrentPage(page);
+ //鍒濆鍖栨祴璇�
+ System.Test.startTest();
+ Controller.init();
+ //鎺掑簭
+ Controller.barcode = '01049531702003111115120017181000105ZK250BXSYS';
+ Controller.SearchPro();
+ // System.assertEquals(1, controller.consumableInventory.size());
+ Controller.ArriveGoodsConfim();
+ System.Test.stopTest();
+ }
+ }
- list1.clear();
- list1.add(Controller.barcode = '241test171234500678901234567890250BBBBJ');
- Controller.inventoryEntryNoESetId(list1);
+ // UPDATE TCM TEST1
+ @isTest
+ static void methodTest1() {
+ // // TO DO: implement unit test
+ List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '璨╁2搴�'];
+ if (rectCo.size() == 0) {
+ return;
+ }
+ // Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET Email)'];
+ Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'];
- list1.clear();
- list1.add(Controller.barcode = '241test17120400678901234567890250BBBBK');
- Controller.inventoryEntryNoESetId(list1);
- list1.clear();
- list1.add(Controller.barcode = '241test171204110678901234567890250BBBBL');
- Controller.inventoryEntryNoESetId(list1);
+ Account myAccount2 = new Account(name='Testaccount002',Dealer_discount__c =20,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '9999900');
+ Account myAccount1 = new Account(name='Testaccount001',Dealer_discount__c =30,RecordTypeId = rectCo[0].Id);
+ insert new account[]{myAccount1,myAccount2};
- list1.clear();
- list1.add(Controller.barcode = '241test171204121078901234567890250BBBBM');
- Controller.inventoryEntryNoESetId(list1);
+ Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount1.id);
+ insert core;
+ user MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com',UserPro_Type__c = 'ET');
+System.runAs(new User(Id = UserInfo.getUserId())){
+ insert MyUser_Test;
+ }
+ // User MyUser_Test = [select id,Contact.accountid from User WHERE ProfileId = :prof.Id and IsActive = true and UserPro_Type__c = 'ET' limit 1 ];
+ // Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ // Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ // insert new Product2[] {prod01,prod02};
+ system.runAs(MyUser_Test){
+ Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ insert new Product2[] {prod01,prod02};
+ Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='N3047730',Product2__c = prod01.Id);
+ Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='N3047731',Product2__c = prod02.Id);
+ insert new Product2__c[] {pro1, pro2};
+ //璁㈠崟
- list1.clear();
- list1.add(Controller.barcode = '241test17120412250BBBBN');
- Controller.inventoryEntryNoESetId(list1);
+ Consumable_order__c Order1 = new Consumable_order__c();
+ Order1.Name = 'OCM_01_001';
+ Order1.Order_status__c = '鎵瑰噯';
+ Order1.Order_type__c = '璁㈠崟';
+ Order1.Dealer_Info__c = myAccount1.id;
+ Order1.RecordTypeid = System.Label.RT_ConOrder_Delivery;
+ Order1.Order_ProType__c = 'ET';
+ insert Order1;
- list1.clear();
- list1.add(Controller.barcode = '241test101204121078901234567890250BBBBO');
- Controller.inventoryEntryNoESetId(list1);
+ //璁㈠崟鏄庣粏
+ //fahuo
+ Consumable_orderdetails__c Orderdet = new Consumable_orderdetails__c();
+ Orderdet.Name = 'OCM_01_00101';
+ Orderdet.Consumable_order__c = Order1.Id;
+ Orderdet.RecordTypeId = System.Label.RT_ConOrderDetail1_Order;
+ Orderdet.Consumable_Product__c = pro1.Id;
+ Orderdet.Consumable_count__c = 4;
+ insert Orderdet;
- list1.clear();
- list1.add(Controller.barcode = '241test1112a4121078901234567890250BBBBP');
- Controller.inventoryEntryNoESetId(list1);
+ //鍙戣揣鏄庣粏
+ //fahuo
+ Consumable_order_details2__c Orderdet1 = new Consumable_order_details2__c();
+ Orderdet1.Name = 'OCM_01_001001';
+ Orderdet1.Consumable_order_minor__c = Order1.Id;
+ Orderdet1.Consumable_Product__c = pro1.Id;
+ Orderdet1.Asset_Model_No__c = 'Test01';
+ Orderdet1.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
+ Orderdet1.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRF';
+ Orderdet1.Arrive_date__c=Date.today();
+ // Orderdet1.Send_Date__c=Date.today();
+ // Orderdet1.Used_date__c=Date.today();
+ Orderdet1.TracingCode__c = 'BXJRF';
+ Orderdet1.SerialLotNo__c = '5ZK';
+ insert Orderdet1;
- list1.clear();
- list1.add(Controller.barcode = '241test111204121778900034567890250BBBBQ');
- Controller.inventoryEntryNoESetId(list1);
+ //fahuo
+ Consumable_order_details2__c Orderdet2 = new Consumable_order_details2__c();
+ Orderdet2.Name = 'OCM_01_001001';
+ Orderdet2.Consumable_order_minor__c = Order1.Id;
+ Orderdet2.Consumable_Product__c = pro1.Id;
+ Orderdet2.Asset_Model_No__c = 'Test01';
+ Orderdet2.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
+ Orderdet2.Bar_Code__c = '01049531702003111115120017181234105ZK250BXJRF';
+ Orderdet2.Arrive_date__c=Date.today();
+ Orderdet2.TracingCode__c = 'BXJRF';
+ Orderdet2.SerialLotNo__c = '5ZK';
+ insert Orderdet2;
- list1.clear();
- list1.add(
- Controller.barcode = '0111234101204120118901231712a4001234250BBBBR'
- );
- Controller.inventoryEntryNoESetId(list1);
+ PageReference page = new PageReference('/apex/ArriveGoods?ESetid=' + Order1.Id);
+ System.Test.setCurrentPage(page);
+ ArriveGoodsController Controller = new ArriveGoodsController();
+ //鍒濆鍖栨祴璇�
+ System.Test.startTest();
+ Controller.init();
+ Controller.barcode = '01049531702003111115120017181000105ZK250BXJRF';
+ Controller.SearchPro();
+ // System.assertEquals(1, Controller.ConsumableorderdetailsRecords.size());
+ // System.assertEquals(2, Controller.consumableInventory.size());
+ Controller.ArriveGoodsConfim();
+ List<Consumable_order_details2__c> ins = [SELECT Id,Name FROM Consumable_order_details2__c];
+ // System.assertEquals(3, ins.size());
+ System.Test.stopTest();
+ }
+ }
- list1.clear();
- list1.add(
- Controller.barcode = '011123410120412011890123171204011234250BBBBS'
- );
- Controller.inventoryEntryNoESetId(list1);
- list1.clear();
- list1.add(
- Controller.barcode = '011test10120412011890123171a04011234250BBBBT'
- );
- Controller.inventoryEntryNoESetId(list1);
+ //杩斿搧
+ @isTest
+ static void methodTest2() {
+ // // TO DO: implement unit test
+ List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '璨╁2搴�'];
+ if (rectCo.size() == 0) {
+ return;
+ }
+ // Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET Email)'];
+ Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'];
- list1.clear();
- list1.add(
- Controller.barcode = '0111234101204120118901231012040112342222250BBBBU'
- );
- Controller.inventoryEntryNoESetId(list1);
- list1.clear();
- list1.add(Controller.barcode = '011123410120412017120100250AAAAA');
- Controller.inventoryEntryNoESetId(list1);
- }
- }
+ Account myAccount2 = new Account(name='Testaccount002',Dealer_discount__c =20,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '9999900');
+ Account myAccount1 = new Account(name='Testaccount001',Dealer_discount__c =30,RecordTypeId = rectCo[0].Id);
+ insert new account[]{myAccount1,myAccount2};
- //鑷姩鍑哄簱
- @isTest
- static void addSaleOrderAuto() {
- // // TO DO: implement unit test
- List<RecordType> rectCo = [
- SELECT Id
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '璨╁2搴�'
- ];
- if (rectCo.size() == 0) {
- return;
- }
- // Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET Email)'];
- Profile prof = [
- SELECT Id
- FROM Profile
- WHERE Name = '901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'
- ];
+ Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount1.id);
+ insert core;
+ user MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com',UserPro_Type__c = 'ET');
+System.runAs(new User(Id = UserInfo.getUserId())){
+ insert MyUser_Test;
+ }
+ // User MyUser_Test = [select id,Contact.accountid from User WHERE ProfileId = :prof.Id and IsActive = true and UserPro_Type__c = 'ET' limit 1 ];
+ // Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ // Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ // insert new Product2[] {prod01,prod02};
+ system.runAs(MyUser_Test){
+ Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ insert new Product2[] {prod01,prod02};
+ Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='Test001',Product2__c = prod01.Id);
+ Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='Test002',Product2__c = prod02.Id);
+ insert new Product2__c[] {pro1, pro2};
+ //璁㈠崟
+ Consumable_order__c Order1 = new Consumable_order__c();
+ Order1.Name = 'OCM_01_001';
+ Order1.Order_status__c = '鎵瑰噯';
+ Order1.Order_type__c = '璁㈠崟';
+ Order1.Dealer_Info__c = myAccount1.id;
+ Order1.RecordTypeid = System.Label.RT_ConOrder_Delivery;
+ Order1.Order_ProType__c = 'ET';
+ insert Order1;
+ //Consumable_order__c coc = [select Dealer_Info__r.name from Consumable_order__c where Id =:Order1.Id];
+ //system.assertEquals('qeee',coc.Dealer_Info__r.name);
- Account myAccount2 = new Account(
- name = 'Testaccount002',
- Dealer_discount__c = 20,
- RecordTypeId = rectCo[0].Id,
- AgentCode_Ext__c = '9999900'
- );
- Account myAccount1 = new Account(
- name = 'Testaccount001',
- Dealer_discount__c = 30,
- RecordTypeId = rectCo[0].Id
- );
- insert new List<account>{ myAccount1, myAccount2 };
+ //璁㈠崟鏄庣粏
+ //fahuo
+ Consumable_orderdetails__c Orderdet = new Consumable_orderdetails__c();
+ Orderdet.Name = 'OCM_01_001001';
+ Orderdet.Consumable_order__c = Order1.Id;
+ Orderdet.RecordTypeId = System.Label.RT_ConOrderDetail1_Order;
+ Orderdet.Consumable_Product__c = pro1.Id;
+ Orderdet.Consumable_count__c = 4;
+ insert Orderdet;
- Contact core = new Contact(
- email = 'jplumber@salesforce.com',
- firstname = 'Joe',
- lastname = 'Plumber',
- accountid = myAccount1.id
- );
- insert core;
- user MyUser_Test = new User(
- ContactId = core.id,
- Alias = 'newUser',
- Email = 'newuser@testorg.com',
- EmailEncodingKey = 'UTF-8',
- LastName = 'TestUser',
- LanguageLocaleKey = 'zh_CN',
- LocaleSidKey = 'zh_CN',
- ProfileId = prof.Id,
- TimeZoneSidKey = 'Asia/Shanghai',
- UserName = 'testUser@testorg.com',
- UserPro_Type__c = 'ET'
- );
- System.runAs(new User(Id = UserInfo.getUserId())) {
- insert MyUser_Test;
- }
- // User MyUser_Test = [select id,Contact.accountid from User WHERE ProfileId = :prof.Id and IsActive = true and UserPro_Type__c = 'ET' limit 1 ];
- // Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false);
- // Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false);
- // insert new Product2[] {prod01,prod02};
- System.runAs(MyUser_Test) {
- Product2 prod01 = new Product2(
- Name = 'Test01',
- ProductCode = 'Test01',
- Asset_Model_No__c = 'Test01',
- SFDA_Status__c = '鏈夊姽',
- JANCODE__c = '04953170200311',
- Dealer_special_Object__c = true,
- Manual_Entry__c = false
- );
- Product2 prod02 = new Product2(
- Name = 'Test02',
- ProductCode = 'Test02',
- Asset_Model_No__c = 'Test02',
- SFDA_Status__c = '鏈夊姽',
- JANCODE__c = '04953170200312',
- Dealer_special_Object__c = true,
- Manual_Entry__c = false
- );
- insert new List<Product2>{ prod01, prod02 };
- Product2__c pro1 = new Product2__c(
- Name = 'Pro001',
- OT_CODE_Text__c = 'Test001',
- Product2__c = prod01.Id
- );
- insert new List<Product2__c>{ pro1 };
- // Account myAccount1 = new Account(name='Testaccount001',Dealer_discount__c =30,RecordTypeId = rectCo[0].Id);
- // insert myAccount1;
- Consumable_order__c Order2 = new Consumable_order__c();
- Order2.Name = 'OCM_02_001';
- Order2.Order_status__c = '鎵瑰噯';
- Order2.Order_type__c = '璁㈠崟';
- Order2.Dealer_Info__c = myAccount1.Id;
- Order2.RecordTypeid = System.Label.RT_ConOrder_Delivery;
- insert Order2;
- //鍙戦敊搴� 宸插埌璐�
- Consumable_order_details2__c Orderdets8 = new Consumable_order_details2__c();
- Orderdets8.Name = 'OCM_01_001011';
- Orderdets8.Consumable_order_minor__c = Order2.Id;
- Orderdets8.Consumable_Product__c = pro1.Id;
- Orderdets8.Asset_Model_No__c = 'Test01';
- Orderdets8.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- Orderdets8.Bar_Code__c = '01049531702003111115120017181000105ZK250BXSYS';
- Orderdets8.Box_Piece__c = '鐩�';
- Orderdets8.Arrive_date__c = Date.today();
- Orderdets8.TracingCode__c = 'BXSYS';
- Orderdets8.SerialLotNo__c = '5ZK';
- insert Orderdets8;
+ //鍙戣揣鏄庣粏
+ //fahuo
+ Consumable_order_details2__c Orderdet1 = new Consumable_order_details2__c();
+ Orderdet1.Name = 'OCM_01_001001';
+ Orderdet1.Consumable_order_minor__c = Order1.Id;
+ Orderdet1.Consumable_Product__c = pro1.Id;
+ Orderdet1.Asset_Model_No__c = 'Pro001';
+ Orderdet1.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
+ Orderdet1.Box_Piece__c ='鐩�';
+ Orderdet1.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRF';
+ //daohuo
+ Consumable_order_details2__c Orderdet2 = new Consumable_order_details2__c();
+ Orderdet2.Name = 'OCM_01_001002';
+ Orderdet2.Consumable_order_minor__c = Order1.Id;
+ Orderdet2.Consumable_Product__c = pro1.Id;
+ Orderdet2.Asset_Model_No__c = 'Pro001';
+ Orderdet2.Consumable_Arrived_order__c = Order1.Id;
+ //Orderdet2.IsArrival__c = true;
+ Orderdet2.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
+ Orderdet2.Box_Piece__c ='鐩�';
+ Orderdet2.Arrive_date__c = Date.today();
+ //Orderdet2.Send_Date__c = Date.today();
+ //Orderdet2.Used_date__c= Date.today();
+ Orderdet2.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRF';
+ //sale
+ Consumable_order_details2__c Orderdet3 = new Consumable_order_details2__c();
+ Orderdet3.Name = 'OCM_01_001003';
+ Orderdet3.Consumable_order_minor__c = Order1.Id;
+ Orderdet3.Consumable_Product__c = pro1.Id;
+ Orderdet3.Asset_Model_No__c = 'Pro001';
+ Orderdet3.Consumable_Arrived_order__c = Order1.Id;
+ //Orderdet3.IsArrival__c = true;
+ Orderdet3.Consumable_Sale_order__c = Order1.Id;
+ Orderdet3.Box_Piece__c ='鐩�';
+ Orderdet3.Used_date__c= Date.today();
+ Orderdet3.Arrive_date__c = Date.today();
+ Orderdet3.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
+ Orderdet3.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRF';
+ Orderdet3.TracingCode__c = 'BXJRF';
+ Orderdet3.SerialLotNo__c = '5ZK';
+ //鍑哄簱
+ Consumable_order_details2__c Orderdet4 = new Consumable_order_details2__c();
+ Orderdet4.Name = 'OCM_01_001004';
+ Orderdet4.Consumable_order_minor__c = Order1.Id;
+ Orderdet4.Consumable_Product__c = pro1.Id;
+ Orderdet4.Asset_Model_No__c = 'Pro001';
+ Orderdet4.Consumable_Arrived_order__c = Order1.Id;
+ //Orderdet4.IsArrival__c = true;
+ Orderdet4.Consumable_Shipment_order__c = Order1.Id;
+ Orderdet4.Box_Piece__c ='涓�';
+ Orderdet4.Send_Date__c = Date.today();
+ Orderdet4.Arrive_date__c = Date.today();
+ Orderdet4.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
+ Orderdet4.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRN';
+ Orderdet4.TracingCode__c = 'BXJRN';
+ Orderdet4.SerialLotNo__c = '5ZK';
+ //quxiao
+ Consumable_order_details2__c Orderdet5 = new Consumable_order_details2__c();
+ Orderdet5.Name = 'OCM_01_001005';
+ Orderdet5.Consumable_order_minor__c = Order1.Id;
+ Orderdet5.Consumable_Product__c = pro1.Id;
+ Orderdet5.Asset_Model_No__c = 'Pro001';
+ Orderdet5.Cancellation_Date__c = Date.today();
+ Orderdet5.Cancellation_Flag__c = true;
+ Orderdet5.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
+ Orderdet5.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRZ';
+ Orderdet5.Box_Piece__c ='涓�';
+ Orderdet5.TracingCode__c = 'BXJRZ';
+ Orderdet5.SerialLotNo__c = '5ZK';
+ insert new Consumable_order_details2__c[] {Orderdet1,Orderdet3,Orderdet4,Orderdet5};
- ArriveGoodsController Controller = new ArriveGoodsController();
- PageReference page = new PageReference('/apex/ArriveGoods?ArrType=Arr');
- System.Test.setCurrentPage(page);
- //鍒濆鍖栨祴璇�
- System.Test.startTest();
- Controller.init();
- //鎺掑簭
- Controller.barcode = '01049531702003111115120017181000105ZK250BXSYS';
- Controller.SearchPro();
- // System.assertEquals(1, controller.consumableInventory.size());
- Controller.ArriveGoodsConfim();
- System.Test.stopTest();
- }
- }
+ PageReference page = new PageReference('/apex/ArriveGoods?ArrType=ReG');
+ System.Test.setCurrentPage(page);
+ ArriveGoodsController Controller = new ArriveGoodsController();
+ //鍒濆鍖栨祴璇�
+ System.Test.startTest();
+ Controller.init();
+ //鎺掑簭
+ Controller.barcode = '01049531702003111115120017181000105ZK250BXJRF\n01049531702003111115120017181000105ZK250BXJRN\n01049531702003111115120017181000105ZK250BXJRZ\n01049531702003111115120017181000105ZK250BXJRR';
+ Controller.SearchPro();
+ System.assertEquals(1, controller.ConsumableorderdetailsRecordserror.size());
+ // System.assertEquals(2, controller.ShowGoodsofReturnList.size());
+ controller.ShowGoodsofReturnList[0].esd.Return_reason__c='澶氬彂';
+ // controller.ShowGoodsofReturnList[1].esd.Return_reason__c='澶氬彂';
+ // controller.ShowGoodsofReturnList[0].esd.Rrturn_count__c =1;
+ Controller.UpdateGoodsOfReturn();
- // UPDATE TCM TEST1
- @isTest
- static void methodTest1() {
- // // TO DO: implement unit test
- List<RecordType> rectCo = [
- SELECT Id
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '璨╁2搴�'
- ];
- if (rectCo.size() == 0) {
- return;
- }
- // Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET Email)'];
- Profile prof = [
- SELECT Id
- FROM Profile
- WHERE Name = '901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'
- ];
+ list<String> list1 = new list<String>();
+ list1.add(Controller.barcode = '01234567898');
+ Controller.inventoryEntryNoESetId(list1);
- Account myAccount2 = new Account(
- name = 'Testaccount002',
- Dealer_discount__c = 20,
- RecordTypeId = rectCo[0].Id,
- AgentCode_Ext__c = '9999900'
- );
- Account myAccount1 = new Account(
- name = 'Testaccount001',
- Dealer_discount__c = 30,
- RecordTypeId = rectCo[0].Id
- );
- insert new List<account>{ myAccount1, myAccount2 };
+ list1.clear();
+ list1.add(Controller.barcode = '012345678901234A67');
+ Controller.inventoryEntryNoESetId(list1);
- Contact core = new Contact(
- email = 'jplumber@salesforce.com',
- firstname = 'Joe',
- lastname = 'Plumber',
- accountid = myAccount1.id
- );
- insert core;
- user MyUser_Test = new User(
- ContactId = core.id,
- Alias = 'newUser',
- Email = 'newuser@testorg.com',
- EmailEncodingKey = 'UTF-8',
- LastName = 'TestUser',
- LanguageLocaleKey = 'zh_CN',
- LocaleSidKey = 'zh_CN',
- ProfileId = prof.Id,
- TimeZoneSidKey = 'Asia/Shanghai',
- UserName = 'testUser@testorg.com',
- UserPro_Type__c = 'ET'
- );
- System.runAs(new User(Id = UserInfo.getUserId())) {
- insert MyUser_Test;
- }
- // User MyUser_Test = [select id,Contact.accountid from User WHERE ProfileId = :prof.Id and IsActive = true and UserPro_Type__c = 'ET' limit 1 ];
- // Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false);
- // Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false);
- // insert new Product2[] {prod01,prod02};
- System.runAs(MyUser_Test) {
- Product2 prod01 = new Product2(
- Name = 'Test01',
- ProductCode = 'Test01',
- Asset_Model_No__c = 'Test01',
- SFDA_Status__c = '鏈夊姽',
- JANCODE__c = '04953170200311',
- Dealer_special_Object__c = true,
- Manual_Entry__c = false
- );
- Product2 prod02 = new Product2(
- Name = 'Test02',
- ProductCode = 'Test02',
- Asset_Model_No__c = 'Test02',
- SFDA_Status__c = '鏈夊姽',
- JANCODE__c = '04953170200312',
- Dealer_special_Object__c = true,
- Manual_Entry__c = false
- );
- insert new List<Product2>{ prod01, prod02 };
- Product2__c pro1 = new Product2__c(
- Name = 'Pro001',
- OT_CODE_Text__c = 'N3047730',
- Product2__c = prod01.Id
- );
- Product2__c pro2 = new Product2__c(
- Name = 'Pro002',
- OT_CODE_Text__c = 'N3047731',
- Product2__c = prod02.Id
- );
- insert new List<Product2__c>{ pro1, pro2 };
- //璁㈠崟
+ list1.clear();
+ list1.add(Controller.barcode = '0123456789012345117AA01');
+ Controller.inventoryEntryNoESetId(list1);
- Consumable_order__c Order1 = new Consumable_order__c();
- Order1.Name = 'OCM_01_001';
- Order1.Order_status__c = '鎵瑰噯';
- Order1.Order_type__c = '璁㈠崟';
- Order1.Dealer_Info__c = myAccount1.id;
- Order1.RecordTypeid = System.Label.RT_ConOrder_Delivery;
- Order1.Order_ProType__c = 'ET';
- insert Order1;
+ list1.clear();
+ list1.add(Controller.barcode = '01234567890123456789012349990001');
+ Controller.inventoryEntryNoESetId(list1);
- //璁㈠崟鏄庣粏
- //fahuo
- Consumable_orderdetails__c Orderdet = new Consumable_orderdetails__c();
- Orderdet.Name = 'OCM_01_00101';
- Orderdet.Consumable_order__c = Order1.Id;
- Orderdet.RecordTypeId = System.Label.RT_ConOrderDetail1_Order;
- Orderdet.Consumable_Product__c = pro1.Id;
- Orderdet.Consumable_count__c = 4;
- insert Orderdet;
+ list1.clear();
+ list1.add(Controller.barcode = '0123456789012345177AA0000000000001');
+ Controller.inventoryEntryNoESetId(list1);
- //鍙戣揣鏄庣粏
- //fahuo
- Consumable_order_details2__c Orderdet1 = new Consumable_order_details2__c();
- Orderdet1.Name = 'OCM_01_001001';
- Orderdet1.Consumable_order_minor__c = Order1.Id;
- Orderdet1.Consumable_Product__c = pro1.Id;
- Orderdet1.Asset_Model_No__c = 'Test01';
- Orderdet1.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- Orderdet1.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRF';
- Orderdet1.Arrive_date__c = Date.today();
- // Orderdet1.Send_Date__c=Date.today();
- // Orderdet1.Used_date__c=Date.today();
- Orderdet1.TracingCode__c = 'BXJRF';
- Orderdet1.SerialLotNo__c = '5ZK';
- insert Orderdet1;
+ list1.clear();
+ list1.add(Controller.barcode = '0123456789012345177AA1111111111111');
+ Controller.inventoryEntryNoESetId(list1);
- //fahuo
- Consumable_order_details2__c Orderdet2 = new Consumable_order_details2__c();
- Orderdet2.Name = 'OCM_01_001001';
- Orderdet2.Consumable_order_minor__c = Order1.Id;
- Orderdet2.Consumable_Product__c = pro1.Id;
- Orderdet2.Asset_Model_No__c = 'Test01';
- Orderdet2.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- Orderdet2.Bar_Code__c = '01049531702003111115120017181234105ZK250BXJRF';
- Orderdet2.Arrive_date__c = Date.today();
- Orderdet2.TracingCode__c = 'BXJRF';
- Orderdet2.SerialLotNo__c = '5ZK';
- insert Orderdet2;
+ list1.clear();
+ list1.add(Controller.barcode = '241345');
+ Controller.inventoryEntryNoESetId(list1);
- PageReference page = new PageReference(
- '/apex/ArriveGoods?ESetid=' + Order1.Id
- );
- System.Test.setCurrentPage(page);
- ArriveGoodsController Controller = new ArriveGoodsController();
- //鍒濆鍖栨祴璇�
- System.Test.startTest();
- Controller.init();
- Controller.barcode = '01049531702003111115120017181000105ZK250BXJRF';
- Controller.SearchPro();
- // System.assertEquals(1, Controller.ConsumableorderdetailsRecords.size());
- // System.assertEquals(2, Controller.consumableInventory.size());
- Controller.ArriveGoodsConfim();
- List<Consumable_order_details2__c> ins = [
- SELECT Id, Name
- FROM Consumable_order_details2__c
- ];
- // System.assertEquals(3, ins.size());
- System.Test.stopTest();
- }
- }
+ list1.clear();
+ list1.add(Controller.barcode = '2413456');
+ Controller.inventoryEntryNoESetId(list1);
- //杩斿搧
- @isTest
- static void methodTest2() {
- // // TO DO: implement unit test
- List<RecordType> rectCo = [
- SELECT Id
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '璨╁2搴�'
- ];
- if (rectCo.size() == 0) {
- return;
- }
- // Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET Email)'];
- Profile prof = [
- SELECT Id
- FROM Profile
- WHERE Name = '901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'
- ];
+ list1.clear();
+ list1.add(Controller.barcode = '24134567');
+ Controller.inventoryEntryNoESetId(list1);
- Account myAccount2 = new Account(
- name = 'Testaccount002',
- Dealer_discount__c = 20,
- RecordTypeId = rectCo[0].Id,
- AgentCode_Ext__c = '9999900'
- );
- Account myAccount1 = new Account(
- name = 'Testaccount001',
- Dealer_discount__c = 30,
- RecordTypeId = rectCo[0].Id
- );
- insert new List<account>{ myAccount1, myAccount2 };
+ list1.clear();
+ list1.add(Controller.barcode = '241345678');
+ Controller.inventoryEntryNoESetId(list1);
- Contact core = new Contact(
- email = 'jplumber@salesforce.com',
- firstname = 'Joe',
- lastname = 'Plumber',
- accountid = myAccount1.id
- );
- insert core;
- user MyUser_Test = new User(
- ContactId = core.id,
- Alias = 'newUser',
- Email = 'newuser@testorg.com',
- EmailEncodingKey = 'UTF-8',
- LastName = 'TestUser',
- LanguageLocaleKey = 'zh_CN',
- LocaleSidKey = 'zh_CN',
- ProfileId = prof.Id,
- TimeZoneSidKey = 'Asia/Shanghai',
- UserName = 'testUser@testorg.com',
- UserPro_Type__c = 'ET'
- );
- System.runAs(new User(Id = UserInfo.getUserId())) {
- insert MyUser_Test;
- }
- // User MyUser_Test = [select id,Contact.accountid from User WHERE ProfileId = :prof.Id and IsActive = true and UserPro_Type__c = 'ET' limit 1 ];
- // Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false);
- // Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false);
- // insert new Product2[] {prod01,prod02};
- System.runAs(MyUser_Test) {
- Product2 prod01 = new Product2(
- Name = 'Test01',
- ProductCode = 'Test01',
- Asset_Model_No__c = 'Test01',
- SFDA_Status__c = '鏈夊姽',
- JANCODE__c = '04953170200311',
- Dealer_special_Object__c = true,
- Manual_Entry__c = false
- );
- Product2 prod02 = new Product2(
- Name = 'Test02',
- ProductCode = 'Test02',
- Asset_Model_No__c = 'Test02',
- SFDA_Status__c = '鏈夊姽',
- JANCODE__c = '04953170200312',
- Dealer_special_Object__c = true,
- Manual_Entry__c = false
- );
- insert new List<Product2>{ prod01, prod02 };
- Product2__c pro1 = new Product2__c(
- Name = 'Pro001',
- OT_CODE_Text__c = 'Test001',
- Product2__c = prod01.Id
- );
- Product2__c pro2 = new Product2__c(
- Name = 'Pro002',
- OT_CODE_Text__c = 'Test002',
- Product2__c = prod02.Id
- );
- insert new List<Product2__c>{ pro1, pro2 };
- //璁㈠崟
- Consumable_order__c Order1 = new Consumable_order__c();
- Order1.Name = 'OCM_01_001';
- Order1.Order_status__c = '鎵瑰噯';
- Order1.Order_type__c = '璁㈠崟';
- Order1.Dealer_Info__c = myAccount1.id;
- Order1.RecordTypeid = System.Label.RT_ConOrder_Delivery;
- Order1.Order_ProType__c = 'ET';
- insert Order1;
- //Consumable_order__c coc = [select Dealer_Info__r.name from Consumable_order__c where Id =:Order1.Id];
- //system.assertEquals('qeee',coc.Dealer_Info__r.name);
+ list1.clear();
+ list1.add(Controller.barcode = '2413456789');
+ Controller.inventoryEntryNoESetId(list1);
- //璁㈠崟鏄庣粏
- //fahuo
- Consumable_orderdetails__c Orderdet = new Consumable_orderdetails__c();
- Orderdet.Name = 'OCM_01_001001';
- Orderdet.Consumable_order__c = Order1.Id;
- Orderdet.RecordTypeId = System.Label.RT_ConOrderDetail1_Order;
- Orderdet.Consumable_Product__c = pro1.Id;
- Orderdet.Consumable_count__c = 4;
- insert Orderdet;
+ list1.clear();
+ list1.add(Controller.barcode = '24134567890');
+ Controller.inventoryEntryNoESetId(list1);
- //鍙戣揣鏄庣粏
- //fahuo
- Consumable_order_details2__c Orderdet1 = new Consumable_order_details2__c();
- Orderdet1.Name = 'OCM_01_001001';
- Orderdet1.Consumable_order_minor__c = Order1.Id;
- Orderdet1.Consumable_Product__c = pro1.Id;
- Orderdet1.Asset_Model_No__c = 'Pro001';
- Orderdet1.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- Orderdet1.Box_Piece__c = '鐩�';
- Orderdet1.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRF';
- //daohuo
- Consumable_order_details2__c Orderdet2 = new Consumable_order_details2__c();
- Orderdet2.Name = 'OCM_01_001002';
- Orderdet2.Consumable_order_minor__c = Order1.Id;
- Orderdet2.Consumable_Product__c = pro1.Id;
- Orderdet2.Asset_Model_No__c = 'Pro001';
- Orderdet2.Consumable_Arrived_order__c = Order1.Id;
- //Orderdet2.IsArrival__c = true;
- Orderdet2.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- Orderdet2.Box_Piece__c = '鐩�';
- Orderdet2.Arrive_date__c = Date.today();
- //Orderdet2.Send_Date__c = Date.today();
- //Orderdet2.Used_date__c= Date.today();
- Orderdet2.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRF';
- //sale
- Consumable_order_details2__c Orderdet3 = new Consumable_order_details2__c();
- Orderdet3.Name = 'OCM_01_001003';
- Orderdet3.Consumable_order_minor__c = Order1.Id;
- Orderdet3.Consumable_Product__c = pro1.Id;
- Orderdet3.Asset_Model_No__c = 'Pro001';
- Orderdet3.Consumable_Arrived_order__c = Order1.Id;
- //Orderdet3.IsArrival__c = true;
- Orderdet3.Consumable_Sale_order__c = Order1.Id;
- Orderdet3.Box_Piece__c = '鐩�';
- Orderdet3.Used_date__c = Date.today();
- Orderdet3.Arrive_date__c = Date.today();
- Orderdet3.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- Orderdet3.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRF';
- Orderdet3.TracingCode__c = 'BXJRF';
- Orderdet3.SerialLotNo__c = '5ZK';
- //鍑哄簱
- Consumable_order_details2__c Orderdet4 = new Consumable_order_details2__c();
- Orderdet4.Name = 'OCM_01_001004';
- Orderdet4.Consumable_order_minor__c = Order1.Id;
- Orderdet4.Consumable_Product__c = pro1.Id;
- Orderdet4.Asset_Model_No__c = 'Pro001';
- Orderdet4.Consumable_Arrived_order__c = Order1.Id;
- //Orderdet4.IsArrival__c = true;
- Orderdet4.Consumable_Shipment_order__c = Order1.Id;
- Orderdet4.Box_Piece__c = '涓�';
- Orderdet4.Send_Date__c = Date.today();
- Orderdet4.Arrive_date__c = Date.today();
- Orderdet4.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- Orderdet4.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRN';
- Orderdet4.TracingCode__c = 'BXJRN';
- Orderdet4.SerialLotNo__c = '5ZK';
- //quxiao
- Consumable_order_details2__c Orderdet5 = new Consumable_order_details2__c();
- Orderdet5.Name = 'OCM_01_001005';
- Orderdet5.Consumable_order_minor__c = Order1.Id;
- Orderdet5.Consumable_Product__c = pro1.Id;
- Orderdet5.Asset_Model_No__c = 'Pro001';
- Orderdet5.Cancellation_Date__c = Date.today();
- Orderdet5.Cancellation_Flag__c = true;
- Orderdet5.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- Orderdet5.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRZ';
- Orderdet5.Box_Piece__c = '涓�';
- Orderdet5.TracingCode__c = 'BXJRZ';
- Orderdet5.SerialLotNo__c = '5ZK';
- insert new List<Consumable_order_details2__c>{
- Orderdet1,
- Orderdet3,
- Orderdet4,
- Orderdet5
- };
+ list1.clear();
+ list1.add(Controller.barcode = '241345678901');
+ Controller.inventoryEntryNoESetId(list1);
- PageReference page = new PageReference('/apex/ArriveGoods?ArrType=ReG');
- System.Test.setCurrentPage(page);
- ArriveGoodsController Controller = new ArriveGoodsController();
- //鍒濆鍖栨祴璇�
- System.Test.startTest();
- Controller.init();
- //鎺掑簭
- Controller.barcode = '01049531702003111115120017181000105ZK250BXJRF\n01049531702003111115120017181000105ZK250BXJRN\n01049531702003111115120017181000105ZK250BXJRZ\n01049531702003111115120017181000105ZK250BXJRR';
- Controller.SearchPro();
- System.assertEquals(
- 1,
- controller.ConsumableorderdetailsRecordserror.size()
- );
- // System.assertEquals(2, controller.ShowGoodsofReturnList.size());
- controller.ShowGoodsofReturnList[0].esd.Return_reason__c = '澶氬彂';
- // controller.ShowGoodsofReturnList[1].esd.Return_reason__c='澶氬彂';
- // controller.ShowGoodsofReturnList[0].esd.Rrturn_count__c =1;
- Controller.UpdateGoodsOfReturn();
+ list1.clear();
+ list1.add(Controller.barcode = '0112345678901231177890121215678901234');
+ Controller.inventoryEntryNoESetId(list1);
- list<String> list1 = new List<String>();
- list1.add(Controller.barcode = '01234567898');
- Controller.inventoryEntryNoESetId(list1);
+ list1.clear();
+ list1.add(Controller.barcode = '0112345678901231106789012105678901234');
+ Controller.inventoryEntryNoESetId(list1);
+ list1.clear();
+ list1.add(Controller.barcode = '0112345678901231106789012105625001234');
+ Controller.inventoryEntryNoESetId(list1);
+ System.Test.stopTest();
- list1.clear();
- list1.add(Controller.barcode = '012345678901234A67');
- Controller.inventoryEntryNoESetId(list1);
+ }
+ }
- list1.clear();
- list1.add(Controller.barcode = '0123456789012345117AA01');
- Controller.inventoryEntryNoESetId(list1);
+ //鏁翠綋鍒拌揣
+ @isTest
+ static void ArrivejancodeTest() {
+ // // TO DO: implement unit test
+ List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '璨╁2搴�'];
+ if (rectCo.size() == 0) {
+ return;
+ }
+ // Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET Email)'];
+ Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'];
- list1.clear();
- list1.add(Controller.barcode = '01234567890123456789012349990001');
- Controller.inventoryEntryNoESetId(list1);
+ Oly_TriggerHandler.bypass('ConsumableAssetHander');
+ Account myAccount2 = new Account(name='Testaccount002',Dealer_discount__c =20,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '9999900');
+ Account myAccount1 = new Account(name='Testaccount001',Dealer_discount__c =30,RecordTypeId = rectCo[0].Id);
+ insert new account[]{myAccount1,myAccount2};
+ Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount1.id);
+ insert core;
+ user MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com',UserPro_Type__c = 'ET');
+ System.runAs(new User(Id = UserInfo.getUserId())){
+ insert MyUser_Test;
+ }
- list1.clear();
- list1.add(Controller.barcode = '0123456789012345177AA0000000000001');
- Controller.inventoryEntryNoESetId(list1);
+ // User MyUser_Test = [select id,Contact.accountid from User WHERE ProfileId = :prof.Id and IsActive = true and UserPro_Type__c = 'ET' limit 1 ];
+ // Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ // Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ // insert new Product2[] {prod01,prod02};
+ system.runAs(MyUser_Test){
+ Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ insert new Product2[] {prod01,prod02};
+ Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='Test001',Product2__c = prod01.Id);
+ insert new Product2__c[] {pro1};
+ // Account myAccount1 = new Account(name='Testaccount001',Dealer_discount__c =30,RecordTypeId = rectCo[0].Id);
+ // insert myAccount1;
+ Consumable_order__c Order2 = new Consumable_order__c();
+ Order2.Name = 'OCM_02_001';
+ Order2.Order_status__c = '鎵瑰噯';
+ Order2.Order_type__c = '璁㈠崟';
+ Order2.Dealer_Info__c = myAccount1.Id;
+ Order2.RecordTypeid = System.Label.RT_ConOrder_Delivery;
+ insert Order2;
+ //鍙戦敊搴� 鏈埌璐�
+ Consumable_order_details2__c Orderdets8 = new Consumable_order_details2__c();
+ Orderdets8.Name = 'OCM_01_001011';
+ Orderdets8.Consumable_order_minor__c = Order2.Id;
+ Orderdets8.Consumable_Product__c = pro1.Id;
+ Orderdets8.Asset_Model_No__c = 'Test01';
+ Orderdets8.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
+ Orderdets8.Bar_Code__c = '01049531702003111115120017181000105ZK250BXsys';
+ Orderdets8.Box_Piece__c = '鐩�';
+ Orderdets8.TracingCode__c = 'BXsys';
+ Orderdets8.SerialLotNo__c = '5ZK';
+ insert Orderdets8;
- list1.clear();
- list1.add(Controller.barcode = '0123456789012345177AA1111111111111');
- Controller.inventoryEntryNoESetId(list1);
+ Consumable_order__c Order1 = new Consumable_order__c();
+ Order1.Name = 'OCM_01_001';
+ Order1.Order_status__c = '鎵瑰噯';
+ Order1.Order_type__c = '璁㈠崟';
+ Order1.Dealer_Info__c = myAccount1.id;
+ Order1.Order_ProType__c = 'ET';
+ Order1.RecordTypeid = System.Label.RT_ConOrder_Delivery;
+ insert Order1;
+ //璁㈠崟鏄庣粏
+ //fahuo
+ Consumable_orderdetails__c Orderdet = new Consumable_orderdetails__c();
+ Orderdet.Name = 'OCM_01_00101';
+ Orderdet.Consumable_order__c = Order1.Id;
+ Orderdet.RecordTypeId = System.Label.RT_ConOrderDetail1_Order;
+ Orderdet.Consumable_Product__c = pro1.Id;
+ Orderdet.Consumable_count__c = 4;
+ insert Orderdet;
- list1.clear();
- list1.add(Controller.barcode = '241345');
- Controller.inventoryEntryNoESetId(list1);
+ //鍒拌揣姝g‘淇℃伅
+ Consumable_order_details2__c Orderdet1 = new Consumable_order_details2__c();
+ Orderdet1.Name = 'OCM_01_001002';
+ Orderdet1.Consumable_order_minor__c = Order1.Id;
+ Orderdet1.Consumable_Product__c = pro1.Id;
+ Orderdet1.Asset_Model_No__c = 'Test01';
+ Orderdet1.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
+ Orderdet1.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRA';
+ Orderdet1.Box_Piece__c = '鐩�';
+ Orderdet1.TracingCode__c = 'BXJRA';
+ Orderdet1.SerialLotNo__c = '5ZK';
+ //娌″埌璐�
+ Consumable_order_details2__c Orderdet2 = new Consumable_order_details2__c();
+ Orderdet2.Name = 'OCM_01_001003';
+ Orderdet2.Consumable_order_minor__c = Order1.Id;
+ Orderdet2.Consumable_Product__c = pro1.Id;
+ Orderdet2.Asset_Model_No__c = 'Test01';
+ Orderdet2.Consumable_Arrived_order__c = Order1.Id;
+ Orderdet2.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
+ Orderdet2.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRB';
+ Orderdet2.Box_Piece__c = '鐩�';
+ Orderdet2.TracingCode__c = 'BXJRB';
+ Orderdet2.SerialLotNo__c = '5ZK';
+ //閿�鍞骇鍝�
+ Consumable_order_details2__c Orderdet3 = new Consumable_order_details2__c();
+ Orderdet3.Name = 'OCM_01_001004';
+ Orderdet3.Consumable_order_minor__c = Order1.Id;
+ Orderdet3.Consumable_Product__c = pro1.Id;
+ Orderdet3.Asset_Model_No__c = 'Test01';
+ Orderdet3.Consumable_Arrived_order__c = Order1.Id;
+ //Orderdet3.IsArrival__c = true;
+ Orderdet3.Consumable_Sale_order__c = Order1.Id;
+ Orderdet3.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
+ Orderdet3.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRC';
+ Orderdet3.Used_date__c = Date.today();
+ Orderdet3.Arrive_date__c = Date.today();
+ Orderdet3.Box_Piece__c = '鐩�';
+ Orderdet3.TracingCode__c = 'BXJRC';
+ Orderdet3.SerialLotNo__c = '5ZK';
+ //Orderdet3.Box_Piece__c = '涓�';
- list1.clear();
- list1.add(Controller.barcode = '2413456');
- Controller.inventoryEntryNoESetId(list1);
- list1.clear();
- list1.add(Controller.barcode = '24134567');
- Controller.inventoryEntryNoESetId(list1);
+ //鍑哄簱浜у搧
+ Consumable_order_details2__c Orderdet4 = new Consumable_order_details2__c();
+ Orderdet4.Name = 'OCM_01_001005';
+ Orderdet4.Consumable_order_minor__c = Order1.Id;
+ Orderdet4.Consumable_Product__c = pro1.Id;
+ Orderdet4.Asset_Model_No__c = 'Test01';
+ Orderdet4.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
+ Orderdet4.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRD';
+ Orderdet4.Send_Date__c = Date.today();
+ Orderdet4.Arrive_date__c = Date.today();
+ Orderdet4.Box_Piece__c = '鐩�';
+ Orderdet4.TracingCode__c = 'BXJRD';
+ Orderdet4.SerialLotNo__c = '5ZK';
+ //Orderdet4.Box_Piece__c = '鐩�';
+ //Orderdet4.Return_date__c = null;
- list1.clear();
- list1.add(Controller.barcode = '241345678');
- Controller.inventoryEntryNoESetId(list1);
+ //宸插埌璐т骇鍝�
+ Consumable_order_details2__c Orderdet5 = new Consumable_order_details2__c();
+ Orderdet5.Name = 'OCM_01_001006';
+ Orderdet5.Consumable_order_minor__c = Order1.Id;
+ Orderdet5.Consumable_Product__c = pro1.Id;
+ Orderdet5.Asset_Model_No__c = 'Test01';
+ Orderdet5.Consumable_Arrived_order__c = Order1.Id;
+ Orderdet5.Consumable_Shipment_order__c = Order1.Id;
+ Orderdet5.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
+ Orderdet5.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRE';
+ Orderdet5.Arrive_date__c = Date.today();
+ Orderdet5.Box_Piece__c = '鐩�';
+ Orderdet5.TracingCode__c = 'BXJRE';
+ Orderdet5.SerialLotNo__c = '5ZK';
+ insert new Consumable_order_details2__c[] {Orderdet1, Orderdet2,Orderdet3,Orderdet4,Orderdet5};
- list1.clear();
- list1.add(Controller.barcode = '2413456789');
- Controller.inventoryEntryNoESetId(list1);
- list1.clear();
- list1.add(Controller.barcode = '24134567890');
- Controller.inventoryEntryNoESetId(list1);
- list1.clear();
- list1.add(Controller.barcode = '241345678901');
- Controller.inventoryEntryNoESetId(list1);
+ ArriveGoodsController Controller = new ArriveGoodsController();
+ PageReference page = new PageReference('/apex/ArriveGoods?ArrType=Arr');
+ System.Test.setCurrentPage(page);
+ //鍒濆鍖栨祴璇�
+ System.Test.startTest();
+ Controller.init();
+ //鎺掑簭
+ Controller.barcode = '01049531702003111115120017181000105ZK250BXJRA\n01049531702003111115120017181000105ZK250BXJRB\n01049531702003111115120017181000105ZK250BXJRC\n01049531702003111115120017181000105ZK250BXJRD\n01049531702003111115120017181000105ZK250BXJRE\n01049531702003111115120017181000105ZK250BX111\n01049531702003111115120017181000105ZK250BXJRF\n01049531702003111115120017181000105ZK250BXJRG\n01049531702003111115120017181000105ZK250BXsys';
+ Controller.SearchPro();
- list1.clear();
- list1.add(Controller.barcode = '0112345678901231177890121215678901234');
- Controller.inventoryEntryNoESetId(list1);
+ System.assertEquals('OCM_01_001002', controller.ConsumableorderdetailsRecords[0].esd.Name);
+ // System.assertEquals(2, controller.ConsumableorderdetailsRecordserror.size());
+ System.Test.stopTest();
- list1.clear();
- list1.add(Controller.barcode = '0112345678901231106789012105678901234');
- Controller.inventoryEntryNoESetId(list1);
- list1.clear();
- list1.add(Controller.barcode = '0112345678901231106789012105625001234');
- Controller.inventoryEntryNoESetId(list1);
- System.Test.stopTest();
- }
- }
- //鏁翠綋鍒拌揣
- @isTest
- static void ArrivejancodeTest() {
- // // TO DO: implement unit test
- List<RecordType> rectCo = [
- SELECT Id
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '璨╁2搴�'
- ];
- if (rectCo.size() == 0) {
- return;
- }
- // Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET Email)'];
- Profile prof = [
- SELECT Id
- FROM Profile
- WHERE Name = '901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'
- ];
+ }
+ }
- Oly_TriggerHandler.bypass('ConsumableAssetHander');
- Account myAccount2 = new Account(
- name = 'Testaccount002',
- Dealer_discount__c = 20,
- RecordTypeId = rectCo[0].Id,
- AgentCode_Ext__c = '9999900'
- );
- Account myAccount1 = new Account(
- name = 'Testaccount001',
- Dealer_discount__c = 30,
- RecordTypeId = rectCo[0].Id
- );
- insert new List<account>{ myAccount1, myAccount2 };
- Contact core = new Contact(
- email = 'jplumber@salesforce.com',
- firstname = 'Joe',
- lastname = 'Plumber',
- accountid = myAccount1.id
- );
- insert core;
- user MyUser_Test = new User(
- ContactId = core.id,
- Alias = 'newUser',
- Email = 'newuser@testorg.com',
- EmailEncodingKey = 'UTF-8',
- LastName = 'TestUser',
- LanguageLocaleKey = 'zh_CN',
- LocaleSidKey = 'zh_CN',
- ProfileId = prof.Id,
- TimeZoneSidKey = 'Asia/Shanghai',
- UserName = 'testUser@testorg.com',
- UserPro_Type__c = 'ET'
- );
- System.runAs(new User(Id = UserInfo.getUserId())) {
- insert MyUser_Test;
- }
+ //鍙戦敊璐� 鍏ュ簱
+ @isTest
+ static void ArriveotheragencyTest() {
+ // // TO DO: implement unit test
+ List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '璨╁2搴�'];
+ if (rectCo.size() == 0) {
+ return;
+ }
+ // Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET Email)'];
+ Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'];
- // User MyUser_Test = [select id,Contact.accountid from User WHERE ProfileId = :prof.Id and IsActive = true and UserPro_Type__c = 'ET' limit 1 ];
- // Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false);
- // Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false);
- // insert new Product2[] {prod01,prod02};
- System.runAs(MyUser_Test) {
- Product2 prod01 = new Product2(
- Name = 'Test01',
- ProductCode = 'Test01',
- Asset_Model_No__c = 'Test01',
- SFDA_Status__c = '鏈夊姽',
- JANCODE__c = '04953170200311',
- Dealer_special_Object__c = true,
- Manual_Entry__c = false
- );
- Product2 prod02 = new Product2(
- Name = 'Test02',
- ProductCode = 'Test02',
- Asset_Model_No__c = 'Test02',
- SFDA_Status__c = '鏈夊姽',
- JANCODE__c = '04953170200312',
- Dealer_special_Object__c = true,
- Manual_Entry__c = false
- );
- insert new List<Product2>{ prod01, prod02 };
- Product2__c pro1 = new Product2__c(
- Name = 'Pro001',
- OT_CODE_Text__c = 'Test001',
- Product2__c = prod01.Id
- );
- insert new List<Product2__c>{ pro1 };
- // Account myAccount1 = new Account(name='Testaccount001',Dealer_discount__c =30,RecordTypeId = rectCo[0].Id);
- // insert myAccount1;
- Consumable_order__c Order2 = new Consumable_order__c();
- Order2.Name = 'OCM_02_001';
- Order2.Order_status__c = '鎵瑰噯';
- Order2.Order_type__c = '璁㈠崟';
- Order2.Dealer_Info__c = myAccount1.Id;
- Order2.RecordTypeid = System.Label.RT_ConOrder_Delivery;
- insert Order2;
- //鍙戦敊搴� 鏈埌璐�
- Consumable_order_details2__c Orderdets8 = new Consumable_order_details2__c();
- Orderdets8.Name = 'OCM_01_001011';
- Orderdets8.Consumable_order_minor__c = Order2.Id;
- Orderdets8.Consumable_Product__c = pro1.Id;
- Orderdets8.Asset_Model_No__c = 'Test01';
- Orderdets8.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- Orderdets8.Bar_Code__c = '01049531702003111115120017181000105ZK250BXsys';
- Orderdets8.Box_Piece__c = '鐩�';
- Orderdets8.TracingCode__c = 'BXsys';
- Orderdets8.SerialLotNo__c = '5ZK';
- insert Orderdets8;
+ Oly_TriggerHandler.bypass('ConsumableAssetHander');
+ Account myAccount2 = new Account(name='Testaccount002',Dealer_discount__c =20,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '9999900');
+ Account myAccount1 = new Account(name='Testaccount001',Dealer_discount__c =30,RecordTypeId = rectCo[0].Id);
+ insert new account[]{myAccount1,myAccount2};
+ Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount1.id);
+ insert core;
+ user MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com',UserPro_Type__c = 'ET');
+ System.runAs(new User(Id = UserInfo.getUserId())){
+ insert MyUser_Test;
+ }
- Consumable_order__c Order1 = new Consumable_order__c();
- Order1.Name = 'OCM_01_001';
- Order1.Order_status__c = '鎵瑰噯';
- Order1.Order_type__c = '璁㈠崟';
- Order1.Dealer_Info__c = myAccount1.id;
- Order1.Order_ProType__c = 'ET';
- Order1.RecordTypeid = System.Label.RT_ConOrder_Delivery;
- insert Order1;
- //璁㈠崟鏄庣粏
- //fahuo
- Consumable_orderdetails__c Orderdet = new Consumable_orderdetails__c();
- Orderdet.Name = 'OCM_01_00101';
- Orderdet.Consumable_order__c = Order1.Id;
- Orderdet.RecordTypeId = System.Label.RT_ConOrderDetail1_Order;
- Orderdet.Consumable_Product__c = pro1.Id;
- Orderdet.Consumable_count__c = 4;
- insert Orderdet;
+ // User MyUser_Test = [select id,Contact.accountid from User WHERE ProfileId = :prof.Id and IsActive = true and UserPro_Type__c = 'ET' limit 1 ];
+ // Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ // Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ // insert new Product2[] {prod01,prod02};
+ system.runAs(MyUser_Test){
+ Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ insert new Product2[] {prod01,prod02};
+ Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='Test001',Product2__c = prod01.Id);
+ insert new Product2__c[] {pro1};
+ Account myAccount3 = new Account(name='Testaccount003',Dealer_discount__c =30,RecordTypeId = rectCo[0].Id);
+ insert myAccount3;
+ Consumable_order__c Order2 = new Consumable_order__c();
+ Order2.Name = 'OCM_02_001';
+ Order2.Order_status__c = '鎵瑰噯';
+ Order2.Order_type__c = '璁㈠崟';
+ Order2.Dealer_Info__c = myAccount3.Id;
+ Order2.RecordTypeid = System.Label.RT_ConOrder_Delivery;
+ Order2.Order_ProType__c = 'ET';
+ insert Order2;
+ //鍙戦敊搴� 鏈埌璐�
+ Consumable_order_details2__c Orderdets8 = new Consumable_order_details2__c();
+ Orderdets8.Name = 'OCM_01_001011';
+ Orderdets8.Consumable_order_minor__c = Order2.Id;
+ Orderdets8.Consumable_Product__c = pro1.Id;
+ Orderdets8.Asset_Model_No__c = 'Test01';
+ Orderdets8.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
+ Orderdets8.Bar_Code__c = '01049531702003111115120017181000105ZK250BXSYS';
+ Orderdets8.Box_Piece__c = '鐩�';
+ Orderdets8.TracingCode__c = 'BXSYS';
+ Orderdets8.SerialLotNo__c = '5ZK';
+ Orderdets8.ownerid = MyUser_Test.id;
+ insert Orderdets8;
- //鍒拌揣姝g‘淇℃伅
- Consumable_order_details2__c Orderdet1 = new Consumable_order_details2__c();
- Orderdet1.Name = 'OCM_01_001002';
- Orderdet1.Consumable_order_minor__c = Order1.Id;
- Orderdet1.Consumable_Product__c = pro1.Id;
- Orderdet1.Asset_Model_No__c = 'Test01';
- Orderdet1.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- Orderdet1.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRA';
- Orderdet1.Box_Piece__c = '鐩�';
- Orderdet1.TracingCode__c = 'BXJRA';
- Orderdet1.SerialLotNo__c = '5ZK';
- //娌″埌璐�
- Consumable_order_details2__c Orderdet2 = new Consumable_order_details2__c();
- Orderdet2.Name = 'OCM_01_001003';
- Orderdet2.Consumable_order_minor__c = Order1.Id;
- Orderdet2.Consumable_Product__c = pro1.Id;
- Orderdet2.Asset_Model_No__c = 'Test01';
- Orderdet2.Consumable_Arrived_order__c = Order1.Id;
- Orderdet2.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- Orderdet2.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRB';
- Orderdet2.Box_Piece__c = '鐩�';
- Orderdet2.TracingCode__c = 'BXJRB';
- Orderdet2.SerialLotNo__c = '5ZK';
- //閿�鍞骇鍝�
- Consumable_order_details2__c Orderdet3 = new Consumable_order_details2__c();
- Orderdet3.Name = 'OCM_01_001004';
- Orderdet3.Consumable_order_minor__c = Order1.Id;
- Orderdet3.Consumable_Product__c = pro1.Id;
- Orderdet3.Asset_Model_No__c = 'Test01';
- Orderdet3.Consumable_Arrived_order__c = Order1.Id;
- //Orderdet3.IsArrival__c = true;
- Orderdet3.Consumable_Sale_order__c = Order1.Id;
- Orderdet3.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- Orderdet3.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRC';
- Orderdet3.Used_date__c = Date.today();
- Orderdet3.Arrive_date__c = Date.today();
- Orderdet3.Box_Piece__c = '鐩�';
- Orderdet3.TracingCode__c = 'BXJRC';
- Orderdet3.SerialLotNo__c = '5ZK';
- //Orderdet3.Box_Piece__c = '涓�';
+ //鍙戦敊搴� 宸插埌璐�
+ Consumable_order_details2__c Orderdets9 = new Consumable_order_details2__c();
+ Orderdets9.Name = 'OCM_01_001012';
+ Orderdets9.Consumable_order_minor__c = Order2.Id;
+ Orderdets9.Consumable_Product__c = pro1.Id;
+ Orderdets9.Asset_Model_No__c = 'Test01';
+ Orderdets9.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
+ Orderdets9.Bar_Code__c = '01049531702003111115120017181000105ZK250BXSYQ';
+ Orderdets9.Consumable_Arrived_order__c = Order2.Id;
+ Orderdets9.Arrive_date__c = Date.today();
+ Orderdets9.Box_Piece__c = '鐩�';
+ Orderdets9.TracingCode__c = 'BXSYQ';
+ Orderdets9.SerialLotNo__c = '5ZK';
+ insert Orderdets9;
- //鍑哄簱浜у搧
- Consumable_order_details2__c Orderdet4 = new Consumable_order_details2__c();
- Orderdet4.Name = 'OCM_01_001005';
- Orderdet4.Consumable_order_minor__c = Order1.Id;
- Orderdet4.Consumable_Product__c = pro1.Id;
- Orderdet4.Asset_Model_No__c = 'Test01';
- Orderdet4.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- Orderdet4.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRD';
- Orderdet4.Send_Date__c = Date.today();
- Orderdet4.Arrive_date__c = Date.today();
- Orderdet4.Box_Piece__c = '鐩�';
- Orderdet4.TracingCode__c = 'BXJRD';
- Orderdet4.SerialLotNo__c = '5ZK';
- //Orderdet4.Box_Piece__c = '鐩�';
- //Orderdet4.Return_date__c = null;
+ // Consumable_order__c Order1 = new Consumable_order__c();
+ // Order1.Name = 'OCM_01_001';
+ // Order1.Order_status__c = '鎵瑰噯';
+ // Order1.Order_type__c = '璁㈠崟';
+ // Order1.Dealer_Info__c = myAccount1.id;
+ // Order1.Order_ProType__c = 'ET';
+ // Order1.RecordTypeid = System.Label.RT_ConOrder_Delivery;
+ // insert Order1;
+ // //璁㈠崟鏄庣粏
+ // //fahuo
+ // Consumable_orderdetails__c Orderdet = new Consumable_orderdetails__c();
+ // Orderdet.Name = 'OCM_01_00101';
+ // Orderdet.Consumable_order__c = Order1.Id;
+ // Orderdet.RecordTypeId = System.Label.RT_ConOrderDetail1_Order;
+ // Orderdet.Consumable_Product__c = pro1.Id;
+ // Orderdet.Consumable_count__c = 4;
+ // insert Orderdet;
- //宸插埌璐т骇鍝�
- Consumable_order_details2__c Orderdet5 = new Consumable_order_details2__c();
- Orderdet5.Name = 'OCM_01_001006';
- Orderdet5.Consumable_order_minor__c = Order1.Id;
- Orderdet5.Consumable_Product__c = pro1.Id;
- Orderdet5.Asset_Model_No__c = 'Test01';
- Orderdet5.Consumable_Arrived_order__c = Order1.Id;
- Orderdet5.Consumable_Shipment_order__c = Order1.Id;
- Orderdet5.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- Orderdet5.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRE';
- Orderdet5.Arrive_date__c = Date.today();
- Orderdet5.Box_Piece__c = '鐩�';
- Orderdet5.TracingCode__c = 'BXJRE';
- Orderdet5.SerialLotNo__c = '5ZK';
- insert new List<Consumable_order_details2__c>{
- Orderdet1,
- Orderdet2,
- Orderdet3,
- Orderdet4,
- Orderdet5
- };
+ // //鍒拌揣姝g‘淇℃伅
+ // Consumable_order_details2__c Orderdet1 = new Consumable_order_details2__c();
+ // Orderdet1.Name = 'OCM_01_001002';
+ // Orderdet1.Consumable_order_minor__c = Order1.Id;
+ // Orderdet1.Consumable_Product__c = pro1.Id;
+ // Orderdet1.Asset_Model_No__c = 'Test01';
+ // Orderdet1.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
+ // Orderdet1.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRA';
+ // Orderdet1.Box_Piece__c = '鐩�';
+ // Orderdet1.TracingCode__c = 'BXJRA';
+ // Orderdet1.SerialLotNo__c = '5ZK';
+ // //娌″埌璐�
+ // Consumable_order_details2__c Orderdet2 = new Consumable_order_details2__c();
+ // Orderdet2.Name = 'OCM_01_001003';
+ // Orderdet2.Consumable_order_minor__c = Order1.Id;
+ // Orderdet2.Consumable_Product__c = pro1.Id;
+ // Orderdet2.Asset_Model_No__c = 'Test01';
+ // Orderdet2.Consumable_Arrived_order__c = Order1.Id;
+ // Orderdet2.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
+ // Orderdet2.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRB';
+ // Orderdet2.Box_Piece__c = '鐩�';
+ // Orderdet2.TracingCode__c = 'BXJRB';
+ // Orderdet2.SerialLotNo__c = '5ZK';
+ // //閿�鍞骇鍝�
+ // Consumable_order_details2__c Orderdet3 = new Consumable_order_details2__c();
+ // Orderdet3.Name = 'OCM_01_001004';
+ // Orderdet3.Consumable_order_minor__c = Order1.Id;
+ // Orderdet3.Consumable_Product__c = pro1.Id;
+ // Orderdet3.Asset_Model_No__c = 'Test01';
+ // Orderdet3.Consumable_Arrived_order__c = Order1.Id;
+ // //Orderdet3.IsArrival__c = true;
+ // Orderdet3.Consumable_Sale_order__c = Order1.Id;
+ // Orderdet3.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
+ // Orderdet3.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRC';
+ // Orderdet3.Used_date__c = Date.today();
+ // Orderdet3.Arrive_date__c = Date.today();
+ // Orderdet3.Box_Piece__c = '鐩�';
+ // Orderdet3.TracingCode__c = 'BXJRC';
+ // Orderdet3.SerialLotNo__c = '5ZK';
+ // //Orderdet3.Box_Piece__c = '涓�';
- ArriveGoodsController Controller = new ArriveGoodsController();
- PageReference page = new PageReference('/apex/ArriveGoods?ArrType=Arr');
- System.Test.setCurrentPage(page);
- //鍒濆鍖栨祴璇�
- System.Test.startTest();
- Controller.init();
- //鎺掑簭
- Controller.barcode = '01049531702003111115120017181000105ZK250BXJRA\n01049531702003111115120017181000105ZK250BXJRB\n01049531702003111115120017181000105ZK250BXJRC\n01049531702003111115120017181000105ZK250BXJRD\n01049531702003111115120017181000105ZK250BXJRE\n01049531702003111115120017181000105ZK250BX111\n01049531702003111115120017181000105ZK250BXJRF\n01049531702003111115120017181000105ZK250BXJRG\n01049531702003111115120017181000105ZK250BXsys';
- Controller.SearchPro();
- System.assertEquals(
- 'OCM_01_001002',
- controller.ConsumableorderdetailsRecords[0].esd.Name
- );
- // System.assertEquals(2, controller.ConsumableorderdetailsRecordserror.size());
- System.Test.stopTest();
- }
- }
+ // //鍑哄簱浜у搧
+ // Consumable_order_details2__c Orderdet4 = new Consumable_order_details2__c();
+ // Orderdet4.Name = 'OCM_01_001005';
+ // Orderdet4.Consumable_order_minor__c = Order1.Id;
+ // Orderdet4.Consumable_Product__c = pro1.Id;
+ // Orderdet4.Asset_Model_No__c = 'Test01';
+ // Orderdet4.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
+ // Orderdet4.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRD';
+ // Orderdet4.Send_Date__c = Date.today();
+ // Orderdet4.Arrive_date__c = Date.today();
+ // Orderdet4.Box_Piece__c = '鐩�';
+ // Orderdet4.TracingCode__c = 'BXJRD';
+ // Orderdet4.SerialLotNo__c = '5ZK';
+ // //Orderdet4.Box_Piece__c = '鐩�';
+ // //Orderdet4.Return_date__c = null;
- //鍙戦敊璐� 鍏ュ簱
- @isTest
- static void ArriveotheragencyTest() {
- // // TO DO: implement unit test
- List<RecordType> rectCo = [
- SELECT Id
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '璨╁2搴�'
- ];
- if (rectCo.size() == 0) {
- return;
- }
- // Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET Email)'];
- Profile prof = [
- SELECT Id
- FROM Profile
- WHERE Name = '901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'
- ];
+ // //宸插埌璐т骇鍝�
+ // Consumable_order_details2__c Orderdet5 = new Consumable_order_details2__c();
+ // Orderdet5.Name = 'OCM_01_001006';
+ // Orderdet5.Consumable_order_minor__c = Order1.Id;
+ // Orderdet5.Consumable_Product__c = pro1.Id;
+ // Orderdet5.Asset_Model_No__c = 'Test01';
+ // Orderdet5.Consumable_Arrived_order__c = Order1.Id;
+ // Orderdet5.Consumable_Shipment_order__c = Order1.Id;
+ // Orderdet5.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
+ // Orderdet5.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRE';
+ // Orderdet5.Arrive_date__c = Date.today();
+ // Orderdet5.Box_Piece__c = '鐩�';
+ // Orderdet5.TracingCode__c = 'BXJRE';
+ // Orderdet5.SerialLotNo__c = '5ZK';
+ // insert new Consumable_order_details2__c[] {Orderdet1, Orderdet2,Orderdet3,Orderdet4,Orderdet5};
- Oly_TriggerHandler.bypass('ConsumableAssetHander');
- Account myAccount2 = new Account(
- name = 'Testaccount002',
- Dealer_discount__c = 20,
- RecordTypeId = rectCo[0].Id,
- AgentCode_Ext__c = '9999900'
- );
- Account myAccount1 = new Account(
- name = 'Testaccount001',
- Dealer_discount__c = 30,
- RecordTypeId = rectCo[0].Id
- );
- insert new List<account>{ myAccount1, myAccount2 };
- Contact core = new Contact(
- email = 'jplumber@salesforce.com',
- firstname = 'Joe',
- lastname = 'Plumber',
- accountid = myAccount1.id
- );
- insert core;
- user MyUser_Test = new User(
- ContactId = core.id,
- Alias = 'newUser',
- Email = 'newuser@testorg.com',
- EmailEncodingKey = 'UTF-8',
- LastName = 'TestUser',
- LanguageLocaleKey = 'zh_CN',
- LocaleSidKey = 'zh_CN',
- ProfileId = prof.Id,
- TimeZoneSidKey = 'Asia/Shanghai',
- UserName = 'testUser@testorg.com',
- UserPro_Type__c = 'ET'
- );
- System.runAs(new User(Id = UserInfo.getUserId())) {
- insert MyUser_Test;
- }
- // User MyUser_Test = [select id,Contact.accountid from User WHERE ProfileId = :prof.Id and IsActive = true and UserPro_Type__c = 'ET' limit 1 ];
- // Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false);
- // Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false);
- // insert new Product2[] {prod01,prod02};
- System.runAs(MyUser_Test) {
- Product2 prod01 = new Product2(
- Name = 'Test01',
- ProductCode = 'Test01',
- Asset_Model_No__c = 'Test01',
- SFDA_Status__c = '鏈夊姽',
- JANCODE__c = '04953170200311',
- Dealer_special_Object__c = true,
- Manual_Entry__c = false
- );
- Product2 prod02 = new Product2(
- Name = 'Test02',
- ProductCode = 'Test02',
- Asset_Model_No__c = 'Test02',
- SFDA_Status__c = '鏈夊姽',
- JANCODE__c = '04953170200312',
- Dealer_special_Object__c = true,
- Manual_Entry__c = false
- );
- insert new List<Product2>{ prod01, prod02 };
- Product2__c pro1 = new Product2__c(
- Name = 'Pro001',
- OT_CODE_Text__c = 'Test001',
- Product2__c = prod01.Id
- );
- insert new List<Product2__c>{ pro1 };
- Account myAccount3 = new Account(
- name = 'Testaccount003',
- Dealer_discount__c = 30,
- RecordTypeId = rectCo[0].Id
- );
- insert myAccount3;
- Consumable_order__c Order2 = new Consumable_order__c();
- Order2.Name = 'OCM_02_001';
- Order2.Order_status__c = '鎵瑰噯';
- Order2.Order_type__c = '璁㈠崟';
- Order2.Dealer_Info__c = myAccount3.Id;
- Order2.RecordTypeid = System.Label.RT_ConOrder_Delivery;
- Order2.Order_ProType__c = 'ET';
- insert Order2;
- //鍙戦敊搴� 鏈埌璐�
- Consumable_order_details2__c Orderdets8 = new Consumable_order_details2__c();
- Orderdets8.Name = 'OCM_01_001011';
- Orderdets8.Consumable_order_minor__c = Order2.Id;
- Orderdets8.Consumable_Product__c = pro1.Id;
- Orderdets8.Asset_Model_No__c = 'Test01';
- Orderdets8.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- Orderdets8.Bar_Code__c = '01049531702003111115120017181000105ZK250BXSYS';
- Orderdets8.Box_Piece__c = '鐩�';
- Orderdets8.TracingCode__c = 'BXSYS';
- Orderdets8.SerialLotNo__c = '5ZK';
- Orderdets8.ownerid = MyUser_Test.id;
- insert Orderdets8;
- //鍙戦敊搴� 宸插埌璐�
- Consumable_order_details2__c Orderdets9 = new Consumable_order_details2__c();
- Orderdets9.Name = 'OCM_01_001012';
- Orderdets9.Consumable_order_minor__c = Order2.Id;
- Orderdets9.Consumable_Product__c = pro1.Id;
- Orderdets9.Asset_Model_No__c = 'Test01';
- Orderdets9.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- Orderdets9.Bar_Code__c = '01049531702003111115120017181000105ZK250BXSYQ';
- Orderdets9.Consumable_Arrived_order__c = Order2.Id;
- Orderdets9.Arrive_date__c = Date.today();
- Orderdets9.Box_Piece__c = '鐩�';
- Orderdets9.TracingCode__c = 'BXSYQ';
- Orderdets9.SerialLotNo__c = '5ZK';
- insert Orderdets9;
+ ArriveGoodsController Controller = new ArriveGoodsController();
+ PageReference page = new PageReference('/apex/ArriveGoods?ArrType=Arr');
+ System.Test.setCurrentPage(page);
+ //鍒濆鍖栨祴璇�
+ System.Test.startTest();
+ Controller.init();
+ //鎺掑簭
+ Controller.barcode = '01049531702003111115120017181000105ZK250BXSYS\n01049531702003111115120017181000105ZK250BXSYQ';
+ Controller.SearchPro();
+ Controller.ArriveGoodsConfim();
- // Consumable_order__c Order1 = new Consumable_order__c();
- // Order1.Name = 'OCM_01_001';
- // Order1.Order_status__c = '鎵瑰噯';
- // Order1.Order_type__c = '璁㈠崟';
- // Order1.Dealer_Info__c = myAccount1.id;
- // Order1.Order_ProType__c = 'ET';
- // Order1.RecordTypeid = System.Label.RT_ConOrder_Delivery;
- // insert Order1;
- // //璁㈠崟鏄庣粏
- // //fahuo
- // Consumable_orderdetails__c Orderdet = new Consumable_orderdetails__c();
- // Orderdet.Name = 'OCM_01_00101';
- // Orderdet.Consumable_order__c = Order1.Id;
- // Orderdet.RecordTypeId = System.Label.RT_ConOrderDetail1_Order;
- // Orderdet.Consumable_Product__c = pro1.Id;
- // Orderdet.Consumable_count__c = 4;
- // insert Orderdet;
+ // System.assertEquals(2, controller.ConsumableorderdetailsRecordserror.size());
+ System.Test.stopTest();
- // //鍒拌揣姝g‘淇℃伅
- // Consumable_order_details2__c Orderdet1 = new Consumable_order_details2__c();
- // Orderdet1.Name = 'OCM_01_001002';
- // Orderdet1.Consumable_order_minor__c = Order1.Id;
- // Orderdet1.Consumable_Product__c = pro1.Id;
- // Orderdet1.Asset_Model_No__c = 'Test01';
- // Orderdet1.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- // Orderdet1.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRA';
- // Orderdet1.Box_Piece__c = '鐩�';
- // Orderdet1.TracingCode__c = 'BXJRA';
- // Orderdet1.SerialLotNo__c = '5ZK';
- // //娌″埌璐�
- // Consumable_order_details2__c Orderdet2 = new Consumable_order_details2__c();
- // Orderdet2.Name = 'OCM_01_001003';
- // Orderdet2.Consumable_order_minor__c = Order1.Id;
- // Orderdet2.Consumable_Product__c = pro1.Id;
- // Orderdet2.Asset_Model_No__c = 'Test01';
- // Orderdet2.Consumable_Arrived_order__c = Order1.Id;
- // Orderdet2.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- // Orderdet2.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRB';
- // Orderdet2.Box_Piece__c = '鐩�';
- // Orderdet2.TracingCode__c = 'BXJRB';
- // Orderdet2.SerialLotNo__c = '5ZK';
- // //閿�鍞骇鍝�
- // Consumable_order_details2__c Orderdet3 = new Consumable_order_details2__c();
- // Orderdet3.Name = 'OCM_01_001004';
- // Orderdet3.Consumable_order_minor__c = Order1.Id;
- // Orderdet3.Consumable_Product__c = pro1.Id;
- // Orderdet3.Asset_Model_No__c = 'Test01';
- // Orderdet3.Consumable_Arrived_order__c = Order1.Id;
- // //Orderdet3.IsArrival__c = true;
- // Orderdet3.Consumable_Sale_order__c = Order1.Id;
- // Orderdet3.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- // Orderdet3.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRC';
- // Orderdet3.Used_date__c = Date.today();
- // Orderdet3.Arrive_date__c = Date.today();
- // Orderdet3.Box_Piece__c = '鐩�';
- // Orderdet3.TracingCode__c = 'BXJRC';
- // Orderdet3.SerialLotNo__c = '5ZK';
- // //Orderdet3.Box_Piece__c = '涓�';
- // //鍑哄簱浜у搧
- // Consumable_order_details2__c Orderdet4 = new Consumable_order_details2__c();
- // Orderdet4.Name = 'OCM_01_001005';
- // Orderdet4.Consumable_order_minor__c = Order1.Id;
- // Orderdet4.Consumable_Product__c = pro1.Id;
- // Orderdet4.Asset_Model_No__c = 'Test01';
- // Orderdet4.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- // Orderdet4.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRD';
- // Orderdet4.Send_Date__c = Date.today();
- // Orderdet4.Arrive_date__c = Date.today();
- // Orderdet4.Box_Piece__c = '鐩�';
- // Orderdet4.TracingCode__c = 'BXJRD';
- // Orderdet4.SerialLotNo__c = '5ZK';
- // //Orderdet4.Box_Piece__c = '鐩�';
- // //Orderdet4.Return_date__c = null;
+ }
+ }
- // //宸插埌璐т骇鍝�
- // Consumable_order_details2__c Orderdet5 = new Consumable_order_details2__c();
- // Orderdet5.Name = 'OCM_01_001006';
- // Orderdet5.Consumable_order_minor__c = Order1.Id;
- // Orderdet5.Consumable_Product__c = pro1.Id;
- // Orderdet5.Asset_Model_No__c = 'Test01';
- // Orderdet5.Consumable_Arrived_order__c = Order1.Id;
- // Orderdet5.Consumable_Shipment_order__c = Order1.Id;
- // Orderdet5.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- // Orderdet5.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRE';
- // Orderdet5.Arrive_date__c = Date.today();
- // Orderdet5.Box_Piece__c = '鐩�';
- // Orderdet5.TracingCode__c = 'BXJRE';
- // Orderdet5.SerialLotNo__c = '5ZK';
- // insert new Consumable_order_details2__c[] {Orderdet1, Orderdet2,Orderdet3,Orderdet4,Orderdet5};
+ //杩斿搧
+ @isTest
+ static void addInventoryDetails1() {
+ // // TO DO: implement unit test
+ List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '璨╁2搴�'];
+ if (rectCo.size() == 0) {
+ return;
+ }
+ // Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET Email)'];
+ Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'];
- ArriveGoodsController Controller = new ArriveGoodsController();
- PageReference page = new PageReference('/apex/ArriveGoods?ArrType=Arr');
- System.Test.setCurrentPage(page);
- //鍒濆鍖栨祴璇�
- System.Test.startTest();
- Controller.init();
- //鎺掑簭
- Controller.barcode = '01049531702003111115120017181000105ZK250BXSYS\n01049531702003111115120017181000105ZK250BXSYQ';
- Controller.SearchPro();
- Controller.ArriveGoodsConfim();
- // System.assertEquals(2, controller.ConsumableorderdetailsRecordserror.size());
- System.Test.stopTest();
- }
- }
+ Account myAccount2 = new Account(name='Testaccount002',Dealer_discount__c =20,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '9999900');
+ Account myAccount1 = new Account(name='Testaccount001',Dealer_discount__c =30,RecordTypeId = rectCo[0].Id);
+ insert new account[]{myAccount1,myAccount2};
- //杩斿搧
- @isTest
- static void addInventoryDetails1() {
- // // TO DO: implement unit test
- List<RecordType> rectCo = [
- SELECT Id
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '璨╁2搴�'
- ];
- if (rectCo.size() == 0) {
- return;
- }
- // Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET Email)'];
- Profile prof = [
- SELECT Id
- FROM Profile
- WHERE Name = '901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'
- ];
+ Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount1.id);
+ insert core;
+ user MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com',UserPro_Type__c = 'ET');
+ System.runAs(new User(Id = UserInfo.getUserId())){
+ insert MyUser_Test;
+ }
- Account myAccount2 = new Account(
- name = 'Testaccount002',
- Dealer_discount__c = 20,
- RecordTypeId = rectCo[0].Id,
- AgentCode_Ext__c = '9999900'
- );
- Account myAccount1 = new Account(
- name = 'Testaccount001',
- Dealer_discount__c = 30,
- RecordTypeId = rectCo[0].Id
- );
- insert new List<account>{ myAccount1, myAccount2 };
+ // User MyUser_Test = [select id,Contact.accountid from User WHERE ProfileId = :prof.Id and IsActive = true and UserPro_Type__c = 'ET' limit 1 ];
+ // Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ // Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ // insert new Product2[] {prod01,prod02};
+ system.runAs(MyUser_Test){
+ Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ insert new Product2[] {prod01,prod02};
+ Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='Test001',Product2__c = prod01.Id);
+ Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='Test002',Product2__c = prod02.Id);
+ insert new Product2__c[] {pro1, pro2};
+ //璁㈠崟
+ Oly_TriggerHandler.bypass('ConsumableAssetHander');
+ Consumable_order__c Order1 = new Consumable_order__c();
+ Order1.Name = 'OCM_01_001';
+ Order1.Order_status__c = '鎵瑰噯';
+ Order1.Order_type__c = '璁㈠崟';
+ Order1.Dealer_Info__c = myAccount1.id;
+ Order1.RecordTypeid = System.Label.RT_ConOrder_Delivery;
+ Order1.Order_ProType__c = 'ET';
+ //杩斿搧璁㈠崟
- Contact core = new Contact(
- email = 'jplumber@salesforce.com',
- firstname = 'Joe',
- lastname = 'Plumber',
- accountid = myAccount1.id
- );
- insert core;
- user MyUser_Test = new User(
- ContactId = core.id,
- Alias = 'newUser',
- Email = 'newuser@testorg.com',
- EmailEncodingKey = 'UTF-8',
- LastName = 'TestUser',
- LanguageLocaleKey = 'zh_CN',
- LocaleSidKey = 'zh_CN',
- ProfileId = prof.Id,
- TimeZoneSidKey = 'Asia/Shanghai',
- UserName = 'testUser@testorg.com',
- UserPro_Type__c = 'ET'
- );
- System.runAs(new User(Id = UserInfo.getUserId())) {
- insert MyUser_Test;
- }
+ Consumable_order__c Order2 = new Consumable_order__c();
+ Order2.Name = 'OCM_01_002';
+ Order2.Order_status__c = '鎵瑰噯';
+ Order2.Order_type__c = '杩斿搧';
+ Order2.Dealer_Info__c = myAccount1.id;
+ Order2.RecordTypeid = System.Label.Dealer_Returned_Label;
+ insert Order1;
+ insert Order2;
- // User MyUser_Test = [select id,Contact.accountid from User WHERE ProfileId = :prof.Id and IsActive = true and UserPro_Type__c = 'ET' limit 1 ];
- // Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false);
- // Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false);
- // insert new Product2[] {prod01,prod02};
- System.runAs(MyUser_Test) {
- Product2 prod01 = new Product2(
- Name = 'Test01',
- ProductCode = 'Test01',
- Asset_Model_No__c = 'Test01',
- SFDA_Status__c = '鏈夊姽',
- JANCODE__c = '04953170200311',
- Dealer_special_Object__c = true,
- Manual_Entry__c = false
- );
- Product2 prod02 = new Product2(
- Name = 'Test02',
- ProductCode = 'Test02',
- Asset_Model_No__c = 'Test02',
- SFDA_Status__c = '鏈夊姽',
- JANCODE__c = '04953170200312',
- Dealer_special_Object__c = true,
- Manual_Entry__c = false
- );
- insert new List<Product2>{ prod01, prod02 };
- Product2__c pro1 = new Product2__c(
- Name = 'Pro001',
- OT_CODE_Text__c = 'Test001',
- Product2__c = prod01.Id
- );
- Product2__c pro2 = new Product2__c(
- Name = 'Pro002',
- OT_CODE_Text__c = 'Test002',
- Product2__c = prod02.Id
- );
- insert new List<Product2__c>{ pro1, pro2 };
- //璁㈠崟
- Oly_TriggerHandler.bypass('ConsumableAssetHander');
- Consumable_order__c Order1 = new Consumable_order__c();
- Order1.Name = 'OCM_01_001';
- Order1.Order_status__c = '鎵瑰噯';
- Order1.Order_type__c = '璁㈠崟';
- Order1.Dealer_Info__c = myAccount1.id;
- Order1.RecordTypeid = System.Label.RT_ConOrder_Delivery;
- Order1.Order_ProType__c = 'ET';
- //杩斿搧璁㈠崟
+ //璁㈠崟鏄庣粏
+ //fahuo
+ Consumable_orderdetails__c Orderdet = new Consumable_orderdetails__c();
+ Orderdet.Name = 'OCM_01_00101';
+ Orderdet.Consumable_order__c = Order1.Id;
+ Orderdet.RecordTypeId = System.Label.RT_ConOrderDetail1_Order;
+ Orderdet.Consumable_Product__c = pro1.Id;
+ Orderdet.Consumable_count__c = 4;
+ insert Orderdet;
- Consumable_order__c Order2 = new Consumable_order__c();
- Order2.Name = 'OCM_01_002';
- Order2.Order_status__c = '鎵瑰噯';
- Order2.Order_type__c = '杩斿搧';
- Order2.Dealer_Info__c = myAccount1.id;
- Order2.RecordTypeid = System.Label.Dealer_Returned_Label;
- insert Order1;
- insert Order2;
+ //鍙戣揣鏄庣粏
+ //fahuo
+ Consumable_order_details2__c Orderdet1 = new Consumable_order_details2__c();
+ Orderdet1.Name = 'OCM_01_001001';
+ Orderdet1.Consumable_order_minor__c = Order1.Id;
+ Orderdet1.Consumable_Product__c = pro1.Id;
+ Orderdet1.Asset_Model_No__c = 'Pro001';
+ Orderdet1.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
+ Orderdet1.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRF';
+ Orderdet1.TracingCode__c = 'BXJRF';
+ //daohuo
+ Consumable_order_details2__c Orderdet2 = new Consumable_order_details2__c();
+ Orderdet2.Name = 'OCM_01_001002';
+ Orderdet2.Consumable_order_minor__c = Order1.Id;
+ Orderdet2.Consumable_Product__c = pro1.Id;
+ Orderdet2.Asset_Model_No__c = 'Pro001';
+ Orderdet2.Consumable_Arrived_order__c = Order1.Id;
+ //Orderdet2.IsArrival__c = true;
+ Orderdet2.Arrive_date__c = Date.today();
+ Orderdet2.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
+ Orderdet2.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRI';
+ Orderdet2.TracingCode__c = 'BXJRF';
+ //sale
+ Consumable_order_details2__c Orderdet3 = new Consumable_order_details2__c();
+ Orderdet3.Name = 'OCM_01_001003';
+ Orderdet3.Consumable_order_minor__c = Order1.Id;
+ Orderdet3.Consumable_Product__c = pro1.Id;
+ Orderdet3.Asset_Model_No__c = 'Pro001';
+ Orderdet3.Consumable_Arrived_order__c = Order1.Id;
+ //Orderdet3.IsArrival__c = true;
+ Orderdet3.Arrive_date__c = Date.today();
+ Orderdet3.Used_date__c = Date.today();
+ Orderdet3.Consumable_Sale_order__c = Order1.Id;
+ Orderdet3.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
+ Orderdet3.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRJ';
+ Orderdet3.Box_Piece__c ='鐩�';
+ Orderdet3.TracingCode__c = 'BXJRF';
+ //鍑哄簱
+ Consumable_order_details2__c Orderdet4 = new Consumable_order_details2__c();
+ Orderdet4.Name = 'OCM_01_001004';
+ Orderdet4.Consumable_order_minor__c = Order1.Id;
+ Orderdet4.Consumable_Product__c = pro1.Id;
+ Orderdet4.Asset_Model_No__c = 'Pro001';
+ Orderdet4.Consumable_Arrived_order__c = Order1.Id;
+ //Orderdet4.IsArrival__c = true;
+ Orderdet4.Arrive_date__c = Date.today();
+ Orderdet4.Send_Date__c = Date.today();
+ Orderdet4.Consumable_Shipment_order__c = Order1.Id;
+ Orderdet4.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
+ Orderdet4.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRN';
+ Orderdet4.Box_Piece__c ='涓�';
+ Orderdet4.TracingCode__c = 'BXJRF';
+ //quxiao
+ Consumable_order_details2__c Orderdet5 = new Consumable_order_details2__c();
+ Orderdet5.Name = 'OCM_01_001005';
+ Orderdet5.Consumable_order_minor__c = Order1.Id;
+ Orderdet5.Consumable_Product__c = pro1.Id;
+ Orderdet5.Asset_Model_No__c = 'Pro001';
+ Orderdet5.Cancellation_Date__c = Date.today();
+ Orderdet5.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
+ Orderdet5.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRZ';
+ Orderdet5.Box_Piece__c ='鐩�';
+ Orderdet5.TracingCode__c = 'BXJRF';
+ //fanpin
+ Consumable_order_details2__c Orderdet6 = new Consumable_order_details2__c();
+ Orderdet6.Name = 'OCM_01_001006';
+ Orderdet6.Consumable_order_minor__c = Order1.Id;
+ Orderdet6.Consumable_Product__c = pro1.Id;
+ Orderdet6.Asset_Model_No__c = 'Pro001';
+ Orderdet6.Consumable_Return_order__c = Order2.Id;
+ Orderdet6.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
+ Orderdet6.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRA';
+ Orderdet6.Box_Piece__c ='涓�';
+ Orderdet6.TracingCode__c = 'BXJRF';
- //璁㈠崟鏄庣粏
- //fahuo
- Consumable_orderdetails__c Orderdet = new Consumable_orderdetails__c();
- Orderdet.Name = 'OCM_01_00101';
- Orderdet.Consumable_order__c = Order1.Id;
- Orderdet.RecordTypeId = System.Label.RT_ConOrderDetail1_Order;
- Orderdet.Consumable_Product__c = pro1.Id;
- Orderdet.Consumable_count__c = 4;
- insert Orderdet;
+ // 涓㈠け
+ Consumable_order_details2__c Orderdet7 = new Consumable_order_details2__c();
+ Orderdet7.Name = 'OCM_01_001002';
+ Orderdet7.Consumable_order_minor__c = Order1.Id;
+ Orderdet7.Consumable_Product__c = pro1.Id;
+ Orderdet7.Asset_Model_No__c = 'Pro001';
+ Orderdet7.Consumable_Arrived_order__c = Order1.Id;
+ Orderdet7.Lose_Flag__c = true;
+ Orderdet7.Arrive_date__c = Date.today();
+ Orderdet7.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
+ Orderdet7.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJQT';
+ Orderdet7.Box_Piece__c ='涓�';
+ Orderdet7.TracingCode__c = 'BXJQT';
- //鍙戣揣鏄庣粏
- //fahuo
- Consumable_order_details2__c Orderdet1 = new Consumable_order_details2__c();
- Orderdet1.Name = 'OCM_01_001001';
- Orderdet1.Consumable_order_minor__c = Order1.Id;
- Orderdet1.Consumable_Product__c = pro1.Id;
- Orderdet1.Asset_Model_No__c = 'Pro001';
- Orderdet1.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- Orderdet1.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRF';
- Orderdet1.TracingCode__c = 'BXJRF';
- //daohuo
- Consumable_order_details2__c Orderdet2 = new Consumable_order_details2__c();
- Orderdet2.Name = 'OCM_01_001002';
- Orderdet2.Consumable_order_minor__c = Order1.Id;
- Orderdet2.Consumable_Product__c = pro1.Id;
- Orderdet2.Asset_Model_No__c = 'Pro001';
- Orderdet2.Consumable_Arrived_order__c = Order1.Id;
- //Orderdet2.IsArrival__c = true;
- Orderdet2.Arrive_date__c = Date.today();
- Orderdet2.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- Orderdet2.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRI';
- Orderdet2.TracingCode__c = 'BXJRF';
- //sale
- Consumable_order_details2__c Orderdet3 = new Consumable_order_details2__c();
- Orderdet3.Name = 'OCM_01_001003';
- Orderdet3.Consumable_order_minor__c = Order1.Id;
- Orderdet3.Consumable_Product__c = pro1.Id;
- Orderdet3.Asset_Model_No__c = 'Pro001';
- Orderdet3.Consumable_Arrived_order__c = Order1.Id;
- //Orderdet3.IsArrival__c = true;
- Orderdet3.Arrive_date__c = Date.today();
- Orderdet3.Used_date__c = Date.today();
- Orderdet3.Consumable_Sale_order__c = Order1.Id;
- Orderdet3.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- Orderdet3.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRJ';
- Orderdet3.Box_Piece__c = '鐩�';
- Orderdet3.TracingCode__c = 'BXJRF';
- //鍑哄簱
- Consumable_order_details2__c Orderdet4 = new Consumable_order_details2__c();
- Orderdet4.Name = 'OCM_01_001004';
- Orderdet4.Consumable_order_minor__c = Order1.Id;
- Orderdet4.Consumable_Product__c = pro1.Id;
- Orderdet4.Asset_Model_No__c = 'Pro001';
- Orderdet4.Consumable_Arrived_order__c = Order1.Id;
- //Orderdet4.IsArrival__c = true;
- Orderdet4.Arrive_date__c = Date.today();
- Orderdet4.Send_Date__c = Date.today();
- Orderdet4.Consumable_Shipment_order__c = Order1.Id;
- Orderdet4.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- Orderdet4.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRN';
- Orderdet4.Box_Piece__c = '涓�';
- Orderdet4.TracingCode__c = 'BXJRF';
- //quxiao
- Consumable_order_details2__c Orderdet5 = new Consumable_order_details2__c();
- Orderdet5.Name = 'OCM_01_001005';
- Orderdet5.Consumable_order_minor__c = Order1.Id;
- Orderdet5.Consumable_Product__c = pro1.Id;
- Orderdet5.Asset_Model_No__c = 'Pro001';
- Orderdet5.Cancellation_Date__c = Date.today();
- Orderdet5.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- Orderdet5.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRZ';
- Orderdet5.Box_Piece__c = '鐩�';
- Orderdet5.TracingCode__c = 'BXJRF';
- //fanpin
- Consumable_order_details2__c Orderdet6 = new Consumable_order_details2__c();
- Orderdet6.Name = 'OCM_01_001006';
- Orderdet6.Consumable_order_minor__c = Order1.Id;
- Orderdet6.Consumable_Product__c = pro1.Id;
- Orderdet6.Asset_Model_No__c = 'Pro001';
- Orderdet6.Consumable_Return_order__c = Order2.Id;
- Orderdet6.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- Orderdet6.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRA';
- Orderdet6.Box_Piece__c = '涓�';
- Orderdet6.TracingCode__c = 'BXJRF';
+ insert new Consumable_order_details2__c[] {Orderdet1, Orderdet2,Orderdet3,Orderdet4,Orderdet5,Orderdet6,Orderdet7};
+ PageReference page = new PageReference('/apex/ArriveGoods?ArrType=ReG');
+ System.Test.setCurrentPage(page);
+ ArriveGoodsController Controller = new ArriveGoodsController();
+ //鍒濆鍖栨祴璇�
+ System.Test.startTest();
+ Controller.init();
+ //鎺掑簭
+ Controller.barcode = '01049531702003111115120017181000105ZK250BXJRN\n01049531702003111115120017181000105ZK250BXJRF\n01049531702003111115120017181000105ZK250BXJRI\n01049531702003111115120017181000105ZK250BXJRN\n01049531702003111115120017181000105ZK250BXJRZ\n01049531702003111115120017181000105ZK250BXJRA\n01049531702003111115120017181000105ZK250BXJRI\n01049531702003111115120017181000105ZK250BXJQT';
+ Controller.SearchPro();
+ //System.assertEquals(1, controller.ShowGoodsofReturnList.size());
+ //System.assertEquals('OCM_01_001003', controller.ShowGoodsofReturnList[0].esd.Name);
+ //System.assertEquals('OCM_01_001004', controller.ShowGoodsofReturnList[1].esd.Name);
+ // System.assertEquals(5, controller.ConsumableorderdetailsRecordserror.size()); //tcm
+ //System.assertEquals('Test01', controller.ConsumableorderdetailsRecordserror[1].Prod.Name__c);
+ //System.assertEquals('OCM_01_001002', controller.ConsumableorderdetailsRecordserror[2].esd.Name);
+ //System.assertEquals('OCM_02_001001', controller.ConsumableorderdetailsRecordserror[3].esd.Name);
+ // Controller.GoodsReturnCheck();
+ controller.ShowGoodsofReturnList[0].esd.Return_reason__c='澶氬彂';
+ controller.ShowGoodsofReturnList[0].esd.Rrturn_count__c =1;
+ //System.assertEquals(1, controller.ShowGoodsofReturnList.size());
+ Controller.UpdateGoodsOfReturn();
+ Controller.ToReturnGoodsPage();
+ Controller.geterrorsize();
+ System.Test.stopTest();
- // 涓㈠け
- Consumable_order_details2__c Orderdet7 = new Consumable_order_details2__c();
- Orderdet7.Name = 'OCM_01_001002';
- Orderdet7.Consumable_order_minor__c = Order1.Id;
- Orderdet7.Consumable_Product__c = pro1.Id;
- Orderdet7.Asset_Model_No__c = 'Pro001';
- Orderdet7.Consumable_Arrived_order__c = Order1.Id;
- Orderdet7.Lose_Flag__c = true;
- Orderdet7.Arrive_date__c = Date.today();
- Orderdet7.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- Orderdet7.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJQT';
- Orderdet7.Box_Piece__c = '涓�';
- Orderdet7.TracingCode__c = 'BXJQT';
+ }
+ }
- insert new List<Consumable_order_details2__c>{
- Orderdet1,
- Orderdet2,
- Orderdet3,
- Orderdet4,
- Orderdet5,
- Orderdet6,
- Orderdet7
- };
- PageReference page = new PageReference('/apex/ArriveGoods?ArrType=ReG');
- System.Test.setCurrentPage(page);
- ArriveGoodsController Controller = new ArriveGoodsController();
- //鍒濆鍖栨祴璇�
- System.Test.startTest();
- Controller.init();
- //鎺掑簭
- Controller.barcode = '01049531702003111115120017181000105ZK250BXJRN\n01049531702003111115120017181000105ZK250BXJRF\n01049531702003111115120017181000105ZK250BXJRI\n01049531702003111115120017181000105ZK250BXJRN\n01049531702003111115120017181000105ZK250BXJRZ\n01049531702003111115120017181000105ZK250BXJRA\n01049531702003111115120017181000105ZK250BXJRI\n01049531702003111115120017181000105ZK250BXJQT';
- Controller.SearchPro();
- //System.assertEquals(1, controller.ShowGoodsofReturnList.size());
- //System.assertEquals('OCM_01_001003', controller.ShowGoodsofReturnList[0].esd.Name);
- //System.assertEquals('OCM_01_001004', controller.ShowGoodsofReturnList[1].esd.Name);
- // System.assertEquals(5, controller.ConsumableorderdetailsRecordserror.size()); //tcm
- //System.assertEquals('Test01', controller.ConsumableorderdetailsRecordserror[1].Prod.Name__c);
- //System.assertEquals('OCM_01_001002', controller.ConsumableorderdetailsRecordserror[2].esd.Name);
- //System.assertEquals('OCM_02_001001', controller.ConsumableorderdetailsRecordserror[3].esd.Name);
- // Controller.GoodsReturnCheck();
- controller.ShowGoodsofReturnList[0].esd.Return_reason__c = '澶氬彂';
- controller.ShowGoodsofReturnList[0].esd.Rrturn_count__c = 1;
- //System.assertEquals(1, controller.ShowGoodsofReturnList.size());
- Controller.UpdateGoodsOfReturn();
- Controller.ToReturnGoodsPage();
- Controller.geterrorsize();
- System.Test.stopTest();
- }
- }
-}
+}
\ No newline at end of file
diff --git a/force-app/main/default/classes/DealerInquiryModifyStateController.cls b/force-app/main/default/classes/DealerInquiryModifyStateController.cls
index f65c671..9e6c25c 100644
--- a/force-app/main/default/classes/DealerInquiryModifyStateController.cls
+++ b/force-app/main/default/classes/DealerInquiryModifyStateController.cls
@@ -51,6 +51,9 @@
private String strColumus;
private String strRtColumus;
+ //add by Link 2023-6-2
+ public String remindMsg{get;set;}
+
@TestVisible private String accTypeForSort = null;
private static Integer oppLimit = 500;
@@ -124,6 +127,7 @@
}
public PageReference init() {
+ remindMsg = '';
PartnerSoapSforceCom.Soap soap = new PartnerSoapSforceCom.Soap();
soap.SessionHeader = new PartnerSoapSforceCom.SessionHeader_element();
soap.SessionHeader.sessionId = UserInfo.getSessionId();
@@ -372,14 +376,22 @@
//鏄剧ず鎻愮ず鎿嶄綔淇℃伅
if (String.isBlank(this.saveType) && String.isBlank(this.sortKey)) {
ApexPages.addmessage(new ApexPages.message(ApexPages.severity.INFO, '鍙栧緱鏈�杩戠殑 ' + oppCount + ' 鏉℃暟鎹�'));
+ //add by Link 2023-6-2
+ remindMsg = '鍙栧緱鏈�杩戠殑 ' + oppCount + ' 鏉℃暟鎹�';
} else if (!String.isBlank(this.sortKey)) {
if (oppCount > oppLimit) {
ApexPages.addmessage(new ApexPages.message(ApexPages.severity.INFO, '鏁版嵁瓒呰繃' + oppLimit + '浠讹紝鍙樉绀哄墠' + oppLimit + '浠�'));
+ //add by Link 2023-6-2
+ remindMsg = '鏁版嵁瓒呰繃' + oppLimit + '浠讹紝鍙樉绀哄墠' + oppLimit + '浠�';
} else {
ApexPages.addmessage(new ApexPages.message(ApexPages.severity.INFO, '鍏辨湁 ' + oppCount + ' 鏉℃暟鎹�'));
+ //add by Link 2023-6-2
+ remindMsg = '鍏辨湁 ' + oppCount + ' 鏉℃暟鎹�';
}
} else {
ApexPages.addmessage(new ApexPages.message(ApexPages.severity.INFO, '鍏辨湁 ' + oppCount + ' 鏉℃暟鎹�'));
+ //add by Link 2023-6-2
+ remindMsg = '鍏辨湁 ' + oppCount + ' 鏉℃暟鎹�';
}
}
//妫�绱㈡潯浠讹細鏁版嵁瀛楁1锛屾暟鎹瓧娈�2锛屾暟鎹瓧娈�3鍧囨弧瓒宠繘鍏ユ鏂规硶 鍒ゆ柇澶氱鎯呭喌
@@ -566,6 +578,8 @@
// update updOpps;
// }
ApexPages.addmessage(new ApexPages.message(ApexPages.severity.INFO, '淇濆瓨瀹屼簡'));
+ //add by Link 2023-6-2
+ remindMsg = '淇濆瓨瀹屼簡';
} catch (Exception e) {
//ApexPages.addmessage(new ApexPages.message(ApexPages.severity.Error, '璇风‘瀹氱瀹ゅ垎绫诲拰浜у搧鍖哄垎鐨勫叧绯�'));
}
diff --git a/force-app/main/default/classes/LexArriveGoodsMainController.cls b/force-app/main/default/classes/LexArriveGoodsMainController.cls
index d79a1a0..57746d1 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 List<String>{ 'Product2__c.Name' };
+ private static String[] columus = new 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,18 +62,7 @@
for (String s : column) {
soql += ',' + s;
}
- soql +=
- ' from Consumable_order__c where Order_type__c = \'' +
- '璁㈠崟' +
- '\' and recordtypeid =\'' +
- System.Label.RT_ConOrder_Delivery +
- '\' and Dealer_Info__c =\'' +
- accountid +
- '\' and Order_ProType__c =\'' +
- agencyProType +
- '\' and (OrderNumber_notarrive__c > 0 or Delivery_detail_count__c >0) and Order_Owner_WorkLocal__c = \'' +
- userWorkLocation +
- '\' and showFalseNotshowTrue__c = false order by Deliver_date__c'; //
+ soql += ' from Consumable_order__c where Order_type__c = \''+'璁㈠崟'+'\' and recordtypeid =\'' + System.Label.RT_ConOrder_Delivery + '\' and Dealer_Info__c =\'' + accountid +'\' and Order_ProType__c =\'' + agencyProType +'\' and (OrderNumber_notarrive__c > 0 or Delivery_detail_count__c >0) and Order_Owner_WorkLocal__c = \'' + userWorkLocation + '\' and showFalseNotshowTrue__c = false order by Deliver_date__c'; //
// soql = 'select id,name,ContractNo__c,Total_num__c,OrderNumber_arrived__c,Delivery_detail_count__c,OrderNumber_notarrive__c,More_than_seven_days__c,Shipment_date__c,First_Delivery__c from Consumable_order__c where id in :idList';
raesList = Database.query(soql);
//20200904 ljh add start
@@ -82,22 +71,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;
@@ -119,13 +108,7 @@
}
@AuraEnabled
- public static Results searchConsumableorderdetails(
- String category1Str,
- Date cate2Str,
- String accountidStr,
- String userWorkLocationStr,
- String agencyProTypeStr
- ) {
+ public static Results searchConsumableorderdetails(String category1Str, Date cate2Str, String accountidStr, String userWorkLocationStr, String agencyProTypeStr){
Results results = new Results();
category1 = category1Str;
cate2 = cate2Str;
@@ -154,23 +137,16 @@
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 c58d900..69da85c 100644
--- a/force-app/main/default/classes/LexArriveGsDetailsController.cls
+++ b/force-app/main/default/classes/LexArriveGsDetailsController.cls
@@ -19,72 +19,45 @@
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
}
@@ -92,7 +65,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;
@@ -117,28 +90,25 @@
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';
@@ -174,7 +144,7 @@
@AuraEnabled
public Consumable_order_details2__c esd;
@AuraEnabled
- public Product2__c Prod;
+ public Product2__c Prod;
@AuraEnabled
public Decimal packing_list;
@AuraEnabled
@@ -188,6 +158,7 @@
@AuraEnabled
public String prodName;
+
// 宸插瓨鍦ㄦ秷鑰楀搧鏄庣粏鐢�
public ConsumableorderdetailsInfo(Consumable_order_details2__c e) {
esd = e;
diff --git a/force-app/main/default/classes/LexCancelRemoveBoxController.cls b/force-app/main/default/classes/LexCancelRemoveBoxController.cls
index 24ddae3..7bd832f 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 { get; set; }
+ public static String alertMessage {set;get;}
//鎷嗙洅鏄庣粏浠舵暟
- 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,38 +44,39 @@
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 List<String>{};
+ public static List<String> ParseBarCode(String Code){
+ String[] Cache = new 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);
}
@@ -84,14 +85,9 @@
//鑾峰彇鏄庣粏
@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;
@@ -101,18 +97,20 @@
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;
}
@@ -124,416 +122,309 @@
// 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);
}
}
}
@@ -541,97 +432,89 @@
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;
@@ -639,48 +522,46 @@
}
//鍙栧緱閫氱暘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
@@ -690,28 +571,29 @@
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; }
@@ -724,18 +606,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 61a4641..0173b6c 100644
--- a/force-app/main/default/classes/LexConInvoiceViewController.cls
+++ b/force-app/main/default/classes/LexConInvoiceViewController.cls
@@ -388,11 +388,7 @@
// attachmentRecoeds.add(new InvoiceOrderInfo(attachmentinfo[i]));
// }
// }
- List<ContentVersion> cvInfo = [
- SELECT Id, Title, OwnerId, Owner.Name, CreatedDate, ContentDocumentId
- FROM ContentVersion
- WHERE FirstPublishLocationId = :invoiceId
- ];
+ List<ContentVersion> cvInfo = [SELECT Id, Title, OwnerId,Owner.Name, CreatedDate,ContentDocumentId FROM ContentVersion WHERE FirstPublishLocationId = :invoiceId];
if (cvInfo.size() > 0) {
for (Integer i = 0; i < cvInfo.size(); i++) {
attachmentRecoeds.add(new InvoiceOrderInfo(cvInfo[i]));
@@ -419,16 +415,17 @@
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(
@@ -456,12 +453,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) {
@@ -536,6 +533,7 @@
}
} else {
if (HospitalInfo != null && HospitalInfo != '') {
+
System.debug('++++++++++++' + ass.esd.Order_ForHospital__c + ' ' + shipmentAccountString);
if (ass.esd.Order_ForHospital__c != shipmentAccountString) {
System.debug('HospitalInfo != null ass.esd.Order_ForHospital__c != shipmentAccountString');
@@ -554,9 +552,7 @@
(ass.esd.Order_ForDealerText__c != null || ass.esd.Order_ForDealerText__c != '') &&
ass.esd.ShipmentAccount__c != shipmentAccountString
) {
- System.debug(
- 'HospitalInfo == null && ass.esd.Order_ForDealerText__c != null ass.esd.ShipmentAccount__c != shipmentAccountString'
- );
+ System.debug('HospitalInfo == null && ass.esd.Order_ForDealerText__c != null ass.esd.ShipmentAccount__c != shipmentAccountString');
invoiceOrderAccountList.add(ass.esd.Name);
}
}
@@ -697,12 +693,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;
}
@@ -853,8 +849,6 @@
delete invoiceLinkdetList;
}
//鏂板缓鍙戠エ鏄庣粏1
- System.debug('===>' + chukudanID);
- System.debug('===>' + chukudanID.size());
if (chukudanID.size() > 0) {
newinvoicedetails1(chukudanID);
}
@@ -889,7 +883,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);
}
@@ -1273,13 +1267,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();
@@ -1305,16 +1299,7 @@
// 妫�绱�(鏈紑鍙戠エ鍑哄簱鍗�)
@AuraEnabled
- public static ResponseBodyLWC InvoiceorderSearch(
- Consumable_order__c cocLwc,
- String invoiceIdLwc,
- String accountidLwc,
- String userWorkLocationLwc,
- String agencyProTypeLwc,
- String HospitalInfoLwc,
- String SecondDealerLwc,
- String invoiceOrderRecoedsLwc
- ) {
+ public static ResponseBodyLWC InvoiceorderSearch(Consumable_order__c cocLwc,String invoiceIdLwc,String accountidLwc,String userWorkLocationLwc,String agencyProTypeLwc,String HospitalInfoLwc,String SecondDealerLwc,String invoiceOrderRecoedsLwc) {
System.debug('杩涘叆 InvoiceorderSearch');
ResponseBodyLWC res = new ResponseBodyLWC();
Map<String, object> data = new Map<String, object>();
@@ -1324,12 +1309,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>();
@@ -1355,7 +1340,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);
@@ -1411,7 +1396,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>();
@@ -1444,11 +1429,7 @@
// 鎻愪氦鎸夐挳
@AuraEnabled
- public static ResponseBodyLWC approval(
- List<String> outOrderStringListLwc,
- Map<String, Consumable_Orderdetails__c> outordercountMapLwc,
- String invoiceIdLwc
- ) {
+ public static ResponseBodyLWC approval(List<String> outOrderStringListLwc,Map<String, Consumable_Orderdetails__c> outordercountMapLwc,String invoiceIdLwc) {
System.debug('杩涘叆 approval');
ResponseBodyLWC res = new ResponseBodyLWC();
Map<String, object> data = new Map<String, object>();
@@ -1456,7 +1437,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>();
@@ -1520,8 +1501,6 @@
outOrderdet1List[i].Consumable_order__c + outOrderdet1List[i].Asset_Model_No__c
)
.Invoice_Unitprice__c;
- System.debug('====>procount' + invoiceUpdte1.Invoiced_Procount__c);
- System.debug('===>RMB' + outOrderdet1List[i].Delivery_List_RMB__c);
invoiceUpdte1.InvoicedProCost_RMB__c = invoiceUpdte1.Invoiced_Procount__c * outOrderdet1List[i].Delivery_List_RMB__c;
Decimal invoicedProcount = 0;
@@ -1542,8 +1521,6 @@
invoicedProcount = outordercountMap.get(outOrderdet1List[i].Consumable_order__c + outOrderdet1List[i].Asset_Model_No__c)
.Invoiced_Count__c;
}
- System.debug('鍙戠エ鏁伴噺===>' + outOrderdet1List[i].InvoiceProNot_count__c);
- System.debug('杩樻病鍙戠エ鏁伴噺===>' + invoicedProcount);
if (outOrderdet1List[i].InvoiceProNot_count__c < invoicedProcount) {
// ApexPages.addmessage(
@@ -1557,16 +1534,7 @@
// )
// );
// return null;
- return new ResponseBodyLWC(
- 'Error',
- 500,
- '鍑哄簱鍗�' +
- outOrderdet1List[i].Consumable_order__r.Name +
- '涓紝' +
- outOrderdet1List[i].Asset_Model_No__c +
- '杩樻病寮�绁ㄦ暟閲忓皬浜庡彂绁ㄦ暟閲忥紝璇风‘璁ゆ槸鍚︽湁杩斿搧',
- ''
- );
+ return new ResponseBodyLWC('Error', 500, '鍑哄簱鍗�' + outOrderdet1List[i].Consumable_order__r.Name + '涓紝' + outOrderdet1List[i].Asset_Model_No__c + '杩樻病寮�绁ㄦ暟閲忓皬浜庡彂绁ㄦ暟閲忥紝璇风‘璁ゆ槸鍚︽湁杩斿搧', '');
}
outOrderdetUp1List.add(invoiceUpdte1);
@@ -1602,7 +1570,7 @@
System.debug('res = ' + res);
return res;
}
- @TestVisible
+
class InvoiceOrderInfo implements Comparable {
@AuraEnabled
public Boolean check { get; set; }
@@ -1615,12 +1583,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
@@ -1648,7 +1616,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 b863861..18a4fb5 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,7 +101,6 @@
FROM Consumable_Orderdetails__c
WHERE Consumable_order__c = :orderId
];
- System.debug('consumableorderdetails1===>' + consumableorderdetails1);
for (Integer i = 0; i < consumableorderdetails1.size(); i++) {
consumableorderdetails1Records.add(new ConsumableorderdetailsInfo(consumableorderdetails1[i]));
}
@@ -139,9 +138,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);
@@ -149,15 +148,12 @@
}
@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);
@@ -356,7 +352,6 @@
}
// Data Bean
- @TestVisible
class ConsumableorderdetailsInfo {
@AuraEnabled
public Boolean check { get; set; }
@@ -374,7 +369,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;
@@ -384,13 +379,12 @@
invoiceAllprice = 0;
Packing_list_manual = e.Consumable_Product__r.Packing_list_manual__c;
- if (!Test.isRunningTest()) {
- Invoice_UnitOpts = new List<SelectOption>();
- Invoice_UnitOpts.add(new SelectOption('鐩�', '鐩�'));
- Invoice_UnitOpts.add(new SelectOption('涓�', '涓�'));
- }
- Invoice_UnitOptsMap = new Map<String, String>();
+ Invoice_UnitOpts = new List<SelectOption>();
+ Invoice_UnitOpts.add(new SelectOption('鐩�', '鐩�'));
+ Invoice_UnitOpts.add(new SelectOption('涓�', '涓�'));
+
+ 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 b8dde25..21d519d 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,10 +273,11 @@
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 1495608..09f8d19 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 6620269..eef1437 100644
--- a/force-app/main/default/classes/LexConsumableAccountSOQL.cls
+++ b/force-app/main/default/classes/LexConsumableAccountSOQL.cls
@@ -1,19 +1,20 @@
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
@@ -21,4 +22,6 @@
];
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 870954c..c6f9846 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,16 +232,17 @@
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
@@ -263,9 +264,9 @@
RecordType.DeveloperName = 'AgencyContract'
AND Contract_Decide_Start_Date__c <= :dateToday
AND Contract_Decide_End_Date__c >= :dateToday
- AND Contact_Type__c LIKE :agencyProType1 //lt 20230517 瀹夊窘涓ょエ鍒� add 1
- AND Agent_Ref__c = :accountid
- AND OSH_Dealer__c = :OSHFLG //lt 20230517 瀹夊窘涓ょエ鍒� add
+ and Contact_Type__c like :agencyProType1//lt 20230517 瀹夊窘涓ょエ鍒� add 1
+ and Agent_Ref__c =:accountid
+ and OSH_Dealer__c =: OSHFLG //lt 20230517 瀹夊窘涓ょエ鍒� add
];
for (Account contract : contractList) {
contactDealer.add(contract.Id);
@@ -329,10 +330,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;
@@ -381,16 +382,7 @@
}
consumableorderdetailsRecords.sort();
if (methodType != null && methodType != '' && (methodType.equals('hospitalorder') || methodType.equals('promotionorder'))) {
- searchorderdetails(
- methodType,
- accountid,
- hospitalId,
- contractId,
- userWorkLocation,
- accountName,
- proLimitAndDate,
- editAble
- );
+ searchorderdetails(methodType,accountid,hospitalId,contractId,userWorkLocation,accountName,proLimitAndDate,editAble);
isfirst = true;
}
getPageInfo();
@@ -466,12 +458,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);
@@ -551,21 +543,10 @@
// attachmentRecoeds.add(new ConsumableorderdetailsInfo(attachmentinfo[i]));
// }
// }
- List<ContentDocumentLink> links = [SELECT Id, ContentDocumentId FROM ContentDocumentLink WHERE LinkedEntityId = :ESetId];
- if (links != null && links.size() > 0) {
- List<String> documentIds = new List<String>();
- for (ContentDocumentLink link : links) {
- documentIds.add(link.ContentDocumentId);
- }
- List<ContentVersion> cvInfo = [
- SELECT Id, Title, OwnerId, Owner.Name, CreatedDate, ContentDocumentId
- FROM ContentVersion
- WHERE ContentDocumentId IN :documentIds
- ];
- if (cvInfo.size() > 0) {
- for (Integer i = 0; i < cvInfo.size(); i++) {
- attachmentRecoeds.add(new ConsumableorderdetailsInfo(cvInfo[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]));
}
}
//
@@ -579,7 +560,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);
}
@@ -615,22 +596,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();
@@ -671,7 +652,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;
@@ -727,7 +708,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;
@@ -753,7 +734,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
@@ -948,7 +929,7 @@
String consumableorderdetailsRecordsviewStr,
Boolean editAbleStr,
List<String> proLimitAndDateList
- ) {
+ ){
Results results = new Results();
errorMsgList = new List<String>();
warningMsgList = new List<String>();
@@ -967,11 +948,8 @@
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 {
@@ -1015,7 +993,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]));
@@ -1090,12 +1068,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;
@@ -1119,7 +1097,7 @@
String accountNameStr,
List<String> proLimitAndDateList,
Boolean editAbleStr
- ) {
+ ){
Results results = new Results();
methodType = methodTypeStr;
accountId = accountIdStr;
@@ -1145,7 +1123,7 @@
for (hospitalprice__c hc : hplist) {
hpids.add(hc.product__c);
}
-
+
if (hpids != null && hpids.size() > 0) {
soql += ' AND Id in : hpids ';
}
@@ -1270,10 +1248,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 = '娌℃湁鎼滅储鍒扮浉鍏虫暟鎹�';
}
@@ -1300,10 +1278,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;
@@ -1464,8 +1442,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;
}
@@ -1474,7 +1452,7 @@
// 缂栬緫鎸夐挳
@AuraEnabled
- public static Results setEditAble(String eSetidStr) {
+ public static Results setEditAble(String eSetidStr){
Results results = new Results();
ESetId = eSetidStr;
try {
@@ -1523,7 +1501,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';
@@ -1536,7 +1514,7 @@
//鍒犻櫎鎸夐挳
@AuraEnabled
- public static Results delConsumable(String eSetidStr) {
+ public static Results delConsumable(String eSetidStr){
Results results = new Results();
ESetId = eSetidStr;
try {
@@ -1559,7 +1537,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>();
@@ -1640,23 +1618,10 @@
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,
@@ -1671,7 +1636,7 @@
String contractIdStr,
String agencyProType1Str,
Boolean OSHFLGStr
- ) {
+ ){
Results results = new Results();
errorMsgList = new List<String>();
warningMsgList = new List<String>();
@@ -1684,16 +1649,13 @@
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 {
@@ -1708,12 +1670,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('涓嶅瓨鍦ㄧ殑鍚堝悓锛岃閲嶆柊纭銆�');
@@ -1766,14 +1728,13 @@
}
//=======================================鍖婚櫌鐗逛环,鏈夐噾棰濈殑璇濆彇閲戦
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);
}
}
//淇冮攢璁㈣揣 鏍规嵁缁忛攢鍟嗕骇鍝佷腑鐨勬暟鎹绠楅噾棰�
@@ -1855,13 +1816,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;
@@ -1926,19 +1887,16 @@
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;
@@ -2029,12 +1987,9 @@
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;
@@ -2064,17 +2019,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';
@@ -2085,11 +2040,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);
}
@@ -2099,9 +2054,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;
}
@@ -2162,6 +2117,7 @@
@AuraEnabled
public Decimal consumableCount { get; set; }
+
// 宸插瓨浜у搧鏄庣粏
public ConsumableorderdetailsInfo(Consumable_Orderdetails__c e) {
check = true;
diff --git a/force-app/main/default/classes/LexConsumableGoodsInfo.cls b/force-app/main/default/classes/LexConsumableGoodsInfo.cls
index ded35fe..78044ce 100644
--- a/force-app/main/default/classes/LexConsumableGoodsInfo.cls
+++ b/force-app/main/default/classes/LexConsumableGoodsInfo.cls
@@ -1,87 +1,59 @@
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;
@@ -94,35 +66,28 @@
//宸插埌璐т骇鍝佷竴瑙�
@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();
}
@@ -131,16 +96,14 @@
//宸插埌璐т骇鍝佷竴瑙圓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;
@@ -149,91 +112,50 @@
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();
}
@@ -242,22 +164,20 @@
//鏈埌璐т骇鍝佷竴瑙�
@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();
}
@@ -266,16 +186,14 @@
//鏈埌璐т骇鍝佷竴瑙圓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;
@@ -284,91 +202,50 @@
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 = 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
- ];
+ 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();
}
@@ -377,89 +254,77 @@
//杩樻病鍙戣揣鏁伴噺
@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;
@@ -467,7 +332,7 @@
}
results.recordList = otherArrList;
results.result = 'Success';
- } catch (Exception e) {
+ }catch (Exception e){
results.result = 'Fail';
results.errorMsg = e.getLineNumber() + '---' + e.getMessage();
}
@@ -476,16 +341,14 @@
//杩樻病鍙戣揣鏁伴噺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;
@@ -494,110 +357,69 @@
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;
@@ -606,7 +428,7 @@
}
results.recordList = allOtherDetIifo;
results.result = 'Success';
- } catch (Exception e) {
+ }catch (Exception e){
results.result = 'Fail';
results.errorMsg = e.getLineNumber() + '---' + e.getMessage();
}
@@ -615,30 +437,26 @@
//鍙戣揣涓冨ぉ杩樻湭鍒拌揣鏁�
@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();
}
@@ -647,16 +465,14 @@
//鍙戣揣涓冨ぉ杩樻湭鍒拌揣鏁癆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;
@@ -665,106 +481,63 @@
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();
}
@@ -780,17 +553,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 7380b26..564eded 100644
--- a/force-app/main/default/classes/LexInventoryController.cls
+++ b/force-app/main/default/classes/LexInventoryController.cls
@@ -4,45 +4,44 @@
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;
- public static List<ConsumableorderdetailsInfo> consumableorderdetailsRecords;
+ private static List<ConsumableorderdetailsInfo> consumableorderdetailsRecords;
//鐩樼偣鍒扮殑浜у搧
- public static List<Consumable_order_details2__c> reSet = new List<Consumable_order_details2__c>();
- public static List<Consumable_order_details2__c> showcod2nid = new List<Consumable_order_details2__c>();
+ 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;
@@ -57,12 +56,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;
@@ -73,79 +72,65 @@
//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';
@@ -157,21 +142,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,
@@ -185,135 +170,123 @@
// 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('consumableorderdetailsRecords', JSON.serialize(consumableorderdetailsRecords));
+
+ 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));
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>();
@@ -324,41 +297,44 @@
//閫夋嫨浜у搧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 List<String>{};
+ public static List<String> ParseBarCode(String Code){
+ Map<String,Integer> barcodeCountMap = new Map<String,Integer>();
+ String[] Cache = new 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
@@ -369,78 +345,53 @@
//========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);
- System.debug('BarCodeListP===>' + BarCodeListP);
+ List<String> BarCodeListP = ParseBarCode( barcode );
//鏌ヨ搴撳瓨 杩藉姞杩斿搧搴撳瓨
- 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);
+ 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 ];
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>();
@@ -448,23 +399,20 @@
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++) {
- 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)) {
+ 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)){
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]));
@@ -476,170 +424,576 @@
}
//宸茬粡鍑哄簱鐨勪骇鍝�
- 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);
+ 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){
+ pandiandetailsListShow.add(pandiandetailsListMid);
+ }
//鍒嗛〉
PaginatedAccounts paginatedAccounts = new PaginatedAccounts();
totalCount = codPageRecords.size();
@@ -666,638 +1020,101 @@
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);
+
+ 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 = 'Success1';
-
+ res.status = 'Sucess';
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;
@@ -1305,67 +1122,60 @@
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);
@@ -1377,15 +1187,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
@@ -1399,7 +1209,6 @@
}
// Data Bean
- @TestVisible
class ConsumableorderdetailsInfo implements Comparable {
@AuraEnabled
public Boolean check { get; set; }
@@ -1412,7 +1221,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
@@ -1431,13 +1240,14 @@
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;
@@ -1449,9 +1259,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;
@@ -1460,11 +1270,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 b662082..a4e9395 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,70 +31,49 @@
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 130028e..1a4c8fd 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 { get; set; }
+ public static List<String> orderDetZaikuList{set;get;}
// 浜у搧 ID
public static String ESetId { get; set; }
public static String idCheck { get; set; }
@@ -98,6 +98,7 @@
categoryOptionMap = new Map<String, String>();
category4OptionMap = new Map<String, String>();
category5OptionMap = new Map<String, String>();
+
// 鍙栫敤鎴稩D
String userId = UserInfo.getUserId();
@@ -239,7 +240,9 @@
}
if (newMidPieceMap.containsKey(CountDel[i].Consumable_Product__c + CountDel[i].Box_Piece__c + tex)) {
ConsumableorderdetailsInfo Jstage = newMidPieceMap.get(
- CountDel[i].Consumable_Product__c + CountDel[i].Box_Piece__c + tex
+ CountDel[i].Consumable_Product__c +
+ CountDel[i].Box_Piece__c +
+ tex
)
.clone();
Jstage.allnumber = Jstage.allnumber + 1;
@@ -404,8 +407,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);
@@ -413,16 +416,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
@@ -466,8 +469,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';
@@ -532,13 +535,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;
@@ -603,7 +606,7 @@
// if (String.isNotBlank(sortField) && String.isNotBlank(sortOrder)) {
// if(sortFieldLWC != 'limitCount'){
// soql += ' ORDER BY ' + sortField + ' ' + sortOrder;
-
+
// }
// }
System.debug('soql = ' + soql);
@@ -627,7 +630,9 @@
}
if (newMidBoxMap.containsKey(CountDel[i].Consumable_Product__c + CountDel[i].Box_Piece__c + tex)) {
ConsumableorderdetailsInfo Jstage = newMidBoxMap.get(
- CountDel[i].Consumable_Product__c + CountDel[i].Box_Piece__c + tex
+ CountDel[i].Consumable_Product__c +
+ CountDel[i].Box_Piece__c +
+ tex
)
.clone();
Jstage.allnumber = Jstage.allnumber + 1;
@@ -657,7 +662,9 @@
}
if (newMidPieceMap.containsKey(CountDel[i].Consumable_Product__c + CountDel[i].Box_Piece__c + tex)) {
ConsumableorderdetailsInfo Jstage = newMidPieceMap.get(
- CountDel[i].Consumable_Product__c + CountDel[i].Box_Piece__c + tex
+ CountDel[i].Consumable_Product__c +
+ CountDel[i].Box_Piece__c +
+ tex
)
.clone();
Jstage.allnumber = Jstage.allnumber + 1;
@@ -773,11 +780,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);
@@ -931,6 +938,7 @@
// }
// 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 a4e7706..97a1cf3 100644
--- a/force-app/main/default/classes/LexLicenceReminderController.cls
+++ b/force-app/main/default/classes/LexLicenceReminderController.cls
@@ -1,40 +1,41 @@
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 aad8163..a1f00f6 100644
--- a/force-app/main/default/classes/LexOutboundorderImportController.cls
+++ b/force-app/main/default/classes/LexOutboundorderImportController.cls
@@ -50,7 +50,6 @@
res.status = 'Success';
res.code = 200;
res.msg = '';
- System.debug('res:' + res);
return res;
}
@@ -103,7 +102,7 @@
barcodePieceMap.put(csvRecordData[6], Integer.valueOf(csvRecordData[7]));
}
}
- String[] csvRecordDataStr = new String[13];
+ String[] csvRecordDataStr = new List<String>(13);
for (Integer j = 0; j < csvRecordData.size(); j++) {
csvRecordDataStr[j] = csvRecordData[j];
}
@@ -191,8 +190,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;
@@ -588,7 +587,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;
@@ -754,7 +753,9 @@
string[] csvRecordData = csvRecordStr[i];
if (orderdetMap.containsKey(csvRecordData[0] + csvRecordData[12] + csvRecordData[9])) {
orderdetMap.put(
- csvRecordData[0] + csvRecordData[12] + csvRecordData[9],
+ csvRecordData[0] +
+ csvRecordData[12] +
+ csvRecordData[9],
orderdetMap.get(csvRecordData[0] + csvRecordData[12] + csvRecordData[9]) + Decimal.valueOf(csvRecordData[7])
);
continue;
@@ -785,7 +786,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;
}
}
@@ -863,7 +864,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 1a71a71..c6d0fd1 100644
--- a/force-app/main/default/classes/LexOverdueStockController.cls
+++ b/force-app/main/default/classes/LexOverdueStockController.cls
@@ -1,4 +1,5 @@
public with sharing class LexOverdueStockController {
+
/*****************妞滅储鐢�******************/
public static String barcode { get; set; }
@@ -16,18 +17,19 @@
// 缁忛攢鍟嗕俊鎭�
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() {
+
}
// 鐢婚潰鍒濆鍖�
@@ -40,118 +42,103 @@
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);
}
}
@@ -159,176 +146,164 @@
}
}
// 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
- ];
+ 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);
- 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, '璇峰厛褰曞叆BarCode', '');
+ return new ResponseBodyLWC('Error',500, '璇峰厛鐐瑰嚮鑾峰彇鏄庣粏', '');
// 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);
@@ -336,24 +311,24 @@
}
// 灏嗛〉闈㈡垨鍙栧緱BarCode鍘绘帀閲嶅鐨勶紝杞崲鎴怢ist
- public static List<String> ParseBarCode(String Code) {
- Map<String, Integer> barcodeCountMap = new Map<String, Integer>();
- String[] Cache = new List<String>{};
+ public static List<String> ParseBarCode(String Code){
+ Map<String,Integer> barcodeCountMap = new Map<String,Integer>();
+ String[] Cache = new 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; }
@@ -361,7 +336,7 @@
public Product2__c Prod { get; set; }
@AuraEnabled
public Boolean check { get; set; }
-
+
// 杩囨湡搴撳瓨
@AuraEnabled
public Integer overlimitCount { get; set; }
@@ -378,7 +353,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;
@@ -393,11 +368,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 a3b0aeb..3a8ca5b 100644
--- a/force-app/main/default/classes/LexProductLimitEditController.cls
+++ b/force-app/main/default/classes/LexProductLimitEditController.cls
@@ -4,55 +4,54 @@
//--------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 6360f98..8388cd6 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 { get; set; }
+ public static String alertMessage {set;get;}
//鎷嗙洅鏄庣粏浠舵暟
- public static integer getinventorysize() {
+ public static integer getinventorysize(){
return ConsumableorderdetailsRecordsdummy.size();
}
public static Map<String, String> ExistIdMap = new Map<String, String>();
@@ -21,47 +21,48 @@
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);
@@ -69,15 +70,15 @@
}
// 灏嗛〉闈㈡垨鍙栧緱BarCode鍘绘帀閲嶅鐨勶紝杞崲鎴怢ist
- public static List<String> ParseBarCode(String Code) {
- String[] Cache = new List<String>{};
+ public static List<String> ParseBarCode(String Code){
+ String[] Cache = new 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);
}
@@ -86,14 +87,10 @@
//鑾峰彇鏄庣粏
@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;
@@ -102,19 +99,21 @@
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;
}
@@ -126,529 +125,417 @@
// 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
//鐧诲綍鎷嗙洅鍚庡湪搴�
@@ -657,29 +544,31 @@
}
}
- 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
@@ -696,18 +585,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 adbd428..6f07385 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 29616ff..d967cc7 100644
--- a/force-app/main/default/classes/LexSaleOrderController.cls
+++ b/force-app/main/default/classes/LexSaleOrderController.cls
@@ -201,7 +201,6 @@
//BarCodelist鍋氭垚
barCodeListP = ParseBarCode(barcode);
- System.debug('barCodeListP:' + barCodeListP);
//閽堝鎵�鏈夊晢鍝佸埌璐х‘璁�
reSet1 = [
SELECT
@@ -236,7 +235,6 @@
AND Arrive_Owner_Work_Location__c = :userWorkLocation
ORDER BY RemoveBox_No__c DESC
];
- System.debug('reSet1:' + reSet1);
List<Consumable_order_details2__c> newdet2 = new List<Consumable_order_details2__c>();
Set<Id> proIds = new Set<Id>();
@@ -244,7 +242,6 @@
Integer idx = 0;
for (Consumable_order_details2__c cod2 : reSet1) {
if (cod2.Bar_Code__c == barcode) {
- System.debug('cod2.Bar_Code__c:' + cod2.Bar_Code__c);
newdet2.add(cod2);
reSet1.remove(idx);
proIds.add(cod2.Consumable_product__c);
@@ -681,13 +678,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;
}
}
@@ -1079,16 +1076,11 @@
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) {
@@ -1273,7 +1265,6 @@
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 a7fd48d..1cf641e 100644
--- a/force-app/main/default/classes/LexSearchContractController.cls
+++ b/force-app/main/default/classes/LexSearchContractController.cls
@@ -1,34 +1,26 @@
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();
@@ -37,12 +29,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();
@@ -50,16 +42,17 @@
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 912d15c..147544e 100644
--- a/force-app/main/default/classes/LexSearchHospitalController.cls
+++ b/force-app/main/default/classes/LexSearchHospitalController.cls
@@ -1,15 +1,16 @@
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();
@@ -18,7 +19,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));
@@ -30,16 +31,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 f5fb177..df46d82 100644
--- a/force-app/main/default/classes/LexSummonsCreatController.cls
+++ b/force-app/main/default/classes/LexSummonsCreatController.cls
@@ -245,13 +245,7 @@
// 鐢婚潰鍒濆鍖�
@AuraEnabled
- public static ResponseBodyLWC init(
- String ESetidJs,
- String statusEdit,
- Integer pageSizeLWC,
- Integer pageTokenLWC,
- String arriveorderLWC
- ) {
+ public static ResponseBodyLWC init(String ESetidJs, String statusEdit, Integer pageSizeLWC, Integer pageTokenLWC,String arriveorderLWC) {
try {
firstInit(ESetidJs);
statusEdit = statusEdit;
@@ -1400,7 +1394,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(), '');
}
}
@@ -2128,7 +2122,11 @@
return new ResponseBodyLWC(
'Error',
500,
- '缁忛攢鍟�:' + coc.Order_ForDealerText__c + ' 娌℃湁娑堣�楀搧:' + proStr.substring(0, proStr.length() - 1) + ' 鐨勭壒浠�',
+ '缁忛攢鍟�:' +
+ coc.Order_ForDealerText__c +
+ ' 娌℃湁娑堣�楀搧:' +
+ proStr.substring(0, proStr.length() - 1) +
+ ' 鐨勭壒浠�',
''
);
}
@@ -2185,10 +2183,7 @@
if (ass.orderdetails1.Delivery_List_RMB__c == null && coc.SummonsForDirction__c != '鍖婚櫌璇曠敤') {
return new ResponseBodyLWC('Error', 500, '璇疯緭鍏ユ纭殑鍑鸿揣鍗曚环 (鍏�)', '');
}
- if (
- (ass.orderdetails1.Delivery_List_RMB__c == null || ass.orderdetails1.Delivery_List_RMB__c == 0) &&
- coc.SummonsForDirction__c != '鍖婚櫌璇曠敤'
- ) {
+ if ((ass.orderdetails1.Delivery_List_RMB__c == null || ass.orderdetails1.Delivery_List_RMB__c == 0) && coc.SummonsForDirction__c != '鍖婚櫌璇曠敤') {
return new ResponseBodyLWC('Error', 500, '璇疯緭鍏ュ嚭璐у崟浠� (鍏�)', '');
}
if (
@@ -2220,7 +2215,9 @@
return new ResponseBodyLWC(
'Error',
500,
- '娑堣�楀搧' + ass.orderdetails1.Consumable_Product__r.Name__c + '搴撳瓨涓嶈冻',
+ '娑堣�楀搧' +
+ ass.orderdetails1.Consumable_Product__r.Name__c +
+ '搴撳瓨涓嶈冻',
''
);
}
@@ -2236,7 +2233,9 @@
return new ResponseBodyLWC(
'Error',
500,
- '娑堣�楀搧' + ass.orderdetails1.Consumable_Product__r.Name__c + '搴撳瓨涓嶈冻',
+ '娑堣�楀搧' +
+ ass.orderdetails1.Consumable_Product__r.Name__c +
+ '搴撳瓨涓嶈冻',
''
);
}
@@ -2342,10 +2341,7 @@
return new ResponseBodyLWC('Error', 500, '璇疯緭鍏ユ纭殑鍑鸿揣鍗曚环 (鍏�)', '');
}
Consumable_orderdetails__c InsAfterDel = new Consumable_orderdetails__c();
- if (
- (ass.orderdetails1.Delivery_List_RMB__c == null || ass.orderdetails1.Delivery_List_RMB__c == 0) &&
- coc.SummonsForDirction__c != '鍖婚櫌璇曠敤'
- ) {
+ if ((ass.orderdetails1.Delivery_List_RMB__c == null || ass.orderdetails1.Delivery_List_RMB__c == 0) && coc.SummonsForDirction__c != '鍖婚櫌璇曠敤') {
return new ResponseBodyLWC('Error', 500, '璇疯緭鍏ュ嚭璐у崟浠� (鍏�)', '');
}
if (
@@ -2371,7 +2367,9 @@
return new ResponseBodyLWC(
'Error',
500,
- '娑堣�楀搧' + ass.orderdetails1.Consumable_Product__r.Name__c + '搴撳瓨涓嶈冻',
+ '娑堣�楀搧' +
+ ass.orderdetails1.Consumable_Product__r.Name__c +
+ '搴撳瓨涓嶈冻',
''
);
}
@@ -2386,7 +2384,9 @@
return new ResponseBodyLWC(
'Error',
500,
- '娑堣�楀搧' + ass.orderdetails1.Consumable_Product__r.Name__c + '搴撳瓨涓嶈冻',
+ '娑堣�楀搧' +
+ ass.orderdetails1.Consumable_Product__r.Name__c +
+ '搴撳瓨涓嶈冻',
''
);
}
@@ -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,6 +2561,7 @@
// ];
// }
+
Date today = Date.today();
//Date today = Date.newInstance(2023, 3, 1);
Integer thisMonth = today.month();
@@ -2569,7 +2570,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);
@@ -2579,14 +2580,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') {
@@ -2688,15 +2689,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(), '');
}
}
@@ -2775,7 +2776,6 @@
}
// Data Bean
- @TestVisible
class ConsumableorderdetailsInfo implements Comparable {
@AuraEnabled
public Boolean check { get; set; }
@@ -2916,7 +2916,6 @@
}
}
- @TestVisible
class ConsumableorderdetailsInfoLwc {
@AuraEnabled
public Boolean check { get; set; }
diff --git a/force-app/main/default/classes/LexTopPageController.cls b/force-app/main/default/classes/LexTopPageController.cls
index 955f049..aab986b 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 List<String>{ 'Product2__c.Name__c' };
+ private static String[] orderby = new String[]{ 'Product2__c.Name__c'};
//浜у搧涓婁笅闄�
- public static String[] proLimitAndDate = new List<String>{};
+ public static String[] proLimitAndDate =new String[]{};
public static String product_Limit;
//搴撳瓨浜у搧鏈�鏃╂湁鏁堟湡闄�
- private static Map<String, Date> productkucun = new Map<String, Date>();
+ private static Map<String,Date> productkucun = new Map<String,Date>();
//娑堣垂鏈熼檺灏忎簬涓�骞寸殑浜у搧
public static List<ConsumableorderdetailsInfo> overlimitdateorderdetails = new List<ConsumableorderdetailsInfo>();
public static String accountid;
@@ -72,60 +72,43 @@
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();
@@ -138,115 +121,91 @@
// 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,
@@ -255,86 +214,78 @@
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);
}
}
}
@@ -343,8 +294,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;
@@ -353,8 +304,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;
@@ -365,31 +316,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 + '涓狝'));
}
}
@@ -397,24 +348,25 @@
//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
@@ -429,28 +381,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';
@@ -469,38 +421,36 @@
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);
@@ -520,137 +470,115 @@
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]));
}
}
@@ -671,7 +599,7 @@
// }
//缂栬緫褰撳墠椤靛唴瀹�
- public static void makeCurrentPageRecords() {
+ public static void makeCurrentPageRecords(){
Integer startIdx;
Integer endIdx;
pageRecords = new List<ConsumableorderdetailsInfo>();
@@ -733,7 +661,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;
@@ -744,17 +672,18 @@
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;
@@ -809,5 +738,7 @@
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 b604be5..7f195d7 100644
--- a/force-app/main/default/classes/LexUpAccountProLimit.cls
+++ b/force-app/main/default/classes/LexUpAccountProLimit.cls
@@ -1,55 +1,59 @@
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);
- if (String.isNotBlank(checkResoultstr)) {
- return new ResponseBodyLWC('Error', 500, '' + checkResoultstr + '', '');
+ String checkResoultstr = checkResoult(productLimit);
+ system.debug('checkResoultstr====>'+checkResoultstr);
+ system.debug('accountId'+accountId);
+ if(String.isNotBlank(checkResoultstr)){
+ return new ResponseBodyLWC('Error',500,''+checkResoultstr+'', '');
// return checkResoultstr;
}
//String[] proidList =new String[]{};
- String[] proList = new List<String>{};
- String[] pro_List = new List<String>{};
+ String[] proList =new String[]{};
+ String[] pro_List =new String[]{};
List<Account> acc = [
- SELECT Id, Name, Product_Limit_Date__c
- FROM Account
- WHERE Id = :accountId
+ SELECT
+ Id,
+ Name,
+ Product_Limit_Date__c
+ FROM
+ Account
+ WHERE
+ Id = : accountId
FOR UPDATE
];
- if (null == acc || acc.size() == 0) {
+ 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 '
@@ -57,83 +61,84 @@
//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 3dc9f81..56d6ae7 100644
--- a/force-app/main/default/classes/LexUtility.cls
+++ b/force-app/main/default/classes/LexUtility.cls
@@ -1,12 +1,13 @@
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 b21d235..5efe728 100644
--- a/force-app/main/default/classes/ResponseBodyLWC.cls
+++ b/force-app/main/default/classes/ResponseBodyLWC.cls
@@ -1,25 +1,24 @@
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 f47d1c1..b244fc7 100644
--- a/force-app/main/default/classes/lexSearchAgencyHospitalController.cls
+++ b/force-app/main/default/classes/lexSearchAgencyHospitalController.cls
@@ -1,32 +1,28 @@
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);
@@ -34,29 +30,25 @@
}
@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 f4ea642..d4cd83a 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>00O0l000000zaGcEAI</value>
+ <value>00O6D000000UPzaUAG</value>
</labels>
<labels>
<fullName>View_Weekly_Report</fullName>
<language>zh_CN</language>
<protected>false</protected>
<shortDescription>鏌ョ湅鍛ㄦ姤娲诲姩</shortDescription>
- <value>00O0l000000zo9aEAA</value>
+ <value>00O6D000000UPzZUAW</value>
</labels>
<labels>
<fullName>invoiceStart</fullName>
diff --git a/force-app/main/default/lwc/boxorpieceType/boxorpieceType.html b/force-app/main/default/lwc/boxorpieceType/boxorpieceType.html
index aa3f32b..d693bae 100644
--- a/force-app/main/default/lwc/boxorpieceType/boxorpieceType.html
+++ b/force-app/main/default/lwc/boxorpieceType/boxorpieceType.html
@@ -1,11 +1,10 @@
<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 6155dc5..6e88773 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 2c2e51f..f367b87 100644
--- a/force-app/main/default/lwc/commonToast/commonToast.html
+++ b/force-app/main/default/lwc/commonToast/commonToast.html
@@ -4,13 +4,7 @@
<div class={outerClass} role="status">
<span class="slds-assistive-text">{type}</span>
<span class={innerClass} title={message}>
- <lightning-icon
- icon-name={getIconName}
- alternative-text="icon"
- styleclass="slds-icon slds-icon_small"
- variant="inverse"
- size="small"
- ></lightning-icon>
+ <lightning-icon icon-name={getIconName} alternative-text="icon" styleclass="slds-icon slds-icon_small" variant="inverse" size="small"></lightning-icon>
</span>
<div class="slds-notify__content">
<h2 class="slds-text-heading_small">
@@ -18,16 +12,9 @@
</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 474f3eb..5da6e8e 100644
--- a/force-app/main/default/lwc/commonToast/commonToast.js
+++ b/force-app/main/default/lwc/commonToast/commonToast.js
@@ -1,50 +1,44 @@
-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 8fd5af3..fbef290 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 026dddf..baae6dd 100644
--- a/force-app/main/default/lwc/customOutboundCountComp/customOutboundCountComp.html
+++ b/force-app/main/default/lwc/customOutboundCountComp/customOutboundCountComp.html
@@ -1,15 +1,5 @@
<template>
- <lightning-input
- step="0"
- type="number"
- name="count"
- label="鍑鸿揣鏁伴噺"
- variant="label-hidden"
- onchange={outboundCountBlur}
- data-field="shipmentNumber"
- value={count}
- min="0"
- disabled={isDisable}
- style="min-width: 150px"
- ></lightning-input>
+ <lightning-input step="0" type="number" name="count" label="鍑鸿揣鏁伴噺"
+ variant="label-hidden" onchange={outboundCountBlur} data-field="shipmentNumber" value={count}
+ min="0" disabled={isDisable} style="min-width: 150px;"></lightning-input>
</template>
\ 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 6d73ec4..ef28c10 100644
--- a/force-app/main/default/lwc/customOutboundCountComp/customOutboundCountComp.js
+++ b/force-app/main/default/lwc/customOutboundCountComp/customOutboundCountComp.js
@@ -1,30 +1,29 @@
-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 1ca7b1b..0277ba5 100644
--- a/force-app/main/default/lwc/customOutputGood/customOutputGood.html
+++ b/force-app/main/default/lwc/customOutputGood/customOutputGood.html
@@ -1,48 +1,23 @@
<template>
<template if:true={showTitle}>
<template if:true={showLink}>
- <p style="height: 10px"></p>
- <a
- style="margin-left: 10px; margin-top: 10px; margin-bottom: 10px"
- onclick={clickLink}
- ><lightning-formatted-text
- value={outputValue}
- ></lightning-formatted-text
- ></a>
- <p style="height: 10px"></p>
+ <p style="height: 10px;"></p>
+ <a style="margin-left: 10px;margin-top: 10px;margin-bottom: 10px;" onclick={clickLink}><lightning-formatted-text value={outputValue}></lightning-formatted-text></a>
+ <p style="height: 10px;"></p>
</template>
<template if:false={showLink}>
- <div
- style="
- margin-left: 10px;
- margin-top: 10px;
- margin-bottom: 10px;
- font-size: 16px;
- color: #696969;
- "
- >
- <lightning-formatted-text
- value={outputValue}
- ></lightning-formatted-text>
+ <div style="margin-left: 10px;margin-top: 10px;margin-bottom: 10px;font-size:16px;color:#696969;">
+ <lightning-formatted-text value={outputValue}></lightning-formatted-text>
</div>
</template>
</template>
<template if:false={showTitle}>
- <div style="text-align: right">
+ <div style="text-align: right;">
<template if:true={showLink}>
- <a
- style="margin-left: 10px; margin-right: 10px"
- onclick={clickLink}
- ><lightning-formatted-number
- value={outputValue}
- ></lightning-formatted-number
- ></a>
+ <a style="margin-left: 10px;margin-right: 10px;" onclick={clickLink}><lightning-formatted-number value={outputValue}></lightning-formatted-number></a>
</template>
<template if:false={showLink}>
- <lightning-formatted-number
- style="margin-left: 10px; margin-right: 10px"
- value={outputValue}
- ></lightning-formatted-number>
+ <lightning-formatted-number style="margin-left: 10px;margin-right: 10px;" value={outputValue}></lightning-formatted-number>
</template>
</div>
</template>
diff --git a/force-app/main/default/lwc/customOutputGood/customOutputGood.js b/force-app/main/default/lwc/customOutputGood/customOutputGood.js
index a3b4649..643c9ce 100644
--- a/force-app/main/default/lwc/customOutputGood/customOutputGood.js
+++ b/force-app/main/default/lwc/customOutputGood/customOutputGood.js
@@ -1,55 +1,42 @@
-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 7f8cb20..70cde91 100644
--- a/force-app/main/default/lwc/customShipmentAmountComp/customShipmentAmountComp.html
+++ b/force-app/main/default/lwc/customShipmentAmountComp/customShipmentAmountComp.html
@@ -1,11 +1,10 @@
<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 8e67f2e..6822093 100644
--- a/force-app/main/default/lwc/customShipmentAmountComp/customShipmentAmountComp.js
+++ b/force-app/main/default/lwc/customShipmentAmountComp/customShipmentAmountComp.js
@@ -1,12 +1,9 @@
-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 c5cff5b..4638662 100644
--- a/force-app/main/default/lwc/customShipmentNumberComp/customShipmentNumberComp.html
+++ b/force-app/main/default/lwc/customShipmentNumberComp/customShipmentNumberComp.html
@@ -1,17 +1,6 @@
<template>
<c-common-toast></c-common-toast>
- <lightning-input
- style="border: 1px solid red; border-radius: 5px"
- step="any"
- type="number"
- name="shipmentNumber"
- label="鍑鸿揣鏁伴噺"
- variant="label-hidden"
- onchange={dataChange}
- data-field="shipmentNumber"
- value={shipmentNumber}
- onblur={shipmentNumberBlur}
- min="0"
- class="inputFont"
- ></lightning-input>
+ <lightning-input style="border:1px solid red;border-radius:5px;" step="any" type="number" name="shipmentNumber" label="鍑鸿揣鏁伴噺"
+ variant="label-hidden" onchange={dataChange} data-field="shipmentNumber" value={shipmentNumber}
+ onblur={shipmentNumberBlur} min="0" class="inputFont"></lightning-input>
</template>
\ 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 f3f1583..d16b48f 100644
--- a/force-app/main/default/lwc/customShipmentNumberComp/customShipmentNumberComp.js
+++ b/force-app/main/default/lwc/customShipmentNumberComp/customShipmentNumberComp.js
@@ -11,20 +11,16 @@
}
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;
}
}
@@ -32,23 +28,18 @@
//鍚戜笅鍙栨暣
if (this.hasDecimals(this.shipmentNumber)) {
this.showMyToast('閿欒', '璇疯緭鍏ユ暣鏁�', 'Error');
- this.shipmentNumber = Math.floor(this.shipmentNumber);
+ this.shipmentNumber = Math.floor(this.shipmentNumber)
}
}
event.target.value = this.shipmentNumber;
- this.dispatchEvent(
- new CustomEvent('shipmentnumber', {
- 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) {
@@ -70,17 +61,10 @@
iconName = 'utility:error';
}
if (message != '') {
- content =
- '<h2><strong>' +
- title +
- '<strong/></h2><h5>' +
- message +
- '</h5>';
+ content = '<h2><strong>' + title + '<strong/></h2><h5>' + message + '</h5>';
} else {
content = '<h2><strong>' + title + '<strong/></h2>';
}
- this.template
- .querySelector('c-common-toast')
- .showToast(variant, content, iconName, 10000);
+ this.template.querySelector('c-common-toast').showToast(variant, content, iconName, 10000);
}
}
\ 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 68f1d77..b573650 100644
--- a/force-app/main/default/lwc/customShippingUnitPriceComp/customShippingUnitPriceComp.html
+++ b/force-app/main/default/lwc/customShippingUnitPriceComp/customShippingUnitPriceComp.html
@@ -1,16 +1,5 @@
<template>
- <lightning-input
- style="border: 1px solid red; border-radius: 5px"
- step="any"
- type="number"
- name="shipmentUnitPrice"
- label="deliveryOrderNo"
- variant="label-hidden"
- data-field="shipmentUnitPrice"
- value={shippingUnitPrice}
- onblur={shipmentUnitPriceBlur}
- min="0"
- class="inputFont"
- onchange={limitDecimals}
- ></lightning-input>
+ <lightning-input style="border:1px solid red;border-radius:5px" step="any" type="number" name="shipmentUnitPrice"
+ label="deliveryOrderNo" variant="label-hidden" data-field="shipmentUnitPrice" value={shippingUnitPrice}
+ onblur={shipmentUnitPriceBlur} min="0" class="inputFont" onchange={limitDecimals}></lightning-input>
</template>
\ 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 2fab414..fa196e7 100644
--- a/force-app/main/default/lwc/customShippingUnitPriceComp/customShippingUnitPriceComp.js
+++ b/force-app/main/default/lwc/customShippingUnitPriceComp/customShippingUnitPriceComp.js
@@ -1,41 +1,34 @@
-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 89e69e5..4592b6c 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,24 +6,22 @@
@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 4fbefed..a4c23fb 100644
--- a/force-app/main/default/lwc/customWeeklyReportComp/customWeeklyReportComp.html
+++ b/force-app/main/default/lwc/customWeeklyReportComp/customWeeklyReportComp.html
@@ -1,13 +1,8 @@
<template>
<template if:true={isShowButton}>
- <lightning-button
- label="鏌ョ湅鍛ㄦ姤娲诲姩"
- title="鍛ㄦ姤"
- onclick={toWeeklyReport}
- class="slds-m-left_x-small"
- ></lightning-button>
+ <lightning-button label="鏌ョ湅鍛ㄦ姤娲诲姩" title="鍛ㄦ姤" onclick={toWeeklyReport} class="slds-m-left_x-small"></lightning-button>
</template>
<template if:false={isShowButton}>
- <p style="text-align: center">...</p>
+ <p style="text-align: center;">...</p>
</template>
</template>
\ 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 184e80d..9c1404f 100644
--- a/force-app/main/default/lwc/customWeeklyReportComp/customWeeklyReportComp.js
+++ b/force-app/main/default/lwc/customWeeklyReportComp/customWeeklyReportComp.js
@@ -1,13 +1,11 @@
import { LightningElement, api, track } from 'lwc';
-import { NavigationMixin } from 'lightning/navigation';
+import { NavigationMixin } from "lightning/navigation";
import View_Weekly_Report from '@salesforce/label/c.View_Weekly_Report';
const customLabel = {
View_Weekly_Report
-};
-export default class CustomWeeklyReportComp extends NavigationMixin(
- LightningElement
-) {
+}
+export default class CustomWeeklyReportComp extends NavigationMixin(LightningElement) {
@track label = customLabel;
@api recordId;
@@ -16,28 +14,20 @@
connectedCallback() {
console.log('CustomWeeklyReportComp recordId = ' + this.recordId);
- console.log(
- 'CustomWeeklyReportComp hospitalName = ' + this.hospitalName
- );
+ console.log('CustomWeeklyReportComp hospitalName = ' + this.hospitalName);
}
toWeeklyReport() {
console.log('鍘绘姤琛�');
- let reportFilters =
- '[{"operator":"equals","value":"' +
- this.hospitalName +
- '","column":"Agency_Report__c.Hospital__c"}]';
+ let reportFilters = '[{"operator":"equals","value":"' + this.hospitalName + '","column":"Agency_Report__c.Hospital__c"}]';
let reportUrl = this.label.View_Weekly_Report;
- let url =
- '/report/' +
- reportUrl +
- '?reportFilters=' +
- encodeURIComponent(reportFilters);
+ console.log('reportUrl = ' + reportUrl);
+ let url = "/report/" + reportUrl + "?reportFilters=" + encodeURIComponent(reportFilters);
this[NavigationMixin.Navigate]({
- type: 'standard__webPage',
+ type: "standard__webPage",
attributes: {
- url: url
- }
+ url: url,
+ },
});
}
}
\ 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 bfe4e5b..1f6f8c2 100644
--- a/force-app/main/default/lwc/lexAgencyInfo/lexAgencyInfo.html
+++ b/force-app/main/default/lwc/lexAgencyInfo/lexAgencyInfo.html
@@ -2,10 +2,7 @@
<template if:true={showSpinner}>
<!-- <lightning-spinner size="medium" variant="brand"></lightning-spinner> -->
<div class="slds-spinner_container">
- <div
- role="status"
- class="slds-spinner slds-spinner_medium slds-spinner_brand"
- >
+ <div role="status" class="slds-spinner slds-spinner_medium slds-spinner_brand">
<span class="slds-assistive-text">Loading</span>
<div class="slds-spinner__dot-a"></div>
<div class="slds-spinner__dot-b"></div>
@@ -14,14 +11,8 @@
</template>
<c-common-toast></c-common-toast>
<template if:true={showPage}>
- <div
- style="
- border: 1px solid #d4d4d4;
- border-top: 3px solid #51606e;
- border-radius: 5px;
- "
- >
- <div style="border-bottom: 1px solid #d4d4d4; padding: 3px">
+ <div style="border: 1px solid #D4D4D4;border-top: 3px solid #51606E;border-radius:5px;">
+ <div style="border-bottom: 1px solid #D4D4D4;padding:3px;">
<lightning-layout>
<lightning-layout-item padding="around-small">
<p style="font-size: 18px">
@@ -30,175 +21,91 @@
</lightning-layout-item>
</lightning-layout>
</div>
- <div style="padding: 10px">
- <lightning-accordion
- allow-multiple-sections-open
- active-section-name={activeSections}
- >
- <lightning-record-view-form
- record-id={accountId}
- object-api-name="Account"
- >
- <lightning-accordion-section
- label="缁忛攢鍟嗚缁嗕俊鎭�"
- name="A"
- >
+ <div style="padding:10px;">
+ <lightning-accordion allow-multiple-sections-open active-section-name={activeSections}>
+ <lightning-record-view-form record-id={accountId} object-api-name="Account">
+ <lightning-accordion-section label="缁忛攢鍟嗚缁嗕俊鎭�" name="A">
<lightning-layout multiple-rows="true">
<lightning-layout-item size="5">
- <lightning-output-field
- field-name="Management_Code__c"
- ></lightning-output-field>
+ <lightning-output-field field-name="Management_Code__c"></lightning-output-field>
</lightning-layout-item>
- <lightning-layout-item
- size="1"
- ></lightning-layout-item>
+ <lightning-layout-item size="1"></lightning-layout-item>
<lightning-layout-item size="5">
- <lightning-output-field
- field-name="Name"
- ></lightning-output-field>
+ <lightning-output-field field-name="Name"></lightning-output-field>
</lightning-layout-item>
- <lightning-layout-item
- size="1"
- ></lightning-layout-item>
+ <lightning-layout-item size="1"></lightning-layout-item>
<lightning-layout-item size="5">
- <lightning-output-field
- field-name="Ban_On_Use_Date__c"
- ></lightning-output-field>
+ <lightning-output-field field-name="Ban_On_Use_Date__c"></lightning-output-field>
</lightning-layout-item>
- <lightning-layout-item
- size="1"
- ></lightning-layout-item>
+ <lightning-layout-item size="1"></lightning-layout-item>
<lightning-layout-item size="5">
- <lightning-output-field
- field-name="Ban_On_Use_Reason__c"
- ></lightning-output-field>
+ <lightning-output-field field-name="Ban_On_Use_Reason__c"></lightning-output-field>
</lightning-layout-item>
- <lightning-layout-item
- size="1"
- ></lightning-layout-item>
+ <lightning-layout-item size="1"></lightning-layout-item>
<lightning-layout-item size="5">
- <lightning-output-field
- field-name="Dealer_discount__c"
- ></lightning-output-field>
+ <lightning-output-field field-name="Dealer_discount__c"></lightning-output-field>
</lightning-layout-item>
- <lightning-layout-item
- size="1"
- ></lightning-layout-item>
+ <lightning-layout-item size="1"></lightning-layout-item>
<lightning-layout-item size="5">
- <lightning-output-field
- field-name="Sales_Shop_Class__c"
- ></lightning-output-field>
+ <lightning-output-field field-name="Sales_Shop_Class__c"></lightning-output-field>
</lightning-layout-item>
- <lightning-layout-item
- size="1"
- ></lightning-layout-item>
+ <lightning-layout-item size="1"></lightning-layout-item>
<lightning-layout-item size="5">
- <lightning-output-field
- field-name="Deposit_Receipt_Finished__c"
- ></lightning-output-field>
+ <lightning-output-field field-name="Deposit_Receipt_Finished__c"></lightning-output-field>
</lightning-layout-item>
- <lightning-layout-item
- size="1"
- ></lightning-layout-item>
+ <lightning-layout-item size="1"></lightning-layout-item>
<lightning-layout-item size="5">
- <lightning-output-field
- field-name="Deposit_Receipt_Completion_Day__c"
- ></lightning-output-field>
+ <lightning-output-field field-name="Deposit_Receipt_Completion_Day__c"></lightning-output-field>
</lightning-layout-item>
- <lightning-layout-item
- size="1"
- ></lightning-layout-item>
+ <lightning-layout-item size="1"></lightning-layout-item>
</lightning-layout>
</lightning-accordion-section>
- <lightning-accordion-section
- label="钀ヤ笟璁稿彲璇佷功鐘跺喌"
- name="B"
- >
+ <lightning-accordion-section label="钀ヤ笟璁稿彲璇佷功鐘跺喌" name="B">
<lightning-layout multiple-rows="true">
<lightning-layout-item size="5">
- <lightning-output-field
- field-name="Business_Authorization_No__c"
- ></lightning-output-field>
+ <lightning-output-field field-name="Business_Authorization_No__c"></lightning-output-field>
</lightning-layout-item>
- <lightning-layout-item
- size="1"
- ></lightning-layout-item>
+ <lightning-layout-item size="1"></lightning-layout-item>
<lightning-layout-item size="5">
- <lightning-output-field
- field-name="Business_Paper_Expiration_Date__c"
- ></lightning-output-field>
+ <lightning-output-field field-name="Business_Paper_Expiration_Date__c"></lightning-output-field>
</lightning-layout-item>
- <lightning-layout-item
- size="1"
- ></lightning-layout-item>
+ <lightning-layout-item size="1"></lightning-layout-item>
<lightning-layout-item size="5">
- <lightning-output-field
- field-name="Tax_Practice_No__c"
- ></lightning-output-field>
+ <lightning-output-field field-name="Tax_Practice_No__c"></lightning-output-field>
</lightning-layout-item>
- <lightning-layout-item
- size="1"
- ></lightning-layout-item>
+ <lightning-layout-item size="1"></lightning-layout-item>
<lightning-layout-item size="5">
- <lightning-output-field
- field-name="Tax_Practice_Expiration_Date__c"
- ></lightning-output-field>
+ <lightning-output-field field-name="Tax_Practice_Expiration_Date__c"></lightning-output-field>
</lightning-layout-item>
- <lightning-layout-item
- size="1"
- ></lightning-layout-item>
+ <lightning-layout-item size="1"></lightning-layout-item>
<lightning-layout-item size="5">
- <lightning-output-field
- field-name="Medical_Equipment_Num__c"
- ></lightning-output-field>
+ <lightning-output-field field-name="Medical_Equipment_Num__c"></lightning-output-field>
</lightning-layout-item>
- <lightning-layout-item
- size="1"
- ></lightning-layout-item>
+ <lightning-layout-item size="1"></lightning-layout-item>
<lightning-layout-item size="5">
- <lightning-output-field
- field-name="Medical_Equipment_Expiration_Date__c"
- ></lightning-output-field>
+ <lightning-output-field field-name="Medical_Equipment_Expiration_Date__c"></lightning-output-field>
</lightning-layout-item>
- <lightning-layout-item
- size="1"
- ></lightning-layout-item>
+ <lightning-layout-item size="1"></lightning-layout-item>
</lightning-layout>
</lightning-accordion-section>
<lightning-accordion-section label="鍦板潃淇℃伅" name="C">
<lightning-layout multiple-rows="true">
<lightning-layout-item size="5">
- <lightning-output-field
- field-name="Postal_Code__c"
- ></lightning-output-field>
+ <lightning-output-field field-name="Postal_Code__c"></lightning-output-field>
</lightning-layout-item>
- <lightning-layout-item
- size="1"
- ></lightning-layout-item>
+ <lightning-layout-item size="1"></lightning-layout-item>
<lightning-layout-item size="5">
- <lightning-output-field
- field-name="Phone"
- ></lightning-output-field>
+ <lightning-output-field field-name="Phone"></lightning-output-field>
</lightning-layout-item>
- <lightning-layout-item
- size="1"
- ></lightning-layout-item>
+ <lightning-layout-item size="1"></lightning-layout-item>
<lightning-layout-item size="5">
- <lightning-output-field
- field-name="Address_Together__c"
- ></lightning-output-field>
+ <lightning-output-field field-name="Address_Together__c"></lightning-output-field>
</lightning-layout-item>
- <lightning-layout-item
- size="1"
- ></lightning-layout-item>
+ <lightning-layout-item size="1"></lightning-layout-item>
<lightning-layout-item size="5">
- <lightning-output-field
- field-name="Fax"
- ></lightning-output-field>
+ <lightning-output-field field-name="Fax"></lightning-output-field>
</lightning-layout-item>
- <lightning-layout-item
- size="1"
- ></lightning-layout-item>
+ <lightning-layout-item size="1"></lightning-layout-item>
</lightning-layout>
</lightning-accordion-section>
</lightning-record-view-form>
diff --git a/force-app/main/default/lwc/lexAgencyInfo/lexAgencyInfo.js b/force-app/main/default/lwc/lexAgencyInfo/lexAgencyInfo.js
index c4dcb37..0d8ae06 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,47 +26,33 @@
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';
@@ -80,5 +66,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 9df951c..1080fb3 100644
--- a/force-app/main/default/lwc/lexAgencyOppCusCell/lexAgencyOppCusCell.html
+++ b/force-app/main/default/lwc/lexAgencyOppCusCell/lexAgencyOppCusCell.html
@@ -1,23 +1,12 @@
<template>
<template if:true={isShowInputField}>
<lightning-record-edit-form object-api-name="Agency_Opportunity__c">
- <lightning-input-field
- field-name={fieldName}
- variant="label-hidden"
- value={inputValue}
- onchange={inputChange}
- ></lightning-input-field>
+ <lightning-input-field field-name={fieldName} variant="label-hidden" value={inputValue} onchange={inputChange}></lightning-input-field>
</lightning-record-edit-form>
</template>
<template if:false={isShowInputField}>
- <lightning-record-view-form
- record-id={recordId}
- object-api-name="Agency_Opportunity__c"
- >
- <lightning-output-field
- variant="label-hidden"
- field-name={fieldName}
- ></lightning-output-field>
+ <lightning-record-view-form record-id={recordId} object-api-name="Agency_Opportunity__c">
+ <lightning-output-field variant="label-hidden" field-name={fieldName}></lightning-output-field>
</lightning-record-view-form>
</template>
</template>
\ 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 b406e66..bce7edd 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,31 +6,24 @@
@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/lexArriveGoods/lexArriveGoods.css b/force-app/main/default/lwc/lexArriveGoods/lexArriveGoods.css
index 32d24c8..49d6963 100644
--- a/force-app/main/default/lwc/lexArriveGoods/lexArriveGoods.css
+++ b/force-app/main/default/lwc/lexArriveGoods/lexArriveGoods.css
@@ -1 +1 @@
-@import "c/lexCssUtility";
+@import 'c/lexCssUtility';
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexArriveGoods/lexArriveGoods.html b/force-app/main/default/lwc/lexArriveGoods/lexArriveGoods.html
index bb32158..9a4bd7e 100644
--- a/force-app/main/default/lwc/lexArriveGoods/lexArriveGoods.html
+++ b/force-app/main/default/lwc/lexArriveGoods/lexArriveGoods.html
@@ -1,337 +1,201 @@
<template>
- <template if:true={showSpinner}>
- <lightning-spinner size="medium" variant="brand"></lightning-spinner>
- </template>
- <c-common-toast></c-common-toast>
- <template if:true={showPage}>
- <div
- style="
- border: 1px solid #d4d4d4;
- border-top: 3px solid #51606e;
- border-radius: 5px;
- "
- >
- <div style="border-bottom: 1px solid #d4d4d4; padding: 3px">
- <lightning-layout>
- <lightning-layout-item padding="around-small">
- <p style="font-size: 18px">
- <strong>鍏ュ簱/杩斿搧</strong>
- </p>
- </lightning-layout-item>
- </lightning-layout>
- <!-- <p style="font-size: 16px;"><strong>鍏ュ簱/杩斿搧</strong></p> -->
- </div>
- <div style="padding: 10px">
- <!-- 鎸夐挳 -->
- <template if:false={returnFLGbln}>
- <!-- <lightning-button style="margin: 5px;" label="鍒拌揣纭" onclick={arriveGoodsConfim} disabled={saveFLGbln}></lightning-button> -->
- <button
- class="slds-button slds-button_neutral slds-button_stretch lexBorder"
- style="margin: 5px"
- label="鍒拌揣纭"
- onclick={arriveGoodsConfim}
- disabled={saveFLGbln}
- >
- 鍒拌揣纭
- </button>
- </template>
- <template if:true={returnFLGbln}>
- <!-- <lightning-button style="margin: 5px;" label="鐧诲綍杩斿搧" onclick={updateGoodsOfReturn}></lightning-button> -->
- <button
- class="slds-button slds-button_neutral slds-button_stretch lexBorder"
- style="margin: 5px"
- label="鐧诲綍杩斿搧"
- onclick={updateGoodsOfReturn}
- >
- 鐧诲綍杩斿搧
- </button>
- </template>
- <p style="height: 10px"></p>
- <!-- 璁㈠崟淇℃伅 -->
- <template if:true={showOrderDetail}>
- <div
- style="
- border: 1px solid #d4d4d4;
- border-top: 3px solid #51606e;
- border-radius: 5px;
- margin-bottom: 7px;
- "
- >
- <div style="border-bottom: 1px solid #d4d4d4; padding: 3px">
- <lightning-layout>
- <lightning-layout-item padding="around-small">
- <p style="font-size: 18px">
- <strong>璁㈠崟淇℃伅</strong>
- </p>
- </lightning-layout-item>
- </lightning-layout>
- <!-- <p style="font-size: 16px;"><strong>璁㈠崟淇℃伅</strong></p> -->
+ <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 style="padding: 10px">
- <table>
- <tbody>
- <tr>
- <td style="width: 10px"></td>
- <td style="width: 60px">
- <div style="color: #696969; font-size: 12px">
- 璁㈠崟鍚嶇О
- </div>
- </td>
- <td style="width: 200px">
- <lightning-formatted-text
- value={coc.Name}
- ></lightning-formatted-text>
- </td>
- <td style="width: 30px"></td>
- <td style="width: 60px">
- <div style="color: #696969; font-size: 12px">
- 璁㈠崟鎬绘暟
- </div>
- </td>
- <td style="width: 100px">
- <lightning-formatted-number
- value={coc.Total_num__c}
- ></lightning-formatted-number>
- </td>
- <td style="width: 30px"></td>
- <td style="width: 72px">
- <div style="color: #696969; font-size: 12px">
- 宸插埌璐ф暟閲�
- </div>
- </td>
- <td style="width: 100px">
- <lightning-formatted-number
- value={coc.OrderNumber_arrived__c}
- ></lightning-formatted-number>
- </td>
- <td style="width: 30px"></td>
- <td style="width: 84px">
- <div style="color: #696969; font-size: 12px">
- 杩樻病鍙戣揣鏁伴噺
- </div>
- </td>
- <td style="width: 100px">
- <lightning-formatted-number
- value={coc.OrderNumber_notarrive__c}
- ></lightning-formatted-number>
- </td>
- <td></td>
- </tr>
- </tbody>
- </table>
- </div>
- </div>
- </template>
- <!-- BarCode褰曞叆 -->
- <div
- style="
- border: 1px solid #d4d4d4;
- border-top: 3px solid #51606e;
- border-radius: 5px;
- margin-bottom: 7px;
- "
- >
- <div style="border-bottom: 1px solid #d4d4d4; padding: 3px">
- <lightning-layout>
- <lightning-layout-item padding="around-small">
- <p style="font-size: 18px">
- <strong>BarCode褰曞叆</strong>
- </p>
- </lightning-layout-item>
- </lightning-layout>
- <!-- <p style="font-size: 16px;"><strong>BarCode褰曞叆</strong></p> -->
- </div>
- <div style="padding: 10px">
- <table>
- <tbody>
- <tr>
- <td style="width: 20px"></td>
- <td style="width: 60px; font-size: 16px">BarCode</td>
- <td style="width: 30px"></td>
- <td style="width: 600px">
- <lightning-textarea
- class="inputFont"
- name="BarCode"
- value={barcode}
- label=""
- variant="label-hidden"
- onchange={barcodeChange}
- ></lightning-textarea>
- </td>
- <td style="width: 30px"></td>
- <td style="width: 200px">
- <!-- <lightning-button label="鑾峰彇鏄庣粏" title="鑾峰彇鏄庣粏" onclick={barcodeEntrys} style="width: 300px;"></lightning-button> -->
- <button
- class="slds-button slds-button_neutral slds-button_stretch lexBorder"
- label="鑾峰彇鏄庣粏"
- onclick={barcodeEntrys}
- >
- 鑾峰彇鏄庣粏
- </button>
- </td>
- <td></td>
- </tr>
- </tbody>
- </table>
- </div>
</div>
- <!-- 璀﹀憡鎻愰啋 -->
- <template if:true={hasWarning}>
- <div
- style="
- border: 1px solid #d4d4d4;
- border-radius: 5px;
- margin-bottom: 7px;
- "
- >
- <div
- style="
- border-bottom: 1px solid #d4d4d4;
- border-radius: 5px;
- margin-bottom: 7px;
- color: #ff6a00;
- font-size: 17px;
- "
- >
- <lightning-icon icon-name="utility:warning"></lightning-icon>
- <strong> 璀﹀憡</strong>
+ </template>
+ <c-common-toast></c-common-toast>
+ <template if:true={showPage}>
+ <div style="border: 1px solid #D4D4D4;border-top: 3px solid #51606E;border-radius:5px;">
+ <div style="border-bottom: 1px solid #D4D4D4;padding:3px;">
+ <lightning-layout>
+ <lightning-layout-item padding="around-small">
+ <p style="font-size: 18px">
+ <strong>鍏ュ簱/杩斿搧</strong>
+ </p>
+ </lightning-layout-item>
+ </lightning-layout>
+ <!-- <p style="font-size: 16px;"><strong>鍏ュ簱/杩斿搧</strong></p> -->
</div>
- <template for:each={warningMsgs} for:item="msg">
- <p
- key={msg}
- style="color: #ff6a00; padding-left: 7px; font-size: 14px"
- >
- 銉� {msg}
- </p>
- </template>
- </div>
- </template>
- <!-- 鎶ラ敊鎻愰啋 -->
- <template if:true={hasError}>
- <div
- style="
- border: 1px solid #d4d4d4;
- border-radius: 5px;
- margin-bottom: 7px;
- "
- >
- <div
- style="
- border-bottom: 1px solid #d4d4d4;
- border-radius: 5px;
- margin-bottom: 7px;
- color: red;
- font-size: 17px;
- "
- >
- <lightning-icon icon-name="utility:error"></lightning-icon>
- <strong> 閿欒</strong>
- </div>
- <template for:each={errorMsgs} for:item="msg">
- <p
- key={msg}
- style="color: red; padding-left: 7px; font-size: 14px"
- >
- 銉� {msg}
- </p>
- </template>
- </div>
- </template>
- <!-- 鏈鍒拌揣浜у搧姹囨�� -->
- <template if:false={returnFLGbln}>
- <div
- style="
- border: 1px solid #d4d4d4;
- border-top: 3px solid #51606e;
- border-radius: 5px;
- margin-bottom: 7px;
- "
- >
- <div style="border-bottom: 1px solid #d4d4d4; padding: 3px">
- <lightning-layout>
- <lightning-layout-item padding="around-small">
- <p style="font-size: 18px">
- <strong>鏈鍒拌揣浜у搧姹囨��</strong>
- </p>
- </lightning-layout-item>
- </lightning-layout>
- <!-- <p style="font-size: 16px;"><strong>鏈鍒拌揣浜у搧姹囨��</strong></p> -->
- </div>
- <div style="padding: 10px">
- <lightning-datatable
- class="wrapped-header-datatable"
- hide-checkbox-column
- key-field="recordId"
- columns={currentArrProdCols}
- data={detailsSummary}
- ></lightning-datatable>
- </div>
- </div>
- </template>
- <!-- 鍒拌揣鏄庣粏 -->
- <template if:false={returnFLGbln}>
- <div
- style="
- border: 1px solid #d4d4d4;
- border-top: 3px solid #51606e;
- border-radius: 5px;
- margin-bottom: 7px;
- "
- >
- <div style="border-bottom: 1px solid #d4d4d4; padding: 3px">
- <lightning-layout>
- <lightning-layout-item padding="around-small">
- <p style="font-size: 18px">
- <strong>鍏ュ簱鍜屽埌璐ф槑缁�</strong>
- </p>
- </lightning-layout-item>
- </lightning-layout>
- </div>
- <div style="padding: 10px">
- <lightning-datatable
- class="wrapped-header-datatable"
- hide-checkbox-column
- key-field="recordId"
- columns={arrDetailCols}
- data={consumableorderdetailsRecordsview}
- ></lightning-datatable>
- </div>
- </div>
- </template>
- <!-- 杩斿搧鏄庣粏 -->
- <template if:true={returnFLGbln}>
- <div
- style="
- border: 1px solid #d4d4d4;
- border-top: 3px solid #51606e;
- border-radius: 5px;
- margin-bottom: 7px;
- "
- >
- <div style="border-bottom: 1px solid #d4d4d4; padding: 3px">
- <lightning-layout>
- <lightning-layout-item padding="around-small">
- <p style="font-size: 18px">
- <strong>鍏ュ簱鍜岃繑鍝佹槑缁�</strong>
- </p>
- </lightning-layout-item>
- </lightning-layout>
- </div>
- <div style="padding: 10px">
- <c-lex-custom-lightning-datatable
- class="wrapped-header-datatable"
- hide-checkbox-column
- key-field="recordId"
- data={showGoodsofReturnListView}
- columns={returnDetailCols}
- onchangereturncount={returnCountChange}
- onchangevalue={returnReasonChange}
- ></c-lex-custom-lightning-datatable>
- </div>
- </div>
- </template>
- <!-- 鍏ュ簱鏄庣粏 -->
- <!-- <div style="border: 1px solid #D4D4D4;border-top: 3px solid #51606E;border-radius:5px;margin-bottom:7px;">
+ <div style="padding:10px;">
+ <!-- 鎸夐挳 -->
+ <template if:false={returnFLGbln}>
+ <!-- <lightning-button style="margin: 5px;" label="鍒拌揣纭" onclick={arriveGoodsConfim} disabled={saveFLGbln}></lightning-button> -->
+ <button class="slds-button slds-button_neutral slds-button_stretch lexBorder" style="margin: 5px;" label="鍒拌揣纭" onclick={arriveGoodsConfim} disabled={saveFLGbln}>鍒拌揣纭</button>
+ </template>
+ <template if:true={returnFLGbln}>
+ <!-- <lightning-button style="margin: 5px;" label="鐧诲綍杩斿搧" onclick={updateGoodsOfReturn}></lightning-button> -->
+ <button class="slds-button slds-button_neutral slds-button_stretch lexBorder" style="margin: 5px;" label="鐧诲綍杩斿搧" onclick={updateGoodsOfReturn}>鐧诲綍杩斿搧</button>
+ </template>
+ <p style="height: 10px;"></p>
+ <!-- 璁㈠崟淇℃伅 -->
+ <template if:true={showOrderDetail}>
+ <div style="border: 1px solid #D4D4D4;border-top: 3px solid #51606E;border-radius:5px;margin-bottom:7px;">
+ <div style="border-bottom: 1px solid #D4D4D4;padding:3px;">
+ <lightning-layout>
+ <lightning-layout-item padding="around-small">
+ <p style="font-size: 18px">
+ <strong>璁㈠崟淇℃伅</strong>
+ </p>
+ </lightning-layout-item>
+ </lightning-layout>
+ <!-- <p style="font-size: 16px;"><strong>璁㈠崟淇℃伅</strong></p> -->
+ </div>
+ <div style="padding:10px;">
+ <table>
+ <tbody>
+ <tr>
+ <td style="width:10px;"></td>
+ <td style="width:60px;">
+ <div style="color:#696969;font-size:12px;">璁㈠崟鍚嶇О</div>
+ </td>
+ <td style="width:200px;">
+ <lightning-formatted-text value={coc.Name}></lightning-formatted-text>
+ </td>
+ <td style="width:30px;"></td>
+ <td style="width:60px;">
+ <div style="color:#696969;font-size:12px;">璁㈠崟鎬绘暟</div>
+ </td>
+ <td style="width:100px;">
+ <lightning-formatted-number value={coc.Total_num__c}></lightning-formatted-number>
+ </td>
+ <td style="width:30px;"></td>
+ <td style="width:72px;">
+ <div style="color:#696969;font-size:12px;">宸插埌璐ф暟閲�</div>
+ </td>
+ <td style="width:100px;">
+ <lightning-formatted-number value={coc.OrderNumber_arrived__c}></lightning-formatted-number>
+ </td>
+ <td style="width:30px;"></td>
+ <td style="width:84px;">
+ <div style="color:#696969;font-size:12px;">杩樻病鍙戣揣鏁伴噺</div>
+ </td>
+ <td style="width:100px;">
+ <lightning-formatted-number value={coc.OrderNumber_notarrive__c}></lightning-formatted-number>
+ </td>
+ <td></td>
+ </tr>
+ </tbody>
+ </table>
+ </div>
+ </div>
+ </template>
+ <!-- BarCode褰曞叆 -->
+ <div style="border: 1px solid #D4D4D4;border-top: 3px solid #51606E;border-radius:5px;margin-bottom:7px;">
+ <div style="border-bottom: 1px solid #D4D4D4;padding:3px;">
+ <lightning-layout>
+ <lightning-layout-item padding="around-small">
+ <p style="font-size: 18px">
+ <strong>BarCode褰曞叆</strong>
+ </p>
+ </lightning-layout-item>
+ </lightning-layout>
+ <!-- <p style="font-size: 16px;"><strong>BarCode褰曞叆</strong></p> -->
+ </div>
+ <div style="padding:10px;">
+ <table>
+ <tbody>
+ <tr>
+ <td style="width:20px;"></td>
+ <td style="width:60px;font-size:16px;">BarCode</td>
+ <td style="width:30px;"></td>
+ <td style="width:600px;">
+ <lightning-textarea class="inputFont" name="BarCode" value={barcode} label="" variant="label-hidden" onchange={barcodeChange}></lightning-textarea>
+ </td>
+ <td style="width:30px;"></td>
+ <td style="width:200px;">
+ <!-- <lightning-button label="鑾峰彇鏄庣粏" title="鑾峰彇鏄庣粏" onclick={barcodeEntrys} style="width: 300px;"></lightning-button> -->
+ <button class="slds-button slds-button_neutral slds-button_stretch lexBorder" label="鑾峰彇鏄庣粏" onclick={barcodeEntrys}>鑾峰彇鏄庣粏</button>
+ </td>
+ <td></td>
+ </tr>
+ </tbody>
+ </table>
+ </div>
+ </div>
+ <!-- 璀﹀憡鎻愰啋 -->
+ <template if:true={hasWarning}>
+ <div style="border: 1px solid #D4D4D4;border-radius:5px;margin-bottom:7px;">
+ <div style="border-bottom: 1px solid #D4D4D4;border-radius:5px;margin-bottom:7px;color:#ff6a00;font-size:17px;">
+ <lightning-icon icon-name="utility:warning"></lightning-icon>
+ <strong> 璀﹀憡</strong>
+ </div>
+ <template for:each={warningMsgs} for:item="msg">
+ <p key={msg} style="color:#ff6a00;padding-left:7px;font-size:14px;"> 銉� {msg}</p>
+ </template>
+ </div>
+ </template>
+ <!-- 鎶ラ敊鎻愰啋 -->
+ <template if:true={hasError}>
+ <div style="border: 1px solid #D4D4D4;border-radius:5px;margin-bottom:7px;">
+ <div style="border-bottom: 1px solid #D4D4D4;border-radius:5px;margin-bottom:7px;color:red;font-size:17px;">
+ <lightning-icon icon-name="utility:error"></lightning-icon>
+ <strong> 閿欒</strong>
+ </div>
+ <template for:each={errorMsgs} for:item="msg">
+ <p key={msg} style="color:red;padding-left:7px;font-size:14px;"> 銉� {msg}</p>
+ </template>
+ </div>
+ </template>
+ <!-- 鏈鍒拌揣浜у搧姹囨�� -->
+ <template if:false={returnFLGbln}>
+ <div style="border: 1px solid #D4D4D4;border-top: 3px solid #51606E;border-radius:5px;margin-bottom:7px;">
+ <div style="border-bottom: 1px solid #D4D4D4;padding:3px;">
+ <lightning-layout>
+ <lightning-layout-item padding="around-small">
+ <p style="font-size: 18px">
+ <strong>鏈鍒拌揣浜у搧姹囨��</strong>
+ </p>
+ </lightning-layout-item>
+ </lightning-layout>
+ <!-- <p style="font-size: 16px;"><strong>鏈鍒拌揣浜у搧姹囨��</strong></p> -->
+ </div>
+ <div style="padding:10px;">
+ <lightning-datatable class="wrapped-header-datatable" style="word-wrap:break-word; word-break:break-all;" hide-checkbox-column key-field="recordId" columns={currentArrProdCols} data={detailsSummary}></lightning-datatable>
+ </div>
+ </div>
+ </template>
+ <!-- 鍒拌揣鏄庣粏 -->
+ <template if:false={returnFLGbln}>
+ <div style="border: 1px solid #D4D4D4;border-top: 3px solid #51606E;border-radius:5px;margin-bottom:7px;">
+ <div style="border-bottom: 1px solid #D4D4D4;padding:3px;">
+ <lightning-layout>
+ <lightning-layout-item padding="around-small">
+ <p style="font-size: 18px">
+ <strong>鍏ュ簱鍜屽埌璐ф槑缁�</strong>
+ </p>
+ </lightning-layout-item>
+ </lightning-layout>
+ </div>
+ <div style="padding:10px;">
+ <lightning-datatable class="wrapped-header-datatable" style="word-wrap:break-word; word-break:break-all;" hide-checkbox-column key-field="recordId" columns={arrDetailCols} data={consumableorderdetailsRecordsview}></lightning-datatable>
+ </div>
+ </div>
+ </template>
+ <!-- 杩斿搧鏄庣粏 -->
+ <template if:true={returnFLGbln}>
+ <div style="border: 1px solid #D4D4D4;border-top: 3px solid #51606E;border-radius:5px;margin-bottom:7px;">
+ <div style="border-bottom: 1px solid #D4D4D4;padding:3px;">
+ <lightning-layout>
+ <lightning-layout-item padding="around-small">
+ <p style="font-size: 18px">
+ <strong>鍏ュ簱鍜岃繑鍝佹槑缁�</strong>
+ </p>
+ </lightning-layout-item>
+ </lightning-layout>
+ </div>
+ <div style="padding:10px;">
+ <c-lex-custom-lightning-datatable class="wrapped-header-datatable" style="word-wrap:break-word; word-break:break-all;" hide-checkbox-column key-field="recordId" data={showGoodsofReturnListView} columns={returnDetailCols} onchangereturncount={returnCountChange} onchangevalue={returnReasonChange}></c-lex-custom-lightning-datatable>
+ </div>
+ </div>
+ </template>
+ <!-- 鍏ュ簱鏄庣粏 -->
+ <!-- <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">
@@ -345,36 +209,23 @@
<lightning-datatable class="wrapped-header-datatable" hide-checkbox-column key-field="recordId" columns={inDetailCols} data={consumableInventory}></lightning-datatable>
</div>
</div> -->
- <!-- 閿欒鏄庣粏 -->
- <div
- style="
- border: 1px solid #d4d4d4;
- border-top: 3px solid #51606e;
- border-radius: 5px;
- margin-bottom: 7px;
- "
- >
- <div style="border-bottom: 1px solid #d4d4d4; padding: 3px">
- <lightning-layout>
- <lightning-layout-item padding="around-small">
- <p style="font-size: 18px">
- <strong>閿欒鏄庣粏</strong>
- </p>
- </lightning-layout-item>
- </lightning-layout>
- <!-- <p style="font-size: 16px;"><strong>閿欒鏄庣粏</strong></p> -->
- </div>
- <div style="padding: 10px">
- <lightning-datatable
- class="wrapped-header-datatable"
- hide-checkbox-column
- key-field="recordId"
- columns={errorDetailCols}
- data={consumableorderdetailsRecordserror}
- ></lightning-datatable>
- </div>
+ <!-- 閿欒鏄庣粏 -->
+ <div style="border: 1px solid #D4D4D4;border-top: 3px solid #51606E;border-radius:5px;margin-bottom:7px;">
+ <div style="border-bottom: 1px solid #D4D4D4;padding:3px;">
+ <lightning-layout>
+ <lightning-layout-item padding="around-small">
+ <p style="font-size: 18px">
+ <strong>閿欒鏄庣粏</strong>
+ </p>
+ </lightning-layout-item>
+ </lightning-layout>
+ <!-- <p style="font-size: 16px;"><strong>閿欒鏄庣粏</strong></p> -->
+ </div>
+ <div style="padding:10px;">
+ <lightning-datatable class="wrapped-header-datatable" style="word-wrap:break-word; word-break:break-all;" hide-checkbox-column key-field="recordId" columns={errorDetailCols} data={consumableorderdetailsRecordserror}></lightning-datatable>
+ </div>
+ </div>
+ </div>
</div>
- </div>
- </div>
- </template>
-</template>
+ </template>
+</template>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexArriveGoods/lexArriveGoods.js b/force-app/main/default/lwc/lexArriveGoods/lexArriveGoods.js
index 47d4801..796a99c 100644
--- a/force-app/main/default/lwc/lexArriveGoods/lexArriveGoods.js
+++ b/force-app/main/default/lwc/lexArriveGoods/lexArriveGoods.js
@@ -1,773 +1,482 @@
-import { LightningElement, wire, track } from "lwc";
-import { CurrentPageReference } from "lightning/navigation";
-import { ShowToastEvent } from "lightning/platformShowToastEvent";
-import { NavigationMixin } from "lightning/navigation";
-import init from "@salesforce/apex/LexArriveGoodsController.init";
-import searchProduct from "@salesforce/apex/LexArriveGoodsController.searchProduct";
-import arriveGoodsConfim from "@salesforce/apex/LexArriveGoodsController.arriveGoodsConfim";
-import updateGoodsOfReturn from "@salesforce/apex/LexArriveGoodsController.updateGoodsOfReturn";
-//table css
+import { LightningElement,wire,track } from 'lwc';
+import { CurrentPageReference } from 'lightning/navigation';
+import { ShowToastEvent } from 'lightning/platformShowToastEvent';
+import { NavigationMixin } from 'lightning/navigation';
+import init from '@salesforce/apex/LexArriveGoodsController.init';
+import searchProduct from '@salesforce/apex/LexArriveGoodsController.searchProduct';
+import arriveGoodsConfim from '@salesforce/apex/LexArriveGoodsController.arriveGoodsConfim';
+import updateGoodsOfReturn from '@salesforce/apex/LexArriveGoodsController.updateGoodsOfReturn';
+//table css
import { loadStyle } from "lightning/platformResourceLoader";
import WrappedHeaderTable from "@salesforce/resourceUrl/lexdatatable";
export default class LexArriveGoods extends NavigationMixin(LightningElement) {
- //椤甸潰鍙橀噺
- @track arrType;
- @track eSetId;
- @track returnFLGbln = false;
- @track saveFLGbln = false;
- @track barcode;
- @track arrController;
- stylesLoaded = false;
- @track showSpinner = true;
- @track showPage = false;
- //娑堣�楀搧璁㈠崟
- @track coc;
- @track cocId;
- //鏈鍒拌揣浜у搧姹囨��
- @track detailsSummary = [];
- //鍒拌揣鏄庣粏
- @track consumableorderdetailsRecords = [];
- @track consumableorderdetailsRecordsview = [];
- //杩斿搧鏄庣粏
- @track showGoodsofReturnList = [];
- @track showGoodsofReturnListView = [];
- //鍏ュ簱鏄庣粏
- @track consumableInventory = [];
- //閿欒鏄庣粏
- @track consumableorderdetailsRecordserror = [];
- //鎶ラ敊鎻愰啋
- @track errorMsgs = [];
- @track warningMsgs = [];
- //鏄惁涓�鐩存樉绀烘彁绀�
- @track isNoteStay = true;
+ //椤甸潰鍙橀噺
+ @track arrType;
+ @track eSetId;
+ @track returnFLGbln = false;
+ @track saveFLGbln = false;
+ @track barcode;
+ @track arrController;
+ stylesLoaded = false;
+ @track showSpinner = true;
+ @track showPage = false;
+ //娑堣�楀搧璁㈠崟
+ @track coc;
+ @track cocId;
+ //鏈鍒拌揣浜у搧姹囨��
+ @track detailsSummary = [];
+ //鍒拌揣鏄庣粏
+ @track consumableorderdetailsRecords = [];
+ @track consumableorderdetailsRecordsview = [];
+ //杩斿搧鏄庣粏
+ @track showGoodsofReturnList = [];
+ @track showGoodsofReturnListView = [];
+ //鍏ュ簱鏄庣粏
+ @track consumableInventory = [];
+ //閿欒鏄庣粏
+ @track consumableorderdetailsRecordserror = [];
+ //鎶ラ敊鎻愰啋
+ @track errorMsgs = [];
+ @track warningMsgs = [];
+ //鏄惁涓�鐩存樉绀烘彁绀�
+ @track isNoteStay = true;
- //鏄惁鏈夎鍛�
- get hasWarning() {
- if (this.warningMsgs == null || this.warningMsgs.length == 0) {
- return false;
+ //鏄惁鏈夎鍛�
+ get hasWarning(){
+ if(this.warningMsgs == null || this.warningMsgs.length == 0){
+ return false;
+ }
+ if(this.warningMsgs.length > 0){
+ return true;
+ }
}
- if (this.warningMsgs.length > 0) {
- return true;
- }
- }
- //鏄惁鏈夐敊璇�
- get hasError() {
- if (this.errorMsgs == null || this.errorMsgs.length == 0) {
- return false;
+ //鏄惁鏈夐敊璇�
+ get hasError(){
+ if(this.errorMsgs == null || this.errorMsgs.length == 0){
+ return false;
+ }
+ if(this.errorMsgs.length > 0){
+ return true;
+ }
}
- if (this.errorMsgs.length > 0) {
- return true;
- }
- }
- //鏈鍒拌揣浜у搧姹囨�籧ols
- @track currentArrProdCols = [
- {
- label: "浜у搧鍨嬪彿",
- fieldName: "assetModelNo",
- hideDefaultActions: true,
- wrapText: true,
- initialWidth: 220
- },
- {
- label: "浜у搧鍚嶇О",
- fieldName: "prodName",
- hideDefaultActions: true,
- wrapText: true
- },
- {
- label: "鍒拌揣鏁伴噺",
- fieldName: "arrivedCount",
- hideDefaultActions: true,
- wrapText: true,
- initialWidth: 220,
- cellAttributes: { alignment: "right" }
- },
- {
- label: "鍒拌揣閲戦",
- type: "number",
- typeAttributes: { minimumFractionDigits: 2 },
- fieldName: "arriveAmount",
- hideDefaultActions: true,
- wrapText: true,
- initialWidth: 220,
- cellAttributes: { alignment: "right" }
+ //鏈鍒拌揣浜у搧姹囨�籧ols
+ @track currentArrProdCols = [
+ {label:'浜у搧鍨嬪彿' , fieldName:'assetModelNo', hideDefaultActions: true,wrapText:true,initialWidth:220},
+ {label:'浜у搧鍚嶇О' , fieldName:'prodName', hideDefaultActions: true,wrapText:true},
+ {label:'鍒拌揣鏁伴噺' , fieldName:'arrivedCount', hideDefaultActions: true,wrapText:true,initialWidth:220,cellAttributes: { alignment: "right" }},
+ {label:'鍒拌揣閲戦' ,type:'number',typeAttributes:{minimumFractionDigits: 2}, fieldName:'arriveAmount', hideDefaultActions: true,wrapText:true,initialWidth:220,cellAttributes: { alignment: "right" }}
+ ];
+ //鍒拌揣鏄庣粏cols
+ @track arrDetailCols = [
+ {label:'娑堣�楀搧鍚嶇О' , fieldName:'prodName', hideDefaultActions: true,wrapText:true},
+ {label:'瑙勬牸' , fieldName:'productPackingListManual', hideDefaultActions: true,wrapText:true,initialWidth:55,cellAttributes: { alignment: "right" }},
+ {label:'CFDA鐘舵��' , fieldName:'status', hideDefaultActions: true,wrapText:true,initialWidth:120},
+ {label:'娉ㄥ唽璇佺紪鐮佸彿' , fieldName:'reportProductApprobation', hideDefaultActions: true,wrapText:true,initialWidth:190},
+ {label:'娉ㄥ唽璇佹晥鏈�' , fieldName:'ReportProductExpirationDate', hideDefaultActions: true,wrapText:true,initialWidth:110},
+ {label:'BarCode' , fieldName:'barCode', hideDefaultActions: true,wrapText:true,initialWidth:400}
+ ];
+ //杩斿搧鏄庣粏cols
+ get returnDetailCols(){
+ var cols = [];
+ cols.push({label:'鍑哄簱鍗�',fieldName:'orderUrl',type:'url',typeAttributes:{label:{fieldName:'orderNo'},target: "_blank"},hideDefaultActions: true,wrapText:true,initialWidth:180});
+ // cols.push({label:'鍑哄簱鍗�' , fieldName:'orderNo', hideDefaultActions: true});
+ cols.push({label:'鍑哄簱鏃�' , fieldName:'prodOutDate',wrapText:true, hideDefaultActions: true,initialWidth:110});
+ cols.push({label:'娑堣�楀搧鍚嶇О' , fieldName:'prodName',wrapText:true, hideDefaultActions: true,wrapText:true,initialWidth:190});
+ cols.push({label:'鍑哄簱鐩殑' , fieldName:'summonsForDirctionDet',wrapText:true, hideDefaultActions: true,initialWidth:130});
+ cols.push({label:'瀹㈡埛鍚�' , fieldName:'hospitalName', hideDefaultActions: true,wrapText:true,initialWidth:130});
+ cols.push({label:'缁忛攢鍟�' , fieldName:'orderDealer', hideDefaultActions: true,wrapText:true,initialWidth:100});
+ cols.push({label:'BarCode' , fieldName:'barCode', hideDefaultActions: true,wrapText:true,initialWidth:230});
+ cols.push({label:'浣跨敤鏈熼檺' , fieldName:'sterilizationLimit', hideDefaultActions: true,wrapText:true,initialWidth:110});
+ cols.push({label:'鍗曚綅' , fieldName:'boxPiece', hideDefaultActions: true,wrapText:true,initialWidth:50});
+ cols.push({
+ label:'杩斿搧鏁伴噺',
+ type: "customReturnGoodInput",
+ typeAttributes: {
+ inputValue: { fieldName: "returnCount" },
+ boxPrice: { fieldName: "boxPiece" },
+ recordId: { fieldName: "recordId" }
+ },
+ hideDefaultActions: true,wrapText:true,initialWidth:100});
+ cols.push({
+ label:'杩斿搧鍘熷洜',
+ type: "customTableInput",
+ typeAttributes: {
+ recordId: { fieldName: "recordId" },
+ inputValue: { fieldName: "returnReason" },
+ valueType: 'Text'
+ },
+ hideDefaultActions: true,wrapText:true,initialWidth:150});
+ // cols.push({label:'杩斿搧鍘熷洜' , fieldName:'returnReason', hideDefaultActions: true});
+ return cols;
}
- ];
- //鍒拌揣鏄庣粏cols
- @track arrDetailCols = [
- {
- label: "娑堣�楀搧鍚嶇О",
- fieldName: "prodName",
- hideDefaultActions: true,
- wrapText: true
- },
- {
- label: "瑙勬牸",
- fieldName: "productPackingListManual",
- hideDefaultActions: true,
- wrapText: true,
- initialWidth: 120,
- cellAttributes: { alignment: "right" }
- },
- {
- label: "CFDA鐘舵��",
- fieldName: "status",
- hideDefaultActions: true,
- wrapText: true,
- initialWidth: 120
- },
- {
- label: "娉ㄥ唽璇佺紪鐮佸彿",
- fieldName: "reportProductApprobation",
- hideDefaultActions: true,
- wrapText: true,
- initialWidth: 180
- },
- {
- label: "娉ㄥ唽璇佹晥鏈�",
- fieldName: "ReportProductExpirationDate",
- hideDefaultActions: true,
- wrapText: true,
- initialWidth: 100
- },
- {
- label: "BarCode",
- fieldName: "barCode",
- hideDefaultActions: true,
- wrap: true,
- initialWidth: 400
+ //鍏ュ簱鏄庣粏cols
+ get inDetailCols(){
+ var cols = [];
+ cols.push({label:'娑堣�楀搧鍚嶇О' , fieldName:'prodName', hideDefaultActions: true,wrapText:true});
+ cols.push({label:'BarCode' , fieldName:'barCodeNo', hideDefaultActions: true,wrapText:true,initialWidth:500});
+ cols.push({label:'浣跨敤鏈熼檺' , fieldName:'sterilizationlimitDate', hideDefaultActions: true,wrapText:true,initialWidth:100});
+ cols.push({label:'serialNoorLotNo' , fieldName:'serialNoorLotNo', hideDefaultActions: true,wrapText:true,initialWidth:140});
+ cols.push({label:'tracingCode' , fieldName:'tracingCodeNo', hideDefaultActions: true,wrapText:true,initialWidth:140});
+ if(this.returnFLGbln){
+ cols.push({label:'杩斿搧鍘熷洜' , fieldName:'ReturnReason', hideDefaultActions: true,wrapText:true,initialWidth:150});
+ }
+ return cols;
}
- ];
- //杩斿搧鏄庣粏cols
- get returnDetailCols() {
- var cols = [];
- cols.push({
- label: "鍑哄簱鍗�",
- fieldName: "orderUrl",
- type: "url",
- typeAttributes: { label: { fieldName: "orderNo" }, target: "_blank" },
- hideDefaultActions: true,
- wrapText: true
- });
- // cols.push({label:'鍑哄簱鍗�' , fieldName:'orderNo', hideDefaultActions: true});
- cols.push({
- label: "鍑哄簱鏃�",
- fieldName: "prodOutDate",
- wrapText: true,
- hideDefaultActions: true,
- initialWidth: 110
- });
- cols.push({
- label: "娑堣�楀搧鍚嶇О",
- fieldName: "prodName",
- wrapText: true,
- hideDefaultActions: true,
- wrapText: true,
- initialWidth: 190
- });
- cols.push({
- label: "鍑哄簱鐩殑",
- fieldName: "summonsForDirctionDet",
- wrapText: true,
- hideDefaultActions: true,
- initialWidth: 130
- });
- cols.push({
- label: "瀹㈡埛鍚�",
- fieldName: "hospitalName",
- hideDefaultActions: true,
- wrapText: true,
- initialWidth: 130
- });
- cols.push({
- label: "缁忛攢鍟�",
- fieldName: "orderDealer",
- hideDefaultActions: true,
- wrapText: true,
- initialWidth: 100
- });
- cols.push({
- label: "BarCode",
- fieldName: "barCode",
- hideDefaultActions: true,
- wrap: true,
- initialWidth: 230
- });
- cols.push({
- label: "浣跨敤鏈熼檺",
- fieldName: "sterilizationLimit",
- hideDefaultActions: true,
- wrapText: true,
- initialWidth: 110
- });
- cols.push({
- label: "鍗曚綅",
- fieldName: "boxPiece",
- hideDefaultActions: true,
- wrapText: true,
- initialWidth: 50
- });
- cols.push({
- label: "杩斿搧鏁伴噺",
- type: "customReturnGoodInput",
- typeAttributes: {
- inputValue: { fieldName: "returnCount" },
- boxPrice: { fieldName: "boxPiece" },
- recordId: { fieldName: "recordId" }
- },
- hideDefaultActions: true,
- wrapText: true,
- initialWidth: 100
- });
- cols.push({
- label: "杩斿搧鍘熷洜",
- type: "customTableInput",
- typeAttributes: {
- recordId: { fieldName: "recordId" },
- inputValue: { fieldName: "returnReason" },
- valueType: "Text"
- },
- hideDefaultActions: true,
- wrapText: true,
- initialWidth: 100
- });
- // cols.push({label:'杩斿搧鍘熷洜' , fieldName:'returnReason', hideDefaultActions: true});
- return cols;
- }
- //鍏ュ簱鏄庣粏cols
- get inDetailCols() {
- var cols = [];
- cols.push({
- label: "娑堣�楀搧鍚嶇О",
- fieldName: "prodName",
- hideDefaultActions: true,
- wrapText: true
- });
- cols.push({
- label: "BarCode",
- fieldName: "barCodeNo",
- hideDefaultActions: true,
- wrapText: true,
- initialWidth: 400
- });
- cols.push({
- label: "浣跨敤鏈熼檺",
- fieldName: "sterilizationlimitDate",
- hideDefaultActions: true,
- wrapText: true,
- initialWidth: 100
- });
- cols.push({
- label: "serialNoorLotNo",
- fieldName: "serialNoorLotNo",
- hideDefaultActions: true,
- wrapText: true,
- initialWidth: 140
- });
- cols.push({
- label: "tracingCode",
- fieldName: "tracingCodeNo",
- hideDefaultActions: true,
- wrapText: true,
- initialWidth: 140
- });
- if (this.returnFLGbln) {
- cols.push({
- label: "杩斿搧鍘熷洜",
- fieldName: "ReturnReason",
- hideDefaultActions: true,
- wrapText: true,
- initialWidth: 150
- });
- }
- return cols;
- }
- //閿欒鏄庣粏cols
- @track errorDetailCols = [
- // {label:'娑堣�楀搧璁㈠崟' , fieldName:'consumableOrderMinor', hideDefaultActions: true,wrapText:true},
- {
- label: "娑堣�楀搧璁㈠崟",
- fieldName: "consumableOrderUrl",
- type: "url",
- typeAttributes: {
- label: { fieldName: "consumableOrderMinorName" },
- target: "_blank"
- },
- hideDefaultActions: true,
- wrapText: true,
- initialWidth: 180
- },
- {
- label: "娑堣�楀搧鍚嶇О",
- fieldName: "prodName",
- hideDefaultActions: true,
- wrapText: true
- },
- {
- label: "BarCode",
- fieldName: "barCode",
- hideDefaultActions: true,
- wrapText: true,
- initialWidth: 400
- },
- {
- label: "鍗曚綅",
- fieldName: "boxPiece",
- hideDefaultActions: true,
- wrapText: true,
- initialWidth: 60
- },
- {
- label: "鏁伴噺",
- fieldName: "intMark",
- hideDefaultActions: true,
- wrapText: true,
- initialWidth: 100,
- cellAttributes: { alignment: "right" }
- },
- {
- label: "閿欒鍘熷洜",
- fieldName: "ErrorReason",
- hideDefaultActions: true,
- initialWidth: 280,
- wrapText: true
- }
- ];
+ //閿欒鏄庣粏cols
+ @track errorDetailCols = [
+ // {label:'娑堣�楀搧璁㈠崟' , fieldName:'consumableOrderMinor', hideDefaultActions: true,wrapText:true},
+ {label:'娑堣�楀搧璁㈠崟',fieldName:'consumableOrderUrl',type:'url',typeAttributes:{label:{fieldName:'consumableOrderMinorName'},target: "_blank"},hideDefaultActions: true,wrapText:true,initialWidth:180},
+ {label:'娑堣�楀搧鍚嶇О' , fieldName:'prodName', hideDefaultActions: true,wrapText:true},
+ {label:'BarCode' , fieldName:'barCode', hideDefaultActions: true,wrapText:true,initialWidth:400},
+ {label:'鍗曚綅' , fieldName:'boxPiece', hideDefaultActions: true,wrapText:true,initialWidth:60},
+ {label:'鏁伴噺' , fieldName:'intMark', hideDefaultActions: true,wrapText:true,initialWidth:100,cellAttributes: { alignment: "right" }},
+ {label:'閿欒鍘熷洜' , fieldName:'ErrorReason', hideDefaultActions: true,initialWidth:280,wrapText:true}
+ ];
- // 鑾峰彇鍙傛暟
- @wire(CurrentPageReference)
- getStateParameters(currentPageReference) {
- console.log("CurrentPageReference");
- if (currentPageReference) {
- this.arrType = currentPageReference.state?.ArrType;
- this.eSetId = currentPageReference.state?.ESetId;
+ // 鑾峰彇鍙傛暟
+ @wire(CurrentPageReference)
+ getStateParameters(currentPageReference) {
+ console.log('CurrentPageReference');
+ if (currentPageReference) {
+ this.arrType = currentPageReference.state?.ArrType;
+ this.eSetId = currentPageReference.state?.ESetId;
+ }
}
- }
- get showOrderDetail() {
- if (this.eSetId != "" && this.eSetId != null) {
- return true;
- } else {
- return false;
+ get showOrderDetail(){
+ if(this.eSetId != '' && this.eSetId != null){
+ return true;
+ }else{
+ return false;
+ }
}
- }
- renderedCallback() {
- if (!this.stylesLoaded) {
- Promise.all([loadStyle(this, WrappedHeaderTable)])
- .then(() => {
- console.log("Custom styles loaded");
- this.stylesLoaded = true;
+ renderedCallback(){
+ if (!this.stylesLoaded) {
+ Promise.all([loadStyle(this, WrappedHeaderTable)])
+ .then(() => {
+ console.log("Custom styles loaded");
+ this.stylesLoaded = true;
+ })
+ .catch((error) => {
+ console.error("Error loading custom styles");
+ });
+ }
+ }
+
+ //鍒濆鍖�
+ connectedCallback(){
+ init({arrType:this.arrType, eSetId:this.eSetId})
+ .then(result=>{
+ this.isNoteStay = result.isNoteStay;
+ this.arrController = result.arrGoodCon;
+ console.log("this.arrController:"+this.arrController);
+ if(result.result == 'Success'){
+ this.saveFLGbln = result.saveFLGbln;
+ this.returnFLGbln = result.returnFLGbln;
+ this.coc = result.coc;
+ this.cocId = result.coc.Id;
+ this.warningMsgs = result.warningMsgList;
+ this.errorMsgs = result.errorMsgList;
+ this.showSpinner = false;
+ this.showPage = true;
+ }else{
+ this.warningMsgs = result.warningMsgList;
+ this.errorMsgs = result.errorMsgList;
+ this.showSpinner = false;
+ this.showPage = true;
+ console.log("error:"+result.errorMsg);
+ this.showMyToast('鍒濆鍖栭〉闈㈠け璐�',result.errorMsg,'error');
+ }
})
- .catch((error) => {
- console.error("Error loading custom styles");
- });
+ .catch(error=>{
+ this.showSpinner = false;
+ this.showPage = true;
+ console.log("error:"+JSON.stringify(error));
+ this.showMyToast('鍒濆鍖栭〉闈㈠け璐�',JSON.stringify(error),'error');
+ })
}
- }
- //鍒濆鍖�
- connectedCallback() {
- init({ arrType: this.arrType, eSetId: this.eSetId })
- .then((result) => {
- this.isNoteStay = result.isNoteStay;
- this.arrController = result.arrGoodCon;
- console.log("this.arrController:" + this.arrController);
- if (result.result == "Success") {
- this.saveFLGbln = result.saveFLGbln;
- this.returnFLGbln = result.returnFLGbln;
- this.coc = result.coc;
- this.cocId = result.coc.Id;
- this.warningMsgs = result.warningMsgList;
- this.errorMsgs = result.errorMsgList;
- this.showSpinner = false;
- this.showPage = true;
- } else {
- this.warningMsgs = result.warningMsgList;
- this.errorMsgs = result.errorMsgList;
- this.showSpinner = false;
- this.showPage = true;
- console.log("error:" + result.errorMsg);
- this.showMyToast("鍒濆鍖栭〉闈㈠け璐�", result.errorMsg, "error");
- }
- })
- .catch((error) => {
- this.showSpinner = false;
- this.showPage = true;
- console.log("error:" + JSON.stringify(error));
- this.showMyToast("鍒濆鍖栭〉闈㈠け璐�", JSON.stringify(error), "error");
- });
- }
-
- //barcode change
- barcodeChange(event) {
- this.barcode = event.detail.value;
- }
-
- //鏍规嵁barcode鎼滅储
- barcodeEntrys() {
- this.showSpinner = true;
- searchProduct({
- barcode: this.barcode,
- arrControllerStr: this.arrController
- })
- .then((result) => {
- this.arrController = result.arrGoodCon;
- if (result.result == "Success") {
- this.saveFLGbln = result.saveFLGbln;
- this.returnFLGbln = result.returnFLGbln;
- this.coc = result.coc;
- this.warningMsgs = result.warningMsgList;
- this.errorMsgs = result.errorMsgList;
- this.consumableInventory = result.consumableInventory;
- this.detailsSummary = result.detailsSummary;
- for (var i in this.detailsSummary) {
- if (this.detailsSummary[i].Prod != null) {
- this.detailsSummary[i]["recordId"] =
- this.detailsSummary[i].Prod.Id;
- this.detailsSummary[i]["assetModelNo"] =
- this.detailsSummary[i].Prod.Asset_Model_No__c;
- this.detailsSummary[i]["prodName"] =
- this.detailsSummary[i].Prod.Name__c;
- }
- }
- console.log(
- "this.detailsSummary:" + JSON.stringify(this.detailsSummary)
- );
- this.consumableorderdetailsRecords =
- result.consumableorderdetailsRecords;
- var consumableorderdetailsRecordsview = [];
- for (var i in this.consumableorderdetailsRecords) {
- consumableorderdetailsRecordsview.push(
- this.consumableorderdetailsRecords[i]
- );
- }
- for (var i in this.consumableInventory) {
- consumableorderdetailsRecordsview.push(this.consumableInventory[i]);
- }
- this.consumableorderdetailsRecordsview =
- consumableorderdetailsRecordsview;
- for (var i in this.consumableorderdetailsRecordsview) {
- if (this.consumableorderdetailsRecordsview[i].Prod != null) {
- this.consumableorderdetailsRecordsview[i]["recordId"] =
- this.consumableorderdetailsRecordsview[i].Prod.Id;
- this.consumableorderdetailsRecordsview[i]["prodName"] =
- this.consumableorderdetailsRecordsview[i].Prod.Name__c;
- }
- if (this.consumableorderdetailsRecordsview[i].esd != null) {
- this.consumableorderdetailsRecordsview[i][
- "productPackingListManual"
- ] =
- this.consumableorderdetailsRecordsview[
- i
- ].esd.ProductPacking_list_manual__c;
- this.consumableorderdetailsRecordsview[i]["status"] =
- this.consumableorderdetailsRecordsview[i].esd.CFDA_Status__c;
- this.consumableorderdetailsRecordsview[i][
- "reportProductApprobation"
- ] =
- this.consumableorderdetailsRecordsview[
- i
- ].esd.Report_Product_Approbation__c;
- this.consumableorderdetailsRecordsview[i]["barCode"] =
- this.consumableorderdetailsRecordsview[i].esd.Bar_Code__c;
- }
- }
- console.log("len1:" + this.consumableorderdetailsRecords.length);
- console.log("len2:" + this.consumableorderdetailsRecordsview.length);
- console.log(
- "this.consumableorderdetailsRecordsview:" +
- JSON.stringify(this.consumableorderdetailsRecordsview)
- );
- this.showGoodsofReturnList = result.showGoodsofReturnList;
- var showGoodsofReturnListView = [];
- for (var i in this.showGoodsofReturnList) {
- showGoodsofReturnListView.push(this.showGoodsofReturnList[i]);
- }
- for (var i in this.consumableInventory) {
- showGoodsofReturnListView.push(this.consumableInventory[i]);
- }
- this.showGoodsofReturnListView = showGoodsofReturnListView;
- for (var i in this.showGoodsofReturnListView) {
- if (this.showGoodsofReturnListView[i].Prod != null) {
- this.showGoodsofReturnListView[i]["prodName"] =
- this.showGoodsofReturnListView[i].Prod.Name__c;
- }
- if (this.showGoodsofReturnListView[i].esd != null) {
- if (
- this.showGoodsofReturnListView[i].esd
- .Consumable_Shipment_order__c != "" &&
- this.showGoodsofReturnListView[i].esd
- .Consumable_Shipment_order__c != null
- ) {
- this.showGoodsofReturnListView[i]["recordId"] =
- this.showGoodsofReturnListView[
- i
- ].esd.Consumable_Shipment_order__c;
- this.showGoodsofReturnListView[i]["orderUrl"] =
- "/lexsummonscreat?ESetid=" +
- this.showGoodsofReturnListView[i].esd
- .Consumable_Shipment_order__c;
- this.showGoodsofReturnListView[i]["orderNo"] =
- this.showGoodsofReturnListView[
- i
- ].esd.Consumable_Shipment_order__r.Name;
- } else if (
- this.showGoodsofReturnListView[i].esd
- .Consumable_Sale_order__c != "" &&
- this.showGoodsofReturnListView[i].esd
- .Consumable_Sale_order__c != null
- ) {
- this.showGoodsofReturnListView[i]["recordId"] =
- this.showGoodsofReturnListView[
- i
- ].esd.Consumable_Sale_order__c;
- this.showGoodsofReturnListView[i]["orderUrl"] =
- "/lexsummonscreat?ESetid=" +
- this.showGoodsofReturnListView[i].esd
- .Consumable_Sale_order__c;
- this.showGoodsofReturnListView[i]["orderNo"] =
- this.showGoodsofReturnListView[
- i
- ].esd.Consumable_Sale_order__r.Name;
- }
- this.showGoodsofReturnListView[i]["prodOutDate"] =
- this.showGoodsofReturnListView[i].esd.Product_OutDate__c;
- this.showGoodsofReturnListView[i]["summonsForDirctionDet"] =
- this.showGoodsofReturnListView[i].esd.SummonsForDirction_det__c;
- this.showGoodsofReturnListView[i]["hospitalName"] =
- this.showGoodsofReturnListView[i].esd.HospItal_Name__c;
- this.showGoodsofReturnListView[i]["orderDealer"] =
- this.showGoodsofReturnListView[i].esd.Order_Dealer_Info__c;
- this.showGoodsofReturnListView[i]["barCode"] =
- this.showGoodsofReturnListView[i].esd.Bar_Code__c;
- this.showGoodsofReturnListView[i]["sterilizationLimit"] =
- this.showGoodsofReturnListView[i].esd.Sterilization_limit__c;
- this.showGoodsofReturnListView[i]["boxPiece"] =
- this.showGoodsofReturnListView[i].esd.Box_Piece__c;
- this.showGoodsofReturnListView[i]["returnCount"] =
- this.showGoodsofReturnListView[i].esd.Rrturn_count__c;
- console.log(
- "returnCount:" +
- this.showGoodsofReturnListView[i].esd.Rrturn_count__c
- );
- this.showGoodsofReturnListView[i]["returnReason"] =
- this.showGoodsofReturnListView[i].esd.Return_reason__c;
- }
- }
- console.log("len1:" + this.showGoodsofReturnList.length);
- console.log("len2:" + this.showGoodsofReturnListView.length);
- console.log(
- "this.showGoodsofReturnListView:" +
- JSON.stringify(this.showGoodsofReturnListView)
- );
- // this.consumableInventory = result.consumableInventory;
- // for(var i in this.consumableInventory){
- // if(this.consumableInventory[i].Prod != null){
- // this.consumableInventory[i]['recordId'] = this.consumableInventory[i].Prod.Id;
- // this.consumableInventory[i]['prodName'] = this.consumableInventory[i].Prod.Name__c;
- // }
- // }
- console.log(
- "this.consumableInventory:" +
- JSON.stringify(this.consumableInventory)
- );
- this.consumableorderdetailsRecordserror =
- result.consumableorderdetailsRecordserror;
- for (var i in this.consumableorderdetailsRecordserror) {
- if (this.consumableorderdetailsRecordserror[i].Prod != null) {
- this.consumableorderdetailsRecordserror[i]["recordId"] =
- this.consumableorderdetailsRecordserror[i].Prod.Id;
- this.consumableorderdetailsRecordserror[i]["prodName"] =
- this.consumableorderdetailsRecordserror[i].Prod.Name__c;
- }
- if (this.consumableorderdetailsRecordserror[i].esd != null) {
- this.consumableorderdetailsRecordserror[i][
- "consumableOrderMinor"
- ] =
- this.consumableorderdetailsRecordserror[
- i
- ].esd.Consumable_order_minor__c;
- if (
- this.consumableorderdetailsRecordserror[i].esd
- .Consumable_order_minor__c != null
- ) {
- this.consumableorderdetailsRecordserror[i][
- "consumableOrderMinorName"
- ] =
- this.consumableorderdetailsRecordserror[
- i
- ].esd.Consumable_order_minor__r.Name;
- this.consumableorderdetailsRecordserror[i][
- "consumableOrderUrl"
- ] =
- "/s/detail/" +
- this.consumableorderdetailsRecordserror[i].esd
- .Consumable_order_minor__c;
- }
- this.consumableorderdetailsRecordserror[i]["barCode"] =
- this.consumableorderdetailsRecordserror[i].esd.Bar_Code__c;
- this.consumableorderdetailsRecordserror[i]["boxPiece"] =
- this.consumableorderdetailsRecordserror[i].esd.Box_Piece__c;
- }
- }
- console.log(
- "this.consumableorderdetailsRecordserror:" +
- JSON.stringify(this.consumableorderdetailsRecordserror)
- );
- this.showSpinner = false;
- this.showMyToast("鑾峰彇鎴愬姛", "", "success");
- } else {
- this.showSpinner = false;
- this.warningMsgs = result.warningMsgList;
- this.errorMsgs = result.errorMsgList;
- console.log("error:" + result.errorMsg);
- this.showMyToast("鑾峰彇澶辫触", result.errorMsg, "error");
- }
- })
- .catch((error) => {
- this.showSpinner = false;
- console.log("error:" + error);
- this.showMyToast("鑾峰彇澶辫触", error, "error");
- });
- }
-
- //杩斿搧鏁伴噺change
- returnCountChange(event) {
- var value = event.detail.data.value;
- var boxPrice = event.detail.data.boxPrice;
- var recordId = event.detail.data.recordId;
- console.log("杩斿搧鏁伴噺:" + value + boxPrice + "---" + recordId);
- for (var i in this.showGoodsofReturnList) {
- if (this.showGoodsofReturnList[i]["recordId"] == recordId) {
- if (this.showGoodsofReturnList[i].canEdit) {
- this.showGoodsofReturnList[i].esd.Rrturn_count__c = 1;
- this.showGoodsofReturnList[i]["returnCount"] =
- this.showGoodsofReturnList[i].esd.Rrturn_count__c;
- } else {
- this.showGoodsofReturnList[i].esd.Rrturn_count__c = value;
- this.showGoodsofReturnList[i]["returnCount"] =
- this.showGoodsofReturnList[i].esd.Rrturn_count__c;
- }
- }
+ //barcode change
+ barcodeChange(event){
+ this.barcode = event.detail.value;
}
- }
- //杩斿搧鍘熷洜change
- returnReasonChange(event) {
- var recordId = event.detail.data.recordId;
- var value = event.detail.data.value;
- console.log("杩斿搧鍘熷洜:" + value + "---" + recordId);
- for (var i in this.showGoodsofReturnList) {
- if (this.showGoodsofReturnList[i]["recordId"] == recordId) {
- this.showGoodsofReturnList[i].esd.Return_reason__c = value;
- this.showGoodsofReturnList[i]["returnReason"] =
- this.showGoodsofReturnList[i].esd.Return_reason__c;
- }
- }
- }
-
- // 鍒拌揣纭
- arriveGoodsConfim() {
- this.showSpinner = true;
- arriveGoodsConfim({ arrControllerStr: this.arrController })
- .then((result) => {
- this.arrController = result.arrGoodCon;
- if (result.result == "Success") {
- this.showSpinner = false;
- this.warningMsgs = result.warningMsgList;
- this.errorMsgs = result.errorMsgList;
- var url = result.url;
- const config = {
- type: "standard__webPage",
- attributes: {
- url: url
+ //鏍规嵁barcode鎼滅储
+ barcodeEntrys(){
+ this.showSpinner = true;
+ searchProduct({
+ barcode : this.barcode,
+ arrControllerStr : this.arrController
+ })
+ .then(result=>{
+ this.arrController = result.arrGoodCon;
+ if(result.result == 'Success'){
+ this.saveFLGbln = result.saveFLGbln;
+ this.returnFLGbln = result.returnFLGbln;
+ this.coc = result.coc;
+ this.warningMsgs = result.warningMsgList;
+ this.errorMsgs = result.errorMsgList;
+ this.consumableInventory = result.consumableInventory;
+ this.detailsSummary = result.detailsSummary;
+ for(var i in this.detailsSummary){
+ if(this.detailsSummary[i].Prod != null){
+ this.detailsSummary[i]['recordId'] = this.detailsSummary[i].Prod.Id;
+ this.detailsSummary[i]['assetModelNo'] = this.detailsSummary[i].Prod.Asset_Model_No__c;
+ this.detailsSummary[i]['prodName'] = this.detailsSummary[i].Prod.Name__c;
+ }
+ }
+ console.log('this.detailsSummary:'+JSON.stringify(this.detailsSummary));
+ this.consumableorderdetailsRecords = result.consumableorderdetailsRecords;
+ var consumableorderdetailsRecordsview = [];
+ for(var i in this.consumableorderdetailsRecords){
+ this.consumableorderdetailsRecords[i]['dataType'] = 'DataileRecords';
+ consumableorderdetailsRecordsview.push(this.consumableorderdetailsRecords[i]);
+ }
+ for(var i in this.consumableInventory){
+ this.consumableInventory[i]['dataType'] = 'Inventory';
+ consumableorderdetailsRecordsview.push(this.consumableInventory[i]);
+ }
+ this.consumableorderdetailsRecordsview = consumableorderdetailsRecordsview;
+ for(var i in this.consumableorderdetailsRecordsview){
+ if(this.consumableorderdetailsRecordsview[i].Prod != null){
+ this.consumableorderdetailsRecordsview[i]['recordId'] = this.consumableorderdetailsRecordsview[i].Prod.Id;
+ this.consumableorderdetailsRecordsview[i]['prodName'] = this.consumableorderdetailsRecordsview[i].Prod.Name__c;
+ }
+ if(this.consumableorderdetailsRecordsview[i]['dataType'] == 'Inventory'){
+ this.consumableorderdetailsRecordsview[i]['barCode'] = this.consumableorderdetailsRecordsview[i].barCodeNo;
+ }else if(this.consumableorderdetailsRecordsview[i].esd != null){
+ this.consumableorderdetailsRecordsview[i]['barCode'] = this.consumableorderdetailsRecordsview[i].esd.Bar_Code__c;
+ }
+ if(this.consumableorderdetailsRecordsview[i].esd != null){
+ this.consumableorderdetailsRecordsview[i]['productPackingListManual'] = this.consumableorderdetailsRecordsview[i].esd.ProductPacking_list_manual__c;
+ this.consumableorderdetailsRecordsview[i]['status'] = this.consumableorderdetailsRecordsview[i].esd.CFDA_Status__c;
+ this.consumableorderdetailsRecordsview[i]['reportProductApprobation'] = this.consumableorderdetailsRecordsview[i].esd.Report_Product_Approbation__c;
+ }
+ }
+ console.log('len1:'+this.consumableorderdetailsRecords.length);
+ console.log('len2:'+this.consumableorderdetailsRecordsview.length);
+ console.log('this.consumableorderdetailsRecordsview:'+JSON.stringify(this.consumableorderdetailsRecordsview));
+ this.showGoodsofReturnList = result.showGoodsofReturnList;
+ var showGoodsofReturnListView = [];
+ for(var i in this.showGoodsofReturnList){
+ this.showGoodsofReturnList[i]['dataType'] = 'GoodsoOfReturn';
+ showGoodsofReturnListView.push(this.showGoodsofReturnList[i]);
+ }
+ for(var i in this.consumableInventory){
+ this.consumableInventory[i]['dataType'] = 'Inventory';
+ showGoodsofReturnListView.push(this.consumableInventory[i]);
+ }
+ this.showGoodsofReturnListView = showGoodsofReturnListView;
+ for(var i in this.showGoodsofReturnListView){
+ if(this.showGoodsofReturnListView[i].Prod != null){
+ this.showGoodsofReturnListView[i]['prodName'] = this.showGoodsofReturnListView[i].Prod.Name__c;
+ }
+ if(this.showGoodsofReturnListView[i]['dataType'] == 'Inventory'){
+ this.showGoodsofReturnListView[i]['barCode'] = this.showGoodsofReturnListView[i].barCodeNo;
+ }else if(this.showGoodsofReturnListView[i].esd != null){
+ this.showGoodsofReturnListView[i]['barCode'] = this.showGoodsofReturnListView[i].esd.Bar_Code__c;
+ }
+ if(this.showGoodsofReturnListView[i].esd != null){
+ if(this.showGoodsofReturnListView[i].esd.Consumable_Shipment_order__c != '' && this.showGoodsofReturnListView[i].esd.Consumable_Shipment_order__c != null){
+ this.showGoodsofReturnListView[i]['recordId'] = this.showGoodsofReturnListView[i].esd.Consumable_Shipment_order__c;
+ this.showGoodsofReturnListView[i]['orderUrl'] = '/lexsummonscreat?ESetid='+this.showGoodsofReturnListView[i].esd.Consumable_Shipment_order__c;
+ this.showGoodsofReturnListView[i]['orderNo'] = this.showGoodsofReturnListView[i].esd.Consumable_Shipment_order__r.Name;
+ }else if(this.showGoodsofReturnListView[i].esd.Consumable_Sale_order__c != '' && this.showGoodsofReturnListView[i].esd.Consumable_Sale_order__c != null){
+ this.showGoodsofReturnListView[i]['recordId'] = this.showGoodsofReturnListView[i].esd.Consumable_Sale_order__c;
+ this.showGoodsofReturnListView[i]['orderUrl'] = '/lexsummonscreat?ESetid='+this.showGoodsofReturnListView[i].esd.Consumable_Sale_order__c;
+ this.showGoodsofReturnListView[i]['orderNo'] = this.showGoodsofReturnListView[i].esd.Consumable_Sale_order__r.Name;
+ }
+ this.showGoodsofReturnListView[i]['prodOutDate'] = this.showGoodsofReturnListView[i].esd.Product_OutDate__c;
+ this.showGoodsofReturnListView[i]['summonsForDirctionDet'] = this.showGoodsofReturnListView[i].esd.SummonsForDirction_det__c;
+ this.showGoodsofReturnListView[i]['hospitalName'] = this.showGoodsofReturnListView[i].esd.HospItal_Name__c;
+ this.showGoodsofReturnListView[i]['orderDealer'] = this.showGoodsofReturnListView[i].esd.Order_Dealer_Info__c;
+ this.showGoodsofReturnListView[i]['sterilizationLimit'] = this.showGoodsofReturnListView[i].esd.Sterilization_limit__c;
+ this.showGoodsofReturnListView[i]['boxPiece'] = this.showGoodsofReturnListView[i].esd.Box_Piece__c;
+ this.showGoodsofReturnListView[i]['returnCount'] = this.showGoodsofReturnListView[i].esd.Rrturn_count__c;
+ console.log('returnCount:'+this.showGoodsofReturnListView[i].esd.Rrturn_count__c);
+ this.showGoodsofReturnListView[i]['returnReason'] = this.showGoodsofReturnListView[i].esd.Return_reason__c;
+ }
+ }
+ console.log('len1:'+this.showGoodsofReturnList.length);
+ console.log('len2:'+this.showGoodsofReturnListView.length);
+ console.log('this.showGoodsofReturnListView:'+JSON.stringify(this.showGoodsofReturnListView));
+ // this.consumableInventory = result.consumableInventory;
+ // for(var i in this.consumableInventory){
+ // if(this.consumableInventory[i].Prod != null){
+ // this.consumableInventory[i]['recordId'] = this.consumableInventory[i].Prod.Id;
+ // this.consumableInventory[i]['prodName'] = this.consumableInventory[i].Prod.Name__c;
+ // }
+ // }
+ console.log('this.consumableInventory:'+JSON.stringify(this.consumableInventory));
+ this.consumableorderdetailsRecordserror = result.consumableorderdetailsRecordserror;
+ for(var i in this.consumableorderdetailsRecordserror){
+ if(this.consumableorderdetailsRecordserror[i].Prod != null){
+ this.consumableorderdetailsRecordserror[i]['recordId'] = this.consumableorderdetailsRecordserror[i].Prod.Id;
+ this.consumableorderdetailsRecordserror[i]['prodName'] = this.consumableorderdetailsRecordserror[i].Prod.Name__c;
+ }
+ if(this.consumableorderdetailsRecordserror[i].esd != null){
+ this.consumableorderdetailsRecordserror[i]['consumableOrderMinor'] = this.consumableorderdetailsRecordserror[i].esd.Consumable_order_minor__c;
+ if(this.consumableorderdetailsRecordserror[i].esd.Consumable_order_minor__c != null){
+ this.consumableorderdetailsRecordserror[i]['consumableOrderMinorName'] = this.consumableorderdetailsRecordserror[i].esd.Consumable_order_minor__r.Name;
+ this.consumableorderdetailsRecordserror[i]['consumableOrderUrl'] = "/s/detail/"+this.consumableorderdetailsRecordserror[i].esd.Consumable_order_minor__c;
+ }
+ this.consumableorderdetailsRecordserror[i]['barCode'] = this.consumableorderdetailsRecordserror[i].esd.Bar_Code__c;
+ this.consumableorderdetailsRecordserror[i]['boxPiece'] = this.consumableorderdetailsRecordserror[i].esd.Box_Piece__c;
+ }
+ }
+ console.log('this.consumableorderdetailsRecordserror:'+JSON.stringify(this.consumableorderdetailsRecordserror));
+ this.showSpinner = false;
+ if(this.errorMsgs.length < 1){
+ this.showMyToast('鑾峰彇鎴愬姛','','success');
+ }
+ }else {
+ this.showSpinner = false;
+ this.warningMsgs = result.warningMsgList;
+ this.errorMsgs = result.errorMsgList;
+ console.log("error:"+result.errorMsg);
+ this.showMyToast('鑾峰彇澶辫触',result.errorMsg,'error');
}
- };
- this[NavigationMixin.Navigate](config);
- } else {
- this.showSpinner = false;
- this.warningMsgs = result.warningMsgList;
- this.errorMsgs = result.errorMsgList;
- console.log("error1:" + result.errorMsg);
- this.showMyToast("鍒拌揣纭澶辫触", result.errorMsg, "error");
- }
- })
- .catch((error) => {
- this.showSpinner = false;
- console.log("error2:" + error);
- this.showMyToast("鍒拌揣纭澶辫触", error, "error");
- });
- }
+ })
+ .catch(error=>{
+ this.showSpinner = false;
+ console.log("error:"+error);
+ this.showMyToast('鑾峰彇澶辫触',error,'error');
+ })
+ }
- // 鐧诲綍杩斿搧
- updateGoodsOfReturn() {
- this.showSpinner = true;
- updateGoodsOfReturn({
- arrControllerStr: this.arrController,
- showGoodsofReturnListStr: JSON.stringify(this.showGoodsofReturnList)
- })
- .then((result) => {
- this.showSpinner = false;
- this.arrController = result.arrGoodCon;
- if (result.result == "Success") {
- this.warningMsgs = result.warningMsgList;
- this.errorMsgs = result.errorMsgList;
- var url = result.url;
- const config = {
- type: "standard__webPage",
- attributes: {
- url: url
+ //杩斿搧鏁伴噺change
+ returnCountChange(event){
+ var value = event.detail.data.value;
+ var boxPrice = event.detail.data.boxPrice;
+ var recordId = event.detail.data.recordId;
+ console.log("杩斿搧鏁伴噺:"+value+boxPrice+"---"+recordId);
+ for(var i in this.showGoodsofReturnList){
+ if(this.showGoodsofReturnList[i]['recordId'] == recordId){
+ if(this.showGoodsofReturnList[i].canEdit){
+ this.showGoodsofReturnList[i].esd.Rrturn_count__c = 1;
+ this.showGoodsofReturnList[i]['returnCount'] = this.showGoodsofReturnList[i].esd.Rrturn_count__c;
+ }else{
+ this.showGoodsofReturnList[i].esd.Rrturn_count__c = value;
+ this.showGoodsofReturnList[i]['returnCount'] = this.showGoodsofReturnList[i].esd.Rrturn_count__c;
+ }
}
- };
- this[NavigationMixin.Navigate](config);
- } else {
- this.showSpinner = false;
- this.warningMsgs = result.warningMsgList;
- this.errorMsgs = result.errorMsgList;
- console.log("error1:" + result.errorMsg);
- this.showMyToast("鐧诲綍杩斿搧澶辫触", result.errorMsg, "error");
}
- })
- .catch((error) => {
- this.showSpinner = false;
- console.log("error2:" + JSON.stringify(error));
- this.showMyToast("鐧诲綍杩斿搧澶辫触", error, "error");
- });
- }
+ }
- showMyToast(title, message, variant) {
- console.log("show custom message");
- var iconName = "";
- var content = "";
- if (variant == "success") {
- iconName = "utility:check";
- } else {
- iconName = "utility:error";
+ //杩斿搧鍘熷洜change
+ returnReasonChange(event){
+ var recordId = event.detail.data.recordId;
+ var value = event.detail.data.value;
+ console.log("杩斿搧鍘熷洜:"+value+"---"+recordId);
+ for(var i in this.showGoodsofReturnList){
+ if(this.showGoodsofReturnList[i]['recordId'] == recordId){
+ this.showGoodsofReturnList[i].esd.Return_reason__c = value;
+ this.showGoodsofReturnList[i]['returnReason'] = this.showGoodsofReturnList[i].esd.Return_reason__c;
+ }
+ }
}
- if (message != "") {
- content =
- "<h2><strong>" + title + "<strong/></h2><h5>" + message + "</h5>";
- } else {
- content = "<h2><strong>" + title + "<strong/></h2>";
+
+ // 鍒拌揣纭
+ arriveGoodsConfim(){
+ this.showSpinner = true;
+ arriveGoodsConfim({arrControllerStr : this.arrController})
+ .then(result=>{
+ this.arrController = result.arrGoodCon;
+ if(result.result == 'Success'){
+ this.showSpinner = false;
+ this.warningMsgs = result.warningMsgList;
+ this.errorMsgs = result.errorMsgList;
+ var url = result.url;
+ const config = {
+ type: 'standard__webPage',
+ attributes: {
+ url: url
+ }
+ };
+ this[NavigationMixin.Navigate](config);
+ }else {
+ this.showSpinner = false;
+ this.warningMsgs = result.warningMsgList;
+ this.errorMsgs = result.errorMsgList;
+ console.log("error1:"+result.errorMsg);
+ this.showMyToast('鍒拌揣纭澶辫触',result.errorMsg,'error');
+ }
+ })
+ .catch(error=>{
+ this.showSpinner = false;
+ console.log("error2:"+error);
+ this.showMyToast('鍒拌揣纭澶辫触',error,'error');
+ })
}
- 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);
- }
-}
+
+ // 鐧诲綍杩斿搧
+ updateGoodsOfReturn(){
+ this.showSpinner = true;
+ updateGoodsOfReturn({arrControllerStr : this.arrController,showGoodsofReturnListStr : JSON.stringify(this.showGoodsofReturnList)})
+ .then(result=>{
+ this.showSpinner = false;
+ this.arrController = result.arrGoodCon;
+ if(result.result == 'Success'){
+ this.warningMsgs = result.warningMsgList;
+ this.errorMsgs = result.errorMsgList;
+ var url = result.url;
+ const config = {
+ type: 'standard__webPage',
+ attributes: {
+ url: url
+ }
+ };
+ this[NavigationMixin.Navigate](config);
+ }else {
+ console.log("error1:"+result.errorMsg);
+ this.showSpinner = false;
+ this.warningMsgs = result.warningMsgList;
+ this.errorMsgs = result.errorMsgList;
+ if(result.errorMsg.includes('鏃犳硶淇濆瓨姝よ褰�')){
+ result.errorMsg = '鏃犳硶淇濆瓨璁板綍';
+ }
+ this.showMyToast('鐧诲綍杩斿搧澶辫触',result.errorMsg,'error');
+ }
+ })
+ .catch(error=>{
+ this.showSpinner = false;
+ console.log("error2:"+JSON.stringify(error));
+ this.showMyToast('鐧诲綍杩斿搧澶辫触',error,'error');
+ })
+ }
+
+ showMyToast(title, message, variant) {
+ console.log('show custom message');
+ var iconName = '';
+ var content = '';
+ if(variant == 'success'){
+ iconName = 'utility:check';
+ }else{
+ iconName = 'utility:error';
+ }
+ if(message != ''){
+ content = '<h2><strong>'+title+'<strong/></h2><h5>'+message+'</h5>';
+ }else{
+ content = '<h2><strong>'+title+'<strong/></h2>';
+ }
+ this.template.querySelector('c-common-toast').
+ showToast(variant,content,iconName,10000);
+ // var mode;
+ // if(this.isNoteStay){
+ // mode ='sticky';
+ // }else{
+ // mode = 'dismissable';
+ // }
+ // const evt = new ShowToastEvent({
+ // title: title,
+ // message: message,
+ // variant: variant,
+ // mode: mode
+ // });
+ // this.dispatchEvent(evt);
+ }
+}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexArriveGoods/lexArriveGoods.js-meta.xml b/force-app/main/default/lwc/lexArriveGoods/lexArriveGoods.js-meta.xml
index 0866cdc..d893635 100644
--- a/force-app/main/default/lwc/lexArriveGoods/lexArriveGoods.js-meta.xml
+++ b/force-app/main/default/lwc/lexArriveGoods/lexArriveGoods.js-meta.xml
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="UTF-8" ?>
+<?xml version="1.0" encoding="UTF-8"?>
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>56.0</apiVersion>
<isExposed>true</isExposed>
@@ -6,4 +6,4 @@
<target>lightningCommunity__Page</target>
<target>lightningCommunity__Default</target>
</targets>
-</LightningComponentBundle>
+</LightningComponentBundle>
\ 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 d83b5ea..724c9c6 100644
--- a/force-app/main/default/lwc/lexArriveGoodsMain/lexArriveGoodsMain.html
+++ b/force-app/main/default/lwc/lexArriveGoodsMain/lexArriveGoodsMain.html
@@ -2,10 +2,7 @@
<template if:true={showSpinner}>
<!-- <lightning-spinner size="medium" variant="brand"></lightning-spinner> -->
<div class="slds-spinner_container">
- <div
- role="status"
- class="slds-spinner slds-spinner_medium slds-spinner_brand"
- >
+ <div role="status" class="slds-spinner slds-spinner_medium slds-spinner_brand">
<span class="slds-assistive-text">Loading</span>
<div class="slds-spinner__dot-a"></div>
<div class="slds-spinner__dot-b"></div>
@@ -14,44 +11,17 @@
</template>
<c-common-toast></c-common-toast>
<template if:true={showPage}>
- <div
- style="
- border: 1px solid #d4d4d4;
- border-top: 3px solid #51606e;
- border-radius: 5px;
- "
- >
- <div style="padding: 10px">
+ <div style="border: 1px solid #D4D4D4;border-top: 3px solid #51606E;border-radius:5px;">
+ <div style="padding:10px;">
<!-- 鎸夐挳 -->
<!-- <lightning-button style="margin: 5px;" label="鍏ュ簱" onclick={orderArrive}></lightning-button>
<lightning-button style="margin: 5px;" label="杩斿搧" onclick={orderReturn}></lightning-button> -->
- <button
- class="slds-button slds-button_neutral slds-button_stretch lexBorder"
- style="margin: 5px; margin-right: 150px"
- label="鍏ュ簱"
- onclick={orderArrive}
- >
- 鍏ュ簱
- </button>
- <button
- class="slds-button slds-button_neutral slds-button_stretch lexBorder"
- style="margin: 5px"
- label="杩斿搧"
- onclick={orderReturn}
- >
- 杩斿搧
- </button>
- <p style="height: 10px"></p>
+ <button class="slds-button slds-button_neutral slds-button_stretch lexBorder" style="margin: 5px;margin-right: 150px;" label="鍏ュ簱" onclick={orderArrive}>鍏ュ簱</button>
+ <button class="slds-button slds-button_neutral slds-button_stretch lexBorder" style="margin: 5px;" label="杩斿搧" onclick={orderReturn}>杩斿搧</button>
+ <p style="height: 10px;"></p>
<!-- 妫�绱㈡潯浠� -->
- <div
- style="
- border: 1px solid #d4d4d4;
- border-top: 3px solid #51606e;
- border-radius: 5px;
- margin-bottom: 7px;
- "
- >
- <div style="border-bottom: 1px solid #d4d4d4; padding: 3px">
+ <div style="border: 1px solid #D4D4D4;border-top: 3px solid #51606E;border-radius:5px;margin-bottom:7px;">
+ <div style="border-bottom: 1px solid #D4D4D4;padding:3px;">
<lightning-layout>
<lightning-layout-item padding="around-small">
<p style="font-size: 18px">
@@ -61,77 +31,30 @@
</lightning-layout>
<!-- <p style="font-size: 16px;"><strong>妫�绱㈡潯浠�</strong></p> -->
</div>
- <div style="padding: 10px">
+ <div style="padding:10px;">
<table>
<tbody>
<tr>
- <td style="width: 10px"></td>
- <td style="width: 120px">
- <div
- style="
- color: #696969;
- font-size: 16px;
- text-align: left;
- "
- >
- 娑堣�楀搧璁㈠崟鍚嶇О
- </div>
+ <td style="width: 10px;"></td>
+ <td style="width: 120px;">
+ <div style="color:#696969;font-size:16px;text-align: left;">娑堣�楀搧璁㈠崟鍚嶇О</div>
</td>
<td>
- <lightning-input
- class="inputFont"
- type="text"
- variant="label-hidden"
- label="娑堣�楀搧璁㈠崟鍚嶇О"
- value={category1}
- onchange={category1Change}
- ></lightning-input>
+ <lightning-input class="inputFont" type="text" variant="label-hidden" label="娑堣�楀搧璁㈠崟鍚嶇О" value={category1} onchange={category1Change}></lightning-input>
</td>
- <td style="width: 30px"></td>
- <td style="width: 108px">
- <div
- style="
- color: #696969;
- font-size: 16px;
- text-align: left;
- "
- >
- 鏈�鏂板彂璐ф棩鏈�
- </div>
+ <td style="width: 30px;"></td>
+ <td style="width: 108px;">
+ <div style="color:#696969;font-size:16px;text-align: left;">鏈�鏂板彂璐ф棩鏈�</div>
</td>
<td>
- <lightning-input
- class="inputFont"
- type="date"
- variant="label-hidden"
- label="鏈�鏂板彂璐ф棩鏈�"
- value={cate2}
- onchange={cate2Change}
- ></lightning-input>
+ <lightning-input class="inputFont" type="date" variant="label-hidden" label="鏈�鏂板彂璐ф棩鏈�" value={cate2} onchange={cate2Change}></lightning-input>
</td>
- <td style="width: 30px"></td>
+ <td style="width: 30px;"></td>
<td>
<!-- <lightning-button style="margin-left: 10px;margin-right: 5px;" label="鎼滅储" onclick={search}></lightning-button>
<lightning-button style="margin-left: 5px;margin-right: 5px;" label="娓呯┖" onclick={clear}></lightning-button> -->
- <button
- class="slds-button slds-button_neutral slds-button_stretch lexsearchStyle"
- style="
- height: 32px;
- margin-right: 30px;
- "
- label="鎼滅储"
- onclick={search}
- >
- 鎼滅储
- </button>
- <button
- class="slds-button slds-button_neutral slds-button_stretch lexclearStyle"
- style="height: 32px"
- label="娓呯┖"
- onclick={clear}
- >
- 娓呯┖
- </button>
+ <button class="slds-button slds-button_neutral slds-button_stretch lexsearchStyle" style="height:32px;margin-right: 30px;" label="鎼滅储" onclick={search}>鎼滅储</button>
+ <button class="slds-button slds-button_neutral slds-button_stretch lexclearStyle" style="height:32px;" label="娓呯┖" onclick={clear}>娓呯┖</button>
</td>
</tr>
</tbody>
@@ -139,15 +62,8 @@
</div>
</div>
<!-- 璁㈠崟鏄庣粏 -->
- <div
- style="
- border: 1px solid #d4d4d4;
- border-top: 3px solid #51606e;
- border-radius: 5px;
- margin-bottom: 7px;
- "
- >
- <div style="border-bottom: 1px solid #d4d4d4; padding: 3px">
+ <div style="border: 1px solid #D4D4D4;border-top: 3px solid #51606E;border-radius:5px;margin-bottom:7px;">
+ <div style="border-bottom: 1px solid #D4D4D4;padding:3px;">
<lightning-layout>
<lightning-layout-item padding="around-small">
<p style="font-size: 18px">
@@ -157,16 +73,9 @@
</lightning-layout>
<!-- <p style="font-size: 16px;"><strong>璁㈠崟鏄庣粏</strong></p> -->
</div>
- <div style="padding: 10px">
+ <div style="padding:10px;">
<!-- <lightning-datatable hide-checkbox-column key-field="id" columns={colms} data={raesList}></lightning-datatable> -->
- <c-lex-custom-lightning-datatable
- class="wrapped-header-datatable"
- hide-checkbox-column
- key-field="Id"
- data={raesList}
- columns={colms}
- onclicklink={clickLick}
- ></c-lex-custom-lightning-datatable>
+ <c-lex-custom-lightning-datatable class="wrapped-header-datatable" hide-checkbox-column key-field="Id" data={raesList} columns={colms} onclicklink={clickLick}></c-lex-custom-lightning-datatable>
</div>
</div>
</div>
@@ -174,65 +83,24 @@
</template>
<!-- 璁㈠崟鍚勭鏁伴噺淇℃伅寮圭獥 -->
<template if:true={showPop}>
- <section
- role="dialog"
- tabindex="-1"
- aria-labelledby="modal-heading-01"
- aria-modal="true"
- aria-describedby="modal-content-id-1"
- class="slds-modal slds-fade-in-open slds-modal_small"
- style="border: 1px solid #d4d4d4"
- >
+ <section role="dialog" tabindex="-1" aria-labelledby="modal-heading-01" aria-modal="true" aria-describedby="modal-content-id-1" class="slds-modal slds-fade-in-open slds-modal_small" style="border: 1px solid #D4D4D4;">
<div class="slds-modal__container">
- <header
- class="slds-modal__header"
- style="background-color: #f3f3f3"
- >
- <button
- style=""
- class="slds-button slds-button_icon slds-modal__close slds-button_icon-inverse"
- title="Close"
- onclick={closePop}
- >
- <lightning-icon
- icon-name="utility:close"
+ <header class="slds-modal__header" style="background-color: #F3F3F3;">
+ <button style="" class="slds-button slds-button_icon slds-modal__close slds-button_icon-inverse" title="Close" onclick={closePop}>
+ <lightning-icon icon-name="utility:close"
alternative-text="close"
variant="inverse"
- size="small"
- ></lightning-icon>
+ size="small" ></lightning-icon>
<span class="slds-assistive-text">Close</span>
</button>
- <h2
- id="modal-heading-01"
- class="slds-text-heading_medium slds-hyphenate"
- >
- {popTitle}
- </h2>
+ <h2 id="modal-heading-01" class="slds-text-heading_medium slds-hyphenate">{popTitle}</h2>
</header>
- <div
- class="slds-modal__content slds-p-around_medium"
- id="modal-content-id-1"
- style="border: 1px solid #f3f3f3"
- >
- <lightning-datatable
- class="wrapped-header-datatable"
- hide-checkbox-column
- key-field="prodModel"
- columns={colms2}
- data={recordList}
- ></lightning-datatable>
+ <div class="slds-modal__content slds-p-around_medium" id="modal-content-id-1" style="border: 1px solid #F3F3F3;">
+ <lightning-datatable class="wrapped-header-datatable" hide-checkbox-column key-field="prodModel" columns={colms2} data={recordList}></lightning-datatable>
</div>
<footer class="slds-modal__footer">
<!-- <lightning-button style="margin-left: 10px;" variant="neutral" label="鍏抽棴" onclick={closePop}></lightning-button> -->
- <button
- class="slds-button slds-button_neutral slds-button_stretch lexclearStyle"
- style="margin-left: 10px"
- variant="neutral"
- label="鍏抽棴"
- onclick={closePop}
- >
- 鍏抽棴
- </button>
+ <button class="slds-button slds-button_neutral slds-button_stretch lexclearStyle" style="margin-left: 10px;" variant="neutral" label="鍏抽棴" onclick={closePop}>鍏抽棴</button>
</footer>
</div>
</section>
diff --git a/force-app/main/default/lwc/lexArriveGoodsMain/lexArriveGoodsMain.js b/force-app/main/default/lwc/lexArriveGoodsMain/lexArriveGoodsMain.js
index 47b005d..163a81f 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,13 +13,11 @@
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;
@@ -50,107 +48,62 @@
// {label:'寰呯郴缁熸搷浣滃叆搴撴暟閲�',fieldName:'Delivery_detail_count__c'},
// {label:'杩樻病鍙戣揣鏁伴噺',fieldName:'OrderNumber_notarrive__c'},
// {label:'鍙戣揣涓冨ぉ杩樻湭鍒拌揣鏁�',fieldName:'More_than_seven_days__c'},
- {
- label: '娑堣�楀搧璁㈠崟鍚嶇О',
- type: 'customOutputGood',
+ {label:'娑堣�楀搧璁㈠崟鍚嶇О',
+ type: "customOutputGood",
typeAttributes: {
- outputValue: { fieldName: 'Name' },
+ outputValue: { fieldName: "Name" },
type: 'Title',
- recordId: { fieldName: 'Id' }
+ recordId: { fieldName: "Id" }
},
- hideDefaultActions: true,
- initialWidth: 200,
- wrapText: true
- },
- {
- label: 'SAP鍚堝悓鍙�',
- fieldName: 'ContractNo__c',
- hideDefaultActions: true,
- wrapText: true,
- initialWidth: 180
- },
- {
- label: '璁㈠崟鎬绘暟',
- type: 'customOutputGood',
+ hideDefaultActions: true,initialWidth:200,wrapText:true},
+ {label:'SAP鍚堝悓鍙�',fieldName:'ContractNo__c',hideDefaultActions: true,wrapText:true,initialWidth:180},
+ {label:'璁㈠崟鎬绘暟',
+ type: "customOutputGood",
typeAttributes: {
- outputValue: { fieldName: 'Total_num__c' },
+ outputValue: { fieldName: "Total_num__c" },
type: 'TotalNum',
- recordId: { fieldName: 'Id' }
+ recordId: { fieldName: "Id" }
},
- hideDefaultActions: true,
- initialWidth: 100,
- cellAttributes: { alignment: 'right' }
- },
- {
- label: '宸插埌璐ф暟閲�',
- type: 'customOutputGood',
+ hideDefaultActions: true, initialWidth: 100,cellAttributes: { alignment: "right" }},
+ {label:'宸插埌璐ф暟閲�',
+ type: "customOutputGood",
typeAttributes: {
- outputValue: { fieldName: 'OrderNumber_arrived__c' },
+ outputValue: { fieldName: "OrderNumber_arrived__c" },
type: 'ArrDet',
- recordId: { fieldName: 'Id' }
+ recordId: { fieldName: "Id" }
},
- hideDefaultActions: true,
- initialWidth: 110,
- cellAttributes: { alignment: 'right' }
- },
- {
- label: '寰呯郴缁熸搷浣滃叆搴撴暟閲�',
- type: 'customOutputGood',
+ hideDefaultActions: true, initialWidth: 110,cellAttributes: { alignment: "right" }},
+ {label:'寰呯郴缁熸搷浣滃叆搴撴暟閲�',
+ type: "customOutputGood",
typeAttributes: {
- outputValue: { fieldName: 'Delivery_detail_count__c' },
+ outputValue: { fieldName: "Delivery_detail_count__c" },
type: 'DeliveryDet',
- recordId: { fieldName: 'Id' }
+ recordId: { fieldName: "Id" }
},
- hideDefaultActions: true,
- initialWidth: 180,
- cellAttributes: { alignment: 'right' }
- },
- {
- label: '杩樻病鍙戣揣鏁伴噺',
- type: 'customOutputGood',
+ hideDefaultActions: true, initialWidth: 180,cellAttributes: { alignment: "right" }},
+ {label:'杩樻病鍙戣揣鏁伴噺',
+ type: "customOutputGood",
typeAttributes: {
- outputValue: { fieldName: 'OrderNumber_notarrive__c' },
+ outputValue: { fieldName: "OrderNumber_notarrive__c" },
type: 'NotArrDet',
- recordId: { fieldName: 'Id' }
+ recordId: { fieldName: "Id" }
},
- hideDefaultActions: true,
- initialWidth: 120,
- cellAttributes: { alignment: 'right' }
- },
- {
- label: '鍙戣揣涓冨ぉ杩樻湭鍒拌揣鏁�',
- type: 'customOutputGood',
+ hideDefaultActions: true, initialWidth: 120,cellAttributes: { alignment: "right" }},
+ {label:'鍙戣揣涓冨ぉ杩樻湭鍒拌揣鏁�',
+ type: "customOutputGood",
typeAttributes: {
- outputValue: { fieldName: 'More_than_seven_days__c' },
+ outputValue: { fieldName: "More_than_seven_days__c" },
type: 'MoreThan7',
- recordId: { fieldName: 'Id' }
+ recordId: { fieldName: "Id" }
},
- hideDefaultActions: true,
- initialWidth: 180,
- cellAttributes: { alignment: 'right' }
- },
- {
- label: '鏈�鏂板彂璐ф棩鏈�',
- fieldName: 'Shipment_date__c',
- hideDefaultActions: true,
- initialWidth: 140
- },
- {
- label: '棣栨鍙戣揣鏃ユ湡',
- fieldName: 'First_Delivery__c',
- hideDefaultActions: true,
- initialWidth: 140
- }
+ hideDefaultActions: true, initialWidth: 180,cellAttributes: { alignment: "right" }},
+ {label:'鏈�鏂板彂璐ф棩鏈�',fieldName:'Shipment_date__c',hideDefaultActions: true, initialWidth: 140},
+ {label:'棣栨鍙戣揣鏃ユ湡',fieldName:'First_Delivery__c',hideDefaultActions: true, initialWidth: 140}
];
@track colms2 = [
- { label: '浜у搧鍨嬪彿', fieldName: 'prodModel', hideDefaultActions: true },
- {
- label: '鏁伴噺',
- fieldName: 'recordCount',
- hideDefaultActions: true,
- initialWidth: 100
- }
+ {label:'浜у搧鍨嬪彿',fieldName:'prodModel',hideDefaultActions: true},
+ {label:'鏁伴噺',fieldName:'recordCount',hideDefaultActions: true,initialWidth: 100}
];
//鑾峰彇鍙傛暟
@@ -162,329 +115,270 @@
// }
// }
- 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);
@@ -494,24 +388,18 @@
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';
@@ -525,5 +413,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 64fd2e0..e83098a 100644
--- a/force-app/main/default/lwc/lexArriveGsDetails/lexArriveGsDetails.html
+++ b/force-app/main/default/lwc/lexArriveGsDetails/lexArriveGsDetails.html
@@ -2,10 +2,7 @@
<template if:true={showSpinner}>
<!-- <lightning-spinner size="medium" variant="brand"></lightning-spinner> -->
<div class="slds-spinner_container">
- <div
- role="status"
- class="slds-spinner slds-spinner_medium slds-spinner_brand"
- >
+ <div role="status" class="slds-spinner slds-spinner_medium slds-spinner_brand">
<span class="slds-assistive-text">Loading</span>
<div class="slds-spinner__dot-a"></div>
<div class="slds-spinner__dot-b"></div>
@@ -14,14 +11,8 @@
</template>
<c-common-toast></c-common-toast>
<template if:true={showPage}>
- <div
- style="
- border: 1px solid #d4d4d4;
- border-top: 3px solid #51606e;
- border-radius: 5px;
- "
- >
- <div style="border-bottom: 1px solid #d4d4d4; padding: 3px">
+ <div style="border: 1px solid #D4D4D4;border-top: 3px solid #51606E;border-radius:5px;">
+ <div style="border-bottom: 1px solid #D4D4D4;padding:3px;">
<lightning-layout>
<lightning-layout-item padding="around-small">
<p style="font-size: 18px">
@@ -31,29 +22,14 @@
</lightning-layout>
<!-- <p style="font-size: 16px;"><strong>鍒拌揣</strong></p> -->
</div>
- <div style="padding: 10px">
+ <div style="padding:10px;">
<!-- 鎸夐挳 -->
<!-- <lightning-button style="margin: 5px;" label="鍑哄簱" onclick={proSale} disabled={arrivetoorder}></lightning-button> -->
- <button
- class="slds-button slds-button_neutral slds-button_stretch lexBorder"
- style="margin: 5px"
- label="鍑哄簱"
- onclick={proSale}
- disabled={arrivetoorder}
- >
- 鍑哄簱
- </button>
- <p style="height: 10px"></p>
+ <button class="slds-button slds-button_neutral slds-button_stretch lexBorder" style="margin: 5px;" label="鍑哄簱" onclick={proSale} disabled={arrivetoorder}>鍑哄簱</button>
+ <p style="height: 10px;"></p>
<!-- 鍒拌揣璁㈠崟淇℃伅 -->
- <div
- style="
- border: 1px solid #d4d4d4;
- border-top: 3px solid #51606e;
- border-radius: 5px;
- margin-bottom: 7px;
- "
- >
- <div style="border-bottom: 1px solid #d4d4d4; padding: 3px">
+ <div style="border: 1px solid #D4D4D4;border-top: 3px solid #51606E;border-radius:5px;margin-bottom:7px;">
+ <div style="border-bottom: 1px solid #D4D4D4;padding:3px;">
<lightning-layout>
<lightning-layout-item padding="around-small">
<p style="font-size: 18px">
@@ -63,77 +39,34 @@
</lightning-layout>
<!-- <p style="font-size: 16px;"><strong>鍒拌揣璁㈠崟淇℃伅</strong></p> -->
</div>
- <div style="padding: 10px">
+ <div style="padding:10px;">
<table>
<tbody>
<tr>
- <td style="width: 10px"></td>
- <td style="width: 140px">
- <div
- style="
- color: #696969;
- font-size: 16px;
- "
- >
- 鍒拌揣璁㈠崟鍚嶇О
- </div>
+ <td style="width:10px;"></td>
+ <td style="width:140px;">
+ <div style="color:#696969;font-size:16px;">鍒拌揣璁㈠崟鍚嶇О</div>
</td>
- <td style="width: 200px">
- <lightning-formatted-text
- style="font-size: 16px"
- value={coc.Name}
- ></lightning-formatted-text>
+ <td style="width:200px;">
+ <lightning-formatted-text style="font-size: 16px;" value={coc.Name}></lightning-formatted-text>
</td>
- <td style="width: 30px"></td>
- <td style="width: 140px">
- <div
- style="
- color: #696969;
- font-size: 16px;
- "
- >
- 鏈鍏ュ簱浜у搧閲戦
- </div>
+ <td style="width:30px;"></td>
+ <td style="width:140px;">
+ <div style="color:#696969;font-size:16px;">鏈鍏ュ簱浜у搧閲戦</div>
</td>
- <td style="width: 100px">
- <lightning-formatted-number
- style="font-size: 16px"
- value={coc.Arrive_total_amount__c}
- minimum-fraction-digits="2"
- ></lightning-formatted-number>
+ <td style="width:100px;">
+ <lightning-formatted-number style="font-size: 16px;" value={coc.Arrive_total_amount__c} minimum-fraction-digits="2"></lightning-formatted-number>
</td>
<td></td>
</tr>
- <tr style="height: 20px"></tr>
+ <tr style="height: 20px;"></tr>
<tr>
- <td style="width: 10px"></td>
- <td style="width: 120px">
- <div
- style="
- color: #696969;
- font-size: 16px;
- "
- >
- 娑堣�楀搧璁㈠崟鍚嶇О<lightning-helptext
- style="
- --lwc-spacingXxSmall: 0px;
- "
- content={label.helpText}
- ></lightning-helptext>
- </div>
+ <td style="width:10px;"></td>
+ <td style="width:120px;">
+ <div style="color:#696969;font-size:16px;">娑堣�楀搧璁㈠崟鍚嶇О<lightning-helptext style="--lwc-spacingXxSmall:0px;" content={label.helpText}></lightning-helptext></div>
</td>
- <td style="width: 200px">
- <a
- style="
- text-decoration: underline;
- color: black;
- "
- onclick={clickOrder}
- ><lightning-formatted-text
- style="font-size: 16px"
- value={coc.arriveOrder}
- ></lightning-formatted-text
- ></a>
+ <td style="width:200px;">
+ <a style="text-decoration: underline;color:black;" onclick={clickOrder}><lightning-formatted-text style="font-size: 16px;" value={coc.arriveOrder}></lightning-formatted-text></a>
<!-- <lightning-formatted-text value={coc.Arrive_Order__r.Name}></lightning-formatted-text> -->
</td>
<td></td>
@@ -143,15 +76,8 @@
</div>
</div>
<!-- 鍦ㄥ簱鍟嗗搧搴撳瓨涓�瑙� -->
- <div
- style="
- border: 1px solid #d4d4d4;
- border-top: 3px solid #51606e;
- border-radius: 5px;
- margin-bottom: 7px;
- "
- >
- <div style="border-bottom: 1px solid #d4d4d4; padding: 3px">
+ <div style="border: 1px solid #D4D4D4;border-top: 3px solid #51606E;border-radius:5px;margin-bottom:7px;">
+ <div style="border-bottom: 1px solid #D4D4D4;padding:3px;">
<lightning-layout>
<lightning-layout-item padding="around-small">
<p style="font-size: 18px">
@@ -161,15 +87,8 @@
</lightning-layout>
<!-- <p style="font-size: 16px;"><strong>鍦ㄥ簱鍟嗗搧搴撳瓨涓�瑙�</strong></p> -->
</div>
- <div style="padding: 10px">
- <lightning-datatable
- class="wrapped-header-datatable"
- style="word-wrap: break-word; word-break: break-all"
- hide-checkbox-column
- key-field="recordId"
- columns={colms}
- data={consumableorderdetailsRecords}
- ></lightning-datatable>
+ <div style="padding:10px;">
+ <lightning-datatable class="wrapped-header-datatable" style="word-wrap:break-word; word-break:break-all;" hide-checkbox-column key-field="recordId" columns={colms} data={consumableorderdetailsRecords}></lightning-datatable>
</div>
</div>
</div>
diff --git a/force-app/main/default/lwc/lexArriveGsDetails/lexArriveGsDetails.js b/force-app/main/default/lwc/lexArriveGsDetails/lexArriveGsDetails.js
index 20bef77..30c135b 100644
--- a/force-app/main/default/lwc/lexArriveGsDetails/lexArriveGsDetails.js
+++ b/force-app/main/default/lwc/lexArriveGsDetails/lexArriveGsDetails.js
@@ -1,17 +1,16 @@
-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;
@@ -25,67 +24,16 @@
//鏄惁涓�鐩存樉绀烘彁绀�
@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)
@@ -93,145 +41,107 @@
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;
- }
- // 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;
- }
- }
- this.showSpinner = false;
- } else {
- this.showSpinner = false;
- console.log('error:' + result.errorMsg);
- this.showMyToast('鍒濆鍖栧け璐�', result.errorMsg, 'error');
+ 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;
}
- })
- .catch((error) => {
+ 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);
+ }
+ if(this.consumableorderdetailsRecords[i].Prod != null){
+ this.consumableorderdetailsRecords[i]['statusCFDA'] = this.consumableorderdetailsRecords[i].Prod.SFDA_Status__c;
+ }
+ }
this.showSpinner = false;
- this.showPage = true;
- console.log('error:' + error);
- this.showMyToast('鍒濆鍖栧け璐�', error, 'error');
- });
+ }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');
+ })
}
- 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 {
- this.showSpinner = false;
- console.log('error:' + result.errorMsg);
- this.showMyToast('鍑哄簱澶辫触', result.errorMsg, 'error');
- }
- })
- .catch((error) => {
- this.showPage = true;
+ .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:' + error);
- this.showMyToast('鍑哄簱澶辫触', error, 'error');
- });
+ 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');
+ })
}
- 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);
@@ -242,24 +152,18 @@
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';
@@ -273,5 +177,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 7b3b455..60898fb 100644
--- a/force-app/main/default/lwc/lexCancelRemoveBox/lexCancelRemoveBox.html
+++ b/force-app/main/default/lwc/lexCancelRemoveBox/lexCancelRemoveBox.html
@@ -1,227 +1,138 @@
<template>
- <template if:true={showSpinner}>
- <!-- <lightning-spinner size="medium" variant="brand"></lightning-spinner> -->
- <div class="slds-spinner_container">
- <div
- role="status"
- class="slds-spinner slds-spinner_medium slds-spinner_brand"
- >
- <span class="slds-assistive-text">Loading</span>
- <div class="slds-spinner__dot-a"></div>
- <div class="slds-spinner__dot-b"></div>
- </div>
- </div>
- </template>
- <c-common-toast></c-common-toast>
- <div style="border: 1px solid #d4d4d4; border-radius: 5px">
- <div
- style="
- border-top: 3px solid #51606e;
- border-bottom: 1px solid #d4d4d4;
- padding: 3px;
- "
- >
- <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>
+ <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;"> -->
- <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;">
+ <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: 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="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="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="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>
+
</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 49f7f59..41e3760 100644
--- a/force-app/main/default/lwc/lexCancelRemoveBox/lexCancelRemoveBox.js
+++ b/force-app/main/default/lwc/lexCancelRemoveBox/lexCancelRemoveBox.js
@@ -1,76 +1,84 @@
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: 'Name__c',
- hideDefaultActions: true,
- wrapText: true
- },
- {
- label: 'BarCode',
- fieldName: 'Bar_Code__c',
- wrapText: true,
- hideDefaultActions: true
- // initialWidth:600
- },
- {
- label: '閿欒鍘熷洜',
- fieldName: 'ErrorReason',
- hideDefaultActions: true
+
}
-];
+ ,
+ {
+ label: '閿欒鍘熷洜',
+ fieldName: 'ErrorReason',
+ hideDefaultActions: true,
+ }
+ ];
+
export default class LexCancelRemoveBox extends LightningElement {
columns = columns;
@@ -78,175 +86,164 @@
@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));
- });
- }
- //鑾峰彇褰撳墠杈撳叆鍊�
- handleChange(event) {
- let value = event.detail.value;
- console.log('value' + value);
- this.barcode = value;
- console.log('this.barcode' + this.barcode);
- }
+ 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));
+ });
- saveConfirm() {
- let msg = '纭鍙栨秷鎷嗙洅鍚�';
- if (this.dataSize > 0) {
- if (confirm(msg) == true) {
- this.CancelRemoveBox();
- }
- } else {
+ }
+ //鑾峰彇褰撳墠杈撳叆鍊�
+ 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) {
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));
- });
+ }
+ 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';
}
- 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);
+ 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/lexConInvoiceView/lexConInvoiceView.html b/force-app/main/default/lwc/lexConInvoiceView/lexConInvoiceView.html
index 8e12258..4406470 100644
--- a/force-app/main/default/lwc/lexConInvoiceView/lexConInvoiceView.html
+++ b/force-app/main/default/lwc/lexConInvoiceView/lexConInvoiceView.html
@@ -3,122 +3,55 @@
<template>
<c-common-toast></c-common-toast>
<template if:true={isShowSpinner}>
- <div
- role="status"
- class="slds-spinner slds-spinner_medium slds-spinner_brand"
- >
- 聽 聽 聽 聽 聽 聽 聽 聽 <span class="slds-assistive-text">Loading</span> 聽 聽
- 聽 聽 聽 聽 聽 聽
- <div class="slds-spinner__dot-a"></div>
- 聽 聽 聽 聽 聽 聽 聽 聽
- <div class="slds-spinner__dot-b"></div>
- 聽 聽 聽 聽
- </div>
+ <div role="status" class="slds-spinner slds-spinner_medium slds-spinner_brand">
+聽 聽 聽 聽 聽 聽 聽 聽 <span class="slds-assistive-text">Loading</span>
+聽 聽 聽 聽 聽 聽 聽 聽 <div class="slds-spinner__dot-a"></div>
+聽 聽 聽 聽 聽 聽 聽 聽 <div class="slds-spinner__dot-b"></div>
+聽 聽 聽 聽 </div>
</template>
+
<template if:false={isDetailsShow}>
<template if:false={isConInvoiceList}>
<!-- 鎼滅储瀹㈡埛鍚� -->
<template if:true={isModalOpen}>
- <section
- role="dialog"
- tabindex="-1"
- aria-labelledby="modal-heading-01"
- aria-modal="true"
- aria-describedby="modal-content-id-1"
- class="slds-modal slds-fade-in-open slds-modal_medium"
- style="border: 1px solid #d4d4d4"
- >
+ <section role="dialog" tabindex="-1" aria-labelledby="modal-heading-01" aria-modal="true"
+ aria-describedby="modal-content-id-1" class="slds-modal slds-fade-in-open slds-modal_medium"
+ style="border: 1px solid #D4D4D4;">
<div class="slds-modal__container">
- <header
- class="slds-modal__header"
- style="background-color: #f3f3f3"
- >
- <button
- style=""
- class="slds-button slds-button_icon slds-modal__close slds-button_icon-inverse"
- title="Close"
- onclick={closeModal}
- >
- <lightning-icon
- icon-name="utility:close"
- alternative-text="close"
- variant="inverse"
- size="small"
- ></lightning-icon>
+ <header class="slds-modal__header" style="background-color: #F3F3F3;">
+ <button style="" class="slds-button slds-button_icon slds-modal__close slds-button_icon-inverse"
+ title="Close" onclick={closeModal}>
+ <lightning-icon icon-name="utility:close" alternative-text="close" variant="inverse"
+ size="small"></lightning-icon>
<span class="slds-assistive-text">Close</span>
</button>
- <h2
- id="modal-heading-01"
- class="slds-text-heading_medium slds-hyphenate"
- >
- 缁忛攢鍟嗗尰闄㈡绱�
- </h2>
+ <h2 id="modal-heading-01" class="slds-text-heading_medium slds-hyphenate">缁忛攢鍟嗗尰闄㈡绱�</h2>
</header>
- <div
- class="slds-modal__content slds-p-around_medium"
- id="modal-content-id-1"
- style="border: 1px solid #f3f3f3"
- >
- <table style="width: 100%">
+ <div class="slds-modal__content slds-p-around_medium" id="modal-content-id-1"
+ style="border: 1px solid #F3F3F3;">
+ <table style="width: 100%;">
<tbody>
<tr>
- <td style="width: 74px">
- <div
- style="
- color: #696969;
- font-size: 16px;
- text-align: left;
- "
- >
- 鍖婚櫌鍚嶇О
- </div>
+ <td style="width: 74px;">
+ <div style="color:#696969;font-size:16px;text-align: left;">鍖婚櫌鍚嶇О</div>
</td>
- <td style="width: 60%">
- <lightning-input
- class="inputFont"
- label="鍖婚櫌鍚嶇О"
- variant="label-hidden"
- placeholder="璇疯緭鍏ュ尰闄㈠悕绉�"
- value={searchHospitalName}
- data-field="searchHospitalName"
- onchange={dataChange}
- ></lightning-input>
- </td>
- <td style="width: 10px"></td>
- <td>
- <button
- class="slds-button slds-button_neutral slds-button_stretch lexsearchStyle"
- style="height: 32px"
- label="鎼滅储"
- onclick={searchHospital}
- >
- 鎼滅储
- </button>
- </td>
+ <td style="width: 60%;"><lightning-input class="inputFont" label="鍖婚櫌鍚嶇О"
+ variant="label-hidden" placeholder="璇疯緭鍏ュ尰闄㈠悕绉�" value={searchHospitalName}
+ data-field="searchHospitalName" onchange={dataChange}></lightning-input></td>
+ <td style="width: 10px;"></td>
+ <td><button class="slds-button slds-button_neutral slds-button_stretch lexsearchStyle"
+ style="height: 32px;" label="鎼滅储" onclick={searchHospital}>鎼滅储</button></td>
</tr>
</tbody>
</table>
- <p style="height: 20px"></p>
+ <p style="height: 20px;"></p>
<!-- <p>宸查�夋嫨鍖婚櫌锛歿chooseHospital}</p> -->
<div
- style="
- border: 1px solid #d4d4d4;
- border-top: 3px solid #51606e;
- border-radius: 5px;
- margin-bottom: 7px;
- "
- >
- <div
- style="
- border-bottom: 1px solid #d4d4d4;
- padding: 3px;
- "
- >
+ style="border: 1px solid #D4D4D4;border-top: 3px solid #51606E;border-radius:5px;margin-bottom:7px;">
+ <div style="border-bottom: 1px solid #D4D4D4;padding:3px;">
<lightning-layout>
- <lightning-layout-item
- padding="around-small"
- >
+ <lightning-layout-item padding="around-small">
<p style="font-size: 18px">
<strong>鎼滅储缁撴灉</strong>
</p>
@@ -126,199 +59,109 @@
</lightning-layout>
<!-- <p style="font-size: 16px;"><strong>鎼滅储缁撴灉</strong></p> -->
</div>
- <div class="myTable" style="padding: 10px">
+ <div class="myTable" style="padding:10px;">
<!-- <lightning-datatable class="wrapped-header-datatable" key-field="id"
hide-checkbox-column="true" data={hospitalList} columns={hosCols}
onrowaction={chooseHos}></lightning-datatable> -->
- <lightning-datatable
- class="datatabel slds-border_top wrapped-header-datatable"
- key-field="id"
- data={hospitalList}
- columns={hospitalColumns}
- hide-checkbox-column="true"
- onrowaction={searchHandleRowAction}
- >
+ <lightning-datatable class="datatabel slds-border_top wrapped-header-datatable"
+ key-field="id" data={hospitalList} columns={hospitalColumns} hide-checkbox-column="true"
+ onrowaction={searchHandleRowAction}>
</lightning-datatable>
</div>
</div>
</div>
<footer class="slds-modal__footer">
- <button
- class="slds-button slds-button_neutral slds-button_stretch lexclearStyle"
- label="鍙栨秷"
- onclick={closeModal}
- >
- 鍙栨秷
- </button>
+ <button class="slds-button slds-button_neutral slds-button_stretch lexclearStyle" label="鍙栨秷"
+ onclick={closeModal}>鍙栨秷</button>
</footer>
</div>
</section>
<div class="slds-backdrop slds-backdrop_open"></div>
</template>
<div class="outerBorderCss">
- <div style="padding: 5px">
+ <div style="padding:5px;">
+
<div class="borderCss">
- <div style="padding: 10px">
+ <div style="padding:10px;">
<div lwc:dom="manual" class="resultDiv"></div>
<div draggable="false">
<template if:false={EditAble}>
<lightning-layout multiple-rows="true">
- <lightning-layout-item
- size="2"
- ></lightning-layout-item>
+ <lightning-layout-item size="2"></lightning-layout-item>
<lightning-layout-item size="10">
<button
class="slds-button slds-button_neutral slds-button_stretch lexBorder"
- onclick={SetEditAbleJs}
- disabled={isDisabledEdit}
- style="width: 150px"
- >
- 缂栬緫
- </button>
+ onclick={SetEditAbleJs} disabled={isDisabledEdit}
+ style="width: 150px;">缂栬緫</button>
<button
class="slds-button slds-button_neutral slds-button_stretch lexBorder buttonminMarginLeft"
- onclick={approvalJs}
- disabled={isDisabledEdit}
- style="width: 150px"
- >
- 鎻愪氦
- </button>
+ onclick={approvalJs} disabled={isDisabledEdit}
+ style="width: 150px;">鎻愪氦</button>
<button
class="slds-button slds-button_neutral slds-button_stretch lexBorder buttonminMarginLeft"
- onclick={openReportJs}
- disabled={isOpenReportDisabled}
- style="width: 150px"
- >
- 鏄剧ず鏄庣粏
- </button>
+ onclick={openReportJs} disabled={isOpenReportDisabled}
+ style="width: 150px;">鏄剧ず鏄庣粏</button>
<button
class="slds-button slds-button_neutral slds-button_stretch lexBorder buttonminMarginLeft"
- onclick={reopenJs}
- disabled={isDisabledReopen}
- style="width: 150px"
- >
- 浣滃簾閲嶅紑
- </button>
+ onclick={reopenJs} disabled={isDisabledReopen}
+ style="width: 150px;">浣滃簾閲嶅紑</button>
</lightning-layout-item>
</lightning-layout>
- <lightning-layout
- multiple-rows="true"
- style="margin-top: 20px"
- >
- <lightning-layout-item
- size="2"
- ></lightning-layout-item>
+ <lightning-layout multiple-rows="true" style="margin-top: 20px;">
+ <lightning-layout-item size="2"></lightning-layout-item>
<lightning-layout-item size="10">
<button
class="slds-button slds-button_neutral slds-button_stretch lexBorder"
- onclick={deleteButtonJs}
- disabled={isDisabledDelete}
- style="width: 150px"
- >
- 鍒犻櫎
- </button>
+ onclick={deleteButtonJs} disabled={isDisabledDelete}
+ style="width: 150px;">鍒犻櫎</button>
<button
class="slds-button slds-button_neutral slds-button_stretch lexBorder buttonminMarginLeft"
- disabled={isDisabledReopen}
- onclick={uploadOrder}
- style="width: 150px"
- >
- 涓婁紶闄勪欢
- </button>
+ disabled={isDisabledReopen} onclick={uploadOrder}
+ style="width: 150px;">涓婁紶闄勪欢</button>
<button
class="slds-button slds-button_neutral slds-button_stretch lexBorder buttonminMarginLeft"
- onclick={saveAttachmentJs}
- disabled={isDisabledReopen}
- style="width: 150px"
- >
- 淇濆瓨闄勪欢
- </button>
+ onclick={saveAttachmentJs} disabled={isDisabledReopen}
+ style="width: 150px;">淇濆瓨闄勪欢</button>
</lightning-layout-item>
</lightning-layout>
</template>
<!-- 涓婁紶闄勪欢寮圭獥 -->
<template if:true={showAttPop}>
- <section
- role="dialog"
- tabindex="-1"
- aria-labelledby="modal-heading-02"
- aria-modal="true"
- aria-describedby="modal-content-id-2"
+ <section role="dialog" tabindex="-1" aria-labelledby="modal-heading-02"
+ aria-modal="true" aria-describedby="modal-content-id-2"
class="slds-modal slds-fade-in-open slds-modal_small"
- style="border: 1px solid #d4d4d4"
- >
+ style="border: 1px solid #D4D4D4;">
<template if:true={showPopSpinner}>
- <lightning-spinner
- size="medium"
- variant="brand"
- ></lightning-spinner>
+ <lightning-spinner size="medium" variant="brand"></lightning-spinner>
</template>
<div class="slds-modal__container">
- <header
- class="slds-modal__header"
- style="
- background-color: #f3f3f3;
- "
- >
- <button
- style=""
+ <header class="slds-modal__header" style="background-color: #F3F3F3;">
+ <button style=""
class="slds-button slds-button_icon slds-modal__close slds-button_icon-inverse"
- title="Close"
- onclick={closePop}
- >
- <lightning-icon
- icon-name="utility:close"
- alternative-text="close"
- variant="inverse"
- size="small"
- ></lightning-icon>
- <span
- class="slds-assistive-text"
- >Close</span
- >
+ title="Close" onclick={closePop}>
+ <lightning-icon icon-name="utility:close" alternative-text="close"
+ variant="inverse" size="small"></lightning-icon>
+ <span class="slds-assistive-text">Close</span>
</button>
- <h2
- id="modal-heading-02"
- class="slds-text-heading_medium slds-hyphenate"
- >
- 涓婁紶闄勪欢
- </h2>
+ <h2 id="modal-heading-02"
+ class="slds-text-heading_medium slds-hyphenate">涓婁紶闄勪欢</h2>
</header>
- <div
- class="slds-modal__content slds-p-around_medium searchName"
- id="modal-content-id-2"
- style="
- border: 1px solid #f3f3f3;
- "
- >
- <div
- class="slds-m-top_medium slds-m-bottom_x-large"
- >
- <div
- class="slds-p-around_medium lgc-bg"
- >
- <lightning-input
- class="fileUpload"
- type="file"
- label="闄勪欢涓婁紶"
+ <div class="slds-modal__content slds-p-around_medium searchName"
+ id="modal-content-id-2" style="border: 1px solid #F3F3F3;">
+ <div class="slds-m-top_medium slds-m-bottom_x-large">
+ <div class="slds-p-around_medium lgc-bg">
+ <lightning-input class="fileUpload" type="file" label="闄勪欢涓婁紶"
accept=".xlsx, .xls, .csv, .png, .doc, .docx, .pdf"
- onchange={attChange}
- ></lightning-input>
+ onchange={attChange}></lightning-input>
</div>
- <p class="fontWeight">
- 宸查�夋嫨鏂囦欢锛歿fileName}
+ <p class="fontWeight">宸查�夋嫨鏂囦欢锛歿fileName}
- <template
- if:true={attDelBtn}
- >
- <a
- onclick={removeAtt}
- >绉婚櫎</a
- >
+ <template if:true={attDelBtn}>
+ <a onclick={removeAtt}>绉婚櫎</a>
</template>
</p>
</div>
@@ -328,49 +171,24 @@
label="鍙栨秷" onclick={closePop}></lightning-button>
<lightning-button style="margin-left: 10px;" variant="neutral"
label="涓婁紶" onclick={handleFilesChange}></lightning-button> -->
- <button
- class="slds-button slds-button_neutral slds-button_stretch lexclearStyle"
- style="margin-left: 10px"
- label="鍙栨秷"
- onclick={closePop}
- >
- 鍙栨秷
- </button>
- <button
- class="slds-button slds-button_neutral slds-button_stretch lexsearchStyle"
- style="margin-left: 10px"
- label="涓婁紶"
- onclick={handleFilesChange}
- >
- 涓婁紶
- </button>
+ <button class="slds-button slds-button_neutral slds-button_stretch lexclearStyle" style="margin-left: 10px;"
+ label="鍙栨秷" onclick={closePop}>鍙栨秷</button>
+ <button class="slds-button slds-button_neutral slds-button_stretch lexsearchStyle" style="margin-left: 10px;"
+ label="涓婁紶" onclick={handleFilesChange}>涓婁紶</button>
</footer>
</div>
</section>
- <div
- class="slds-backdrop slds-backdrop_open"
- ></div>
+ <div class="slds-backdrop slds-backdrop_open"></div>
</template>
<template if:true={EditAble}>
<lightning-layout>
- <lightning-layout-item
- size="1"
- padding="around-small"
- ></lightning-layout-item>
- <lightning-layout-item
- size="2"
- padding="around-small"
- ></lightning-layout-item>
- <lightning-layout-item
- padding="around-small"
- >
+ <lightning-layout-item size="1" padding="around-small"></lightning-layout-item>
+ <lightning-layout-item size="2" padding="around-small"></lightning-layout-item>
+ <lightning-layout-item padding="around-small">
<button
class="slds-button slds-button_neutral slds-button_stretch lexBorder"
- onclick={SaveJs}
- >
- 纭畾
- </button>
+ onclick={SaveJs}>纭畾</button>
</lightning-layout-item>
</lightning-layout>
</template>
@@ -407,6 +225,7 @@
</template>
</lightning-layout> -->
+
</div>
</div>
</div>
@@ -421,180 +240,103 @@
</lightning-layout-item>
</lightning-layout>
</div>
- <div style="padding: 7px">
+ <div style="padding:7px;">
<div lwc:dom="manual" class="resultDiv"></div>
<div draggable="false">
<!--鍙戠エ淇℃伅 鏄剧ず鐢� -->
<template if:false={isEditInvoice}>
- <lightning-record-edit-form
- object-api-name="Consumable_order__c"
- record-id={cocId}
- onload={handleLoad2}
- >
+ <lightning-record-edit-form object-api-name="Consumable_order__c" record-id={cocId}
+ onload={handleLoad2}>
<!-- 鍙戠エ鍙� 鐘舵�� -->
<lightning-layout multiple-rows="true">
- <lightning-layout-item
- size="1"
- ></lightning-layout-item>
+ <lightning-layout-item size="1"></lightning-layout-item>
- <lightning-layout-item
- class="hehe-layoutItem"
- size="5"
- >
- <lightning-output-field
- field-name="Name"
- ></lightning-output-field>
+ <lightning-layout-item class="hehe-layoutItem" size="5">
+ <lightning-output-field field-name="Name"></lightning-output-field>
</lightning-layout-item>
- <lightning-layout-item
- class="hehe-layoutItem"
- size="5"
- style="padding-left: 100px"
- >
+ <lightning-layout-item class="hehe-layoutItem" size="5" style="padding-left: 100px;">
<lightning-output-field
- field-name="Invoice_status__c"
- ></lightning-output-field>
+ field-name="Invoice_status__c"></lightning-output-field>
</lightning-layout-item>
- <lightning-layout-item
- size="1"
- ></lightning-layout-item>
+ <lightning-layout-item size="1"></lightning-layout-item>
+
</lightning-layout>
<!-- 鍙戠エ鏃ユ湡 -->
<lightning-layout multiple-rows="true">
- <lightning-layout-item
- size="1"
- ></lightning-layout-item>
+ <lightning-layout-item size="1"></lightning-layout-item>
- <lightning-layout-item
- class="hehe-layoutItem"
- size="5"
- >
+ <lightning-layout-item class="hehe-layoutItem" size="5">
<lightning-output-field
- field-name="Invoice_Date__c"
- ></lightning-output-field>
+ field-name="Invoice_Date__c"></lightning-output-field>
</lightning-layout-item>
</lightning-layout>
<!-- 浜岀骇缁忛攢鍟� -->
- <template
- if:true={isShowSecondaryDistributor}
- >
- <lightning-layout-item
- size="1"
- ></lightning-layout-item>
+ <template if:true={isShowSecondaryDistributor}>
+ <lightning-layout-item size="1"></lightning-layout-item>
- <lightning-layout
- multiple-rows="true"
- >
- <lightning-layout-item
- class="hehe-layoutItem"
- size="5"
- >
+ <lightning-layout multiple-rows="true">
+ <lightning-layout-item class="hehe-layoutItem" size="5">
<lightning-output-field
- field-name="Order_Dealer_Info__c"
- ></lightning-output-field>
+ field-name="Order_Dealer_Info__c"></lightning-output-field>
</lightning-layout-item>
</lightning-layout>
</template>
<!-- 瀹㈡埛鍚� -->
<lightning-layout multiple-rows="true">
- <lightning-layout-item
- size="1"
- ></lightning-layout-item>
+ <lightning-layout-item size="1"></lightning-layout-item>
- <lightning-layout-item
- class="hehe-layoutItem"
- size="5"
- >
- <lightning-output-field
- field-name="ShipmentAccount__c"
- class="hideHelpText"
- ></lightning-output-field>
+ <lightning-layout-item class="hehe-layoutItem" size="5">
+ <lightning-output-field field-name="ShipmentAccount__c"
+ class="hideHelpText"></lightning-output-field>
</lightning-layout-item>
</lightning-layout>
<!-- 绉戝 鍙戠エ绁ㄩ潰閲戦 -->
- <lightning-layout
- multiple-rows="true"
- style="height: 35.5px"
- >
- <lightning-layout-item
- size="1"
- ></lightning-layout-item>
+ <lightning-layout multiple-rows="true" style="height:35.5px">
+ <lightning-layout-item size="1"></lightning-layout-item>
- <lightning-layout-item
- class="hehe-layoutItem"
- size="5"
- >
+ <lightning-layout-item class="hehe-layoutItem" size="5">
<lightning-output-field
- field-name="Order_ForCustomerText__c"
- ></lightning-output-field>
+ field-name="Order_ForCustomerText__c"></lightning-output-field>
</lightning-layout-item>
- <lightning-layout-item
- size="5"
- class="readOnly"
- style="padding-left: 100px"
- >
- <lightning-input
- label="鍙戠エ绁ㄩ潰閲戦(鍏�)"
- value={sumPrice}
- read-only
- variant="label-inline"
- ></lightning-input>
+ <lightning-layout-item size="5" class="readOnly" style="padding-left: 100px;">
+ <lightning-input label="鍙戠エ绁ㄩ潰閲戦(鍏�)" value={sumPrice} read-only
+ variant="label-inline"></lightning-input>
</lightning-layout-item>
- <lightning-layout-item
- size="1"
- ></lightning-layout-item>
+ <lightning-layout-item size="1"></lightning-layout-item>
</lightning-layout>
<!-- 澶囨敞 -->
<lightning-layout multiple-rows="true">
- <lightning-layout-item
- size="1"
- ></lightning-layout-item>
- <lightning-layout-item
- class="hehe-layoutItem"
- size="5"
- >
+ <lightning-layout-item size="1"></lightning-layout-item>
+ <lightning-layout-item class="hehe-layoutItem" size="5">
<lightning-output-field
- field-name="Invoice_Note__c"
- ></lightning-output-field>
+ field-name="Invoice_Note__c"></lightning-output-field>
</lightning-layout-item>
</lightning-layout>
<!-- 鍙戠エ闄勪欢 鏄庣粏闄勪欢 -->
<lightning-layout multiple-rows="true">
- <lightning-layout-item
- size="1"
- ></lightning-layout-item>
+ <lightning-layout-item size="1"></lightning-layout-item>
- <lightning-layout-item
- class="hehe-layoutItem"
- size="5"
- >
+ <lightning-layout-item class="hehe-layoutItem" size="5">
<lightning-output-field
- field-name="Invoice_attachment__c"
- ></lightning-output-field>
+ field-name="Invoice_attachment__c"></lightning-output-field>
</lightning-layout-item>
- <lightning-layout-item
- class="hehe-layoutItem"
- size="5"
- style="padding-left: 100px"
- >
+ <lightning-layout-item class="hehe-layoutItem" size="5" style="padding-left: 100px;">
<lightning-output-field
- field-name="Invoicedet_attachment__c"
- ></lightning-output-field>
+ field-name="Invoicedet_attachment__c"></lightning-output-field>
</lightning-layout-item>
- <lightning-layout-item
- size="1"
- ></lightning-layout-item>
+ <lightning-layout-item size="1"></lightning-layout-item>
</lightning-layout>
<!-- 闄勪欢棰勮 -->
@@ -602,68 +344,30 @@
<lightning-layout-item size="1">
</lightning-layout-item>
<lightning-layout-item size="10">
- <lightning-card
- class="attListTitle"
- variant="Narrow"
- title="闄勪欢鍒楄〃"
- icon-name="utility:attach"
- >
- <lightning-layout
- slot="footer"
- multiple-rows="true"
- >
- <template
- for:each={fileData}
- for:item="item"
- for:index="index"
- >
- <lightning-layout-item
- padding="around-none"
- size="2"
+ <lightning-card class="attListTitle" variant="Narrow" title="闄勪欢鍒楄〃"
+ icon-name="utility:attach">
+
+ <lightning-layout slot="footer" multiple-rows="true">
+ <template for:each={fileData} for:item="item" for:index="index">
+ <lightning-layout-item padding="around-none" size="2"
key={item.recordId}
- style="
- text-align: left;
- padding: 5px;
- "
- >
- <lightning-icon
- title={item.Title}
- style="
- margin-left: 20px;
- "
- icon-name="doctype:gform"
+ style="text-align: left;padding:5px">
+ <lightning-icon title={item.Title}
+ style="margin-left: 20px;" icon-name="doctype:gform"
alternative-text={item.Title}
- size="large"
- ></lightning-icon
- ><br />
- <div
- title={item.Title}
- style="
- width: 100px;
- text-overflow: ellipsis;
- overflow: hidden;
- white-space: nowrap;
- "
- >
+ size="large"></lightning-icon><br />
+ <div title={item.Title} style="width: 100px;text-overflow: ellipsis;overflow: hidden;white-space: nowrap;">
{item.Title}
</div>
<p>
<!-- <a data-fileid ={item.documentId} onclick={previweAtt}> -->
- <a
- href={item.attUrl}
- target="_blank"
- >
- 棰勮 </a
- > 路
- <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>
@@ -678,177 +382,95 @@
</template>
<!--鍙戠エ淇℃伅 缂栬緫鐢� -->
<template if:true={isEditInvoice}>
- <lightning-record-edit-form
- object-api-name="Consumable_order__c"
- record-id={cocId}
- onload={handleLoad2}
- >
+ <lightning-record-edit-form object-api-name="Consumable_order__c" record-id={cocId}
+ onload={handleLoad2}>
<!-- 鍙戠エ鍙� 鐘舵�� -->
<lightning-layout multiple-rows="true">
- <lightning-layout-item
- size="1"
- ></lightning-layout-item>
+ <lightning-layout-item size="1"></lightning-layout-item>
- <lightning-layout-item
- class="hehe-layoutItem"
- size="5"
- >
- <lightning-input
- label="鍙戠エ鍙�"
- value={OrderCode}
- data-field="OrderCode"
- onchange={dataChange}
- variant="label-inline"
- required
- class="inputFont"
- ></lightning-input>
+ <lightning-layout-item class="hehe-layoutItem" size="5">
+ <lightning-input label="鍙戠エ鍙�" value={OrderCode} data-field="OrderCode"
+ onchange={dataChange} variant="label-inline" required
+ class="inputFont"></lightning-input>
</lightning-layout-item>
- <lightning-layout-item
- class="hehe-layoutItem"
- size="5"
- style="padding-left: 100px"
- >
+ <lightning-layout-item class="hehe-layoutItem" size="5" style="padding-left: 100px;">
<lightning-output-field
- field-name="Invoice_status__c"
- ></lightning-output-field>
+ field-name="Invoice_status__c"></lightning-output-field>
</lightning-layout-item>
- <lightning-layout-item
- size="1"
- ></lightning-layout-item>
+ <lightning-layout-item size="1"></lightning-layout-item>
</lightning-layout>
<!-- 鍙戠エ鏃ユ湡 -->
<lightning-layout multiple-rows="true">
- <lightning-layout-item
- size="1"
- ></lightning-layout-item>
+ <lightning-layout-item size="1"></lightning-layout-item>
- <lightning-layout-item
- class="hehe-layoutItem"
- size="5"
- >
- <lightning-input
- type="date"
- label="鍙戠エ鏃ユ湡"
- variant="label-inline"
- value={InvoiceDate}
- onchange={invoiceDateChange}
- required
- class="inputFont"
- ></lightning-input>
+ <lightning-layout-item class="hehe-layoutItem" size="5">
+ <lightning-input type="date" label="鍙戠エ鏃ユ湡" variant="label-inline"
+ value={InvoiceDate} onchange={invoiceDateChange} required
+ class="inputFont"></lightning-input>
</lightning-layout-item>
</lightning-layout>
<!-- 瀹㈡埛鍚� 浜岀骇缁忛攢鍟� -->
<lightning-layout multiple-rows="true">
- <lightning-layout-item
- size="1"
- ></lightning-layout-item>
+ <lightning-layout-item size="1"></lightning-layout-item>
- <lightning-layout-item
- class="hehe-layoutItem"
- size="5"
- >
+ <lightning-layout-item class="hehe-layoutItem" size="5">
<div
- class="slds-form-element__control slds-input-has-icon slds-input-has-icon_right"
- >
- <lightning-icon
- size="x-small"
+ class="slds-form-element__control slds-input-has-icon slds-input-has-icon_right">
+ <lightning-icon size="x-small"
class="iconMargin slds-icon slds-input__icon slds-input__icon_right slds-icon-text-default hideHelpText"
- icon-name="utility:search"
- ></lightning-icon>
- <lightning-input
- type="text"
- name="HospitalName"
- label="瀹㈡埛鍚�"
- value={HospitalName}
- variant="label-inline"
- onclick={searchHospitalNameModal}
- data-field="HospitalName"
- onchange={clearAgencyI}
- class="inputFont"
- ></lightning-input>
+ icon-name="utility:search"></lightning-icon>
+ <lightning-input type="text" name="HospitalName" label="瀹㈡埛鍚�"
+ value={HospitalName} variant="label-inline"
+ onclick={searchHospitalNameModal} data-field="HospitalName"
+ onchange={clearAgencyI} class="inputFont"></lightning-input>
</div>
</lightning-layout-item>
- <lightning-layout-item
- class="hehe-layoutItem"
- size="5"
- style="padding-left: 100px"
- >
- <lightning-combobox
- data-field="secondaryDistributor"
- name="secondaryDistributor"
- label="浜岀骇缁忛攢鍟�"
- value={secondaryDistributor}
- placeholder="璇烽�夋嫨..."
- options={provinceOptsMap}
- variant="label-inline"
- onchange={dataChange}
- class="inputFont"
- ></lightning-combobox>
+ <lightning-layout-item class="hehe-layoutItem" size="5" style="padding-left: 100px;">
+ <lightning-combobox data-field="secondaryDistributor"
+ name="secondaryDistributor" label="浜岀骇缁忛攢鍟�"
+ value={secondaryDistributor} placeholder="璇烽�夋嫨..."
+ options={provinceOptsMap} variant="label-inline"
+ onchange={dataChange} class="inputFont"></lightning-combobox>
</lightning-layout-item>
- <lightning-layout-item
- size="1"
- ></lightning-layout-item>
+ <lightning-layout-item size="1"></lightning-layout-item>
</lightning-layout>
<!-- 绉戝 缁忛攢鍟�(褰曞叆) -->
<lightning-layout multiple-rows="true">
- <lightning-layout-item
- size="1"
- ></lightning-layout-item>
+ <lightning-layout-item size="1"></lightning-layout-item>
- <lightning-layout-item
- class="hehe-layoutItem"
- size="5"
- >
- <lightning-input-field
- onchange={dataChange}
- data-field="ForCustomerText"
- value={ForCustomerText}
+ <lightning-layout-item class="hehe-layoutItem" size="5">
+ <lightning-input-field onchange={dataChange}
+ data-field="ForCustomerText" value={ForCustomerText}
field-name="Order_ForCustomerText__c"
- class="inputFont"
- ></lightning-input-field>
+ class="inputFont"></lightning-input-field>
</lightning-layout-item>
- <lightning-layout-item
- class="hehe-layoutItem"
- size="5"
- style="padding-left: 100px"
- >
+ <lightning-layout-item class="hehe-layoutItem" size="5" style="padding-left: 100px;">
<lightning-output-field
- field-name="Order_ForDealerText__c"
- ></lightning-output-field>
+ field-name="Order_ForDealerText__c"></lightning-output-field>
</lightning-layout-item>
- <lightning-layout-item
- size="1"
- ></lightning-layout-item>
+ <lightning-layout-item size="1"></lightning-layout-item>
</lightning-layout>
<!-- 澶囨敞 -->
<lightning-layout multiple-rows="true">
- <lightning-layout-item
- size="1"
- ></lightning-layout-item>
+ <lightning-layout-item size="1"></lightning-layout-item>
- <lightning-layout-item
- class="hehe-layoutItem"
- size="5"
- >
- <lightning-input-field
- onchange={dataChange}
- data-field="InvoiceNote"
- value={InvoiceNote}
- field-name="Invoice_Note__c"
- class="inputFont"
- ></lightning-input-field>
+ <lightning-layout-item class="hehe-layoutItem" size="5">
+ <lightning-input-field onchange={dataChange} data-field="InvoiceNote"
+ value={InvoiceNote} field-name="Invoice_Note__c"
+ class="inputFont"></lightning-input-field>
</lightning-layout-item>
</lightning-layout>
+
</lightning-record-edit-form>
</template>
</div>
@@ -857,31 +479,25 @@
<!-- 鍑哄簱鍗曚竴瑙� -->
<div class="borderCss">
<div class="headerDorderCss">
+
<lightning-layout>
<lightning-layout-item padding="around-small">
<p style="font-size: 18px">
<strong>鍑哄簱鍗曚竴瑙�</strong>
</p>
</lightning-layout-item>
- <lightning-layout-item
- size="2"
- padding="around-small"
- >
+ <lightning-layout-item size="2" padding="around-small">
</lightning-layout-item>
<template if:false={hideCheckbox}>
- <lightning-layout-item
- padding="around-small"
- >
+ <lightning-layout-item padding="around-small">
<!-- <lightning-button label=" 妫�绱� "
onclick={InvoiceorderSearchJs}></lightning-button> -->
<button
class="slds-button slds-button_neutral slds-button_stretch lexsearchStyle"
- onclick={InvoiceorderSearchJs}
- >
- 妫�绱�
- </button>
+ onclick={InvoiceorderSearchJs}>妫�绱�</button>
</lightning-layout-item>
</template>
+
</lightning-layout>
</div>
@@ -904,25 +520,13 @@
<div style="padding: 7px">
<div lwc:dom="manual" class="resultDiv"></div>
<div draggable="false">
- <lightning-datatable
- key-field="Id"
- data={outboundData}
- columns={outboundColumns}
- hide-checkbox-column={hideCheckbox}
- onrowselection={getSelectedRows}
- selected-rows={selectedRows}
- class="wrapped-header-datatable"
- data-field="outbound"
- >
+ <lightning-datatable key-field="Id" data={outboundData} columns={outboundColumns}
+ hide-checkbox-column={hideCheckbox} onrowselection={getSelectedRows}
+ selected-rows={selectedRows} class="wrapped-header-datatable" data-field="outbound">
</lightning-datatable>
- <lightning-datatable
- key-field="id"
- data={outboundDataSumPrice}
- columns={outboundColumns}
- hide-checkbox-column
- hide-table-header
- class="wrapped-header-datatable"
- >
+ <lightning-datatable key-field="id" data={outboundDataSumPrice}
+ columns={outboundColumns} hide-checkbox-column hide-table-header
+ class="wrapped-header-datatable">
</lightning-datatable>
</div>
</div>
@@ -932,9 +536,7 @@
<div class="borderCss">
<div class="headerDorderCss">
<lightning-layout>
- <lightning-layout-item
- padding="around-small"
- >
+ <lightning-layout-item padding="around-small">
<p style="font-size: 18px">
<strong>鍙戠エ鏄庣粏</strong>
</p>
@@ -944,13 +546,9 @@
<div style="padding: 7px">
<div lwc:dom="manual" class="resultDiv"></div>
<div draggable="false">
- <lightning-datatable
- key-field="id"
- data={invoiceOrderdetail1Recoeds}
- columns={invoiceDetailsColumns}
- hide-checkbox-column
- class="wrapped-header-datatable"
- >
+ <lightning-datatable key-field="id" data={invoiceOrderdetail1Recoeds}
+ columns={invoiceDetailsColumns} hide-checkbox-column
+ class="wrapped-header-datatable">
</lightning-datatable>
</div>
</div>
@@ -1007,25 +605,21 @@
<template if:true={isConInvoiceList}>
<div class="outerBorderCss">
- <div style="padding: 5px">
+ <div style="padding:5px;">
<!-- 鏂板缓鍙戠エ -->
<div class="borderCss">
- <div style="padding: 15px">
+ <div style="padding:15px;">
<div lwc:dom="manual" class="resultDiv"></div>
<div draggable="false">
<!-- <lightning-button label="鏂板缓鍙戠エ" onclick={newInvoiceJs}></lightning-button> -->
- <button
- class="slds-button slds-button_neutral slds-button_stretch lexBorder"
- onclick={newInvoiceJs}
- >
- 鏂板缓鍙戠エ
- </button>
+ <button class="slds-button slds-button_neutral slds-button_stretch lexBorder"
+ onclick={newInvoiceJs}>鏂板缓鍙戠エ</button>
</div>
</div>
</div>
<!-- 妫�绱㈡潯浠� -->
- <div class="borderCss" style="margin-top: 5px">
+ <div class="borderCss" style="margin-top: 5px;">
<div class="headerDorderCss">
<lightning-layout>
<lightning-layout-item padding="around-small">
@@ -1038,150 +632,77 @@
<div style="padding: 15px">
<div lwc:dom="manual" class="resultDiv"></div>
<div draggable="false">
+
<lightning-layout multiple-rows>
<lightning-layout-item flexibility="auto">
<div class="slds-text-align_center">
- <div
- class="slds-grid slds-grid_vertical-align-center"
- >
- <div
- class="slds-form-element__label"
- >
- 鍑哄簱鏃� 浠�
- </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">
@@ -1194,13 +715,8 @@
<div style="padding: 7px">
<div lwc:dom="manual" class="resultDiv"></div>
<div draggable="false">
- <lightning-datatable
- key-field="id"
- data={invoiceData}
- columns={invoiceColumns}
- hide-checkbox-column="true"
- class="wrapped-header-datatable"
- >
+ <lightning-datatable key-field="id" data={invoiceData} columns={invoiceColumns}
+ hide-checkbox-column="true" class="wrapped-header-datatable">
</lightning-datatable>
</div>
</div>
@@ -1212,25 +728,21 @@
<template if:true={isDetailsShow}>
<div class="outerBorderCss">
- <div style="padding: 5px">
+ <div style="padding:5px;">
<!-- 纭畾 -->
<div class="borderCss">
- <div style="padding: 10px">
+ <div style="padding:10px;">
<div lwc:dom="manual" class="resultDiv"></div>
<div draggable="false">
<!-- <lightning-button label="纭畾" onclick={detailsSaveJs}></lightning-button> -->
- <button
- class="slds-button slds-button_neutral slds-button_stretch lexBorder"
- onclick={detailsSaveJs}
- >
- 纭畾
- </button>
+ <button class="slds-button slds-button_neutral slds-button_stretch lexBorder"
+ onclick={detailsSaveJs}>纭畾</button>
</div>
</div>
</div>
<!-- 鍙戠エ淇℃伅 -->
- <div class="borderCss" style="margin-top: 5px">
+ <div class="borderCss" style="margin-top: 5px;">
<div class="headerDorderCss">
<lightning-layout>
<lightning-layout-item padding="around-small">
@@ -1243,43 +755,26 @@
<div style="padding: 7px">
<div lwc:dom="manual" class="resultDiv"></div>
<div draggable="false">
- <lightning-record-edit-form
- object-api-name="Consumable_order__c"
- record-id={detailsInvoiceId}
- onload={handleLoad2}
- >
+ <lightning-record-edit-form object-api-name="Consumable_order__c"
+ record-id={detailsInvoiceId} onload={handleLoad2}>
<lightning-layout multiple-rows="true">
- <lightning-layout-item
- size="1"
- ></lightning-layout-item>
+ <lightning-layout-item size="1"></lightning-layout-item>
<lightning-layout-item size="5">
- <lightning-output-field
- field-name="Name"
- ></lightning-output-field>
+ <lightning-output-field field-name="Name"></lightning-output-field>
</lightning-layout-item>
</lightning-layout>
<lightning-layout multiple-rows="true">
- <lightning-layout-item
- size="1"
- ></lightning-layout-item>
- <lightning-layout-item
- size="5"
- class="hehe-layoutItem"
- >
- <lightning-output-field
- field-name="ShipmentAccount__c"
- class="hideHelpText"
- ></lightning-output-field>
+ <lightning-layout-item size="1"></lightning-layout-item>
+ <lightning-layout-item size="5" class="hehe-layoutItem">
+ <lightning-output-field field-name="ShipmentAccount__c"
+ class="hideHelpText"></lightning-output-field>
</lightning-layout-item>
</lightning-layout>
<lightning-layout multiple-rows="true">
- <lightning-layout-item
- size="1"
- ></lightning-layout-item>
+ <lightning-layout-item size="1"></lightning-layout-item>
<lightning-layout-item size="5">
<lightning-output-field
- field-name="Order_ForCustomerText__c"
- ></lightning-output-field>
+ field-name="Order_ForCustomerText__c"></lightning-output-field>
</lightning-layout-item>
</lightning-layout>
</lightning-record-edit-form>
@@ -1288,7 +783,7 @@
</div>
<!-- 鍑哄簱鍗� -->
- <div class="borderCss" style="margin-top: 5px">
+ <div class="borderCss" style="margin-top: 5px;">
<div class="headerDorderCss">
<lightning-layout>
<lightning-layout-item padding="around-small">
@@ -1301,28 +796,17 @@
<div style="padding: 7px">
<div lwc:dom="manual" class="resultDiv"></div>
<div draggable="false">
- <lightning-record-edit-form
- object-api-name="Consumable_order__c"
- record-id={detailsCocId}
- >
+ <lightning-record-edit-form object-api-name="Consumable_order__c" record-id={detailsCocId}>
<lightning-layout multiple-rows="true">
- <lightning-layout-item
- size="1"
- ></lightning-layout-item>
+ <lightning-layout-item size="1"></lightning-layout-item>
<lightning-layout-item size="5">
- <lightning-output-field
- field-name="Name"
- ></lightning-output-field>
+ <lightning-output-field field-name="Name"></lightning-output-field>
</lightning-layout-item>
</lightning-layout>
<lightning-layout multiple-rows="true">
- <lightning-layout-item
- size="1"
- ></lightning-layout-item>
+ <lightning-layout-item size="1"></lightning-layout-item>
<lightning-layout-item size="5">
- <lightning-output-field
- field-name="Outbound_Date__c"
- ></lightning-output-field>
+ <lightning-output-field field-name="Outbound_Date__c"></lightning-output-field>
</lightning-layout-item>
</lightning-layout>
</lightning-record-edit-form>
@@ -1331,7 +815,7 @@
</div>
<!-- 鍑哄簱鍗曟槑缁� -->
- <div class="borderCss" style="margin-top: 5px">
+ <div class="borderCss" style="margin-top: 5px;">
<div class="headerDorderCss">
<lightning-layout>
<lightning-layout-item padding="around-small">
@@ -1347,30 +831,15 @@
<!-- <lightning-datatable class="datatabel slds-border_top" key-field="id"
data={detaisData} columns={detailsColumns}>
</lightning-datatable> -->
- <c-lex-custom-lightning-datatable
- key-field="Id"
- data={detailsData}
- columns={detailsColumns}
- onunitchange={handleUnitChange}
- onshipmentnumber={handleShipmentNumber}
- onrowselection={detailsGetSelectedRows}
- selected-rows={detailsSelectedRows}
- style="
- word-wrap: break-word;
- word-break: break-all;
- "
- class="wrapped-header-datatable"
- min-column-width="115"
- >
+ <c-lex-custom-lightning-datatable key-field="Id" data={detailsData} columns={detailsColumns}
+ onunitchange={handleUnitChange} onshipmentnumber={handleShipmentNumber}
+ onrowselection={detailsGetSelectedRows} selected-rows={detailsSelectedRows}
+ style="word-wrap:break-word; word-break:break-all; " class="wrapped-header-datatable"
+ min-column-width="115">
</c-lex-custom-lightning-datatable>
- <lightning-datatable
- class="datatabel slds-border_top wrapped-header-datatable"
- key-field="id"
- data={invoiceAllpriceData}
- columns={detailsColumns}
- hide-checkbox-column
- hide-table-header
- >
+ <lightning-datatable class="datatabel slds-border_top wrapped-header-datatable"
+ key-field="id" data={invoiceAllpriceData} columns={detailsColumns} hide-checkbox-column
+ hide-table-header>
</lightning-datatable>
</div>
</div>
@@ -1378,4 +847,5 @@
</div>
</div>
</template>
+
</template>
\ 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 495eb73..032f8fc 100644
--- a/force-app/main/default/lwc/lexConInvoiceView/lexConInvoiceView.js
+++ b/force-app/main/default/lwc/lexConInvoiceView/lexConInvoiceView.js
@@ -1,291 +1,290 @@
import { LightningElement, api, track, wire } from 'lwc';
-import { ShowToastEvent } from 'lightning/platformShowToastEvent';
-import init from '@salesforce/apex/LexConInvoiceViewController.init';
-import save from '@salesforce/apex/LexConInvoiceViewController.save';
-import saveFile from '@salesforce/apex/LexConInvoiceViewController.saveFile';
-import saveAttachment from '@salesforce/apex/LexConInvoiceViewController.saveAttachment';
-import InvoiceorderSearch from '@salesforce/apex/LexConInvoiceViewController.InvoiceorderSearch';
-import deleteButton from '@salesforce/apex/LexConInvoiceViewController.deleteButton';
-import approval from '@salesforce/apex/LexConInvoiceViewController.approval';
-import conInvoiceListInit from '@salesforce/apex/LexConInvoiceList.init';
-import invoiceCodeSearch from '@salesforce/apex/LexConInvoiceList.invoiceCodeSearch';
-import hospitalInit from '@salesforce/apex/lexSearchAgencyHospitalController.init';
-import serContact from '@salesforce/apex/lexSearchAgencyHospitalController.serContact';
-import detailsInit from '@salesforce/apex/LexConInvoicedetailsController.init';
-import detailsSave from '@salesforce/apex/LexConInvoicedetailsController.save';
+import { ShowToastEvent } from "lightning/platformShowToastEvent";
+import init from "@salesforce/apex/LexConInvoiceViewController.init";
+import save from "@salesforce/apex/LexConInvoiceViewController.save";
+import saveFile from "@salesforce/apex/LexConInvoiceViewController.saveFile";
+import saveAttachment from "@salesforce/apex/LexConInvoiceViewController.saveAttachment";
+import InvoiceorderSearch from "@salesforce/apex/LexConInvoiceViewController.InvoiceorderSearch";
+import deleteButton from "@salesforce/apex/LexConInvoiceViewController.deleteButton";
+import approval from "@salesforce/apex/LexConInvoiceViewController.approval";
+import conInvoiceListInit from "@salesforce/apex/LexConInvoiceList.init";
+import invoiceCodeSearch from "@salesforce/apex/LexConInvoiceList.invoiceCodeSearch";
+import hospitalInit from "@salesforce/apex/lexSearchAgencyHospitalController.init";
+import serContact from "@salesforce/apex/lexSearchAgencyHospitalController.serContact";
+import detailsInit from "@salesforce/apex/LexConInvoicedetailsController.init";
+import detailsSave from "@salesforce/apex/LexConInvoicedetailsController.save";
import deleteAtt from '@salesforce/apex/LexSummonsCreatController.deleteAtt';
-import { NavigationMixin } from 'lightning/navigation';
-//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',
- hideDefaultActions: true,
- wrapText: true
- },
- {
- label: '鍑哄簱鍗曠紪鐮�',
- fieldName: 'esdetInvoicedet1ODlinkName',
- wrapText: true,
- hideDefaultActions: true,
- wrapText: true
- },
- {
- label: '浜у搧鍨嬪彿',
- fieldName: 'esdetAssetModelNo',
+ label: "鍑哄簱鏃ユ湡",
+ fieldName: "esdetProductOutDate",
hideDefaultActions: true,
wrapText: true,
- initialWidth: 400
},
{
- label: '鍗曚綅',
- fieldName: 'esdetInvoiceUnit',
+ label: "鍑哄簱鍗曠紪鐮�",
+ fieldName: "esdetInvoicedet1ODlinkName",
+ wrapText: true,
hideDefaultActions: true,
wrapText: true,
- initialWidth: 50
},
{
- label: '鍙戠エ鍗曚环',
- fieldName: 'esdetInvoiceUnitprice',
+ label: "浜у搧鍨嬪彿",
+ fieldName: "esdetAssetModelNo",
hideDefaultActions: true,
wrapText: true,
- type: 'number',
+ initialWidth: 400,
+ },
+ {
+ label: "鍗曚綅",
+ fieldName: "esdetInvoiceUnit",
+ hideDefaultActions: true,
+ wrapText: true,
+ initialWidth: 50,
+ },
+ {
+ label: "鍙戠エ鍗曚环",
+ fieldName: "esdetInvoiceUnitprice",
+ hideDefaultActions: true,
+ wrapText: true,
+ type: "number",
typeAttributes: {
- minimumFractionDigits: 2
- }
+ minimumFractionDigits: 2,
+ },
},
{
- label: '鍙戠エ鏁伴噺',
- fieldName: 'esdetInvoicedCount',
+ label: "鍙戠エ鏁伴噺",
+ fieldName: "esdetInvoicedCount",
cellAttributes: { alignment: 'right' },
hideDefaultActions: true,
- wrapText: true
+ wrapText: true,
},
{
- label: '鍙戠エ绁ㄩ潰閲戦(鍏�)',
- fieldName: 'esdetInvoicedProCostRMB',
+ label: "鍙戠エ绁ㄩ潰閲戦(鍏�)",
+ fieldName: "esdetInvoicedProCostRMB",
hideDefaultActions: true,
wrapText: true,
cellAttributes: { alignment: 'right' },
- initialWidth: 145,
- type: 'number',
+ 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
- },
- {
- label: '瀹㈡埛鍚�',
- fieldName: 'ShipmentAccount__c',
hideDefaultActions: true,
- wrapText: true
},
{
- label: '鍙戠エ鐘舵��',
- fieldName: 'Invoice_status__c',
+ label: "瀹㈡埛鍚�",
+ fieldName: "ShipmentAccount__c",
+ hideDefaultActions: true,
+ wrapText: true,
+ },
+ {
+ label: "鍙戠エ鐘舵��",
+ fieldName: "Invoice_status__c",
hideDefaultActions: true,
initialWidth: 100
},
{
- label: '鍙戠エ璐﹂潰閲戦(鍏�)',
- fieldName: 'Invoice_total_amount__c',
+ label: "鍙戠エ璐﹂潰閲戦(鍏�)",
+ fieldName: "Invoice_total_amount__c",
hideDefaultActions: true,
- type: 'number',
+ type: "number",
typeAttributes: {
- minimumFractionDigits: 2
+ minimumFractionDigits: 2,
},
initialWidth: 180
},
{
- label: '鍙戠エ闄勪欢',
- fieldName: 'Invoice_attachment__c',
+ label: "鍙戠エ闄勪欢",
+ fieldName: "Invoice_attachment__c",
type: 'boolean',
hideDefaultActions: true,
initialWidth: 120
},
{
- label: '鍙戠エ鏄庣粏闄勪欢',
- fieldName: 'Invoicedet_attachment__c',
+ label: "鍙戠エ鏄庣粏闄勪欢",
+ fieldName: "Invoicedet_attachment__c",
type: 'boolean',
hideDefaultActions: true,
initialWidth: 120
- }
+ },
];
const detailsColumns = [
{
- label: '浜у搧鍨嬪彿',
- fieldName: 'esdAssetModelNo',
+ label: "浜у搧鍨嬪彿",
+ fieldName: "esdAssetModelNo",
hideDefaultActions: true,
initialWidth: 200,
- wrapText: true
+ wrapText: true,
},
{
- label: '瑙勬牸',
- fieldName: 'packingListManual',
+ label: "瑙勬牸",
+ fieldName: "packingListManual",
hideDefaultActions: true,
initialWidth: 30
},
{
- label: '鍑鸿揣鍗曚环(鍏�)',
- fieldName: 'esdDeliveryListRMB',
+ label: "鍑鸿揣鍗曚环(鍏�)",
+ fieldName: "esdDeliveryListRMB",
hideDefaultActions: true,
- type: 'number',
+ type: "number",
typeAttributes: {
- minimumFractionDigits: 2
- }
+ minimumFractionDigits: 2,
+ },
},
{
- label: '鍑鸿揣鏁伴噺',
- fieldName: 'esdShipmentCount',
- hideDefaultActions: true
- },
- {
- label: '杩斿搧鏁伴噺',
- fieldName: 'esdRrturnProCount',
- hideDefaultActions: true
- },
- {
- label: '鍑哄簱鍗曚綅',
- fieldName: 'esdBoxPiece',
- hideDefaultActions: true
- },
- {
- label: '宸插彂绁ㄦ暟閲�',
- fieldName: 'esdInvoicedProcount',
+ label: "鍑鸿揣鏁伴噺",
+ fieldName: "esdShipmentCount",
hideDefaultActions: true,
- type: 'number',
- typeAttributes: {
- minimumFractionDigits: 2
- }
},
{
- label: '杩樻病鍙戠エ鏁伴噺',
- fieldName: 'esdInvoiceProNotCount',
+ label: "杩斿搧鏁伴噺",
+ fieldName: "esdRrturnProCount",
hideDefaultActions: true,
- type: 'number',
- typeAttributes: {
- minimumFractionDigits: 2
- }
},
{
- label: '寮�绁ㄥ崟浣�',
+ label: "鍑哄簱鍗曚綅",
+ fieldName: "esdBoxPiece",
hideDefaultActions: true,
- type: 'customUnit',
- typeAttributes: {
- unitValue: { fieldName: 'unitValue' },
- unitOptions: { fieldName: 'unitOptions' },
- recordId: { fieldName: 'recordId' },
- isDisabled: { fieldName: 'isDisabled' }
- }
},
{
- label: '鍙戠エ鍗曚环',
- fieldName: 'esdInvoiceUnitprice',
+ label: "宸插彂绁ㄦ暟閲�",
+ fieldName: "esdInvoicedProcount",
hideDefaultActions: true,
- type: 'number',
+ type: "number",
typeAttributes: {
- minimumFractionDigits: 2
+ minimumFractionDigits: 2,
+ },
+ },
+ {
+ label: "杩樻病鍙戠エ鏁伴噺",
+ fieldName: "esdInvoiceProNotCount",
+ hideDefaultActions: true,
+ type: "number",
+ typeAttributes: {
+ minimumFractionDigits: 2,
+ },
+ },
+ {
+ label: "寮�绁ㄥ崟浣�",
+ hideDefaultActions: true,
+ type: "customUnit",
+ typeAttributes: {
+ unitValue: { fieldName: "unitValue" },
+ unitOptions: { fieldName: "unitOptions" },
+ recordId: { fieldName: "recordId" },
+ isDisabled: { fieldName: "isDisabled" },
+ },
+ },
+ {
+ label: "鍙戠エ鍗曚环",
+ fieldName: "esdInvoiceUnitprice",
+ hideDefaultActions: true,
+ type: "number",
+ typeAttributes: {
+ minimumFractionDigits: 2,
},
initialWidth: 130
},
{
- label: '鍙戠エ鏁伴噺',
+ label: "鍙戠エ鏁伴噺",
//fieldName: "invoiceCount",
hideDefaultActions: true,
- type: 'customShipment',
+ type: "customShipment",
cellAttributes: { alignment: 'right' },
typeAttributes: {
- recordId: { fieldName: 'recordId' },
- shipmentNumber: { fieldName: 'shipmentNumber' },
- isConinvoice: { fieldName: 'isConinvoice' },
- esdInvoiceProNotCount: { fieldName: 'esdInvoiceProNotCount' }
- }
+ recordId: { fieldName: "recordId" },
+ shipmentNumber: { fieldName: "shipmentNumber" },
+ isConinvoice: { fieldName: "isConinvoice" },
+ esdInvoiceProNotCount: { fieldName: "esdInvoiceProNotCount" },
+ },
},
{
- label: '鍙戠エ绁ㄩ潰閲戦(鍏�)',
+ label: "鍙戠エ绁ㄩ潰閲戦(鍏�)",
cellAttributes: { alignment: 'right' },
- fieldName: 'invoiceAllprice',
+ fieldName: "invoiceAllprice",
hideDefaultActions: true,
- type: 'number',
+ type: "number",
initialWidth: 150,
typeAttributes: {
- minimumFractionDigits: 2
- }
- }
-];
+ minimumFractionDigits: 2,
+ },
+ },
+]
const customLabel = {
LexConInvoiceViewReport
-};
-export default class LexConInvoiceView extends NavigationMixin(
- LightningElement
-) {
+}
+export default class LexConInvoiceView extends NavigationMixin(LightningElement) {
+
@track label = customLabel;
invoiceColumns = invoiceColumns;
detailsColumns = detailsColumns;
@track outboundColumns = [
{
- label: '鍑哄簱鏃ユ湡',
- fieldName: 'esdOutboundDate',
+ label: "鍑哄簱鏃ユ湡",
+ fieldName: "esdOutboundDate",
hideDefaultActions: true,
- wrapText: true
+ wrapText: true,
},
{
- label: '鍑哄簱鍗曠紪鐮�',
- fieldName: 'esdNameUrl',
+ label: "鍑哄簱鍗曠紪鐮�",
+ fieldName: "esdNameUrl",
type: 'url',
typeAttributes: {
- label: { fieldName: 'esdName' },
- target: '_blank'
+ label: { fieldName: "esdName" },
+ target: "_blank",
},
hideDefaultActions: true,
- wrapText: true
+ wrapText: true,
}
- ];
+ ]
@track outboundData = [];
@track outboundDataSumPrice = [];
@track invoiceData = [];
@@ -302,7 +301,7 @@
@track coc = {};
@track EditAble = false;
@track isChange = false;
- @track sumPrice = 0.0;
+ @track sumPrice = 0.00;
@track OrderCode = '';
@track ExistOutbound = false;
@track reopen = '';
@@ -314,7 +313,7 @@
@track detailsInvoiceId = '';
@track detailsCocId = '';
@track detailsData = [];
- @track invoiceAllprice = 0.0;
+ @track invoiceAllprice = 0.00;
//鐘舵��
@track invoiceStatusValue = '';
@track invoiceStatusOptions = [];
@@ -338,9 +337,9 @@
@track secondaryDistributor = '';
//瀹㈡埛鍚�
@track isModalOpen = false;
- @track HospitalName = '';
- @track HospitalInfo = '';
- @track searchHospitalName = '';
+ @track HospitalName = "";
+ @track HospitalInfo = "";
+ @track searchHospitalName = "";
@track isDisabledHospitalName = false;
@track agencyProType = '';
@track accountid = '';
@@ -376,50 +375,47 @@
//鏂囦欢涓婁紶
@track showLoadingSpinner = false;
@track showPopSpinner = false;
- @track UploadFile = 'Upload File';
- @track fileName = '';
+ @track UploadFile = "Upload File";
+ @track fileName = "";
@track fileData = [];
@track fileColumns = [
{
- label: '鏍囬',
- fieldName: 'url',
- type: 'url',
- typeAttributes: { label: { fieldName: 'Title' }, target: '_blank' },
- hideDefaultActions: true
+ label: "鏍囬",
+ fieldName: "url",
+ type: "url",
+ typeAttributes: { label: { fieldName: "Title" }, target: "_blank" },
+ hideDefaultActions: true,
},
{
- label: '鍒涘缓浜�',
- type: 'url',
- fieldName: 'CreatedByNameUrl',
- typeAttributes: {
- label: { fieldName: 'CreatedByName' },
- target: '_blank'
- },
- hideDefaultActions: true
+ label: "鍒涘缓浜�",
+ type: "url",
+ fieldName: "CreatedByNameUrl",
+ typeAttributes: { label: { fieldName: "CreatedByName" }, target: "_blank" },
+ hideDefaultActions: true,
},
{
- label: '涓婁紶鏃ユ湡',
+ label: "涓婁紶鏃ユ湡",
type: 'date',
typeAttributes: {
- year: 'numeric',
- month: 'long',
- day: '2-digit',
- hour: '2-digit',
- minute: '2-digit'
+ year: "numeric",
+ month: "long",
+ day: "2-digit",
+ hour: "2-digit",
+ minute: "2-digit"
},
- fieldName: 'CreatedDate',
- hideDefaultActions: true
+ fieldName: "CreatedDate",
+ hideDefaultActions: true,
},
{
- label: '闄勪欢绫诲瀷',
- type: 'customAttachmentType',
+ label: "闄勪欢绫诲瀷",
+ type: "customAttachmentType",
typeAttributes: {
- typeValue: { fieldName: 'typeValue' },
- typeOptions: { fieldName: 'typeOptions' },
- recordId: { fieldName: 'recordId' },
- isDisabledAttachment: { fieldName: 'isDisabledAttachment' }
+ typeValue: { fieldName: "typeValue" },
+ typeOptions: { fieldName: "typeOptions" },
+ recordId: { fieldName: "recordId" },
+ isDisabledAttachment: { fieldName: "isDisabledAttachment" },
},
- hideDefaultActions: true
+ hideDefaultActions: true,
},
{
label: '',
@@ -432,7 +428,7 @@
},
initialWidth: 50,
hideDefaultActions: true
- }
+ },
];
filesUploaded = [];
fileContents;
@@ -445,19 +441,19 @@
if (!this.stylesLoaded) {
Promise.all([loadStyle(this, WrappedHeaderTable)])
.then(() => {
- console.log('Custom styles loaded');
+ console.log("Custom styles loaded");
this.stylesLoaded = true;
})
.catch((error) => {
- console.error('Error loading custom styles');
+ console.error("Error loading custom styles");
});
}
}
//鑾峰彇閾炬帴鍙傛暟
getQueryString(name) {
- console.log('getQueryString name ' + name);
- let reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)', 'i');
+ console.log("getQueryString name " + name);
+ let reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
let r = window.location.search.substr(1).match(reg);
if (r != null) {
return decodeURIComponent(r[2]);
@@ -471,178 +467,121 @@
init() {
this.isShowSpinner = true;
- this.deliveryId = this.getQueryString('deliveryId');
- this.deliveryId = this.deliveryId == null ? '' : this.deliveryId;
- this.invoiceId = this.getQueryString('invoiceId');
- this.invoiceId = this.invoiceId == null ? '' : this.invoiceId;
- this.orderId = this.getQueryString('orderId');
- this.orderId = this.orderId == null ? '' : this.orderId;
- this.statusEdit = this.getQueryString('KeyWords');
- this.statusEdit = this.statusEdit == null ? '' : this.statusEdit;
- this.reopen = this.getQueryString('reopen');
- this.reopen = this.reopen == null ? '' : this.reopen;
- this.isNew = this.getQueryString('isNew');
- this.isNew = this.isNew == null ? '' : this.isNew;
- console.log(
- 'this.deliveryId = ' +
- this.deliveryId +
- ' this.invoiceId = ' +
- this.invoiceId +
- ' this.statusEdit = ' +
- this.statusEdit
- );
+ this.deliveryId = this.getQueryString("deliveryId");
+ this.deliveryId = this.deliveryId == null ? "" : this.deliveryId;
+ this.invoiceId = this.getQueryString("invoiceId");
+ this.invoiceId = this.invoiceId == null ? "" : this.invoiceId;
+ this.orderId = this.getQueryString("orderId");
+ this.orderId = this.orderId == null ? "" : this.orderId;
+ this.statusEdit = this.getQueryString("KeyWords");
+ this.statusEdit = this.statusEdit == null ? "" : this.statusEdit;
+ this.reopen = this.getQueryString("reopen");
+ this.reopen = this.reopen == null ? "" : this.reopen;
+ this.isNew = this.getQueryString("isNew");
+ this.isNew = this.isNew == null ? "" : this.isNew;
+ console.log('this.deliveryId = ' + this.deliveryId + ' this.invoiceId = ' + this.invoiceId + ' this.statusEdit = ' + this.statusEdit);
if (this.invoiceId != '' && this.orderId != '') {
//杩涘叆coninvoiceDetails
detailsInit({
orderIdLwc: this.orderId,
invoiceIdLwc: this.invoiceId
- })
- .then((r) => {
- 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]['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]['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;
- 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');
+ if (this.detailsData[i].check) {
+ this.detailsSelectedRows.push(this.detailsData[i]['Id']);
+ this.invoiceAllprice += this.detailsData[i]['invoiceAllprice'];
+ }
}
- })
- .catch((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))
+
this.isShowSpinner = false;
- console.log('error = ' + JSON.stringify(error));
- });
- } else if (
- this.deliveryId == '' &&
- this.invoiceId == '' &&
- this.isNew == ''
- ) {
+ 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('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;
- }
- 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');
+ this.invoiceData = r.entity.raesList;
+ for (var i in this.invoiceData) {
+ this.invoiceData[i]['NameUrl'] = '/lexconinvoiceview?invoiceId=' + this.invoiceData[i].Id;
}
- })
- .catch((error) => {
- console.log('error = ' + JSON.stringify(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));
+ });
+
} else {
console.log('init');
this.isConInvoiceList = false;
@@ -650,345 +589,226 @@
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;
- }
- 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.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
-
- 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;
- }
- 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.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.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');
+ 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);
}
- })
- .catch((error) => {
- console.log('error = ' + JSON.stringify(error));
- });
+ 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.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
+
+
+ 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;
+ }
+ 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.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.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));
+ });
}
+
}
+
//涓婁紶閰嶇疆鍗�
uploadOrder(event) {
@@ -1019,11 +839,7 @@
//鏄惁鏄剧ず闄勪欢绉婚櫎
get attDelBtn() {
- if (
- this.fileName != '' &&
- this.fileName != null &&
- this.fileName != '閫夋嫨涓�涓枃浠朵笂浼�'
- ) {
+ if (this.fileName != '' && this.fileName != null && this.fileName != '閫夋嫨涓�涓枃浠朵笂浼�') {
return true;
} else {
return false;
@@ -1042,47 +858,47 @@
s += '0';
}
return s;
- }
+ };
dataChange(event) {
- let fieldName = event.target.getAttribute('data-field');
+ let fieldName = event.target.getAttribute("data-field");
let value = event.detail.value;
- console.log('fieldName = ' + fieldName + ' value = ' + value);
+ console.log("fieldName = " + fieldName + " value = " + value);
switch (fieldName) {
- case 'OrderCode':
+ case "OrderCode":
this.OrderCode = value;
this.coc['Name'] = value;
break;
- case 'ForCustomerText':
+ case "ForCustomerText":
this.ForCustomerText = value;
this.coc['Order_ForCustomerText__c'] = value;
break;
- case 'InvoiceDate':
+ case "InvoiceDate":
this.InvoiceDate = value;
this.coc['Invoice_Date__c'] = value;
break;
- case 'secondaryDistributor':
+ case "secondaryDistributor":
this.secondaryDistributor = value;
break;
- case 'deliveryFromDate':
+ case "deliveryFromDate":
this.deliveryFromDate = value;
break;
- case 'deliveryToDate':
+ case "deliveryToDate":
this.deliveryToDate = value;
break;
- case 'category1':
+ case "category1":
this.category1 = value;
break;
- case 'category2':
+ case "category2":
this.category2 = value;
break;
- case 'invoiceStatus':
+ case "invoiceStatus":
this.invoiceStatusValue = value;
break;
- case 'searchHospitalName':
+ case "searchHospitalName":
this.searchHospitalName = value;
break;
- case 'InvoiceNote':
+ case "InvoiceNote":
this.InvoiceNote = value;
this.coc['Invoice_Note__c'] = value;
break;
@@ -1097,68 +913,58 @@
//鎼滅储瀹㈡埛鍚�
searchHospitalNameModal() {
- console.log('searchHospitalNameModal');
+ console.log("searchHospitalNameModal");
hospitalInit({
- ctype: this.agencyProType
+ ctype: this.agencyProType,
}).then((r) => {
r = JSON.parse(JSON.stringify(r));
- if (r.status == 'Success') {
+ if (r.status == "Success") {
this.hospitalList = r.entity.at;
for (var i in this.hospitalList) {
- this.hospitalList[i]['stateMasterName'] =
- this.hospitalList[i].State_Master__r.Name;
+ this.hospitalList[i]["stateMasterName"] = this.hospitalList[i].State_Master__r.Name;
}
- console.log(
- 'hospitalInit r = ' + JSON.stringify(this.hospitalList)
- );
+ console.log("hospitalInit r = " + JSON.stringify(this.hospitalList));
this.isModalOpen = true;
}
});
}
searchHospital() {
- console.log('this.searchHospitalName = ' + this.searchHospitalName);
+ console.log("this.searchHospitalName = " + this.searchHospitalName);
serContact({
searchName: this.searchHospitalName,
- ctype: this.agencyProType
+ ctype: this.agencyProType,
}).then((r) => {
r = JSON.parse(JSON.stringify(r));
- if (r.status == 'Success') {
+ if (r.status == "Success") {
this.hospitalList = r.entity.at;
for (var i in this.hospitalList) {
- this.hospitalList[i]['stateMasterName'] =
+ this.hospitalList[i]["stateMasterName"] =
this.hospitalList[i].State_Master__r.Name;
}
- console.log(
- 'hospitalInit r = ' + JSON.stringify(this.hospitalList)
- );
+ console.log("hospitalInit r = " + JSON.stringify(this.hospitalList));
}
});
}
//閫夋嫨瀹㈡埛鍚�
searchHandleRowAction(event) {
- console.log('searchHandleRowAction');
+ console.log("searchHandleRowAction");
let row = event.detail.row;
this.HospitalInfo = row.Id;
this.HospitalName = row.Name;
- console.log(
- 'this.HospitalInfo = ' +
- this.HospitalInfo +
- ' this.HospitalName = ' +
- this.HospitalName
- );
+ console.log("this.HospitalInfo = " + this.HospitalInfo + " this.HospitalName = " + this.HospitalName);
this.isModalOpen = false;
}
//褰撳鎴峰悕鏄┖鏃躲�傚鎴穒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() {
@@ -1167,12 +973,10 @@
SaveJs() {
this.isShowSpinner = true;
- let cloneData = this.outboundData;
+ let cloneData = this.outboundData
- debugger;
- const selectedRows = this.template
- .querySelector("[data-field='outbound']")
- .getSelectedRows();
+ debugger
+ const selectedRows = this.template.querySelector("[data-field='outbound']").getSelectedRows();
console.log('selectedRows = ' + JSON.stringify(selectedRows));
for (var i in cloneData) {
@@ -1207,10 +1011,7 @@
console.log('this.accountid = ' + this.accountid);
console.log('this.agencyProType = ' + this.agencyProType);
console.log('this.reopen = ' + this.reopen);
- console.log(
- 'this.invoiceOrderRecoedschangeLwc = ' +
- JSON.stringify(this.invoiceOrderRecoedschange)
- );
+ console.log('this.invoiceOrderRecoedschangeLwc = ' + JSON.stringify(this.invoiceOrderRecoedschange));
save({
cocLwc: this.coc,
HospitalNameLwc: this.HospitalName,
@@ -1222,47 +1023,42 @@
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];
@@ -1274,74 +1070,72 @@
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;
@@ -1358,96 +1152,74 @@
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'
- );
- } else {
- this.showMyToast(
- '鎼滅储澶辫触',
- '娌℃湁鎼滅储鍒扮浉鍏冲彂绁�',
- 'Error'
- );
- }
- } else {
- this.showMyToast('鎼滅储澶辫触', r.msg, 'Error');
+ 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;
}
- })
- .catch((error) => {
- console.log('error = ' + error.message);
- this.showMyToast('閿欒', '鎼滅储澶辫触', 'Error');
- });
+ 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('鎼滅储澶辫触', r.msg, 'Error');
+ }
+ }).catch((error) => {
+ console.log("error = " + error.message);
+ this.showMyToast('閿欒', '鎼滅储澶辫触', 'Error');
+ });
}
ClearJs() {
@@ -1457,38 +1229,30 @@
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;
- }
- console.log(
- 'this.invoiceData = ' + JSON.stringify(this.invoiceData)
- );
- this.isShowSpinner = false;
- } else {
- this.showMyToast('鎼滅储澶辫触', r.msg, 'Error');
+ 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;
}
- })
- .catch((error) => {
- console.log('error = ' + JSON.stringify(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));
+ });
}
InvoiceorderSearchJs() {
this.isShowSpinner = true;
- debugger;
- let cloneData = this.outboundData;
- const selectedRows = this.template
- .querySelector("[data-field='outbound']")
- .getSelectedRows();
+ debugger
+ let cloneData = this.outboundData
+ const selectedRows = this.template.querySelector("[data-field='outbound']").getSelectedRows();
console.log('selectedRows ' + JSON.stringify(selectedRows));
for (var i in cloneData) {
let b = false;
@@ -1529,107 +1293,74 @@
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;
+ 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 (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;
+ 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;
}
- console.log(
- 'this.selectedRows = ' +
- JSON.stringify(this.selectedRows)
- );
- this.isShowSpinner = false;
- } else {
- this.showMyToast('鎼滅储澶辫触', r.msg, 'Error');
+ 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;
}
- })
- .catch((error) => {
- console.log('error = ' + error.message);
- this.showMyToast('閿欒', '鎼滅储澶辫触', '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');
+ });
}
getSelectedRows(event) {
@@ -1653,43 +1384,37 @@
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,
+ },
});
}
@@ -1699,44 +1424,35 @@
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",
@@ -1751,18 +1467,13 @@
// statusEdit = 'Redirect';
// PageReference ref = new Pagereference('/ConInvoiceView?invoiceId=' + invoiceId + '&reopen=isreopen' + '&KeyWords=' + statusEdit);
let statusEditAbleJs = 'Redirect';
- let url =
- '/lexconinvoiceview?invoiceId=' +
- this.invoiceId +
- '&reopen=isreopen' +
- '&KeyWords=' +
- statusEditAbleJs;
+ let url = "/lexconinvoiceview?invoiceId=" + this.invoiceId + '&reopen=isreopen' + '&KeyWords=' + statusEditAbleJs;
console.log('url = ' + url);
this[NavigationMixin.Navigate]({
- type: 'standard__webPage',
+ type: "standard__webPage",
attributes: {
- url: url
- }
+ url: url,
+ },
});
}
@@ -1782,36 +1493,26 @@
iconName = 'utility:error';
}
if (message != '') {
- content =
- '<h2><strong>' +
- title +
- '<strong/></h2><h5>' +
- message +
- '</h5>';
+ content = '<h2><strong>' + title + '<strong/></h2><h5>' + message + '</h5>';
} else {
content = '<h2><strong>' + title + '<strong/></h2>';
}
- this.template
- .querySelector('c-common-toast')
- .showToast(variant, content, iconName, 10000);
+ this.template.querySelector('c-common-toast').showToast(variant, content, iconName, 10000);
}
handleLoad() {
- console.log('handleLoad');
+ console.log('handleLoad')
try {
const style = document.createElement('style');
- style.innerText =
- '.hehe-layoutItem .slds-button__icon {display: none;}';
+ style.innerText = '.hehe-layoutItem .slds-button__icon {display: none;}';
this.template.querySelector('.hideHelpText').appendChild(style);
const style2 = document.createElement('style');
- style2.innerText =
- '.hehe-layoutItem .slds-form-element__label {padding : 0px}';
+ style2.innerText = '.hehe-layoutItem .slds-form-element__label {padding : 0px}';
this.template.querySelector('.hideHelpText').appendChild(style2);
const style3 = document.createElement('style');
- style3.innerText =
- '.readOnly .slds-form-element__label {padding-top: 7px;}';
+ style3.innerText = '.readOnly .slds-form-element__label {padding-top: 7px;}';
this.template.querySelector('.hideHelpText').appendChild(style3);
} catch (error) {
console.log(error);
@@ -1830,19 +1531,17 @@
s += '0';
}
return s;
- }
+ };
handleLoad2() {
- console.log('handleLoad2');
+ console.log('handleLoad2')
try {
const style = document.createElement('style');
- style.innerText =
- '.hehe-layoutItem .slds-button__icon {display: none;}';
+ style.innerText = '.hehe-layoutItem .slds-button__icon {display: none;}';
this.template.querySelector('.hideHelpText').appendChild(style);
const style2 = document.createElement('style');
- style2.innerText =
- '.hehe-layoutItem .slds-form-element__label {padding : 0px}';
+ style2.innerText = '.hehe-layoutItem .slds-form-element__label {padding : 0px}';
this.template.querySelector('.hideHelpText').appendChild(style2);
} catch (error) {
console.log(error);
@@ -1850,203 +1549,120 @@
}
handleUnitChange(event) {
- console.log('handleUnitChange');
- this.invoiceAllpriceData[0].invoiceAllprice = 0.0;
+ console.log("handleUnitChange");
+ this.invoiceAllpriceData[0].invoiceAllprice = 0.00;
const unitDetail = event.detail;
- console.log('unitDetail = ' + JSON.stringify(unitDetail));
+ console.log("unitDetail = " + JSON.stringify(unitDetail));
for (var i in this.detailsData) {
if (this.detailsData[i].recordId == unitDetail.data.recordId) {
this.detailsData[i].unitValue = unitDetail.data.unitValue;
- this.detailsData[i].esd.Invoice_Unit__c =
- unitDetail.data.unitValue;
- if (
- this.detailsSelectedRows.indexOf(
- this.detailsData[i].recordId
- ) == -1
- )
+ this.detailsData[i].esd.Invoice_Unit__c = unitDetail.data.unitValue;
+ if (this.detailsSelectedRows.indexOf(this.detailsData[i].recordId) == -1)
this.detailsSelectedRows.push(this.detailsData[i].recordId);
}
}
this.detailsSelectedRows = [...this.detailsSelectedRows];
- console.log(
- 'this.detailsSelectedRows = ' +
- JSON.stringify(this.detailsSelectedRows)
- );
+
+ console.log('this.detailsSelectedRows = ' + JSON.stringify(this.detailsSelectedRows))
for (var i in this.detailsData) {
- this.detailsData[i].invoiceAllprice = 0.0;
+ this.detailsData[i].invoiceAllprice = 0.00;
for (var j in this.detailsSelectedRows) {
- console.log(
- 'this.detailsData[i].Id = ' + this.detailsData[i].Id
- );
- console.log(
- 'this.detailsSelectedRows[j] = ' +
- this.detailsSelectedRows[j]
- );
+ console.log('this.detailsData[i].Id = ' + this.detailsData[i].Id);
+ console.log('this.detailsSelectedRows[j] = ' + this.detailsSelectedRows[j]);
if (this.detailsData[i].Id == this.detailsSelectedRows[j]) {
- this.detailsData[i].invoiceAllprice = this.amend(
- this.detailsData[i].shipmentNumber,
- this.detailsData[i].esdInvoiceUnitprice,
- '*'
- );
- console.log(
- 'this.detailsData[i].invoiceAllprice = ' +
- this.detailsData[i].invoiceAllprice
- );
+ this.detailsData[i].invoiceAllprice = this.amend(this.detailsData[i].shipmentNumber, this.detailsData[i].esdInvoiceUnitprice, '*');
+ console.log('this.detailsData[i].invoiceAllprice = ' + this.detailsData[i].invoiceAllprice);
}
}
- this.invoiceAllpriceData[0].invoiceAllprice = this.amend(
- this.invoiceAllpriceData[0].invoiceAllprice,
- this.detailsData[i].invoiceAllprice,
- '+'
- );
+ this.invoiceAllpriceData[0].invoiceAllprice = this.amend(this.invoiceAllpriceData[0].invoiceAllprice, this.detailsData[i].invoiceAllprice, '+');
}
this.detailsData = [...this.detailsData];
this.invoiceAllpriceData = [...this.invoiceAllpriceData];
}
handleShipmentNumber(event) {
- console.log('handleShipmentNumber');
- this.invoiceAllpriceData[0].invoiceAllprice = 0.0;
+ console.log("handleShipmentNumber");
+ this.invoiceAllpriceData[0].invoiceAllprice = 0.00;
const numberDetail = event.detail;
- console.log('numberDetail = ' + JSON.stringify(numberDetail));
+ console.log('numberDetail = ' + JSON.stringify(numberDetail))
if (numberDetail.data.shipmentnumber == 0) {
- if (
- this.detailsSelectedRows.indexOf(numberDetail.data.recordId) !=
- -1
- ) {
- this.detailsSelectedRows.splice(
- this.detailsSelectedRows.indexOf(
- numberDetail.data.recordId
- ),
- 1
- );
+ if (this.detailsSelectedRows.indexOf(numberDetail.data.recordId) != -1) {
+ this.detailsSelectedRows.splice(this.detailsSelectedRows.indexOf(numberDetail.data.recordId), 1);
}
}
- console.log(
- 'start this.detailsSelectedRows = ' +
- JSON.stringify(this.detailsSelectedRows)
- );
- console.log('numberDetail = ' + JSON.stringify(numberDetail));
+ console.log("start this.detailsSelectedRows = " + JSON.stringify(this.detailsSelectedRows));
+ console.log("numberDetail = " + JSON.stringify(numberDetail));
for (var i in this.detailsData) {
if (this.detailsData[i].recordId == numberDetail.data.recordId) {
- this.detailsData[i].shipmentNumber = Number(
- numberDetail.data.shipmentnumber
- );
- this.detailsData[i].invoiceCount = Number(
- numberDetail.data.shipmentnumber
- );
- if (
- this.detailsSelectedRows.indexOf(
- this.detailsData[i].recordId
- ) == -1 &&
- numberDetail.data.shipmentnumber != 0
- )
+ this.detailsData[i].shipmentNumber = Number(numberDetail.data.shipmentnumber);
+ this.detailsData[i].invoiceCount = Number(numberDetail.data.shipmentnumber);
+ if (this.detailsSelectedRows.indexOf(this.detailsData[i].recordId) == -1 && numberDetail.data.shipmentnumber != 0)
this.detailsSelectedRows.push(this.detailsData[i].recordId);
}
}
- console.log(
- 'end this.detailsSelectedRows = ' +
- JSON.stringify(this.detailsSelectedRows)
- );
+ console.log("end this.detailsSelectedRows = " + JSON.stringify(this.detailsSelectedRows));
this.detailsSelectedRows = [...this.detailsSelectedRows];
- console.log(
- 'this.detailsSelectedRows = ' +
- JSON.stringify(this.detailsSelectedRows)
- );
+
+ console.log('this.detailsSelectedRows = ' + JSON.stringify(this.detailsSelectedRows));
for (var i in this.detailsData) {
- this.detailsData[i].invoiceAllprice = 0.0;
+ this.detailsData[i].invoiceAllprice = 0.00;
for (var j in this.detailsSelectedRows) {
- console.log(
- 'this.detailsData[i].Id = ' + this.detailsData[i].Id
- );
- console.log(
- 'this.detailsSelectedRows[j] = ' +
- this.detailsSelectedRows[j]
- );
+ console.log('this.detailsData[i].Id = ' + this.detailsData[i].Id);
+ console.log('this.detailsSelectedRows[j] = ' + this.detailsSelectedRows[j]);
if (this.detailsData[i].Id == this.detailsSelectedRows[j]) {
- this.detailsData[i].invoiceAllprice = this.amend(
- this.detailsData[i].shipmentNumber,
- this.detailsData[i].esdInvoiceUnitprice,
- '*'
- );
- console.log(
- 'this.detailsData[i].invoiceAllprice = ' +
- this.detailsData[i].invoiceAllprice
- );
+ this.detailsData[i].invoiceAllprice = this.amend(this.detailsData[i].shipmentNumber, this.detailsData[i].esdInvoiceUnitprice, '*');
+ console.log('this.detailsData[i].invoiceAllprice = ' + this.detailsData[i].invoiceAllprice);
}
}
- this.invoiceAllpriceData[0].invoiceAllprice = this.amend(
- this.invoiceAllpriceData[0].invoiceAllprice,
- this.detailsData[i].invoiceAllprice,
- '+'
- );
+ this.invoiceAllpriceData[0].invoiceAllprice = this.amend(this.invoiceAllpriceData[0].invoiceAllprice, this.detailsData[i].invoiceAllprice, '+');
}
this.detailsData = [...this.detailsData];
this.invoiceAllpriceData = [...this.invoiceAllpriceData];
}
detailsGetSelectedRows(event) {
- console.log('detailsGetSelectedRows ');
- this.invoiceAllpriceData[0].invoiceAllprice = 0.0;
+ console.log("detailsGetSelectedRows ");
+ this.invoiceAllpriceData[0].invoiceAllprice = 0.00;
let selectedRows = event.detail.selectedRows;
for (var i in this.detailsData) {
- this.detailsData[i].invoiceAllprice = 0.0;
+ this.detailsData[i].invoiceAllprice = 0.00;
for (var j in selectedRows) {
if (this.detailsData[i].Id == selectedRows[j].esd.Id) {
- this.detailsData[i].invoiceAllprice = this.amend(
- this.detailsData[i].shipmentNumber,
- this.detailsData[i].esdInvoiceUnitprice,
- '*'
- );
- console.log(
- 'this.detailsData[i].invoiceAllprice = ' +
- this.detailsData[i].invoiceAllprice
- );
+ this.detailsData[i].invoiceAllprice = this.amend(this.detailsData[i].shipmentNumber, this.detailsData[i].esdInvoiceUnitprice, '*');
+ console.log('this.detailsData[i].invoiceAllprice = ' + this.detailsData[i].invoiceAllprice);
}
}
- this.invoiceAllpriceData[0].invoiceAllprice = this.amend(
- this.invoiceAllpriceData[0].invoiceAllprice,
- this.detailsData[i].invoiceAllprice,
- '+'
- );
- console.log(
- 'this.invoiceAllpriceData[0].invoiceAllprice = ' +
- this.invoiceAllpriceData[0].invoiceAllprice
- );
+ this.invoiceAllpriceData[0].invoiceAllprice = this.amend(this.invoiceAllpriceData[0].invoiceAllprice, this.detailsData[i].invoiceAllprice, '+');
+ console.log('this.invoiceAllpriceData[0].invoiceAllprice = ' + this.invoiceAllpriceData[0].invoiceAllprice);
}
- console.log(
- 'start this.detailsData = ' + JSON.stringify(this.detailsData)
- );
+ console.log('start this.detailsData = ' + JSON.stringify(this.detailsData));
this.detailsData = [...this.detailsData];
- console.log(
- 'end this.detailsData = ' + JSON.stringify(this.detailsData)
- );
+ console.log('end this.detailsData = ' + JSON.stringify(this.detailsData));
this.invoiceAllpriceData = [...this.invoiceAllpriceData];
}
ComputePrice(index, number, price) {
- console.log('index = ' + index);
- console.log('number = ' + number);
- console.log('price = ' + price);
- let shipmentAmount = this.amend(number, price, '*');
- console.log('shipmentAmount = ' + shipmentAmount);
+ console.log("index = " + index);
+ console.log("number = " + number);
+ console.log("price = " + price);
+ let shipmentAmount = this.amend(number, price, "*");
+ console.log("shipmentAmount = " + shipmentAmount);
let sumPrice = 0.0;
this.data[index].shipmentAmount = shipmentAmount;
for (var i in this.data) {
- if (this.data[i].shipmentAmount)
- sumPrice += this.data[i].shipmentAmount;
+ if (this.data[i].shipmentAmount) sumPrice += this.data[i].shipmentAmount;
}
- this.sumPrice = sumPrice + '鍏�';
+ this.sumPrice = sumPrice + "鍏�";
//瀛樹笅閫夋嫨琛岋紝涓嶄細琚竻绌�
if (this.selectedRows.indexOf(this.data[index].Id) == -1)
this.selectedRows.push(this.data[index].Id);
this.data = [...this.data];
- this.selectedRows = [...this.selectedRows];
- console.log('this.selectedRows = ' + JSON.stringify(this.selectedRows));
- console.log('this.data = ' + JSON.stringify(this.data));
+ this.selectedRows = [...this.selectedRows]
+ console.log("this.selectedRows = " + JSON.stringify(this.selectedRows));
+ console.log("this.data = " + JSON.stringify(this.data));
}
deepClone(obj) {
@@ -2057,9 +1673,7 @@
this.isShowSpinner = true;
let cloneData = this.deepClone(this.detailsData);
- let selectedRows = this.template
- .querySelector('c-lex-custom-lightning-datatable')
- .getSelectedRows();
+ let selectedRows = this.template.querySelector('c-lex-custom-lightning-datatable').getSelectedRows();
console.log('selectedRows = ' + JSON.stringify(selectedRows));
for (var i in cloneData) {
@@ -2086,29 +1700,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 +-*/绗﹀彿
@@ -2120,27 +1734,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:
@@ -2153,23 +1767,23 @@
deleteAtt(event) {
this.isShowSpinner = true;
//var recordId = event.detail.data.recordId;
- var recordId = event.target.getAttribute('data-fileid');
+ var recordId = event.target.getAttribute("data-fileid");
console.log('attid:' + recordId);
deleteAtt({
contentVersionId: recordId
+ }).then(r => {
+ 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 0b6d4b0..33ba4d1 100644
--- a/force-app/main/default/lwc/lexConsumable/lexConsumable.html
+++ b/force-app/main/default/lwc/lexConsumable/lexConsumable.html
@@ -2,10 +2,7 @@
<template if:true={showSpinner}>
<!-- <lightning-spinner size="medium" variant="brand"></lightning-spinner> -->
<div class="slds-spinner_container">
- <div
- role="status"
- class="slds-spinner slds-spinner_medium slds-spinner_brand"
- >
+ <div role="status" class="slds-spinner slds-spinner_medium slds-spinner_brand">
<span class="slds-assistive-text">Loading</span>
<div class="slds-spinner__dot-a"></div>
<div class="slds-spinner__dot-b"></div>
@@ -14,93 +11,36 @@
</template>
<c-common-toast></c-common-toast>
<template if:true={showPage}>
- <div
- style="
- border: 1px solid #d4d4d4;
- border-top: 3px solid #51606e;
- border-radius: 5px;
- "
- >
- <div style="padding: 10px">
+ <div style="border: 1px solid #D4D4D4;border-top: 3px solid #51606E;border-radius:5px;">
+ <div style="padding:10px;">
<!-- 鎸夐挳 -->
<template if:true={showEditBtn}>
<!-- <lightning-button style="margin: 5px;" label="缂栬緫" disabled={disabledEditBtn} onclick={editOrder}></lightning-button> -->
- <button
- class="slds-button slds-button_neutral slds-button_stretch lexBorder"
- disabled={disabledEditBtn}
- onclick={editOrder}
- >
- 缂栬緫
- </button>
+ <button class="slds-button slds-button_neutral slds-button_stretch lexBorder" disabled={disabledEditBtn} onclick={editOrder}>缂栬緫</button>
</template>
<template if:true={showPrintSheetBtn}>
<!-- <lightning-button style="margin: 5px;" label="鎵撳嵃閰嶇疆鍗�" onclick={printOrder}></lightning-button> -->
- <button
- class="slds-button slds-button_neutral slds-button_stretch lexBorder"
- style="margin: 5px"
- label="鎵撳嵃閰嶇疆鍗�"
- onclick={printOrder}
- >
- 鎵撳嵃閰嶇疆鍗�
- </button>
+ <button class="slds-button slds-button_neutral slds-button_stretch lexBorder" style="margin: 5px;" label="鎵撳嵃閰嶇疆鍗�" onclick={printOrder}>鎵撳嵃閰嶇疆鍗�</button>
</template>
<template if:true={showUploadSheetBtn}>
<!-- <lightning-button style="margin: 5px;" label="涓婁紶閰嶇疆鍗�" disabled={disabledUploadSheetBtn} onclick={uploadOrder}></lightning-button> -->
- <button
- class="slds-button slds-button_neutral slds-button_stretch lexBorder"
- style="margin: 5px"
- label="涓婁紶閰嶇疆鍗�"
- disabled={disabledUploadSheetBtn}
- onclick={uploadOrder}
- >
- 涓婁紶閰嶇疆鍗�
- </button>
+ <button class="slds-button slds-button_neutral slds-button_stretch lexBorder" style="margin: 5px;" label="涓婁紶閰嶇疆鍗�" disabled={disabledUploadSheetBtn} onclick={uploadOrder}>涓婁紶閰嶇疆鍗�</button>
</template>
<template if:true={showSubOrderbtn}>
<!-- <lightning-button style="margin: 5px;" label="鎻愪氦璁㈠崟" disabled={disabledSubOrderbtn} onclick={submitOrder}></lightning-button> -->
- <button
- class="slds-button slds-button_neutral slds-button_stretch lexBorder"
- style="margin: 5px"
- label="鎻愪氦璁㈠崟"
- disabled={disabledSubOrderbtn}
- onclick={submitOrder}
- >
- 鎻愪氦璁㈠崟
- </button>
+ <button class="slds-button slds-button_neutral slds-button_stretch lexBorder" style="margin: 5px;" label="鎻愪氦璁㈠崟" disabled={disabledSubOrderbtn} onclick={submitOrder}>鎻愪氦璁㈠崟</button>
</template>
<template if:true={showSaveOrderbtn1}>
<!-- <lightning-button style="margin: 5px;" label="淇濆瓨璁㈠崟" onclick={saveOrder}></lightning-button> -->
- <button
- class="slds-button slds-button_neutral slds-button_stretch lexBorder"
- style="margin: 5px"
- label="淇濆瓨璁㈠崟"
- onclick={saveOrder}
- >
- 淇濆瓨璁㈠崟
- </button>
+ <button class="slds-button slds-button_neutral slds-button_stretch lexBorder" style="margin: 5px;" label="淇濆瓨璁㈠崟" onclick={saveOrder}>淇濆瓨璁㈠崟</button>
</template>
<template if:true={showSaveOrderbtn2}>
<!-- <lightning-button style="margin: 5px;" label="淇濆瓨璁㈠崟" onclick={orderCopy}></lightning-button> -->
- <button
- class="slds-button slds-button_neutral slds-button_stretch lexBorder"
- style="margin: 5px"
- label="淇濆瓨璁㈠崟"
- onclick={orderCopy}
- >
- 淇濆瓨璁㈠崟
- </button>
+ <button class="slds-button slds-button_neutral slds-button_stretch lexBorder" style="margin: 5px;" label="淇濆瓨璁㈠崟" onclick={orderCopy}>淇濆瓨璁㈠崟</button>
</template>
<template if:true={showDeleteBtn}>
<!-- <lightning-button style="margin: 5px;" label="鍒犻櫎" disabled={disabledDeleteBtn} onclick={deleteOrder}></lightning-button> -->
- <button
- class="slds-button slds-button_neutral slds-button_stretch lexBorder"
- style="margin: 5px"
- label="鍒犻櫎"
- disabled={disabledDeleteBtn}
- onclick={deleteOrder}
- >
- 鍒犻櫎
- </button>
+ <button class="slds-button slds-button_neutral slds-button_stretch lexBorder" style="margin: 5px;" label="鍒犻櫎" disabled={disabledDeleteBtn} onclick={deleteOrder}>鍒犻櫎</button>
</template>
<!-- <template if:true={showOfferPriceInputBtn}>
<lightning-button style="margin: 5px;" label="鐗逛环閲戦褰曞叆" disabled={disabledOfferPriceInputBtn} onclick={inputOfferPrice}></lightning-button>
@@ -108,32 +48,13 @@
</template> -->
<template if:true={showReapplyBtn}>
<!-- <lightning-button style="margin: 5px;" label="鍐嶇敵璇�" onclick={reapplyOrder}></lightning-button> -->
- <button
- class="slds-button slds-button_neutral slds-button_stretch lexBorder"
- style="margin: 5px"
- label="鍐嶇敵璇�"
- onclick={reapplyOrder}
- >
- 鍐嶇敵璇�
- </button>
+ <button class="slds-button slds-button_neutral slds-button_stretch lexBorder" style="margin: 5px;" label="鍐嶇敵璇�" onclick={reapplyOrder}>鍐嶇敵璇�</button>
</template>
- <p style="height: 10px"></p>
+ <p style="height: 10px;"></p>
<!-- 璁㈠崟淇℃伅 -->
<template if:false={editAble}>
- <div
- style="
- border: 1px solid #d4d4d4;
- border-top: 3px solid #51606e;
- border-radius: 5px;
- margin-bottom: 7px;
- "
- >
- <div
- style="
- border-bottom: 1px solid #d4d4d4;
- padding: 3px;
- "
- >
+ <div style="border: 1px solid #D4D4D4;border-top: 3px solid #51606E;border-radius:5px;margin-bottom:7px;">
+ <div style="border-bottom: 1px solid #D4D4D4;padding:3px;">
<lightning-layout>
<lightning-layout-item padding="around-small">
<p style="font-size: 18px">
@@ -143,35 +64,21 @@
</lightning-layout>
<!-- <p style="font-size: 16px;"><strong>璁㈠崟淇℃伅</strong></p> -->
</div>
- <div style="padding: 10px">
- <lightning-record-view-form
- record-id={cocId}
- object-api-name="Consumable_order__c"
- >
- <table style="width: 100%">
+ <div style="padding:10px;">
+ <lightning-record-view-form record-id={cocId} object-api-name="Consumable_order__c">
+ <table style="width: 100%;">
<tbody>
<tr>
<td style="width: 10%"></td>
- <td style="width: 40%">
- <lightning-output-field
- class="outputfont"
- field-name="Name"
- ></lightning-output-field>
- </td>
- <td style="width: 40%">
- <lightning-output-field
- field-name="Order_status__c"
- ></lightning-output-field>
- </td>
+ <td style="width: 40%;"><lightning-output-field class="outputfont" field-name="Name"></lightning-output-field></td>
+ <td style="width: 40%;"><lightning-output-field field-name="Order_status__c"></lightning-output-field></td>
<td style="width: 10%"></td>
</tr>
<tr>
<td></td>
<td>
<template if:false={editAble}>
- <lightning-output-field
- field-name="Total_amount__c"
- ></lightning-output-field>
+ <lightning-output-field field-name="Total_amount__c"></lightning-output-field>
</template>
</td>
<td>
@@ -180,14 +87,11 @@
<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>
@@ -199,12 +103,8 @@
</template>
</td> -->
<td>
- <template
- if:true={showAttUploadDate}
- >
- <lightning-output-field
- field-name="Consumable_pdf_insert_day__c"
- ></lightning-output-field>
+ <template if:true={showAttUploadDate}>
+ <lightning-output-field field-name="Consumable_pdf_insert_day__c"></lightning-output-field>
</template>
</td>
<td></td>
@@ -222,12 +122,8 @@
<tr>
<td></td>
<td>
- <template
- if:true={showOrderDate}
- >
- <lightning-output-field
- field-name="Order_date__c"
- ></lightning-output-field>
+ <template if:true={showOrderDate}>
+ <lightning-output-field field-name="Order_date__c"></lightning-output-field>
</template>
</td>
<td></td>
@@ -236,71 +132,26 @@
<tr>
<td></td>
<td colspan="2">
- <lightning-card
- class="attListTitle"
- variant="Narrow"
- title="闄勪欢鍒楄〃"
- icon-name="utility:attach"
- >
- <lightning-layout
- slot="footer"
- multiple-rows="true"
- >
- <template
- for:each={attachmentRecoeds}
- for:item="item"
- for:index="index"
- >
- <lightning-layout-item
- padding="around-none"
- size="2"
- key={item.recordId}
- style="
- text-align: left;
- padding: 5px;
- "
- >
- <lightning-icon
- title={item.fileFullName}
- style="
- margin-left: 20px;
- "
- icon-name="doctype:gform"
- alternative-text={item.fileFullName}
- size="large"
- ></lightning-icon
- ><br />
+ <lightning-card class="attListTitle" variant="Narrow" title="闄勪欢鍒楄〃" icon-name="utility:attach">
+ <lightning-layout slot="footer" multiple-rows="true">
+ <template for:each={attachmentRecoeds} for:item="item" for:index="index">
+ <lightning-layout-item padding="around-none" size="2" key={item.recordId} style="text-align: left;padding:5px">
+ <lightning-icon title={item.fileFullName} style="margin-left: 20px;" icon-name="doctype:gform" alternative-text={item.fileFullName} size="large"></lightning-icon><br/>
<!-- <span style="word-wrap:break-word; word-break:break-all;width:80px;display:flex;" title={item.fileFullName}>
{item.fileName}
</span> -->
- <div
- title={item.fileFullName}
- style="
- width: 100px;
- text-overflow: ellipsis;
- overflow: hidden;
- white-space: nowrap;
- "
- >
+ <div title={item.fileFullName} style="width: 100px;text-overflow: ellipsis;overflow: hidden;white-space: nowrap;">
{item.fileName}
</div>
<p>
<!-- <a data-fileid ={item.documentId} onclick={previweAtt}> -->
- <a
- href={item.attUrl}
- target="_blank"
- >
- 棰勮 </a
- > 路
- <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>
@@ -320,15 +171,8 @@
</template>
<!-- searchBlock -->
<template if:true={editAble}>
- <div
- style="
- border: 1px solid #d4d4d4;
- border-top: 3px solid #51606e;
- border-radius: 5px;
- margin-bottom: 7px;
- "
- >
- <div style="padding: 10px">
+ <div style="border: 1px solid #D4D4D4;border-top: 3px solid #51606E;border-radius:5px;margin-bottom:7px;">
+ <div style="padding:10px;">
<table>
<tbody>
<!-- <tr>
@@ -364,190 +208,62 @@
<!-- <tr style="height: 10px;"></tr> -->
<tr>
<td>
- <div
- style="
- color: #696969;
- font-size: 16px;
- "
- >
- 娑堣�楀搧鍚嶇О
- </div>
+ <div style="color:#696969;font-size:16px;">娑堣�楀搧鍚嶇О</div>
</td>
<td>
- <lightning-input
- class="inputFont"
- variant="label-hidden"
- label="娑堣�楀搧鍚嶇О"
- value={category1}
- onchange={category1Change}
- ></lightning-input>
+ <lightning-input class="inputFont" variant="label-hidden" label="娑堣�楀搧鍚嶇О" value={category1} onchange={category1Change}></lightning-input>
</td>
<td></td>
<td>
- <div
- style="
- color: #696969;
- font-size: 16px;
- "
- >
- 绗�3鍒嗙被
- </div>
+ <div style="color:#696969;font-size:16px;">绗�3鍒嗙被</div>
</td>
<td>
- <lightning-combobox
- class="inputFont"
- variant="label-hidden"
- label="绗�3鍒嗙被"
- value={category3}
- options={category3Option}
- onchange={category3Change}
- ></lightning-combobox>
+ <lightning-combobox class="inputFont" variant="label-hidden" label="绗�3鍒嗙被" value={category3} options={category3Option} onchange={category3Change}></lightning-combobox>
</td>
- <td style="width: 30px"></td>
- <td style="width: 66px">
- <div
- style="
- color: #696969;
- font-size: 16px;
- "
- >
- 绗�4鍒嗙被
- </div>
+ <td style="width:30px;"></td>
+ <td style="width:66px;">
+ <div style="color:#696969;font-size:16px;">绗�4鍒嗙被</div>
</td>
- <td>
- <lightning-combobox
- class="inputFont"
- variant="label-hidden"
- label="绗�4鍒嗙被"
- value={category4}
- options={category4Option}
- onchange={category4Change}
- ></lightning-combobox>
+ <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 style="width: 66px;">
+ <div style="color:#696969;font-size:16px;">绗�5鍒嗙被</div>
</td>
- <td style="width: 160px">
- <lightning-combobox
- class="inputFont"
- variant="label-hidden"
- label="绗�5鍒嗙被"
- value={category5}
- options={category5Option}
- onchange={category5Change}
- ></lightning-combobox>
+ <td style="width: 160px;">
+ <lightning-combobox class="inputFont" variant="label-hidden" label="绗�5鍒嗙被" value={category5} options={category5Option} onchange={category5Change}></lightning-combobox>
</td>
</tr>
- <tr style="height: 10px"></tr>
+ <tr style="height: 10px;"></tr>
<tr>
- <td style="width: 100px">
- <div
- style="
- color: #696969;
- font-size: 16px;
- "
- >
- <span style="color: red"
- >* </span
- >鍚堝悓
+ <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: 320px">
- <div
- class="slds-form-element__control slds-input-has-icon slds-input-has-icon_right"
- >
- <lightning-icon
- size="x-small"
- class="iconMargin slds-icon slds-input__icon slds-input__icon_right slds-icon-text-default"
- icon-name="utility:search"
- ></lightning-icon>
- <lightning-input
- class="inputFont"
- variant="label-hidden"
- label="鍚堝悓"
- placeholder="璇烽�夋嫨鍚堝悓"
- value={contractName}
- onchange={changeCon}
- onclick={showSearchCon}
- ></lightning-input>
- </div>
- </td>
- <td style="width: 30px"></td>
- <td style="width: 66px">
+ <td style="width: 30px;"></td>
+ <td style="width:66px;">
<template if:true={showHospital}>
- <div
- style="
- color: #696969;
- font-size: 16px;
- "
- >
- <span style="color: red"
- >* </span
- >鍖婚櫌
+ <div style="color:#696969;font-size:16px;"><span style="color: red;">* </span>鍖婚櫌</div>
+ </template>
+ </td>
+ <td colspan="4" style="padding-bottom:5px;padding-top:5px;">
+ <template if:true={showHospital}>
+ <div class="slds-form-element__control slds-input-has-icon slds-input-has-icon_right">
+ <lightning-icon size="x-small" class="iconMargin slds-icon slds-input__icon slds-input__icon_right slds-icon-text-default" icon-name="utility:search" ></lightning-icon>
+ <lightning-input class="inputFont" variant="label-hidden" label="鍖婚櫌" placeholder="璇烽�夋嫨鍖婚櫌" value={hospitalName} onclick={showSearchHos} onchange={changeHos}></lightning-input>
</div>
</template>
</td>
- <td
- colspan="4"
- style="
- padding-bottom: 5px;
- padding-top: 5px;
- "
- >
- <template if:true={showHospital}>
- <div
- class="slds-form-element__control slds-input-has-icon slds-input-has-icon_right"
- >
- <lightning-icon
- size="x-small"
- class="iconMargin slds-icon slds-input__icon slds-input__icon_right slds-icon-text-default"
- icon-name="utility:search"
- ></lightning-icon>
- <lightning-input
- class="inputFont"
- variant="label-hidden"
- label="鍖婚櫌"
- placeholder="璇烽�夋嫨鍖婚櫌"
- value={hospitalName}
- onclick={showSearchHos}
- onchange={changeHos}
- ></lightning-input>
- </div>
- </template>
- </td>
- <td style="width: 30px"></td>
+ <td style="width: 30px;"></td>
<td colspan="2">
- <button
- class="slds-button slds-button_neutral slds-button_stretch lexsearchStyle"
- style="
- width: 130px;
- height: 32px;
- margin-right: 10px;
- "
- label="娑堣�楀搧鎼滅储"
- onclick={searchProduct}
- >
- 娑堣�楀搧鎼滅储
- </button>
- <button
- class="slds-button slds-button_neutral slds-button_stretch lexclearStyle"
- style="
- width: 80px;
- height: 32px;
- "
- label="娓呯┖"
- onclick={clear}
- >
- 娓呯┖
- </button>
+ <button class="slds-button slds-button_neutral slds-button_stretch lexsearchStyle" style="width:130px;height:32px;margin-right: 10px;" label="娑堣�楀搧鎼滅储" onclick={searchProduct}>娑堣�楀搧鎼滅储</button>
+ <button class="slds-button slds-button_neutral slds-button_stretch lexclearStyle" style="width:80px;height:32px;" label="娓呯┖" onclick={clear}>娓呯┖</button>
</td>
</tr>
</tbody>
@@ -557,94 +273,31 @@
</template>
<!-- 璀﹀憡鎻愰啋 -->
<template if:true={hasWarning}>
- <div
- style="
- border: 1px solid #d4d4d4;
- border-radius: 5px;
- margin-bottom: 7px;
- "
- >
- <div
- style="
- border-bottom: 1px solid #d4d4d4;
- border-radius: 5px;
- margin-bottom: 7px;
- color: #ff6a00;
- font-size: 17px;
- "
- >
- <lightning-icon
- style="margin: 3px"
- icon-name="utility:warning"
- size="small"
- ></lightning-icon>
+ <div style="border: 1px solid #D4D4D4;border-radius:5px;margin-bottom:7px;">
+ <div style="border-bottom: 1px solid #D4D4D4;border-radius:5px;margin-bottom:7px;color:#ff6a00;font-size:17px;">
+ <lightning-icon style="margin: 3px;" icon-name="utility:warning" size="small"></lightning-icon>
<strong> 璀﹀憡</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">
@@ -654,65 +307,24 @@
</lightning-layout>
<!-- <p style="font-size: 16px;"><strong>娑堣�楀搧鏄庣粏</strong></p> -->
</div>
- <div style="padding: 10px">
+ <div style="padding:10px;">
<template if:true={editAble}>
- <c-lex-custom-lightning-datatable
- class="wrapped-header-datatable"
- style="
- word-wrap: break-word;
- word-break: break-all;
- "
- key-field="recordId"
- data={currentRecord}
- columns={cols}
- selected-rows={selectRows}
- onrowselection={checkRows}
- onchangevalue={conCountChange}
- onvalueblur={conCountBlur}
- default-sort-direction="asc"
- sorted-direction={sortDirection}
- sorted-by={sortedBy}
- onsort={onHandleSort}
- ></c-lex-custom-lightning-datatable>
- <c-paginator
- onprevious={prePageClick}
- onnext={nextPageClick}
- onpageschange={pageSizeChange}
- onfirst={goFirstPage}
- onlast={goLastPage}
- page-size-options={pageSizeOptions}
- previous-button-disabled={previousButtonDisabled}
- next-button-disabled={nextButtonDisabled}
- record-start={recordStart}
- record-end={recordEnd}
- total-records={totalRecords}
- ></c-paginator>
+ <c-lex-custom-lightning-datatable class="wrapped-header-datatable" style="word-wrap:break-word; word-break:break-all;" key-field="recordId" data={currentRecord} columns={cols}
+ selected-rows={selectRows} onrowselection={checkRows} onchangevalue={conCountChange} onvalueblur={conCountBlur}
+ default-sort-direction="asc" sorted-direction={sortDirection} sorted-by={sortedBy} onsort={onHandleSort}></c-lex-custom-lightning-datatable>
+ <c-paginator onprevious={prePageClick} onnext={nextPageClick}
+ onpageschange={pageSizeChange} onfirst={goFirstPage} onlast={goLastPage}
+ page-size-options={pageSizeOptions} previous-button-disabled={previousButtonDisabled}
+ next-button-disabled={nextButtonDisabled} record-start={recordStart}
+ record-end={recordEnd} total-records={totalRecords}></c-paginator>
</template>
<template if:false={editAble}>
- <c-lex-custom-lightning-datatable
- class="wrapped-header-datatable"
- style="
- word-wrap: break-word;
- word-break: break-all;
- "
- hide-checkbox-column
- key-field="recordId"
- data={consumableorderdetailsRecordsview}
- columns={cols}
- ></c-lex-custom-lightning-datatable>
- <c-paginator
- onprevious={prePageClick}
- onnext={nextPageClick}
- onpageschange={pageSizeChange}
- onfirst={goFirstPage}
- onlast={goLastPage}
- page-size-options={pageSizeOptions}
- previous-button-disabled={previousButtonDisabled}
- next-button-disabled={nextButtonDisabled}
- record-start={recordStart}
- record-end={recordEnd}
- total-records={totalRecords}
- ></c-paginator>
+ <c-lex-custom-lightning-datatable class="wrapped-header-datatable" style="word-wrap:break-word; word-break:break-all;" hide-checkbox-column key-field="recordId" data={consumableorderdetailsRecordsview} columns={cols}></c-lex-custom-lightning-datatable>
+ <c-paginator onprevious={prePageClick} onnext={nextPageClick}
+ onpageschange={pageSizeChange} onfirst={goFirstPage} onlast={goLastPage}
+ page-size-options={pageSizeOptions} previous-button-disabled={previousButtonDisabled}
+ next-button-disabled={nextButtonDisabled} record-start={recordStart}
+ record-end={recordEnd} total-records={totalRecords}></c-paginator>
</template>
</div>
</div>
@@ -737,65 +349,27 @@
</template> -->
<!-- 涓婁紶闄勪欢寮圭獥 -->
<template if:true={showAttPop}>
- <section
- role="dialog"
- tabindex="-1"
- aria-labelledby="modal-heading-01"
- aria-modal="true"
- aria-describedby="modal-content-id-1"
- class="slds-modal slds-fade-in-open slds-modal_small"
- style="border: 1px solid #d4d4d4"
- >
+ <section role="dialog" tabindex="-1" aria-labelledby="modal-heading-01" aria-modal="true" aria-describedby="modal-content-id-1" class="slds-modal slds-fade-in-open slds-modal_small" style="border: 1px solid #D4D4D4;">
<template if:true={showPopSpinner}>
- <lightning-spinner
- size="medium"
- variant="brand"
- ></lightning-spinner>
+ <lightning-spinner size="medium" variant="brand"></lightning-spinner>
</template>
<div class="slds-modal__container">
- <header
- class="slds-modal__header"
- style="background-color: #f3f3f3"
- >
- <button
- style=""
- class="slds-button slds-button_icon slds-modal__close slds-button_icon-inverse"
- title="Close"
- onclick={closePop}
- >
- <lightning-icon
- icon-name="utility:close"
+ <header class="slds-modal__header" style="background-color: #F3F3F3;">
+ <button style="" class="slds-button slds-button_icon slds-modal__close slds-button_icon-inverse" title="Close" onclick={closePop}>
+ <lightning-icon icon-name="utility:close"
alternative-text="close"
variant="inverse"
- size="small"
- ></lightning-icon>
+ size="small" ></lightning-icon>
<span class="slds-assistive-text">Close</span>
</button>
- <h2
- id="modal-heading-01"
- class="slds-text-heading_medium slds-hyphenate"
- >
- 涓婁紶閰嶇疆鍗�
- </h2>
+ <h2 id="modal-heading-01" class="slds-text-heading_medium slds-hyphenate">涓婁紶閰嶇疆鍗�</h2>
</header>
- <div
- class="slds-modal__content slds-p-around_medium"
- id="modal-content-id-1"
- style="border: 1px solid #f3f3f3"
- >
+ <div class="slds-modal__content slds-p-around_medium" id="modal-content-id-1" style="border: 1px solid #F3F3F3;">
<div class="slds-m-top_medium slds-m-bottom_x-large">
<div class="slds-p-around_medium lgc-bg">
- <lightning-input
- class="fileUpload"
- type="file"
- label="闄勪欢涓婁紶"
- accept=".xlsx, .xls, .csv, .png, .doc, .docx, .pdf"
- onchange={attChange}
- ></lightning-input>
+ <lightning-input class="fileUpload" type="file" label="闄勪欢涓婁紶" accept=".xlsx, .xls, .csv, .png, .doc, .docx, .pdf" onchange={attChange}></lightning-input>
</div>
- <p style="font-size: 16px">
- 宸查�夋嫨鏂囦欢锛歿fileName}
-
+ <p style="font-size: 16px;">宸查�夋嫨鏂囦欢锛歿fileName}
<template if:true={attDelBtn}>
<a onclick={removeAtt}>绉婚櫎</a>
</template>
@@ -805,24 +379,8 @@
<footer class="slds-modal__footer">
<!-- <lightning-button style="margin-left: 10px;" variant="neutral" label="鍙栨秷" onclick={closePop}></lightning-button>
<lightning-button style="margin-left: 10px;" variant="neutral" label="涓婁紶" onclick={uploadAtt}></lightning-button> -->
- <button
- class="slds-button slds-button_neutral slds-button_stretch lexclearStyle"
- style="margin-left: 10px"
- variant="neutral"
- label="鍙栨秷"
- onclick={closePop}
- >
- 鍙栨秷
- </button>
- <button
- class="slds-button slds-button_neutral slds-button_stretch lexsearchStyle"
- style="margin-left: 10px"
- variant="neutral"
- label="涓婁紶"
- onclick={uploadAtt}
- >
- 涓婁紶
- </button>
+ <button class="slds-button slds-button_neutral slds-button_stretch lexclearStyle" style="margin-left: 10px;" variant="neutral" label="鍙栨秷" onclick={closePop}>鍙栨秷</button>
+ <button class="slds-button slds-button_neutral slds-button_stretch lexsearchStyle" style="margin-left: 10px;" variant="neutral" label="涓婁紶" onclick={uploadAtt}>涓婁紶</button>
</footer>
</div>
</section>
@@ -830,104 +388,35 @@
</template>
<!-- 鎼滅储鍖婚櫌 -->
<template if:true={showAttHosPop}>
- <section
- role="dialog"
- tabindex="-1"
- aria-labelledby="modal-heading-01"
- aria-modal="true"
- aria-describedby="modal-content-id-1"
- class="slds-modal slds-fade-in-open slds-modal_medium"
- style="border: 1px solid #d4d4d4"
- >
+ <section role="dialog" tabindex="-1" aria-labelledby="modal-heading-01" aria-modal="true" aria-describedby="modal-content-id-1" class="slds-modal slds-fade-in-open slds-modal_medium" style="border: 1px solid #D4D4D4;">
<div class="slds-modal__container">
- <header
- class="slds-modal__header"
- style="background-color: #f3f3f3"
- >
- <button
- style=""
- class="slds-button slds-button_icon slds-modal__close slds-button_icon-inverse"
- title="Close"
- onclick={closeHospitalPop}
- >
- <lightning-icon
- icon-name="utility:close"
+ <header class="slds-modal__header" style="background-color: #F3F3F3;">
+ <button style="" class="slds-button slds-button_icon slds-modal__close slds-button_icon-inverse" title="Close" onclick={closeHospitalPop}>
+ <lightning-icon icon-name="utility:close"
alternative-text="close"
variant="inverse"
- size="small"
- ></lightning-icon>
+ size="small" ></lightning-icon>
<span class="slds-assistive-text">Close</span>
</button>
- <h2
- id="modal-heading-02"
- class="slds-text-heading_medium slds-hyphenate"
- >
- 缁忛攢鍟嗗尰闄㈡绱�
- </h2>
+ <h2 id="modal-heading-02" class="slds-text-heading_medium slds-hyphenate">缁忛攢鍟嗗尰闄㈡绱�</h2>
</header>
- <div
- class="slds-modal__content slds-p-around_medium"
- id="modal-content-id-2"
- style="border: 1px solid #f3f3f3"
- >
- <table style="width: 100%">
+ <div class="slds-modal__content slds-p-around_medium" id="modal-content-id-2" style="border: 1px solid #F3F3F3;">
+ <table style="width: 100%;">
<tbody>
<tr>
- <td style="width: 74px">
- <div
- style="
- color: #696969;
- font-size: 16px;
- text-align: left;
- "
- >
- 鍖婚櫌鍚嶇О
- </div>
- </td>
- <td style="width: 60%">
- <lightning-input
- class="inputFont"
- label="鍖婚櫌鍚嶇О"
- variant="label-hidden"
- placeholder="璇疯緭鍏ュ尰闄㈠悕绉�"
- value={searchNameHos}
- onchange={searchNameHosChange}
- ></lightning-input>
- </td>
- <td style="width: 10px"></td>
- <td>
- <button
- class="slds-button slds-button_neutral slds-button_stretch lexsearchStyle"
- style="height: 32px"
- label="鎼滅储"
- onclick={searchHos}
- >
- 鎼滅储
- </button>
- </td>
+ <td style="width: 74px;"><div style="color:#696969;font-size:16px;text-align: left;">鍖婚櫌鍚嶇О</div></td>
+ <td style="width: 60%;"><lightning-input class="inputFont" label="鍖婚櫌鍚嶇О" variant="label-hidden" placeholder="璇疯緭鍏ュ尰闄㈠悕绉�" value={searchNameHos} onchange={searchNameHosChange}></lightning-input></td>
+ <td style="width: 10px;"></td>
+ <td><button class="slds-button slds-button_neutral slds-button_stretch lexsearchStyle" style="height: 32px;" label="鎼滅储" onclick={searchHos}>鎼滅储</button></td>
</tr>
</tbody>
</table>
- <p style="height: 20px"></p>
+ <p style="height: 20px;"></p>
<!-- <p>宸查�夋嫨鍖婚櫌锛歿chooseHospital}</p> -->
- <div
- style="
- border: 1px solid #d4d4d4;
- border-top: 3px solid #51606e;
- border-radius: 5px;
- margin-bottom: 7px;
- "
- >
- <div
- style="
- border-bottom: 1px solid #d4d4d4;
- padding: 3px;
- "
- >
+ <div style="border: 1px solid #D4D4D4;border-top: 3px solid #51606E;border-radius:5px;margin-bottom:7px;">
+ <div style="border-bottom: 1px solid #D4D4D4;padding:3px;">
<lightning-layout>
- <lightning-layout-item
- padding="around-small"
- >
+ <lightning-layout-item padding="around-small">
<p style="font-size: 18px">
<strong>鎼滅储缁撴灉</strong>
</p>
@@ -935,27 +424,14 @@
</lightning-layout>
<!-- <p style="font-size: 16px;"><strong>鎼滅储缁撴灉</strong></p> -->
</div>
- <div class="myTable" style="padding: 10px">
- <lightning-datatable
- class="wrapped-header-datatable"
- key-field="id"
- hide-checkbox-column="true"
- data={hospitalList}
- columns={hosCols}
- onrowaction={chooseHos}
- ></lightning-datatable>
+ <div class="myTable" style="padding:10px;">
+ <lightning-datatable class="wrapped-header-datatable" key-field="id" hide-checkbox-column="true" data={hospitalList} columns={hosCols} onrowaction={chooseHos}></lightning-datatable>
</div>
</div>
</div>
<footer class="slds-modal__footer">
<!-- <lightning-button style="margin-left: 10px;" variant="neutral" label="鍙栨秷" onclick={closeHospitalPop}></lightning-button> -->
- <button
- class="slds-button slds-button_neutral slds-button_stretch lexclearStyle"
- label="鍙栨秷"
- onclick={closeHospitalPop}
- >
- 鍙栨秷
- </button>
+ <button class="slds-button slds-button_neutral slds-button_stretch lexclearStyle" label="鍙栨秷" onclick={closeHospitalPop}>鍙栨秷</button>
<!-- <lightning-button style="margin-left: 10px;" variant="neutral" label="纭" onclick={confirmHospital}></lightning-button> -->
</footer>
</div>
@@ -964,132 +440,50 @@
</template>
<!-- 鎼滅储鍚堝悓 -->
<template if:true={showConPop}>
- <section
- role="dialog"
- tabindex="-1"
- aria-labelledby="modal-heading-01"
- aria-modal="true"
- aria-describedby="modal-content-id-1"
- class="slds-modal slds-fade-in-open slds-modal_medium"
- style="border: 1px solid #d4d4d4"
- >
+ <section role="dialog" tabindex="-1" aria-labelledby="modal-heading-01" aria-modal="true" aria-describedby="modal-content-id-1" class="slds-modal slds-fade-in-open slds-modal_medium" style="border: 1px solid #D4D4D4;">
<div class="slds-modal__container">
- <header
- class="slds-modal__header"
- style="background-color: #f3f3f3"
- >
- <button
- style=""
- class="slds-button slds-button_icon slds-modal__close slds-button_icon-inverse"
- title="Close"
- onclick={closeContractPop}
- >
- <lightning-icon
- icon-name="utility:close"
+ <header class="slds-modal__header" style="background-color: #F3F3F3;">
+ <button style="" class="slds-button slds-button_icon slds-modal__close slds-button_icon-inverse" title="Close" onclick={closeContractPop}>
+ <lightning-icon icon-name="utility:close"
alternative-text="close"
variant="inverse"
- size="small"
- ></lightning-icon>
+ size="small" ></lightning-icon>
<span class="slds-assistive-text">Close</span>
</button>
- <h2
- id="modal-heading-03"
- class="slds-text-heading_medium slds-hyphenate"
- >
- 鍚堝悓妫�绱�
- </h2>
+ <h2 id="modal-heading-03" class="slds-text-heading_medium slds-hyphenate">鍚堝悓妫�绱�</h2>
</header>
- <div
- class="slds-modal__content slds-p-around_medium"
- id="modal-content-id-3"
- style="border: 1px solid #f3f3f3"
- >
- <table style="width: 100%">
+ <div class="slds-modal__content slds-p-around_medium" id="modal-content-id-3" style="border: 1px solid #F3F3F3;">
+ <table style="width: 100%;">
<tbody>
<tr>
- <td style="width: 74px">
- <div
- style="
- color: #696969;
- font-size: 16px;
- text-align: left;
- "
- >
- 鍚堝悓鍚嶇О
- </div>
- </td>
- <td style="width: 60%">
- <lightning-input
- class="inputFont"
- label="鍚堝悓鍚嶇О"
- variant="label-hidden"
- placeholder="璇疯緭鍏ュ悎鍚屽悕绉�"
- value={searchNameCon}
- onchange={searchNameConChange}
- ></lightning-input>
- </td>
- <td style="width: 10px"></td>
- <td>
- <button
- class="slds-button slds-button_neutral slds-button_stretch lexsearchStyle"
- style="height: 32px"
- label="鎼滅储"
- onclick={searchCon}
- >
- 鎼滅储
- </button>
- </td>
+ <td style="width: 74px;"><div style="color:#696969;font-size:16px;text-align: left;">鍚堝悓鍚嶇О</div></td>
+ <td style="width: 60%;"><lightning-input class="inputFont" label="鍚堝悓鍚嶇О" variant="label-hidden" placeholder="璇疯緭鍏ュ悎鍚屽悕绉�" value={searchNameCon} onchange={searchNameConChange}></lightning-input></td>
+ <td style="width: 10px;"></td>
+ <td><button class="slds-button slds-button_neutral slds-button_stretch lexsearchStyle" style="height: 32px;" label="鎼滅储" onclick={searchCon}>鎼滅储</button></td>
<!-- <td><lightning-button label="鎼滅储" onclick={searchCon}></lightning-button></td> -->
</tr>
</tbody>
</table>
- <p style="height: 10px"></p>
+ <p style="height: 10px;"></p>
<!-- <p>宸查�夋嫨鍚堝悓锛歿chooseContract}</p> -->
- <div
- style="
- border: 1px solid #d4d4d4;
- border-top: 3px solid #51606e;
- border-radius: 5px;
- margin-bottom: 7px;
- "
- >
- <div
- style="
- border-bottom: 1px solid #d4d4d4;
- padding: 3px;
- "
- >
+ <div style="border: 1px solid #D4D4D4;border-top: 3px solid #51606E;border-radius:5px;margin-bottom:7px;">
+ <div style="border-bottom: 1px solid #D4D4D4;padding:3px;">
<lightning-layout>
- <lightning-layout-item
- padding="around-small"
- >
+ <lightning-layout-item padding="around-small">
<p style="font-size: 18px">
<strong>鎼滅储缁撴灉</strong>
</p>
</lightning-layout-item>
</lightning-layout>
</div>
- <div style="padding: 20px">
- <lightning-datatable
- class="wrapped-header-datatable"
- key-field="id"
- hide-checkbox-column="true"
- data={contractList}
- columns={conCols}
- onrowaction={chooseCon}
- ></lightning-datatable>
+ <div style="padding:20px;">
+ <lightning-datatable class="wrapped-header-datatable" key-field="id" hide-checkbox-column="true" data={contractList} columns={conCols} onrowaction={chooseCon}></lightning-datatable>
</div>
</div>
</div>
<footer class="slds-modal__footer">
<!-- <lightning-button style="margin-left: 10px;" variant="neutral" label="鍙栨秷" onclick={closeContractPop}></lightning-button> -->
- <button
- class="slds-button slds-button_neutral slds-button_stretch lexclearStyle"
- label="鍙栨秷"
- onclick={closeContractPop}
- >
- 鍙栨秷
- </button>
+ <button class="slds-button slds-button_neutral slds-button_stretch lexclearStyle" label="鍙栨秷" onclick={closeContractPop}>鍙栨秷</button>
<!-- <lightning-button style="margin-left: 10px;" variant="neutral" label="纭" onclick={confirmContract}></lightning-button> -->
</footer>
</div>
diff --git a/force-app/main/default/lwc/lexConsumable/lexConsumable.js b/force-app/main/default/lwc/lexConsumable/lexConsumable.js
index 4cb51c5..9733513 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,1758 +19,1372 @@
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'
- },
- 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: '鐩�'
+ //娑堣�楀搧鏁版嵁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: 126
- });
- cols.push({
- label: '鏈夋晥鏈熷簱瀛�(涓�)',
- fieldName: 'allnumber_piece',
- hideDefaultActions: true,
- initialWidth: 126,
- cellAttributes: { alignment: 'right' }
- });
- return cols;
- }
+ 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;
+ }
- //闄勪欢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);
+ //鍙栧緱鎵�鏈夎鍕鹃�夌殑浜у搧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);
}
- }
- }
-
- //鍕鹃�夋搷浣�
- 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
- );
- }
+ }
+ 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]);
}
- if (count == 0) {
- this.consumableorderdetailsRecordsview[i].check = false;
- } else {
- this.consumableorderdetailsRecordsview[i].check = true;
- this.selectRows.push(
- this.consumableorderdetailsRecordsview[i].recordId
- );
+ }
+ }
+ }
+
+ //閲囪喘鏁伴噺鑾峰彇
+ 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;
}
- }
- 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]);
- }
+ }
+ }
+ 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');
}
- }
- }
-
- //閲囪喘鏁伴噺鑾峰彇
- 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) => {
+ })
+ .catch(error=>{
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');
+ 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;
+ }
+ }
- //淇濆瓨璁㈠崟锛堥┏鍥烇級
- 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');
+ sortBy(field, reverse, primer) {
+ const key = primer
+ ? function (x) {
+ return primer(x[field]);
}
- });
- }
-
- //缂栬緫
- 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');
- }
- });
- }
-
- //鎵撳嵃閰嶇疆鍗�
- 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();
+ : function (x) {
+ return x[field];
};
- 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');
- }
+ 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) => {
- 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=>{
+ console.log("Error:"+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
+ //娓呴櫎鎼滅储鏍�
+ 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');
+ }
}
- });
- }
+ })
+ }
- //鎵撳紑鎼滅储寮圭獥锛屽苟鍒濆鍖栧脊绐�
- 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'
- );
- }
+ //閫夋嫨鎵�鏈�
+ 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{
+ 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');
+ }
+ })
+ }
+
+ //鎵撳嵃閰嶇疆鍗�
+ 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.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');
+ }
+ }
})
- .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');
})
- .catch((error) => {
- console.log('Error:' + error);
- this.showMyToast('鎼滅储澶辫触', error, 'error');
- });
- }
+ this.tempidHp = 'tempId';
+ }
+ }else{
+ this.showMyToast('璇烽�夋嫨鍖婚櫌','','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]);
- }
+ //鎵撳紑鍚堝悓妫�绱㈠脊绐楀苟鍒濆鍖�
+ 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;
+ }
}
- 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';
- }
- } else {
- this.showMyToast('璇烽�夋嫨鍖婚櫌', '', 'error');
- }
- }
+ }else{
+ console.log("Error:"+result.errorMsg);
+ this.showMyToast('鍒濆鍖栨绱㈠悎鍚岄〉闈㈠け璐�',result.errorMsg,'error');
+ }
+ })
+ .catch(error=>{
+ console.log("Error:"+error);
+ this.showMyToast('鍒濆鍖栨绱㈠悎鍚岄〉闈㈠け璐�',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;
- }
- }
- } else {
- console.log('Error:' + result.errorMsg);
- this.showMyToast(
- '鍒濆鍖栨绱㈠悎鍚岄〉闈㈠け璐�',
- result.errorMsg,
- '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');
- });
- }
-
- //妫�绱㈠悎鍚�
- 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');
})
- .catch((error) => {
- console.log('Error:' + error);
- this.showMyToast('鎼滅储澶辫触', error, 'error');
- });
- }
+ this.tempidPp = 'tempId';
+ }
+ }else{
+ this.showMyToast('璇烽�夋嫨鍚堝悓','','error');
+ }
+ }
- searchNameConChange(event) {
- this.searchNameCon = event.detail.value;
- }
+ 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);
+ }
- //鍏抽棴寮圭獥
- 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';
+ //鍒嗛〉
+ 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 {
- 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;
+ }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]);
+ }
}
- 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++;
+ }
}
- 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]
- );
- }
+ 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 = [];
- }
- }
+ }
+ 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();
- }
+ //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;
+ }
- //涓婁竴椤垫寜閽槸鍚isable
- get previousButtonDisabled() {
- return this.currentPage == 1 || this.currentPage == 0;
- }
-
- //涓嬩竴椤垫寜閽槸鍚isable
- get nextButtonDisabled() {
- return this.currentPage == this.totalPage;
- }
+ //涓嬩竴椤垫寜閽槸鍚isable
+ get nextButtonDisabled() {
+ return this.currentPage == this.totalPage;
+ }
}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexConsumableAccountInfoPrint/lexConsumableAccountInfoPrint.html b/force-app/main/default/lwc/lexConsumableAccountInfoPrint/lexConsumableAccountInfoPrint.html
index 360e326..884c635 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,33 +16,24 @@
</lightning-layout>
<div class="outerBorderCss">
- <div style="padding: 5px">
+ <div style="padding:5px;">
<div class="borderCss">
- <div style="padding: 10px; border-bottom: 1px solid #dde4e9">
- <div lwc:dom="manual" class="resultDiv"></div>
- <p style="font-size: 15px"><strong>瀹㈡埛淇℃伅</strong></p>
+ <div style="padding:10px;border-bottom:1px solid #DDE4E9">
+ <div lwc:dom="manual" class="resultDiv">
+ </div>
+ <p style="font-size: 15px;"><strong>瀹㈡埛淇℃伅</strong></p>
<div draggable="false">
<div class="slds-m-top_small slds-m-bottom_medium">
<lightning-layout multiple-rows="true">
<lightning-layout-item size="2">
</lightning-layout-item>
<lightning-layout-item size="5">
- <lightning-input
- type="text"
- label="瀹㈡埛鍚�"
- value={accountDataInfo.name}
- variant="label-inline"
- read-only
- ></lightning-input>
+ <lightning-input type="text" label="瀹㈡埛鍚�" value={accountDataInfo.name}
+ variant="label-inline" read-only></lightning-input>
</lightning-layout-item>
<lightning-layout-item size="5">
- <lightning-input
- type="text"
- label="瀹㈡埛鎵�鏈変汉"
- value={accountDataInfo.ownerName}
- variant="label-inline"
- read-only
- ></lightning-input>
+ <lightning-input type="text" label="瀹㈡埛鎵�鏈変汉" value={accountDataInfo.ownerName}
+ variant="label-inline" read-only></lightning-input>
</lightning-layout-item>
</lightning-layout>
@@ -50,22 +41,12 @@
<lightning-layout-item size="2">
</lightning-layout-item>
<lightning-layout-item size="5">
- <lightning-input
- type="text"
- label="鍒悕1"
- value={accountDataInfo.site}
- variant="label-inline"
- read-only
- ></lightning-input>
+ <lightning-input type="text" label="鍒悕1" value={accountDataInfo.site}
+ variant="label-inline" read-only></lightning-input>
</lightning-layout-item>
<lightning-layout-item size="5">
- <lightning-input
- type="text"
- label="鏈夋晥/鏃犳晥"
- value={accountDataInfo.isActive}
- variant="label-inline"
- read-only
- ></lightning-input>
+ <lightning-input type="text" label="鏈夋晥/鏃犳晥" value={accountDataInfo.isActive}
+ variant="label-inline" read-only></lightning-input>
</lightning-layout-item>
</lightning-layout>
@@ -73,22 +54,12 @@
<lightning-layout-item size="2">
</lightning-layout-item>
<lightning-layout-item size="5">
- <lightning-input
- type="text"
- label="鍒悕2"
- value={accountDataInfo.aliasName2}
- variant="label-inline"
- read-only
- ></lightning-input>
+ <lightning-input type="text" label="鍒悕2" value={accountDataInfo.aliasName2}
+ variant="label-inline" read-only></lightning-input>
</lightning-layout-item>
<lightning-layout-item size="5">
- <lightning-input
- type="text"
- label="绂佺敤鐞嗙敱"
- value={accountDataInfo.banOnUseReason}
- variant="label-inline"
- read-only
- ></lightning-input>
+ <lightning-input type="text" label="绂佺敤鐞嗙敱" value={accountDataInfo.banOnUseReason}
+ variant="label-inline" read-only></lightning-input>
</lightning-layout-item>
</lightning-layout>
@@ -96,22 +67,13 @@
<lightning-layout-item size="2">
</lightning-layout-item>
<lightning-layout-item size="5">
- <lightning-input
- type="text"
- label="鏀垮簻绛夌礆"
- value={accountDataInfo.grade}
- variant="label-inline"
- read-only
- ></lightning-input>
+ <lightning-input type="text" label="鏀垮簻绛夌礆" value={accountDataInfo.grade}
+ variant="label-inline" read-only></lightning-input>
</lightning-layout-item>
<lightning-layout-item size="5">
- <lightning-input
- type="text"
- label="鍖婚櫌鎵�灞炴�ц川"
- value={accountDataInfo.attributeType}
- variant="label-inline"
- read-only
- ></lightning-input>
+ <lightning-input type="text" label="鍖婚櫌鎵�灞炴�ц川"
+ value={accountDataInfo.attributeType} variant="label-inline"
+ read-only></lightning-input>
</lightning-layout-item>
</lightning-layout>
@@ -119,53 +81,36 @@
<lightning-layout-item size="2">
</lightning-layout-item>
<lightning-layout-item size="5">
- <lightning-input
- type="text"
- label="OCSM鍒嗙被(鍖婚櫌)"
- value={accountDataInfo.oCMCategory}
- variant="label-inline"
- read-only
- ></lightning-input>
+ <lightning-input type="text" label="OCSM鍒嗙被(鍖婚櫌)"
+ value={accountDataInfo.oCMCategory} variant="label-inline"
+ read-only></lightning-input>
</lightning-layout-item>
<lightning-layout-item size="5">
- <lightning-input
- type="text"
- label="鍖婚櫌涓撲笟鍖哄垎"
- value={accountDataInfo.specialityType}
- variant="label-inline"
- read-only
- ></lightning-input>
+ <lightning-input type="text" label="鍖婚櫌涓撲笟鍖哄垎"
+ value={accountDataInfo.specialityType} variant="label-inline"
+ read-only></lightning-input>
</lightning-layout-item>
</lightning-layout>
</div>
</div>
</div>
- <div style="padding: 10px; border-bottom: 1px solid #dde4e9">
- <div lwc:dom="manual" class="resultDiv"></div>
- <p style="font-size: 15px"><strong>鍦板潃淇℃伅</strong></p>
+ <div style="padding:10px;border-bottom:1px solid #DDE4E9">
+ <div lwc:dom="manual" class="resultDiv">
+ </div>
+ <p style="font-size: 15px;"><strong>鍦板潃淇℃伅</strong></p>
<div draggable="false">
<div class="slds-m-top_small slds-m-bottom_medium">
<lightning-layout multiple-rows="true">
<lightning-layout-item size="2">
</lightning-layout-item>
<lightning-layout-item size="5">
- <lightning-input
- type="text"
- label="鐪�"
- value={accountDataInfo.stateMasterName}
- variant="label-inline"
- read-only
- ></lightning-input>
+ <lightning-input type="text" label="鐪�" value={accountDataInfo.stateMasterName}
+ variant="label-inline" read-only></lightning-input>
</lightning-layout-item>
<lightning-layout-item size="5">
- <lightning-input
- type="text"
- label="鐢佃瘽"
- value={accountDataInfo.phone}
- variant="label-inline"
- read-only
- ></lightning-input>
+ <lightning-input type="text" label="鐢佃瘽" value={accountDataInfo.phone}
+ variant="label-inline" read-only></lightning-input>
</lightning-layout-item>
</lightning-layout>
@@ -173,22 +118,12 @@
<lightning-layout-item size="2">
</lightning-layout-item>
<lightning-layout-item size="5">
- <lightning-input
- type="text"
- label="甯�"
- value={accountDataInfo.cityMasterName}
- variant="label-inline"
- read-only
- ></lightning-input>
+ <lightning-input type="text" label="甯�" value={accountDataInfo.cityMasterName}
+ variant="label-inline" read-only></lightning-input>
</lightning-layout-item>
<lightning-layout-item size="5">
- <lightning-input
- type="text"
- label="鐢佃瘽2"
- value={accountDataInfo.phoneCall}
- variant="label-inline"
- read-only
- ></lightning-input>
+ <lightning-input type="text" label="鐢佃瘽2" value={accountDataInfo.phoneCall}
+ variant="label-inline" read-only></lightning-input>
</lightning-layout-item>
</lightning-layout>
@@ -196,22 +131,12 @@
<lightning-layout-item size="2">
</lightning-layout-item>
<lightning-layout-item size="5">
- <lightning-input
- type="text"
- label="鍘�/鍖�"
- value={accountDataInfo.town}
- variant="label-inline"
- read-only
- ></lightning-input>
+ <lightning-input type="text" label="鍘�/鍖�" value={accountDataInfo.town}
+ variant="label-inline" read-only></lightning-input>
</lightning-layout-item>
<lightning-layout-item size="5">
- <lightning-input
- type="text"
- label="浼犵湡"
- value={accountDataInfo.fax}
- variant="label-inline"
- read-only
- ></lightning-input>
+ <lightning-input type="text" label="浼犵湡" value={accountDataInfo.fax}
+ variant="label-inline" read-only></lightning-input>
</lightning-layout-item>
</lightning-layout>
@@ -219,22 +144,12 @@
<lightning-layout-item size="2">
</lightning-layout-item>
<lightning-layout-item size="5">
- <lightning-input
- type="text"
- label="琛楅亾"
- value={accountDataInfo.street}
- variant="label-inline"
- read-only
- ></lightning-input>
+ <lightning-input type="text" label="琛楅亾" value={accountDataInfo.street}
+ variant="label-inline" read-only></lightning-input>
</lightning-layout-item>
<lightning-layout-item size="5">
- <lightning-input
- type="text"
- label="閭紪"
- value={accountDataInfo.postalCode}
- variant="label-inline"
- read-only
- ></lightning-input>
+ <lightning-input type="text" label="閭紪" value={accountDataInfo.postalCode}
+ variant="label-inline" read-only></lightning-input>
</lightning-layout-item>
</lightning-layout>
@@ -242,40 +157,32 @@
<lightning-layout-item size="2">
</lightning-layout-item>
<lightning-layout-item size="5">
- <lightning-input
- type="text"
- label="鍦板潃"
- value={accountDataInfo.address}
- variant="label-inline"
- read-only
- ></lightning-input>
+ <lightning-input type="text" label="鍦板潃" value={accountDataInfo.address}
+ variant="label-inline" read-only></lightning-input>
</lightning-layout-item>
</lightning-layout>
</div>
</div>
</div>
- <div style="padding: 10px; border-bottom: 1px solid #dde4e9">
- <div lwc:dom="manual" class="resultDiv"></div>
- <p style="font-size: 15px"><strong>绯荤粺淇℃伅</strong></p>
+ <div style="padding:10px;border-bottom:1px solid #DDE4E9">
+ <div lwc:dom="manual" class="resultDiv">
+ </div>
+ <p style="font-size: 15px;"><strong>绯荤粺淇℃伅</strong></p>
<div draggable="false">
<div class="slds-m-top_small slds-m-bottom_medium">
<lightning-layout multiple-rows="true">
<lightning-layout-item size="2">
</lightning-layout-item>
<lightning-layout-item size="5">
- <lightning-input
- type="text"
- label="姣嶅叕鍙�"
- value={accountDataInfo.parentName}
- variant="label-inline"
- read-only
- ></lightning-input>
+ <lightning-input type="text" label="姣嶅叕鍙�" value={accountDataInfo.parentName}
+ variant="label-inline" read-only></lightning-input>
</lightning-layout-item>
</lightning-layout>
</div>
</div>
</div>
+
</div>
</div>
</div>
diff --git a/force-app/main/default/lwc/lexConsumableAccountInfoPrint/lexConsumableAccountInfoPrint.js b/force-app/main/default/lwc/lexConsumableAccountInfoPrint/lexConsumableAccountInfoPrint.js
index ab29dde..03621bb 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,73 +38,48 @@
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));
+ }).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);
+ })
}
}
@@ -118,11 +93,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 a30c83d..03feeaa 100644
--- a/force-app/main/default/lwc/lexConsumableOrderManage/lexConsumableOrderManage.html
+++ b/force-app/main/default/lwc/lexConsumableOrderManage/lexConsumableOrderManage.html
@@ -2,10 +2,7 @@
<template if:true={showSpinner}>
<!-- <lightning-spinner size="medium" variant="brand"></lightning-spinner> -->
<div class="slds-spinner_container">
- <div
- role="status"
- class="slds-spinner slds-spinner_medium slds-spinner_brand"
- >
+ <div role="status" class="slds-spinner slds-spinner_medium slds-spinner_brand">
<span class="slds-assistive-text">Loading</span>
<div class="slds-spinner__dot-a"></div>
<div class="slds-spinner__dot-b"></div>
@@ -14,53 +11,23 @@
</template>
<c-common-toast></c-common-toast>
<template if:true={showPage}>
- <div
- style="
- border: 1px solid #d4d4d4;
- border-top: 3px solid #51606e;
- border-radius: 5px;
- "
- >
- <div style="padding: 10px">
+ <div style="border: 1px solid #D4D4D4;border-top: 3px solid #51606E;border-radius:5px;">
+ <div style="padding:10px;">
<!-- 鎸夐挳 -->
<!-- <lightning-button style="margin: 5px;" label="鍗忚璁㈣揣" onclick={agreementorder}></lightning-button> -->
- <button
- class="slds-button slds-button_neutral slds-button_stretch lexBorder"
- style="margin-right: 150px"
- onclick={agreementorder}
- >
- 鍗忚璁㈣揣
- </button>
+ <button class="slds-button slds-button_neutral slds-button_stretch lexBorder" style="margin-right: 150px;" onclick={agreementorder}>鍗忚璁㈣揣</button>
<template if:true={showHop}>
<!-- <lightning-button style="margin: 5px;" label="鍖婚櫌鐗逛环" onclick={hospitalorder}></lightning-button> -->
- <button
- class="slds-button slds-button_neutral slds-button_stretch lexBorder"
- style="margin-right: 150px"
- onclick={hospitalorder}
- >
- 鍖婚櫌鐗逛环
- </button>
+ <button class="slds-button slds-button_neutral slds-button_stretch lexBorder" style="margin-right: 150px;" onclick={hospitalorder}>鍖婚櫌鐗逛环</button>
</template>
<template if:true={hasSpecial}>
<!-- <lightning-button style="margin: 5px;" label="淇冮攢璁㈣揣" onclick={promotionorder}></lightning-button> -->
- <button
- class="slds-button slds-button_neutral slds-button_stretch lexBorder"
- onclick={promotionorder}
- >
- 淇冮攢璁㈣揣
- </button>
+ <button class="slds-button slds-button_neutral slds-button_stretch lexBorder" onclick={promotionorder}>淇冮攢璁㈣揣</button>
</template>
- <p style="height: 10px"></p>
+ <p style="height: 10px;"></p>
<!-- 鎼滅储 -->
- <div
- style="
- border: 1px solid #d4d4d4;
- border-top: 3px solid #51606e;
- border-radius: 5px;
- margin-bottom: 7px;
- "
- >
- <div style="border-bottom: 1px solid #d4d4d4; padding: 3px">
+ <div style="border: 1px solid #D4D4D4;border-top: 3px solid #51606E;border-radius:5px;margin-bottom:7px;">
+ <div style="border-bottom: 1px solid #D4D4D4;padding:3px;">
<lightning-layout>
<lightning-layout-item padding="around-small">
<p style="font-size: 18px">
@@ -70,103 +37,42 @@
</lightning-layout>
<!-- <p style="font-size: 16px;"><strong>妫�绱㈡潯浠�</strong></p> -->
</div>
- <div style="padding: 10px">
+ <div style="padding:10px;">
<table>
<tbody>
<tr>
- <td style="width: 10px"></td>
- <td style="width: 122px">
- <div
- style="
- color: #696969;
- font-size: 16px;
- "
- >
- 娑堣�楀搧璁㈠崟鍚嶇О
- </div>
+ <td style="width:10px;"></td>
+ <td style="width:122px;">
+ <div style="color:#696969;font-size:16px;">娑堣�楀搧璁㈠崟鍚嶇О</div>
</td>
- <td>
- <lightning-input
- class="inputFont"
- type="text"
- label="娑堣�楀搧璁㈠崟鍚嶇О"
- value={category1}
- variant="label-hidden"
- onchange={category1Change}
- ></lightning-input>
+ <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>
@@ -174,15 +80,8 @@
</div>
</div>
<!-- 璁㈣揣鏄庣粏 -->
- <div
- style="
- border: 1px solid #d4d4d4;
- border-top: 3px solid #51606e;
- border-radius: 5px;
- margin-bottom: 7px;
- "
- >
- <div style="border-bottom: 1px solid #d4d4d4; padding: 3px">
+ <div style="border: 1px solid #D4D4D4;border-top: 3px solid #51606E;border-radius:5px;margin-bottom:7px;">
+ <div style="border-bottom: 1px solid #D4D4D4;padding:3px;">
<lightning-layout>
<lightning-layout-item padding="around-small">
<p style="font-size: 18px">
@@ -192,15 +91,9 @@
</lightning-layout>
<!-- <p style="font-size: 16px;"><strong>璁㈣揣鏄庣粏</strong></p> -->
</div>
- <div style="padding: 10px">
+ <div style="padding:10px;">
<div class="table-container">
- <lightning-datatable
- class="wrapped-header-datatable"
- key-field="id"
- hide-checkbox-column="true"
- data={raesList}
- columns={cols}
- ></lightning-datatable>
+ <lightning-datatable class="wrapped-header-datatable" key-field="id" hide-checkbox-column="true" data={raesList} columns={cols}></lightning-datatable>
</div>
</div>
</div>
diff --git a/force-app/main/default/lwc/lexConsumableOrderManage/lexConsumableOrderManage.js b/force-app/main/default/lwc/lexConsumableOrderManage/lexConsumableOrderManage.js
index 0281ae7..2cf3248 100644
--- a/force-app/main/default/lwc/lexConsumableOrderManage/lexConsumableOrderManage.js
+++ b/force-app/main/default/lwc/lexConsumableOrderManage/lexConsumableOrderManage.js
@@ -1,15 +1,14 @@
-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 = '';
@@ -29,12 +28,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;
@@ -44,68 +43,64 @@
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: {
@@ -115,7 +110,7 @@
this[NavigationMixin.Navigate](config);
}
- hospitalorder(event) {
+ hospitalorder(event){
const config = {
type: 'standard__webPage',
attributes: {
@@ -125,7 +120,7 @@
this[NavigationMixin.Navigate](config);
}
- promotionorder(event) {
+ promotionorder(event){
const config = {
type: 'standard__webPage',
attributes: {
@@ -135,106 +130,80 @@
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;
+ 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;
}
- 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);
}
- 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;
+ 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;
}
- 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);
}
- 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';
@@ -248,5 +217,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 01d3be0..bf67af1 100644
--- a/force-app/main/default/lwc/lexCssUtility/lexCssUtility.css
+++ b/force-app/main/default/lwc/lexCssUtility/lexCssUtility.css
@@ -1,80 +1,84 @@
/* .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 {
@@ -83,34 +87,36 @@
}
/* 搴撳瓨鐩樼偣鍙樺寲鏄庣粏 */
-.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 d930dd5..a910547 100644
--- a/force-app/main/default/lwc/lexCustomAttachmentTypeComp/lexCustomAttachmentTypeComp.html
+++ b/force-app/main/default/lwc/lexCustomAttachmentTypeComp/lexCustomAttachmentTypeComp.html
@@ -12,4 +12,5 @@
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 2bd4799..0a6be95 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,31 +6,20 @@
@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 7ce19b5..bed3e16 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 7a017c3..97cd01a 100644
--- a/force-app/main/default/lwc/lexCustomDiffReasonComp/lexCustomDiffReasonComp.js
+++ b/force-app/main/default/lwc/lexCustomDiffReasonComp/lexCustomDiffReasonComp.js
@@ -1,31 +1,28 @@
-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 b46df6e..98db636 100644
--- a/force-app/main/default/lwc/lexCustomInventoryColor/lexCustomInventoryColor.html
+++ b/force-app/main/default/lwc/lexCustomInventoryColor/lexCustomInventoryColor.html
@@ -1,19 +1,16 @@
<template>
<template if:true={showNormal}>
- <div
- style="margin-left: 10px;margin-right: 10px;margin-top: 10px;margin-bottom: 10px;font-size:16px;text-align: right;padding-right:10px;">
+ <div style="margin-left: 10px;margin-right: 10px;margin-top: 10px;margin-bottom: 10px;font-size:16px;text-align: right;padding-right:10px;">
<lightning-formatted-number value={value}></lightning-formatted-number>
</div>
</template>
<template if:true={showRed}>
- <div
- style="margin-left: 10px;margin-right: 10px;margin-top: 10px;margin-bottom: 10px;font-size:16px;background-color:red;text-align: right;padding-right:10px;">
+ <div style="margin-left: 10px;margin-right: 10px;margin-top: 10px;margin-bottom: 10px;font-size:16px;background-color:red;text-align: right;padding-right:10px;">
<lightning-formatted-number value={value}></lightning-formatted-number>
</div>
</template>
<template if:true={showYellow}>
- <div
- style="margin-left: 10px;margin-right: 10px;margin-top: 10px;margin-bottom: 10px;font-size:16px;background-color:yellow;text-align: right;padding-right:10px;">
+ <div style="margin-left: 10px;margin-right: 10px;margin-top: 10px;margin-bottom: 10px;font-size:16px;background-color:yellow;text-align: right;padding-right:10px;">
<lightning-formatted-number value={value}></lightning-formatted-number>
</div>
</template>
diff --git a/force-app/main/default/lwc/lexCustomLightningDatatable/customAgencyOppInput.html b/force-app/main/default/lwc/lexCustomLightningDatatable/customAgencyOppInput.html
index c459a30..45c7582 100644
--- a/force-app/main/default/lwc/lexCustomLightningDatatable/customAgencyOppInput.html
+++ b/force-app/main/default/lwc/lexCustomLightningDatatable/customAgencyOppInput.html
@@ -1,8 +1,3 @@
<template>
- <c-lex-agency-opp-cus-cell
- input-value={typeAttributes.inputValue}
- record-id={typeAttributes.recordId}
- field-name={typeAttributes.fieldName}
- show-type={typeAttributes.showType}
- ></c-lex-agency-opp-cus-cell>
+ <c-lex-agency-opp-cus-cell input-value={typeAttributes.inputValue} record-id={typeAttributes.recordId} field-name={typeAttributes.fieldName} show-type={typeAttributes.showType}></c-lex-agency-opp-cus-cell>
</template>
\ 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 62072c1..0ad4f99 100644
--- a/force-app/main/default/lwc/lexCustomLightningDatatable/customInventoryColor.html
+++ b/force-app/main/default/lwc/lexCustomLightningDatatable/customInventoryColor.html
@@ -1,8 +1,3 @@
<template>
- <c-lex-custom-inventory-color
- value={typeAttributes.value}
- upperlimit={typeAttributes.upperlimit}
- lowerlimit={typeAttributes.lowerlimit}
- box-price={typeAttributes.boxPrice}
- ></c-lex-custom-inventory-color>
+ <c-lex-custom-inventory-color value={typeAttributes.value} upperlimit={typeAttributes.upperlimit} lowerlimit={typeAttributes.lowerlimit} box-price = {typeAttributes.boxPrice}></c-lex-custom-inventory-color>
</template>
\ 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 9708b97..b513653 100644
--- a/force-app/main/default/lwc/lexCustomLightningDatatable/customOutboundCount.html
+++ b/force-app/main/default/lwc/lexCustomLightningDatatable/customOutboundCount.html
@@ -1,8 +1,7 @@
<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 d01de0b..3dedf49 100644
--- a/force-app/main/default/lwc/lexCustomLightningDatatable/customOutputGoods.html
+++ b/force-app/main/default/lwc/lexCustomLightningDatatable/customOutputGoods.html
@@ -1,7 +1,3 @@
<template>
- <c-custom-output-good
- output-value={typeAttributes.outputValue}
- output-type={typeAttributes.type}
- record-id={typeAttributes.recordId}
- ></c-custom-output-good>
+ <c-custom-output-good output-value={typeAttributes.outputValue} output-type={typeAttributes.type} record-id={typeAttributes.recordId}></c-custom-output-good>
</template>
\ 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 e5c8790..00045c0 100644
--- a/force-app/main/default/lwc/lexCustomLightningDatatable/customReturnGoodInput.html
+++ b/force-app/main/default/lwc/lexCustomLightningDatatable/customReturnGoodInput.html
@@ -1,7 +1,3 @@
<template>
- <c-lex-return-good-cus-input
- input-value={typeAttributes.inputValue}
- box-price={typeAttributes.boxPrice}
- record-id={typeAttributes.recordId}
- ></c-lex-return-good-cus-input>
+ <c-lex-return-good-cus-input input-value={typeAttributes.inputValue} box-price={typeAttributes.boxPrice} record-id={typeAttributes.recordId}></c-lex-return-good-cus-input>
</template>
\ 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 f967e12..6b8fb9f 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 9ba3e9b..af207b0 100644
--- a/force-app/main/default/lwc/lexCustomLightningDatatable/customShipmentNumber.html
+++ b/force-app/main/default/lwc/lexCustomLightningDatatable/customShipmentNumber.html
@@ -1,10 +1,11 @@
<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 4cea6e3..56d603a 100644
--- a/force-app/main/default/lwc/lexCustomLightningDatatable/customShippingUnitPrice.html
+++ b/force-app/main/default/lwc/lexCustomLightningDatatable/customShippingUnitPrice.html
@@ -1,7 +1,8 @@
<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 ede64bb..854b613 100644
--- a/force-app/main/default/lwc/lexCustomLightningDatatable/customTableCellIcon.html
+++ b/force-app/main/default/lwc/lexCustomLightningDatatable/customTableCellIcon.html
@@ -1,6 +1,3 @@
<template>
- <c-lex-table-cell-icon
- icon-name={typeAttributes.iconName}
- record-id={typeAttributes.recordId}
- ></c-lex-table-cell-icon>
+ <c-lex-table-cell-icon icon-name={typeAttributes.iconName} record-id={typeAttributes.recordId}></c-lex-table-cell-icon>
</template>
\ 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 3fa0cc1..7c38c74 100644
--- a/force-app/main/default/lwc/lexCustomLightningDatatable/customTableInput.html
+++ b/force-app/main/default/lwc/lexCustomLightningDatatable/customTableInput.html
@@ -1,10 +1,3 @@
<template>
- <c-lex-custom-table-input
- input-value={typeAttributes.inputValue}
- record-id={typeAttributes.recordId}
- value-type={typeAttributes.valueType}
- upper-limit={typeAttributes.upperLimit}
- lower-limit={typeAttributes.lowerLimit}
- allnumber={typeAttributes.allnumber}
- ></c-lex-custom-table-input>
+ <c-lex-custom-table-input input-value={typeAttributes.inputValue} record-id={typeAttributes.recordId} value-type={typeAttributes.valueType} upper-limit={typeAttributes.upperLimit} lower-limit={typeAttributes.lowerLimit} allnumber={typeAttributes.allnumber}></c-lex-custom-table-input>
</template>
\ 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 bf62016..667aeb4 100644
--- a/force-app/main/default/lwc/lexCustomLightningDatatable/customdeleteReason.html
+++ b/force-app/main/default/lwc/lexCustomLightningDatatable/customdeleteReason.html
@@ -1,6 +1,8 @@
<!-- sldsValidatorIgnore -->
<!-- sldsValidatorIgnore -->
<template>
- <c-custom-delete-reason-comp record-id={typeAttributes.recordId}>
+ <c-custom-delete-reason-comp
+ record-id={typeAttributes.recordId}
+ >
</c-custom-delete-reason-comp>
</template>
\ 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 06d33ea..f520c11 100644
--- a/force-app/main/default/lwc/lexCustomLightningDatatable/lexCustomDiffReason.html
+++ b/force-app/main/default/lwc/lexCustomLightningDatatable/lexCustomDiffReason.html
@@ -1,7 +1,5 @@
<template>
<c-lex-custom-diff-reason-comp
- prod-id={typeAttributes.ProdId}
- box-piece={typeAttributes.boxPiece}
- >
+ prod-id={typeAttributes.ProdId} box-piece ={typeAttributes.boxPiece}>
</c-lex-custom-diff-reason-comp>
</template>
\ 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 0440d2c..27e0f69 100644
--- a/force-app/main/default/lwc/lexCustomLightningDatatable/lexCustomLightningDatatable.html
+++ b/force-app/main/default/lwc/lexCustomLightningDatatable/lexCustomLightningDatatable.html
@@ -1 +1,3 @@
-<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 930abca..1f46c88 100644
--- a/force-app/main/default/lwc/lexCustomLightningDatatable/lexCustomLightningDatatable.js
+++ b/force-app/main/default/lwc/lexCustomLightningDatatable/lexCustomLightningDatatable.js
@@ -16,104 +16,84 @@
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 fe4ab90..be0a1af 100644
--- a/force-app/main/default/lwc/lexCustomTableInput/lexCustomTableInput.html
+++ b/force-app/main/default/lwc/lexCustomTableInput/lexCustomTableInput.html
@@ -1,22 +1,8 @@
<template>
<template if:true={showInputType}>
- <lightning-input
- type="number"
- name="cusInput"
- label="cusInput"
- variant="label-hidden"
- value={inputValue}
- onchange={valueChange}
- onblur={blurInput}
- ></lightning-input>
+ <lightning-input type="number" name="cusInput" label="cusInput" variant="label-hidden" value={inputValue} onchange={valueChange} onblur={blurInput}></lightning-input>
</template>
<template if:false={showInputType}>
- <lightning-input
- name="cusInput"
- label="cusInput"
- variant="label-hidden"
- value={inputValue}
- onchange={valueChange}
- ></lightning-input>
+ <lightning-input name="cusInput" label="cusInput" variant="label-hidden" value={inputValue} onchange={valueChange}></lightning-input>
</template>
</template>
\ 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 f0b14a7..739a642 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,55 +8,37 @@
@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 070615c..5a4d467 100644
--- a/force-app/main/default/lwc/lexDealerInquiryModifyState/lexDealerInquiryModifyState.html
+++ b/force-app/main/default/lwc/lexDealerInquiryModifyState/lexDealerInquiryModifyState.html
@@ -3,14 +3,8 @@
<lightning-spinner size="medium" variant="brand"></lightning-spinner>
</template>
<c-common-toast></c-common-toast>
- <div
- style="
- border: 1px solid #d4d4d4;
- border-top: 3px solid #51606e;
- border-radius: 5px;
- "
- >
- <div style="border-bottom: 1px solid #d4d4d4; padding: 3px">
+ <div style="border: 1px solid #D4D4D4;border-top: 3px solid #51606E;border-radius:5px;">
+ <div style="border-bottom: 1px solid #D4D4D4;padding:3px;">
<lightning-layout>
<lightning-layout-item padding="around-small">
<p style="font-size: 18px">
@@ -19,17 +13,10 @@
</lightning-layout-item>
</lightning-layout>
</div>
- <div style="padding: 10px">
+ <div style="padding:10px;">
<!-- 鎼滅储 -->
- <div
- style="
- border: 1px solid #d4d4d4;
- border-top: 3px solid #51606e;
- border-radius: 5px;
- margin-bottom: 10px;
- "
- >
- <div style="border-bottom: 1px solid #d4d4d4; padding: 3px">
+ <div style="border: 1px solid #D4D4D4;border-top: 3px solid #51606E;border-radius:5px;margin-bottom:10px;">
+ <div style="border-bottom: 1px solid #D4D4D4;padding:3px;">
<lightning-layout>
<lightning-layout-item padding="around-small">
<p style="font-size: 18px">
@@ -38,63 +25,37 @@
</lightning-layout-item>
</lightning-layout>
</div>
- <div style="padding: 10px">
+ <div style="padding:10px;">
<!-- 绗竴琛� -->
- <table style="margin-bottom: 20px">
+ <table style="margin-bottom: 20px;">
<tbody>
<tr>
- <td style="width: 100px">
- <div style="font-size: 16px">
- 缁忛攢鍟嗗尰闄�
- </div>
+ <td style="width: 100px;">
+ <div style="font-size:16px;">缁忛攢鍟嗗尰闄�</div>
</td>
- <td style="width: 230px">
- <lightning-input
- class="inputFont"
- variant="label-hidden"
- value={accSearch}
- onchange={accSearchChange}
- ></lightning-input>
+ <td style="width: 230px;">
+ <lightning-input class="inputFont" variant="label-hidden" value={accSearch} onchange={accSearchChange}></lightning-input>
</td>
- <td style="width: 30px"></td>
- <td style="width: 74px">
- <div style="font-size: 16px">閿�鍞媴褰�</div>
+ <td style="width: 30px;"></td>
+ <td style="width: 74px;">
+ <div style="font-size:16px;">閿�鍞媴褰�</div>
</td>
- <td style="width: 230px">
- <lightning-input
- class="inputFont"
- variant="label-hidden"
- value={aooSearch}
- onchange={aooSearchChange}
- ></lightning-input>
+ <td style="width: 230px;">
+ <lightning-input class="inputFont" variant="label-hidden" value={aooSearch} onchange={aooSearchChange}></lightning-input>
</td>
- <td style="width: 30px"></td>
- <td style="width: 32px">
- <span style="font-size: 16px">鏄剧ず</span>
+ <td style="width: 30px;"></td>
+ <td style="width: 32px;">
+ <span style="font-size:16px;">鏄剧ず</span>
</td>
- <td style="width: 50px">
- <lightning-combobox
- class="inputFont"
- variant="label-hidden"
- value={limits}
- options={limitOpts}
- onchange={limitsChange}
- ></lightning-combobox>
+ <td style="width: 50px;">
+ <lightning-combobox class="inputFont" variant="label-hidden" value={limits} options={limitOpts} onchange={limitsChange}></lightning-combobox>
</td>
- <td style="width: 48px">
- <span style="font-size: 16px">鏉℃暟鎹�</span>
+ <td style="width: 48px;">
+ <span style="font-size:16px;">鏉℃暟鎹�</span>
</td>
- <td style="width: 30px"></td>
- <td style="width: 64px">
- <a
- href="#"
- onclick={expandAll}
- style="
- text-decoration: underline;
- font-size: 16px;
- "
- >鍏ㄩ儴灞曞紑</a
- >
+ <td style="width: 30px;"></td>
+ <td style="width: 64px;">
+ <a href="#" onclick={expandAll} style="text-decoration: underline;font-size:16px;">鍏ㄩ儴灞曞紑</a>
</td>
<td></td>
</tr>
@@ -104,53 +65,22 @@
<table>
<tbody>
<tr>
- <td style="width: 100px">
- <div style="font-size: 16px">鏁版嵁瀛楁</div>
+ <td style="width: 100px;">
+ <div style="font-size:16px;">鏁版嵁瀛楁</div>
</td>
<td>
- <lightning-combobox
- class="inputFont"
- variant="label-hidden"
- value={numtext1}
- options={textOpts}
- onchange={numtext1Change}
- ></lightning-combobox>
+ <lightning-combobox class="inputFont" variant="label-hidden" value={numtext1} options={textOpts} onchange={numtext1Change}></lightning-combobox>
</td>
<td>
- <lightning-combobox
- style="margin-left: 10px"
- class="inputFont"
- variant="label-hidden"
- value={numtext2}
- options={equalOpts}
- onchange={numtext2Change}
- ></lightning-combobox>
+ <lightning-combobox style="margin-left:10px;" class="inputFont" variant="label-hidden" value={numtext2} options={equalOpts} onchange={numtext2Change}></lightning-combobox>
</td>
<td>
- <lightning-input
- style="margin-left: 10px"
- class="inputFont"
- variant="label-hidden"
- value={numtext}
- onchange={numtextChange}
- ></lightning-input>
+ <lightning-input style="margin-left:10px;" class="inputFont" variant="label-hidden" value={numtext} onchange={numtextChange}></lightning-input>
</td>
- <td style="width: 30px"></td>
+ <td style="width: 30px;"></td>
<td>
- <button
- class="slds-button slds-button_neutral slds-button_stretch lexsearchStyle"
- style="height: 32px"
- onclick={search}
- >
- 妫�绱�
- </button>
- <button
- class="slds-button slds-button_neutral slds-button_stretch lexsearchStyle"
- style="height: 32px"
- onclick={save}
- >
- 淇濆瓨
- </button>
+ <button class="slds-button slds-button_neutral slds-button_stretch lexsearchStyle" style="height: 32px;" onclick={search}>妫�绱�</button>
+ <button class="slds-button slds-button_neutral slds-button_stretch lexsearchStyle" style="height: 32px;" onclick={save}>淇濆瓨</button>
</td>
</tr>
</tbody>
@@ -158,14 +88,8 @@
</div>
</div>
<!-- 鏁版嵁灞曠ず -->
- <div
- style="
- border: 1px solid #d4d4d4;
- border-top: 3px solid #51606e;
- border-radius: 5px;
- "
- >
- <div style="border-bottom: 1px solid #d4d4d4; padding: 3px">
+ <div style="border: 1px solid #D4D4D4;border-top: 3px solid #51606E;border-radius:5px;">
+ <div style="border-bottom: 1px solid #D4D4D4;padding:3px;">
<lightning-layout>
<lightning-layout-item padding="around-small">
<p style="font-size: 18px">
@@ -174,32 +98,14 @@
</lightning-layout-item>
</lightning-layout>
</div>
- <div style="padding: 10px">
- <c-lex-custom-lightning-datatable
- key-field="recordId"
- columns={colms}
- data={datas}
- oninputchange={agencyOppInputChange}
- class="wrapped-header-datatable"
- default-sort-direction={defaultSortDirection}
- sorted-direction={sortDirection}
- sorted-by={sortedBy}
- onsort={onHandleSort}
- hide-checkbox-column={hidecheckboxcolumn}
- ></c-lex-custom-lightning-datatable>
- <c-paginator
- onprevious={handlePrevious}
- onnext={handleNext}
- onpageschange={handlePageschange}
- onfirst={handleFirst}
- onlast={handleLast}
- page-size-options={pageSizeOptions}
- previous-button-disabled={previousButtonDisabled}
- next-button-disabled={nextButtonDisabled}
- record-start={recordStart}
- record-end={recordEnd}
- total-records={totalRecords}
- ></c-paginator>
+ <div style="padding:10px;">
+ <c-lex-custom-lightning-datatable key-field="recordId" columns={colms} data={datas} oninputchange={agencyOppInputChange} class="wrapped-header-datatable"
+ default-sort-direction={defaultSortDirection} sorted-direction={sortDirection}
+ sorted-by={sortedBy} onsort={onHandleSort} hide-checkbox-column={hidecheckboxcolumn}></c-lex-custom-lightning-datatable>
+ <c-paginator onprevious={handlePrevious} onnext={handleNext} onpageschange={handlePageschange}
+ onfirst={handleFirst} onlast={handleLast} page-size-options={pageSizeOptions}
+ previous-button-disabled={previousButtonDisabled} next-button-disabled={nextButtonDisabled}
+ record-start={recordStart} record-end={recordEnd} total-records={totalRecords}></c-paginator>
<!-- <lightning-layout multiple-rows="true">
<lightning-layout-item size="6">
<table id="tableLeft" >
diff --git a/force-app/main/default/lwc/lexDealerInquiryModifyState/lexDealerInquiryModifyState.js b/force-app/main/default/lwc/lexDealerInquiryModifyState/lexDealerInquiryModifyState.js
index 6525803..5c1c630 100644
--- a/force-app/main/default/lwc/lexDealerInquiryModifyState/lexDealerInquiryModifyState.js
+++ b/force-app/main/default/lwc/lexDealerInquiryModifyState/lexDealerInquiryModifyState.js
@@ -5,11 +5,13 @@
// 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;
@@ -26,7 +28,7 @@
@track strRtColumus = '';
//鍒嗛〉start
- @track sortBy = '';
+ @track sortBy = "";
//@track sortDirection = "asc";
@track pageSize = 10;
error;
@@ -42,14 +44,17 @@
@track recordStart = 0;
@track recordEnd = 0;
//end
- defaultSortDirection = 'asc';
- sortDirection = 'asc';
- 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},
@@ -115,366 +120,234 @@
@track colms = [
{
- label: 'OCSM璇环缂栫爜',
- fieldName: 'OCSM_Opportunity_No__c',
- hideDefaultActions: true,
- wrapText: true,
- initialWidth: 140,
- sortable: true,
+ label: "OCSM璇环缂栫爜", fieldName: "OCSM_Opportunity_No__c", hideDefaultActions: true, wrapText: true, initialWidth: 140,sortable: true,
typeAttributes: {
- recordId: { fieldName: 'recordId' },
- inputValue: { fieldName: 'OCSM_Opportunity_No__c' },
+ recordId: { fieldName: "recordId" },
+ inputValue: { fieldName: "OCSM_Opportunity_No__c" },
showType: 'outputField'
- }
+ },
},
{
- label: 'OCSM璇环',
- fieldName: 'Change_To_Opportunity_T__c',
- hideDefaultActions: true,
- wrapText: true,
- initialWidth: 100,
- sortable: true,
+ label: "OCSM璇环", fieldName: "Change_To_Opportunity_T__c", hideDefaultActions: true, wrapText: true, initialWidth: 100,sortable: true,
typeAttributes: {
- recordId: { fieldName: 'recordId' },
- inputValue: { fieldName: 'Change_To_Opportunity_T__c' },
+ recordId: { fieldName: "recordId" },
+ inputValue: { fieldName: "Change_To_Opportunity_T__c" },
showType: 'outputField'
- }
+ },
},
{
- label: '绉戝鍒嗙被',
- fieldName: 'Strategic_department_Class_Name__c',
- hideDefaultActions: true,
- wrapText: true,
- initialWidth: 105,
- sortable: true,
+ label: "绉戝鍒嗙被", fieldName: "Strategic_department_Class_Name__c", hideDefaultActions: true, wrapText: true, initialWidth: 105,sortable: true,
typeAttributes: {
- recordId: { fieldName: 'recordId' },
- inputValue: { fieldName: 'Strategic_department_Class_Name__c' },
+ recordId: { fieldName: "recordId" },
+ inputValue: { fieldName: "Strategic_department_Class_Name__c" },
showType: 'outputField'
- }
+ },
},
{
- label: '鐘舵��1',
- fieldName: 'Oly_Inquiry_Status1__c',
- hideDefaultActions: true,
- wrapText: true,
- initialWidth: 100,
- sortable: true,
+ label: "鐘舵��1", fieldName: "Oly_Inquiry_Status1__c", hideDefaultActions: true, wrapText: true, initialWidth: 100,sortable: true,
typeAttributes: {
- recordId: { fieldName: 'recordId' },
- inputValue: { fieldName: 'Oly_Inquiry_Status1__c' },
+ recordId: { fieldName: "recordId" },
+ inputValue: { fieldName: "Oly_Inquiry_Status1__c" },
showType: 'outputField'
- }
+ },
},
{
- label: 'Oly璇环闃舵',
- fieldName: 'Oly_Inquiry_Stage__c',
- hideDefaultActions: true,
- wrapText: true,
- initialWidth: 110,
- sortable: true,
+ label: "Oly璇环闃舵", fieldName: "Oly_Inquiry_Stage__c", hideDefaultActions: true, wrapText: true, initialWidth: 110,sortable: true,
typeAttributes: {
- recordId: { fieldName: 'recordId' },
- inputValue: { fieldName: 'Oly_Inquiry_Stage__c' },
+ recordId: { fieldName: "recordId" },
+ inputValue: { fieldName: "Oly_Inquiry_Stage__c" },
showType: 'outputField'
- }
+ },
},
{
- label: '棰勬祴OCSM绛剧害鏃�',
- fieldName: 'Oly_Forecasted_Date__c',
- hideDefaultActions: true,
- wrapText: true,
- initialWidth: 150,
- sortable: true,
+ label: "棰勬祴OCSM绛剧害鏃�", fieldName: "Oly_Forecasted_Date__c", hideDefaultActions: true, wrapText: true, initialWidth: 150,sortable: true,
typeAttributes: {
- recordId: { fieldName: 'recordId' },
- inputValue: { fieldName: 'Oly_Forecasted_Date__c' },
+ recordId: { fieldName: "recordId" },
+ inputValue: { fieldName: "Oly_Forecasted_Date__c" },
showType: 'outputField'
- }
+ },
},
{
- label: '鏄惁涓婃湀棰勬祴璇环',
- fieldName: 'Oly_Forecast_last_month__c',
- hideDefaultActions: true,
- wrapText: true,
- initialWidth: 150,
- sortable: true,
+ label: "鏄惁涓婃湀棰勬祴璇环", fieldName: "Oly_Forecast_last_month__c", hideDefaultActions: true, wrapText: true, initialWidth: 150,sortable: true,
typeAttributes: {
- recordId: { fieldName: 'recordId' },
- inputValue: { fieldName: 'Oly_Forecast_last_month__c' },
+ recordId: { fieldName: "recordId" },
+ inputValue: { fieldName: "Oly_Forecast_last_month__c" },
showType: 'outputField'
- }
+ },
},
{
- label: '鏄惁鏈湀棰勬祴璇环',
- fieldName: 'Oly_Forecast_this_month__c',
- hideDefaultActions: true,
- wrapText: true,
- initialWidth: 150,
- sortable: true,
+ label: "鏄惁鏈湀棰勬祴璇环", fieldName: "Oly_Forecast_this_month__c", hideDefaultActions: true, wrapText: true, initialWidth: 150,sortable: true,
typeAttributes: {
- recordId: { fieldName: 'recordId' },
- inputValue: { fieldName: 'Oly_Forecast_this_month__c' },
+ recordId: { fieldName: "recordId" },
+ inputValue: { fieldName: "Oly_Forecast_this_month__c" },
showType: 'outputField'
- }
+ },
},
{
- label: '鏄惁娆℃湀棰勬祴璇环',
- fieldName: 'Oly_NM_Forecast__c',
- hideDefaultActions: true,
- wrapText: true,
- initialWidth: 150,
- sortable: true,
+ label: "鏄惁娆℃湀棰勬祴璇环", fieldName: "Oly_NM_Forecast__c", hideDefaultActions: true, wrapText: true, initialWidth: 150,sortable: true,
typeAttributes: {
- recordId: { fieldName: 'recordId' },
- inputValue: { fieldName: 'Oly_NM_Forecast__c' },
+ recordId: { fieldName: "recordId" },
+ inputValue: { fieldName: "Oly_NM_Forecast__c" },
showType: 'outputField'
- }
+ },
},
{
- label: '鎺堟潈鐢宠缂栫爜',
- fieldName: 'Oly_Authorized_DB_No__c',
- hideDefaultActions: true,
- wrapText: true,
- initialWidth: 110,
- sortable: true,
+ label: "鎺堟潈鐢宠缂栫爜", fieldName: "Oly_Authorized_DB_No__c", hideDefaultActions: true, wrapText: true, initialWidth: 110,sortable: true,
typeAttributes: {
- recordId: { fieldName: 'recordId' },
- inputValue: { fieldName: 'Oly_Authorized_DB_No__c' },
+ recordId: { fieldName: "recordId" },
+ inputValue: { fieldName: "Oly_Authorized_DB_No__c" },
showType: 'outputField'
- }
+ },
},
// -----------------------------------------------
{
- label: '璇环鍚�',
- fieldName: 'NameLink',
- hideDefaultActions: true,
- wrapText: true,
- initialWidth: 110,
- sortable: true,
+ label: "璇环鍚�", fieldName: "NameLink", hideDefaultActions: true, wrapText: true, initialWidth: 110,sortable: true,
type: 'url',
typeAttributes: { label: { fieldName: 'Name' }, target: '_blank' }
},
{
- label: '缁忛攢鍟嗚浠风紪鐮�',
- fieldName: 'Agency_Opportunity_No__c',
- hideDefaultActions: true,
- wrapText: true,
- initialWidth: 130,
- sortable: true,
+ label: "缁忛攢鍟嗚浠风紪鐮�", fieldName: "Agency_Opportunity_No__c", hideDefaultActions: true, wrapText: true, initialWidth: 130,sortable: true,
typeAttributes: {
- recordId: { fieldName: 'recordId' },
- inputValue: { fieldName: 'Agency_Opportunity_No__c' },
+ recordId: { fieldName: "recordId" },
+ inputValue: { fieldName: "Agency_Opportunity_No__c" },
showType: 'outputField'
- }
+ },
},
{
- label: '缁忛攢鍟嗗尰闄�',
- fieldName: 'Agency_Hospital__c',
- hideDefaultActions: true,
- wrapText: true,
- initialWidth: 110,
- sortable: true,
+ label: "缁忛攢鍟嗗尰闄�", fieldName: "Agency_Hospital__c", hideDefaultActions: true, wrapText: true, initialWidth: 110,sortable: true,
typeAttributes: {
- recordId: { fieldName: 'recordId' },
- inputValue: { fieldName: 'Agency_Hospital__c' },
+ recordId: { fieldName: "recordId" },
+ inputValue: { fieldName: "Agency_Hospital__c" },
showType: 'inputField'
- }
+ },
},
{
- label: '绉戝鍒嗙被',
- fieldName: 'Department_Cateogy__c',
- hideDefaultActions: true,
- wrapText: true,
- initialWidth: 110,
- sortable: true,
+ label: "绉戝鍒嗙被", fieldName: "Department_Cateogy__c", hideDefaultActions: true, wrapText: true, initialWidth: 110,sortable: true,
typeAttributes: {
- recordId: { fieldName: 'recordId' },
- inputValue: { fieldName: 'Department_Cateogy__c' },
+ recordId: { fieldName: "recordId" },
+ inputValue: { fieldName: "Department_Cateogy__c" },
showType: 'inputField'
- }
+ },
},
{
- label: '绉戝鍚嶇О',
- fieldName: 'Department_Name_Text__c',
- hideDefaultActions: true,
- wrapText: true,
- initialWidth: 110,
- sortable: true,
+ label: "绉戝鍚嶇О", fieldName: "Department_Name_Text__c", hideDefaultActions: true, wrapText: true, initialWidth: 110,sortable: true,
typeAttributes: {
- recordId: { fieldName: 'recordId' },
- inputValue: { fieldName: 'Department_Cateogy__c' },
+ recordId: { fieldName: "recordId" },
+ inputValue: { fieldName: "Department_Cateogy__c" },
showType: 'inputField'
- }
+ },
},
{
- label: '甯�',
- fieldName: 'Hospital_City_Master__c',
- hideDefaultActions: true,
- wrapText: true,
- initialWidth: 110,
- sortable: true,
+ label: "甯�", fieldName: "Hospital_City_Master__c", hideDefaultActions: true, wrapText: true, initialWidth: 110,sortable: true,
typeAttributes: {
- recordId: { fieldName: 'recordId' },
- inputValue: { fieldName: 'Hospital_City_Master__c' },
+ recordId: { fieldName: "recordId" },
+ inputValue: { fieldName: "Hospital_City_Master__c" },
showType: 'outputField'
- }
+ },
},
{
- label: '浜у搧鍖哄垎1',
- fieldName: 'Product_Category1_P__c',
- hideDefaultActions: true,
- wrapText: true,
- initialWidth: 110,
- sortable: true,
+ label: "浜у搧鍖哄垎1", fieldName: "Product_Category1_P__c", hideDefaultActions: true, wrapText: true, initialWidth: 110,sortable: true,
typeAttributes: {
- recordId: { fieldName: 'recordId' },
- inputValue: { fieldName: 'Product_Category1_P__c' },
+ recordId: { fieldName: "recordId" },
+ inputValue: { fieldName: "Product_Category1_P__c" },
showType: 'inputField'
- }
+ },
},
{
- label: '浜у搧鍖哄垎2',
- fieldName: 'Product_Category2_P__c',
- hideDefaultActions: true,
- wrapText: true,
- initialWidth: 110,
- sortable: true,
+ label: "浜у搧鍖哄垎2", fieldName: "Product_Category2_P__c", hideDefaultActions: true, wrapText: true, initialWidth: 110,sortable: true,
typeAttributes: {
- recordId: { fieldName: 'recordId' },
- inputValue: { fieldName: 'Product_Category2_P__c' },
+ recordId: { fieldName: "recordId" },
+ inputValue: { fieldName: "Product_Category2_P__c" },
showType: 'inputField'
- }
+ },
},
{
- label: '浜у搧鍖哄垎3',
- fieldName: 'Product_Category3_P__c',
- hideDefaultActions: true,
- wrapText: true,
- initialWidth: 110,
- sortable: true,
+ label: "浜у搧鍖哄垎3", fieldName: "Product_Category3_P__c", hideDefaultActions: true, wrapText: true, initialWidth: 110,sortable: true,
typeAttributes: {
- recordId: { fieldName: 'recordId' },
- inputValue: { fieldName: 'Product_Category3_P__c' },
+ recordId: { fieldName: "recordId" },
+ inputValue: { fieldName: "Product_Category3_P__c" },
showType: 'inputField'
- }
+ },
},
{
- label: '瀹㈡埛浜哄憳',
- fieldName: 'Agency_Contact__c',
- hideDefaultActions: true,
- wrapText: true,
- initialWidth: 110,
- sortable: true,
+ label: "瀹㈡埛浜哄憳", fieldName: "Agency_Contact__c", hideDefaultActions: true, wrapText: true, initialWidth: 110,sortable: true,
typeAttributes: {
- recordId: { fieldName: 'recordId' },
- inputValue: { fieldName: 'Agency_Contact__c' },
+ recordId: { fieldName: "recordId" },
+ inputValue: { fieldName: "Agency_Contact__c" },
showType: 'inputField'
- }
+ },
},
{
- label: '閿�鍞媴褰�',
- fieldName: 'Agency_PersonName__c',
- hideDefaultActions: true,
- wrapText: true,
- initialWidth: 110,
- sortable: true,
+ label: "閿�鍞媴褰�", fieldName: "Agency_PersonName__c", hideDefaultActions: true, wrapText: true, initialWidth: 110,sortable: true,
typeAttributes: {
- recordId: { fieldName: 'recordId' },
- inputValue: { fieldName: 'Agency_PersonName__c' },
+ recordId: { fieldName: "recordId" },
+ inputValue: { fieldName: "Agency_PersonName__c" },
showType: 'outputField'
- }
+ },
},
{
- label: '鍖婚櫌閲囪喘棰勭畻(涓嶅惈绋�,鍏�)',
- fieldName: 'Amount__c',
- hideDefaultActions: true,
- wrapText: true,
- initialWidth: 200,
- sortable: true,
+ label: "鍖婚櫌閲囪喘棰勭畻(涓嶅惈绋�,鍏�)", fieldName: "Amount__c", hideDefaultActions: true, wrapText: true, initialWidth: 200,sortable: true,
typeAttributes: {
- recordId: { fieldName: 'recordId' },
- inputValue: { fieldName: 'Amount__c' },
+ recordId: { fieldName: "recordId" },
+ inputValue: { fieldName: "Amount__c" },
showType: 'inputField'
- }
+ },
+
},
{
- label: '璁㈣揣閲戦(涓嶅惈绋�,鍏�)',
- fieldName: 'OCMSale_Price__c',
- hideDefaultActions: true,
- wrapText: true,
- initialWidth: 190,
- sortable: true,
+ label: "璁㈣揣閲戦(涓嶅惈绋�,鍏�)", fieldName: "OCMSale_Price__c", hideDefaultActions: true, wrapText: true, initialWidth: 190,sortable: true,
typeAttributes: {
- recordId: { fieldName: 'recordId' },
- inputValue: { fieldName: 'OCMSale_Price__c' },
+ recordId: { fieldName: "recordId" },
+ inputValue: { fieldName: "OCMSale_Price__c" },
showType: 'inputField'
- }
+ },
},
{
- label: '棰勬祴涓嶰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");
});
}
}
@@ -483,14 +356,15 @@
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
@@ -498,13 +372,10 @@
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;
@@ -520,66 +391,35 @@
this.changeFlg = result.oppRecords.changeFlg;
for (var i in this.datas) {
this.datas[i]['recordId'] = this.datas[i].opp.Id;
- this.datas[i]['OCSM_Opportunity_No__c'] =
- this.datas[i].opp.OCSM_Opportunity_No__c;
- this.datas[i]['Change_To_Opportunity_T__c'] =
- this.datas[i].opp.Change_To_Opportunity_T__c;
- this.datas[i]['Strategic_department_Class_Name__c'] =
- this.datas[
- i
- ].opp.Strategic_department_Class_Name__c;
- this.datas[i]['Oly_Inquiry_Status1__c'] =
- this.datas[i].opp.Oly_Inquiry_Status1__c;
- this.datas[i]['Oly_Inquiry_Stage__c'] =
- this.datas[i].opp.Oly_Inquiry_Stage__c;
- this.datas[i]['Oly_Forecasted_Date__c'] =
- this.datas[i].opp.Oly_Forecasted_Date__c;
- this.datas[i]['Oly_Forecast_last_month__c'] =
- this.datas[i].opp.Oly_Forecast_last_month__c;
- this.datas[i]['Oly_Forecast_this_month__c'] =
- this.datas[i].opp.Oly_Forecast_this_month__c;
- this.datas[i]['Oly_NM_Forecast__c'] =
- this.datas[i].opp.Oly_NM_Forecast__c;
- this.datas[i]['Oly_Authorized_DB_No__c'] =
- this.datas[i].opp.Oly_Authorized_DB_No__c;
+ this.datas[i]['OCSM_Opportunity_No__c'] = this.datas[i].opp.OCSM_Opportunity_No__c;
+ this.datas[i]['Change_To_Opportunity_T__c'] = this.datas[i].opp.Change_To_Opportunity_T__c;
+ this.datas[i]['Strategic_department_Class_Name__c'] = this.datas[i].opp.Strategic_department_Class_Name__c;
+ this.datas[i]['Oly_Inquiry_Status1__c'] = this.datas[i].opp.Oly_Inquiry_Status1__c;
+ this.datas[i]['Oly_Inquiry_Stage__c'] = this.datas[i].opp.Oly_Inquiry_Stage__c;
+ this.datas[i]['Oly_Forecasted_Date__c'] = this.datas[i].opp.Oly_Forecasted_Date__c;
+ this.datas[i]['Oly_Forecast_last_month__c'] = this.datas[i].opp.Oly_Forecast_last_month__c;
+ this.datas[i]['Oly_Forecast_this_month__c'] = this.datas[i].opp.Oly_Forecast_this_month__c;
+ this.datas[i]['Oly_NM_Forecast__c'] = this.datas[i].opp.Oly_NM_Forecast__c;
+ this.datas[i]['Oly_Authorized_DB_No__c'] = this.datas[i].opp.Oly_Authorized_DB_No__c;
// -------
this.datas[i]['Name'] = this.datas[i].AgcOpp.Name;
- this.datas[i]['Agency_Opportunity_No__c'] =
- this.datas[i].AgcOpp.Agency_Opportunity_No__c;
- this.datas[i]['Agency_Hospital__c'] =
- this.datas[i].AgcOpp.Agency_Hospital__c;
- this.datas[i]['Department_Cateogy__c'] =
- this.datas[i].AgcOpp.Department_Cateogy__c;
- this.datas[i]['Department_Name_Text__c'] =
- this.datas[i].AgcOpp.Department_Name_Text__c;
- this.datas[i]['Hospital_City_Master__c'] =
- this.datas[i].AgcOpp.Hospital_City_Master__c;
- this.datas[i]['Product_Category1_P__c'] =
- this.datas[i].AgcOpp.Product_Category1_P__c;
- this.datas[i]['Product_Category2_P__c'] =
- this.datas[i].AgcOpp.Product_Category2_P__c;
- this.datas[i]['Product_Category3_P__c'] =
- this.datas[i].AgcOpp.Product_Category3_P__c;
- this.datas[i]['Agency_Contact__c'] =
- this.datas[i].AgcOpp.Agency_Contact__c;
- this.datas[i]['Agency_PersonName__c'] =
- this.datas[i].AgcOpp.Agency_PersonName__c;
- this.datas[i]['Amount__c'] =
- this.datas[i].AgcOpp.Amount__c;
- this.datas[i]['OCMSale_Price__c'] =
- this.datas[i].AgcOpp.OCMSale_Price__c;
- this.datas[i]['Close_Forecasted_Date__c'] =
- this.datas[i].AgcOpp.Close_Forecasted_Date__c;
- this.datas[i]['Bid_Planned_Date__c'] =
- this.datas[i].AgcOpp.Bid_Planned_Date__c;
- this.datas[i]['StageName__c'] =
- this.datas[i].AgcOpp.StageName__c;
- this.datas[i]['OCM_Change_To_Opportunity_Flg__c'] =
- this.datas[
- i
- ].AgcOpp.OCM_Change_To_Opportunity_Flg__c;
- this.datas[i]['NameLink'] =
- '/s/agency-opportunity/' + this.datas[i].opp.Id;
+ this.datas[i]['Agency_Opportunity_No__c'] = this.datas[i].AgcOpp.Agency_Opportunity_No__c;
+ this.datas[i]['Agency_Hospital__c'] = this.datas[i].AgcOpp.Agency_Hospital__c;
+ this.datas[i]['Department_Cateogy__c'] = this.datas[i].AgcOpp.Department_Cateogy__c;
+ this.datas[i]['Department_Name_Text__c'] = this.datas[i].AgcOpp.Department_Name_Text__c;
+ this.datas[i]['Hospital_City_Master__c'] = this.datas[i].AgcOpp.Hospital_City_Master__c;
+ this.datas[i]['Product_Category1_P__c'] = this.datas[i].AgcOpp.Product_Category1_P__c;
+ this.datas[i]['Product_Category2_P__c'] = this.datas[i].AgcOpp.Product_Category2_P__c;
+ this.datas[i]['Product_Category3_P__c'] = this.datas[i].AgcOpp.Product_Category3_P__c;
+ this.datas[i]['Agency_Contact__c'] = this.datas[i].AgcOpp.Agency_Contact__c;
+ this.datas[i]['Agency_PersonName__c'] = this.datas[i].AgcOpp.Agency_PersonName__c;
+ this.datas[i]['Amount__c'] = this.datas[i].AgcOpp.Amount__c;
+ this.datas[i]['OCMSale_Price__c'] = this.datas[i].AgcOpp.OCMSale_Price__c;
+ this.datas[i]['Close_Forecasted_Date__c'] = this.datas[i].AgcOpp.Close_Forecasted_Date__c;
+ this.datas[i]['Bid_Planned_Date__c'] = this.datas[i].AgcOpp.Bid_Planned_Date__c;
+ this.datas[i]['StageName__c'] = this.datas[i].AgcOpp.StageName__c;
+ this.datas[i]['OCM_Change_To_Opportunity_Flg__c'] = this.datas[i].AgcOpp.OCM_Change_To_Opportunity_Flg__c;
+ this.datas[i]['NameLink'] = '/s/agency-opportunity/'+this.datas[i].opp.Id;
}
this.showMyToast(result.Msg, '', 'success');
this.showSpinner = false;
@@ -588,15 +428,12 @@
this.showMyToast('鍒濆鍖栭〉闈㈠け璐�', result.Msg, 'error');
}
})
- .catch((error) => {
+ .catch(error => {
this.showSpinner = false;
- console.log('Error:' + JSON.stringify(error));
- this.showMyToast(
- '鍒濆鍖栭〉闈㈠け璐�',
- JSON.stringify(error),
- 'error'
- );
- });
+ console.log("Error:" + JSON.stringify(error));
+ this.showMyToast('鍒濆鍖栭〉闈㈠け璐�', JSON.stringify(error), 'error');
+ })
+
}
// renderedCallback() {
@@ -636,16 +473,14 @@
var inputValue = event.detail.data.inputValue;
var recordId = event.detail.data.recordId;
var fieldName = event.detail.data.fieldName;
- console.log(
- 'valueChange:' + recordId + '---' + fieldName + '---' + inputValue
- );
+ console.log("valueChange:" + recordId + '---' + fieldName + '---' + inputValue);
for (var i in this.datas) {
if (this.datas[i]['recordId'] == recordId) {
this.datas[i]['fieldName'] = inputValue;
- this.datas[i]['changeFlg'] = this.changeFlg;
+ this.datas[i]['changeFlg'] = this.changeFlg;
}
}
- console.log(' this.datas==>' + JSON.stringify(this.datas));
+ console.log(" this.datas==>" + JSON.stringify(this.datas));
}
accSearchChange(event) {
@@ -672,31 +507,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);
@@ -709,118 +544,91 @@
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;
- }
- this.showSpinner = false;
- this.showMyToast('鎼滅储鎴愬姛', result.Msg, 'success');
- } else {
- this.showSpinner = false;
- this.showMyToast('鎼滅储澶辫触', result.Msg, 'error');
+ 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;
+
}
- })
- .catch((error) => {
this.showSpinner = false;
- console.log('error = ' + JSON.stringify(error));
- });
+ 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));
+ });
}
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));
- this.showSpinner = false;
- this.showMyToast('淇濆瓨鎴愬姛', '', 'success');
- } else {
- this.showSpinner = false;
- this.showMyToast('淇濆瓨澶辫触', result.Msg, 'error');
- }
- })
- .catch((error) => {
+ sortKeyLWC:this.sortKey
+
+ }).then((result) => {
+ if (result.result == 'Success') {
+ this.datas = result.oppRecords;
+ console.log('result==>' + JSON.stringify(result));
this.showSpinner = false;
- console.log('error = ' + JSON.stringify(error));
- });
+ this.showMyToast('淇濆瓨鎴愬姛', '', 'success');
+
+ } else {
+ this.showSpinner = false;
+ this.showMyToast('淇濆瓨澶辫触', result.Msg, 'error');
+
+ }
+ }).catch((error) => {
+ this.showSpinner = false;
+ console.log('error = ' + JSON.stringify(error));
+ });
+
}
showMyToast(title, message, variant) {
@@ -833,18 +641,12 @@
iconName = 'utility:error';
}
if (message != '') {
- content =
- '<h2><strong>' +
- title +
- '<strong/></h2><h5>' +
- message +
- '</h5>';
+ content = '<h2><strong>' + title + '<strong/></h2><h5>' + message + '</h5>';
} else {
content = '<h2><strong>' + title + '<strong/></h2>';
}
- this.template
- .querySelector('c-common-toast')
- .showToast(variant, content, iconName, 10000);
+ this.template.querySelector('c-common-toast').
+ showToast(variant, content, iconName, 10000);
}
//鎺掑簭
sortByMethod(field, reverse, primer) {
@@ -863,71 +665,55 @@
};
}
- 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) {
@@ -937,14 +723,12 @@
}
}
handlePrevious() {
- this.currentPageToken =
- Number(this.currentPageToken) - Number(this.pageSize);
+ this.currentPageToken = Number(this.currentPageToken) - Number(this.pageSize);
this.init();
}
handleNext() {
- this.currentPageToken =
- Number(this.currentPageToken) + Number(this.pageSize);
+ this.currentPageToken = Number(this.currentPageToken) + Number(this.pageSize);
this.init();
}
handleFirst() {
@@ -953,8 +737,7 @@
}
handleLast() {
- this.currentPageToken =
- this.totalPages > 1 ? (this.totalPages - 1) * this.pageSize : 0;
+ this.currentPageToken = this.totalPages > 1 ? (this.totalPages - 1) * this.pageSize : 0;
this.init();
}
diff --git a/force-app/main/default/lwc/lexInventory/lexInventory.html b/force-app/main/default/lwc/lexInventory/lexInventory.html
index 8e14dd9..18b0886 100644
--- a/force-app/main/default/lwc/lexInventory/lexInventory.html
+++ b/force-app/main/default/lwc/lexInventory/lexInventory.html
@@ -2,10 +2,7 @@
<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>
@@ -14,46 +11,20 @@
</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" />
@@ -74,28 +45,13 @@
<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>
@@ -105,20 +61,8 @@
</div>
</div>
- <div
- style="
- border: 1px solid #d4d4d4;
- border-radius: 5px;
- margin-bottom: 7px;
- "
- >
- <div
- style="
- border-top: 3px solid #51606e;
- border-bottom: 1px solid #d4d4d4;
- padding: 3px;
- "
- >
+ <div style="border: 1px solid #D4D4D4;border-radius:5px;margin-bottom:7px;">
+ <div style="border-top: 3px solid #51606E;border-bottom: 1px solid #D4D4D4;padding:3px;">
<!-- <p style="font-size: 16px;"><strong>鍦ㄥ簱鍟嗗搧搴撳瓨涓�瑙�</strong></p> -->
<lightning-layout>
<lightning-layout-item padding="around-small">
@@ -128,222 +72,122 @@
</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 07ed955..9a35fb2 100644
--- a/force-app/main/default/lwc/lexInventory/lexInventory.js
+++ b/force-app/main/default/lwc/lexInventory/lexInventory.js
@@ -1,857 +1,765 @@
-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;
- //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 = [];
+ //鍔犺浇妗�
+ // @track casesSpinner = true;
+ @track showSpinner = true;
- //瀵煎嚭csv
- xlsDataHeader = ['娑堣�楀搧鍚嶇О', '鍗曚綅', 'barCode', '璋冩暣鍘熷洜'];
+ //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 = [];
- //鑾峰彇閾炬帴鍙傛暟
- 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() {
+
+ //瀵煎嚭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() {
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('===>鍒濆鍖�');
- //鑾峰彇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;
- }
+ connectedCallback() {
+ console.log("===>鍒濆鍖�");
- //褰曞叆barcode
- barcodeEntrys() {
- console.log('Test');
- this.showTable = false;
- this.showbutton = false;
- this.showSpinner = true;
+ //鑾峰彇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;
+ }
- //鏌ヨ鏈夊摢浜涢�夋嫨浜嗙殑鐒跺悗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');
+ }
+ init() {
- // }
- 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;
- }
+ 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;
+ }
- 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();
- }
+ //褰曞叆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"]);
- //鑷畾涔塪ataType
+ }
+ }
+ // if(this.barcode == ''||this.barcode == null){
+ // this.showMyToast('鑾峰彇澶辫触','璇疯緭鍏arCode鍙�','error');
- 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
- );
+ // }
+ 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
- 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));
- }
+ })
+ .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;
+ }
- 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']
- );
- }
- }
+ 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();
+ }
- // 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));
- 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');
+ //鑷畾涔塪ataType
- 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;
- });
- }
+ 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);
- inits() {
- this.showSpinner = true;
- datainit({
- eSetId: this.eSetId
- })
- .then((result) => {
- result = JSON.parse(JSON.stringify(result));
- console.log('鐩樼偣涓�瑙�===>' + JSON.stringify(result));
+ 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));
+ }
- 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();
- }
+ 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"]);
- 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();
- }
+ // 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));
- handlePageschange(event) {
- console.log(event.detail);
- this.pageSize = event.detail;
- this.currentPageToken = 0;
- this.barcodeEntrys();
- }
- get previousButtonDisabled() {
- return this.currentPageToken === 0;
- }
+ 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");
- get nextButtonDisabled() {
- return this.nextPageToken === undefined;
- }
+ 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;
+ });
+ }
- handleLoad2() {
- console.log('handleLoad2');
+ 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')
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 c3fe048..bd7f8ea 100644
--- a/force-app/main/default/lwc/lexLicenceReminder/lexLicenceReminder.html
+++ b/force-app/main/default/lwc/lexLicenceReminder/lexLicenceReminder.html
@@ -1,23 +1,9 @@
<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 404f38f..f154617 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,63 +6,47 @@
@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 +
- '澶╀簡锛�';
- }
- } else {
- console.log('Error:' + result.errorMsg);
- this.showMyToast(result.errorMsg, '', 'error');
+ .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+'澶╀簡锛�';
}
- })
- .catch((error) => {
- console.log('Error:' + JSON.stringify(error));
- this.showMyToast(
- '鍒濆鍖栨彁閱掑け璐�',
- JSON.stringify(error),
- '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');
+ })
}
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 a1c9da2..0a059dd 100644
--- a/force-app/main/default/lwc/lexLookup/lexLookup.html
+++ b/force-app/main/default/lwc/lexLookup/lexLookup.html
@@ -1,139 +1,67 @@
<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}
@@ -151,53 +79,25 @@
<!-- 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>
@@ -211,28 +111,14 @@
<!-- 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>
@@ -243,11 +129,7 @@
<!-- 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 05e2a9e..7d2ef23 100644
--- a/force-app/main/default/lwc/lexLookup/lexLookup.js
+++ b/force-app/main/default/lwc/lexLookup/lexLookup.js
@@ -11,8 +11,7 @@
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) {
@@ -46,13 +45,15 @@
_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);
}
}
@@ -92,13 +93,9 @@
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
@@ -127,8 +124,7 @@
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';
}
@@ -143,7 +139,7 @@
@api
getSelection() {
- console.log('get selection:' + this._curSelection);
+ console.log('get selection:' +this._curSelection);
return this._curSelection;
}
@@ -160,11 +156,9 @@
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
@@ -172,10 +166,7 @@
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;
}
@@ -184,10 +175,7 @@
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;
}
@@ -207,9 +195,7 @@
detail: {
searchTerm: this._cleanSearchTerm,
rawSearchTerm: newSearchTerm,
- selectedIds: this._curSelection.map(
- (element) => element.id
- )
+ selectedIds: this._curSelection.map((element) => element.id)
}
});
this.dispatchEvent(searchEvent);
@@ -243,9 +229,7 @@
// 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 }));
}
}
@@ -277,18 +261,12 @@
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();
}
}
@@ -297,9 +275,7 @@
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;
}
@@ -343,7 +319,7 @@
});
this.dispatchEvent(blurEvent);
this._hasFocus = false;
- if (!this.hasSelection()) {
+ if(!this.hasSelection()){
this._searchTerm = '';
}
}
@@ -353,9 +329,7 @@
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);
}
@@ -370,9 +344,7 @@
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
@@ -398,15 +370,11 @@
}
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)
);
}
@@ -435,8 +403,7 @@
}
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';
}
@@ -448,16 +415,11 @@
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;
}
@@ -467,9 +429,7 @@
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;
}
@@ -490,32 +450,23 @@
}
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() {
@@ -528,9 +479,7 @@
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 ff944f9..44f8281 100644
--- a/force-app/main/default/lwc/lexNewOrder/lexNewOrder.html
+++ b/force-app/main/default/lwc/lexNewOrder/lexNewOrder.html
@@ -2,20 +2,6 @@
<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 73ae356..7363f96 100644
--- a/force-app/main/default/lwc/lexNewOrder/lexNewOrder.js
+++ b/force-app/main/default/lwc/lexNewOrder/lexNewOrder.js
@@ -1,23 +1,25 @@
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 419ea5e..7156e21 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 d0cee60..76b9b05 100644
--- a/force-app/main/default/lwc/lexOutboundorderImport/lexOutboundorderImport.html
+++ b/force-app/main/default/lwc/lexOutboundorderImport/lexOutboundorderImport.html
@@ -3,17 +3,11 @@
<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">
@@ -22,22 +16,11 @@
<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>
@@ -46,12 +29,8 @@
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
@@ -59,18 +38,13 @@
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">
@@ -83,17 +57,9 @@
<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 9378d25..0200238 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,37 +103,35 @@
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() {
@@ -142,7 +140,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;
}
@@ -150,78 +148,66 @@
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;
- }
- 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');
+ 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;
}
- })
- .catch((error) => {
- console.log('error = ' + JSON.stringify(error.message));
- this.showMyToast('瀵煎叆閿欒', '瀵煎叆澶辫触', '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')
+ });
}
dataImport() {
@@ -243,31 +229,29 @@
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;
@@ -285,17 +269,10 @@
iconName = 'utility:error';
}
if (message != '') {
- content =
- '<h2><strong>' +
- title +
- '<strong/></h2><h5>' +
- message +
- '</h5>';
+ content = '<h2><strong>' + title + '<strong/></h2><h5>' + message + '</h5>';
} else {
content = '<h2><strong>' + title + '<strong/></h2>';
}
- this.template
- .querySelector('c-common-toast')
- .showToast(variant, content, iconName, 10000);
+ this.template.querySelector('c-common-toast').showToast(variant, content, iconName, 10000);
}
}
\ 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 ba371d6..75c65de 100644
--- a/force-app/main/default/lwc/lexOverdueStock/lexOverdueStock.html
+++ b/force-app/main/default/lwc/lexOverdueStock/lexOverdueStock.html
@@ -1,212 +1,131 @@
<template>
<template if:true={showSpinner}>
- <!-- <lightning-spinner size="medium" variant="brand"></lightning-spinner> -->
- <div class="slds-spinner_container">
- <div
- role="status"
- class="slds-spinner slds-spinner_medium slds-spinner_brand"
- >
- <span class="slds-assistive-text">Loading</span>
- <div class="slds-spinner__dot-a"></div>
- <div class="slds-spinner__dot-b"></div>
- </div>
- </div>
- </template>
- <c-common-toast></c-common-toast>
- <div style="border: 1px solid #d4d4d4; border-radius: 5px">
- <div
- style="
- border-top: 3px solid #51606e;
- border-bottom: 1px solid #d4d4d4;
- padding: 3px;
- "
- >
- <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>
- </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>
-
- <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>
+ <!-- <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 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>
+ </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>
+
+ <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>
</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 92f0d0e..88325a0 100644
--- a/force-app/main/default/lwc/lexOverdueStock/lexOverdueStock.js
+++ b/force-app/main/default/lwc/lexOverdueStock/lexOverdueStock.js
@@ -4,397 +4,350 @@
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
- },
- {
- label: '鍗曚綅',
- fieldName: 'boxPiece',
- hideDefaultActions: true
- // initialWidth: 250,
- },
- {
- label: '杩囨湡鏁伴噺',
- fieldName: 'overlimitCount',
- hideDefaultActions: true,
- cellAttributes: { alignment: 'right' }
+ hideDefaultActions: true
- // initialWidth: 250,
- },
- {
- label: '閿�瀛樻暟閲�',
- fieldName: 'pandian',
- hideDefaultActions: true,
- cellAttributes: { alignment: 'right' }
- // initialWidth: 250,
- // cellAttributes: { alignment: 'center' }
- }
+ },
+ {
+ 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' }
+ }
];
//閿�瀛樻槑缁�
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 = [];
- 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');
- });
- }
- }
+ //鍔犺浇妗�
+ // @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 = [];
- //鍒濆鍖�
- 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;
- 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)
+ renderedCallback() {
+ if (!this.stylesLoaded) {
+ Promise.all([loadStyle(this, WrappedHeaderTable)])
+ .then(() => {
+ console.log("Custom styles loaded");
+ this.stylesLoaded = true;
})
- .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;
- }
+ .catch((error) => {
+ console.error("Error loading custom styles");
+ });
+ }
+ }
- // 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));
+
+ //鍒濆鍖�
+ 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;
for (var i in this.data) {
- this.data[i]['check'] = false;
+ 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"];
}
for (var i in this.data) {
- for (var j in selectedRows) {
- if (
- this.data[i].prodid + this.data[i]['boxPiece'] ==
- selectedRows[j].prodid + selectedRows[j]['boxPiece']
- ) {
- this.data[i]['check'] = true;
- }
+ if (this.data[i]['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;
+
}
- 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';
- }
- 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.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';
}
+ 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 4dd6031..b6a3c31 100644
--- a/force-app/main/default/lwc/lexProductLimitEdit/lexProductLimitEdit.html
+++ b/force-app/main/default/lwc/lexProductLimitEdit/lexProductLimitEdit.html
@@ -2,21 +2,9 @@
<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">
@@ -26,142 +14,69 @@
</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 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>
</th>
<th scope="col">
- <div
- class="slds-truncate"
- style="font-size: 16px"
- title="First 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>
- <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>
</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 c0fea80..025f40b 100644
--- a/force-app/main/default/lwc/lexProductLimitEdit/lexProductLimitEdit.js
+++ b/force-app/main/default/lwc/lexProductLimitEdit/lexProductLimitEdit.js
@@ -1,11 +1,9 @@
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 = '';
@@ -13,8 +11,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]);
@@ -26,48 +24,47 @@
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]
- });
- }
- this.showSpinner = false;
- console.log(
- 'this.invRecords' + JSON.stringify(this.invRecords)
- );
- } else {
- this.showSpinner = false;
- console.log('error = ' + JSON.stringify(error));
+
+ }).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]
+ });
}
- })
- .catch((error) => {
this.showSpinner = false;
- console.log('error = ' + JSON.stringify(error));
- });
+ 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));
+ });
// this.inventoryTempRecords();
+
}
addRow() {
@@ -76,7 +73,7 @@
inventory1: '',
inventory2: '',
id: ++this.keyIndex
- };
+ }
this.invRecords = [...this.invRecords, Object.create(objRow)];
}
removeRow(event) {
@@ -92,59 +89,30 @@
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(','));
@@ -153,26 +121,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');
- 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));
+ }).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;
+ });
this.inventoryTempRecords();
console.log('Save ==> ' + JSON.stringify(toSaveList));
@@ -180,16 +148,15 @@
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));
}
}
@@ -197,7 +164,7 @@
//鏁板瓧楠岃瘉
isNum(num) {
var reNum = /^[0-9]+$/;
- return reNum.test(num);
+ return (reNum.test(num));
}
showMyToast(title, message, variant) {
console.log('show custom message');
@@ -209,18 +176,11 @@
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 9a67917..b8546a2 100644
--- a/force-app/main/default/lwc/lexRemoveBox/lexRemoveBox.html
+++ b/force-app/main/default/lwc/lexRemoveBox/lexRemoveBox.html
@@ -1,231 +1,141 @@
<template>
- <template if:true={showSpinner}>
- <!-- <lightning-spinner size="medium" variant="brand"></lightning-spinner> -->
- <div class="slds-spinner_container">
- <div
- role="status"
- class="slds-spinner slds-spinner_medium slds-spinner_brand"
- >
- <span class="slds-assistive-text">Loading</span>
- <div class="slds-spinner__dot-a"></div>
- <div class="slds-spinner__dot-b"></div>
- </div>
- </div>
- </template>
- <c-common-toast></c-common-toast>
- <div style="border: 1px solid #d4d4d4; border-radius: 5px">
- <div
- style="
- border-top: 3px solid #51606e;
- border-bottom: 1px solid #d4d4d4;
- padding: 3px;
- "
- >
- <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>
+ <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;"> -->
- <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;">
+ <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: 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>
+ <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="padding: 10px">
- <!-- <template if:true={showTables}> -->
+ <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>
- <!-- <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>
+ <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>
+
</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 2620c5f..440d3e2 100644
--- a/force-app/main/default/lwc/lexRemoveBox/lexRemoveBox.js
+++ b/force-app/main/default/lwc/lexRemoveBox/lexRemoveBox.js
@@ -4,253 +4,248 @@
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;
- })
- .catch((error) => {
- console.error('Error loading custom styles');
- });
+ 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.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));
+ });
- //鍒濆鍖�
- 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) {
- this.removeBox();
- }
- } else {
+ }
+ //鑾峰彇褰撳墠杈撳叆鍊�
+ 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();
}
- 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));
- });
+
+ }
+ 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';
}
- 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);
+ 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/lexReturnGoodCusInput/lexReturnGoodCusInput.html b/force-app/main/default/lwc/lexReturnGoodCusInput/lexReturnGoodCusInput.html
index f30bfdf..848a41b 100644
--- a/force-app/main/default/lwc/lexReturnGoodCusInput/lexReturnGoodCusInput.html
+++ b/force-app/main/default/lwc/lexReturnGoodCusInput/lexReturnGoodCusInput.html
@@ -1,18 +1,10 @@
<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 81d837e..84d7bf9 100644
--- a/force-app/main/default/lwc/lexReturnGoodCusInput/lexReturnGoodCusInput.js
+++ b/force-app/main/default/lwc/lexReturnGoodCusInput/lexReturnGoodCusInput.js
@@ -1,37 +1,31 @@
-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 5f770e0..d2c33e0 100644
--- a/force-app/main/default/lwc/lexSaleAndDelivery/lexSaleAndDelivery.html
+++ b/force-app/main/default/lwc/lexSaleAndDelivery/lexSaleAndDelivery.html
@@ -8,7 +8,6 @@
<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>
@@ -29,33 +28,22 @@
<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>
@@ -85,46 +73,26 @@
<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>
@@ -133,73 +101,46 @@
<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>
@@ -207,21 +148,15 @@
</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>
@@ -233,21 +168,12 @@
<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>
@@ -260,17 +186,10 @@
</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 e57180a..17153ab 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,20 +76,18 @@
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 = '';
@@ -110,48 +108,49 @@
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;
- }
- 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');
+ 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;
}
- })
- .catch((error) => {
- console.log('error = ' + JSON.stringify(error));
- this.showMyToast('閿欒', '鍒濆鍖栧け璐�', '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');
+ })
}
+
+
//鏂板缓鍑哄簱鍗�
neworderhead() {
@@ -176,32 +175,29 @@
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');
+ }).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;
}
- })
- .catch((error) => {
- console.log('error = ' + JSON.stringify(error));
- });
+ 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))
+ })
}
//杩樻病鍑哄簱鐨勫嚭搴撳崟
@@ -219,36 +215,29 @@
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');
+ }).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;
}
- })
- .catch((error) => {
- console.log('error = ' + JSON.stringify(error));
- this.showMyToast(
- '鎼滅储澶辫触',
- '鎼滅储杩樻病鍑哄簱鐨勫嚭搴撳崟鍑洪敊',
- 'Error'
- );
- });
+ 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');
+ })
}
//宸插嚭搴撳凡寮�绁ㄧ殑鍑哄簱鍗�
@@ -264,36 +253,29 @@
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');
+ }).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;
}
- })
- .catch((error) => {
- console.log('error = ' + JSON.stringify(error));
- this.showMyToast(
- '鎼滅储澶辫触',
- '鎼滅储宸插嚭搴撳凡寮�绁ㄧ殑鍑哄簱鍗曞嚭閿�',
- 'Error'
- );
- });
+ 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');
+ })
}
//娓呯┖
@@ -307,33 +289,30 @@
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');
+ 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;
}
- })
- .catch((error) => {
- console.log('error = ' + JSON.stringify(error));
- this.showMyToast('鎼滅储澶辫触', '鎼滅储澶辫触', 'Error');
- });
+ 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
@@ -360,11 +339,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);
@@ -373,25 +352,27 @@
};
}
+
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() {
@@ -414,18 +395,11 @@
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 76f7619..728b39d 100644
--- a/force-app/main/default/lwc/lexSummonsCreat/lexSummonsCreat.js
+++ b/force-app/main/default/lwc/lexSummonsCreat/lexSummonsCreat.js
@@ -844,7 +844,6 @@
//disable
- debugger
if (Object.values(r.entity.coc).length > 0) {
this.cocLwc = r.entity.coc;
console.log("this.cocLwc = " + JSON.stringify(this.cocLwc));
@@ -855,12 +854,6 @@
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;
}
@@ -2053,45 +2046,10 @@
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 eca5e11..6a27e23 100644
--- a/force-app/main/default/lwc/lexTableCellIcon/lexTableCellIcon.html
+++ b/force-app/main/default/lwc/lexTableCellIcon/lexTableCellIcon.html
@@ -1,7 +1,3 @@
<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 9df4a22..1931b2a 100644
--- a/force-app/main/default/lwc/lexTableCellIcon/lexTableCellIcon.js
+++ b/force-app/main/default/lwc/lexTableCellIcon/lexTableCellIcon.js
@@ -1,24 +1,22 @@
-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 2f6a06d..e7b4de8 100644
--- a/force-app/main/default/lwc/lexTopPage/lexTopPage.html
+++ b/force-app/main/default/lwc/lexTopPage/lexTopPage.html
@@ -2,10 +2,7 @@
<template if:true={showSpinner}>
<!-- <lightning-spinner size="medium" variant="brand"></lightning-spinner> -->
<div class="slds-spinner_container">
- <div
- role="status"
- class="slds-spinner slds-spinner_medium slds-spinner_brand"
- >
+ <div role="status" class="slds-spinner slds-spinner_medium slds-spinner_brand">
<span class="slds-assistive-text">Loading</span>
<div class="slds-spinner__dot-a"></div>
<div class="slds-spinner__dot-b"></div>
@@ -31,15 +28,8 @@
</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">
@@ -49,29 +39,15 @@
</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">
@@ -81,14 +57,8 @@
</lightning-layout>
<!-- <p style="font-size: 16px;"><strong>浣跨敤鏈熼檺灏忎簬涓�骞寸殑浜у搧</strong></p> -->
</div>
- <div style="padding: 10px">
- <lightning-datatable
- class="wrapped-header-datatable"
- hide-checkbox-column
- key-field="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>
@@ -177,15 +147,8 @@
</div>
</div> -->
<!--缁忛攢鍟嗗簱瀛樹笂涓嬮檺 -->
- <div
- style="
- border: 1px solid #d4d4d4;
- border-top: 3px solid #51606e;
- border-radius: 5px;
- margin-bottom: 7px;
- "
- >
- <div style="border-bottom: 1px solid #d4d4d4; padding: 3px">
+ <div style="border: 1px solid #D4D4D4;border-top: 3px solid #51606E;border-radius:5px;margin-bottom:7px;">
+ <div style="border-bottom: 1px solid #D4D4D4;padding:3px;">
<lightning-layout>
<lightning-layout-item padding="around-small">
<p style="font-size: 18px">
@@ -195,24 +158,12 @@
</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>
@@ -243,65 +194,24 @@
</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 2af5fa4..777d6e7 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,256 +76,212 @@
@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
- },
- {
- label: '绗笁鍒嗙被',
- fieldName: 'Category3__c',
- initialWidth: 85,
- cellAttributes: { alignment: 'left' },
hideDefaultActions: true,
- wrapText: true
},
{
- label: '绗洓鍒嗙被',
- fieldName: 'Category4__c',
- cellAttributes: { alignment: 'left' },
+ label: "绗笁鍒嗙被",
+ fieldName: "Category3__c",
initialWidth: 85,
+ cellAttributes: { alignment: "left" },
hideDefaultActions: true,
- wrapText: true
+ wrapText: true,
},
{
- label: '绗簲鍒嗙被',
- fieldName: 'Category5__c',
- cellAttributes: { alignment: 'left' },
+ label: "绗洓鍒嗙被",
+ fieldName: "Category4__c",
+ cellAttributes: { alignment: "left" },
initialWidth: 85,
hideDefaultActions: true,
wrapText: true,
- sortable: true
+
},
{
- label: 'CFDA鐘舵��',
- fieldName: 'SFDA_Status__c',
- cellAttributes: { alignment: 'left' },
+ label: "绗簲鍒嗙被",
+ fieldName: "Category5__c",
+ cellAttributes: { alignment: "left" },
+ initialWidth: 85,
+ hideDefaultActions: true,
+ wrapText: true,
+ sortable: true,
+
+ },
+ {
+ 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");
});
}
}
@@ -338,23 +294,20 @@
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
@@ -365,117 +318,81 @@
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');
+ })
}
//鐐瑰嚮閾炬帴
@@ -483,9 +400,7 @@
var outputValue = event.detail.data.value;
var outputType = event.detail.data.type;
var recordId = event.detail.data.recordId;
- console.log(
- 'click:' + outputValue + '---' + outputType + '---' + recordId
- );
+ console.log("click:" + outputValue + "---" + outputType + "---" + recordId);
if (outputType == 'Title') {
const config = {
type: 'standard__webPage',
@@ -496,146 +411,120 @@
this[NavigationMixin.Navigate](config);
} else if (outputType == 'TotalNum') {
this.popTitle = '鎵�鏈変骇鍝佷竴瑙�';
- 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'
- );
- }
- });
+ 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'
- );
- }
- });
+ 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');
+ }
+ })
}
}
}
@@ -647,11 +536,7 @@
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: {
@@ -679,24 +564,18 @@
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';
@@ -710,17 +589,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);
@@ -730,17 +609,15 @@
}
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;
@@ -756,14 +633,12 @@
}
}
handlePrevious() {
- this.currentPageToken =
- Number(this.currentPageToken) - Number(this.pageSize);
+ this.currentPageToken = Number(this.currentPageToken) - Number(this.pageSize);
this.init();
}
handleNext() {
- this.currentPageToken =
- Number(this.currentPageToken) + Number(this.pageSize);
+ this.currentPageToken = Number(this.currentPageToken) + Number(this.pageSize);
this.init();
}
handleFirst() {
@@ -772,8 +647,7 @@
}
handleLast() {
- this.currentPageToken =
- this.totalPages > 1 ? (this.totalPages - 1) * this.pageSize : 0;
+ this.currentPageToken = this.totalPages > 1 ? (this.totalPages - 1) * this.pageSize : 0;
this.init();
}
diff --git a/force-app/main/default/lwc/lexinventoryViewLWC/lexinventoryViewLWC.html b/force-app/main/default/lwc/lexinventoryViewLWC/lexinventoryViewLWC.html
index 181806f..6c29ff9 100644
--- a/force-app/main/default/lwc/lexinventoryViewLWC/lexinventoryViewLWC.html
+++ b/force-app/main/default/lwc/lexinventoryViewLWC/lexinventoryViewLWC.html
@@ -2,10 +2,7 @@
<template if:true={showSpinner}>
<!-- <lightning-spinner size="medium" variant="brand"></lightning-spinner> -->
<div class="slds-spinner_container">
- <div
- role="status"
- class="slds-spinner slds-spinner_medium slds-spinner_brand"
- >
+ <div role="status" class="slds-spinner slds-spinner_medium slds-spinner_brand">
<span class="slds-assistive-text">Loading</span>
<div class="slds-spinner__dot-a"></div>
<div class="slds-spinner__dot-b"></div>
@@ -13,14 +10,8 @@
</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">
@@ -30,21 +21,9 @@
</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="杩囨湡搴撳瓨閿�瀛�"
@@ -52,58 +31,21 @@
<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" />
@@ -124,129 +66,57 @@
</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">
@@ -256,36 +126,22 @@
</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 ff6c1ae..08547a6 100644
--- a/force-app/main/default/lwc/lexinventoryViewLWC/lexinventoryViewLWC.js
+++ b/force-app/main/default/lwc/lexinventoryViewLWC/lexinventoryViewLWC.js
@@ -1,366 +1,335 @@
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
- @track data = [];
- @track message = '';
- @track Name;
- @track CategoryThree;
+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 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 data = [];
+ @track message = "";
+ @track Name;
+ @track CategoryThree;
- @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
- },
+ @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;
- {
- 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;
+ @track columns = [
+ {
+ label: "娑堣�楀搧鍚嶇О",
+ fieldName: "Name__c",
+ type: "Name",
+ sortable: true,
+ hideDefaultActions: true,
+ initialWidth: 300,
+ wrapText: true,
+ cellAttributes: { alignment: "left" }
+ },
+ {
+ label: "绗笁鍒嗙被",
+ fieldName: "Category3__c",
+ initialWidth: 120,
+ cellAttributes: { alignment: "left" },
+ hideDefaultActions: true,
+ sortable: true,
+ wrapText: true,
+ },
+ {
+ label: "绗洓鍒嗙被",
+ fieldName: "Category4__c",
+ cellAttributes: { alignment: "left" },
+ initialWidth: 120,
+ hideDefaultActions: true,
+ wrapText: true,
+ sortable: true,
+
+ },
+ {
+ label: "绗簲鍒嗙被",
+ fieldName: "Category5__c",
+ cellAttributes: { alignment: "left" },
+ initialWidth: 120,
+ hideDefaultActions: true,
+ wrapText: true,
+ sortable: true,
+
+ },
+
+ {
+ label: "瑙勬牸",
+ fieldName: "packing_list",
+ cellAttributes: { alignment: "right" },
+ initialWidth: 55,
+ wrapText: true,
+ hideDefaultActions: true,
+ },
+ {
+ label: "鍗曚綅",
+ fieldName: "BoxPiece",
+ cellAttributes: { alignment: "left" },
+ initialWidth: 55,
+ wrapText: true,
+ hideDefaultActions: true,
+ },
+ {
+ label: "娉ㄥ唽璇佺紪鐮佸彿",
+ fieldName: "approbation_No",
+ cellAttributes: { alignment: "left" },
+ wrapText: true,
+ initialWidth: 200,
+ hideDefaultActions: true,
+ },
+ {
+ label: "娉ㄥ唽鏈夋晥鏈�",
+ fieldName: "expiration_Date",
+ cellAttributes: { alignment: "left" },
+ wrapText: true,
+ hideDefaultActions: true,
+ initialWidth: 110
+ },
+ {
+ label: "CFDA鐘舵��",
+ fieldName: "SFDA_Status__c",
+ cellAttributes: { alignment: "left" },
+ initialWidth: 95,
+ wrapText: true,
+ hideDefaultActions: true,
+ },
+ {
+ label: "浣跨敤鏈熼檺",
+ fieldName: "guaranteeperiod",
+ cellAttributes: { alignment: "left" },
+ hideDefaultActions: true,
+ initialWidth: 105
+ },
+ {
+ label:'鏈夋晥鏈熷唴搴撳瓨',
+ type: "customInventoryColor",
+ fieldName: "limitCount",
+ sortable: true,
+ cellAttributes: {alignment: "right" },
+ typeAttributes: {
+ value: { fieldName:"limitCount"},
+ upperlimit: { fieldName: "upperlimit" },
+ lowerlimit: { fieldName: "lowerlimit" },
+ boxPrice:{ fieldName: "BoxPiece" },
+ },
+ hideDefaultActions: true,
+ initialWidth:150
+ },
+ {
+ label: "杩囨湡搴撳瓨",
+ fieldName: "overlimitCount",
+ hideDefaultActions: true,
+ cellAttributes: { alignment: "right" },
+ initialWidth:80
+ }
+ ];
+ defaultSortDirection = "asc";
+ sortDirection = "asc";
+ sortedBy;
+
+
+
renderedCallback() {
if (!this.stylesLoaded) {
Promise.all([loadStyle(this, WrappedHeaderTable)])
.then(() => {
- console.log('Custom styles loaded');
+ 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);
- //棰滆壊鏍囪
+ 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
- //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.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);
+ }
}
- })
- .catch((error) => {
- this.loader = false;
- this.showSpinner = false;
- console.log('error = ' + JSON.stringify(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));
+ });
+ }
- handleChange(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);
+ console.log("======>value" + value);
+ switch (fieldName) {
+ case "Name":
+ this.Name = value;
+ break;
+ case "CategoryThree":
+ this.CategoryThree = value;
+ break;
+ case "CategoryFour":
+ this.CategoryFour = value;
+ break;
+ case "CategoryFive":
+ this.CategoryFive = value;
+ break;
+ default:
+ console.log("no data");
+ }
+ }
+ dataChange(event) {
+ let fieldName = event.target.getAttribute("data-field");
let value = event.detail.value;
- console.log('======>fieldName' + fieldName);
- console.log('======>value' + value);
+ console.log("fieldName = " + fieldName + " value = " + value);
switch (fieldName) {
- case 'Name':
- this.Name = value;
- break;
- case 'CategoryThree':
- this.CategoryThree = value;
- break;
- case 'CategoryFour':
- this.CategoryFour = value;
- break;
- case 'CategoryFive':
- this.CategoryFive = value;
- break;
- default:
- console.log('no data');
- }
- }
- dataChange(event) {
- let fieldName = event.target.getAttribute('data-field');
- let value = event.detail.value;
- console.log('fieldName = ' + fieldName + ' value = ' + value);
- switch (fieldName) {
- case 'Name':
- this.Name = value;
- break;
- case 'CategoryThree':
+ case "Name":
+ this.Name = value;
+ break;
+ case "CategoryThree":
this.CategoryThree = value;
//璋冪敤鍚庡彴鏄剧ず绗洓浜斿垎绫�
this.showAllCate();
@@ -369,7 +338,7 @@
this.CategoryFive = '';
}
break;
- case 'CategoryFour':
+ case "CategoryFour":
this.CategoryFour = value;
//璋冪敤鍚庡彴鏄剧ず绗簲鍒嗙被
this.showCate();
@@ -377,242 +346,215 @@
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);
- }
- 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');
+ 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);
}
- })
- .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;
+ 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));
- this.showSpinner = false;
- });
- }
- inventoryCount() {
- this[NavigationMixin.Navigate]({
- type: 'standard__webPage',
- attributes: {
- url: '/lexinventory'
+ } else {
+ console.log("result = " + JSON.stringify(result));
+ this.showMyToast(result.msg,'','error');
}
+ }).catch((error) => {
+ console.log("error" + JSON.stringify(error));
});
}
- 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'
- }
- });
- }
+ 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;
- 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;
+ // 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'
+ }
+ });
+ }
- 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;
- });
- }
+ handleExpired() {
+ console.log('杩囨湡搴撳瓨鍛㈤攢瀛�');
+ this[NavigationMixin.Navigate]({
+ type: 'standard__webPage',
+ attributes: {
+ url: '/lexoverduestock'
+ }
+ });
- sortByMethod(field, reverse, primer) {
+ }
+ 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) {
const key = primer
? function (x) {
return primer(x[field]);
@@ -628,98 +570,86 @@
};
}
- 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 93200b0..8294ccc 100644
--- a/force-app/main/default/lwc/lwcDatatableUtility/lwcDatatableUtility.html
+++ b/force-app/main/default/lwc/lwcDatatableUtility/lwcDatatableUtility.html
@@ -1,32 +1,13 @@
<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>
@@ -41,101 +22,59 @@
</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"
- />
- <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"></input>
+ <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 b201755..a6ede92 100644
--- a/force-app/main/default/lwc/lwcDatatableUtility/lwcDatatableUtility.js
+++ b/force-app/main/default/lwc/lwcDatatableUtility/lwcDatatableUtility.js
@@ -1,34 +1,35 @@
-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';
@@ -37,32 +38,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;
@@ -70,98 +71,95 @@
//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;
}
@@ -170,7 +168,7 @@
handleKeyChange(event) {
window.clearTimeout(this.delayTimeout);
const searchKey = event.target.value;
- if (searchKey) {
+ if(searchKey){
this.delayTimeout = setTimeout(() => {
//this.paginationVisibility = HIDEDIV;
this.setPaginationControls();
@@ -179,119 +177,97 @@
//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 8292ef2..f33c4ea 100644
--- a/force-app/main/default/lwc/myCustomTypeDatatable/customName.html
+++ b/force-app/main/default/lwc/myCustomTypeDatatable/customName.html
@@ -1,7 +1,6 @@
<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 4bcd167..ae6203e 100644
--- a/force-app/main/default/lwc/myCustomTypeDatatable/customNumber.html
+++ b/force-app/main/default/lwc/myCustomTypeDatatable/customNumber.html
@@ -1,12 +1,6 @@
<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 52ecbd1..169416c 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 0440d2c..ba53413 100644
--- a/force-app/main/default/lwc/myCustomTypeDatatable/myCustomTypeDatatable.html
+++ b/force-app/main/default/lwc/myCustomTypeDatatable/myCustomTypeDatatable.html
@@ -1 +1,2 @@
-<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 d1ea9cd..5d161b7 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,7 +6,10 @@
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,
@@ -21,18 +24,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/pages/DealerInquiryModifyState.page b/force-app/main/default/pages/DealerInquiryModifyState.page
index 7398e3d..a8a3245 100644
--- a/force-app/main/default/pages/DealerInquiryModifyState.page
+++ b/force-app/main/default/pages/DealerInquiryModifyState.page
@@ -1,4 +1,4 @@
-<apex:page controller="DealerInquiryModifyStateController" showHeader="false" sidebar="false" id="allPage" action="{!init}">
+<apex:page controller="DealerInquiryModifyStateController" docType="html-5.0" showHeader="false" sidebar="false" id="allPage" action="{!init}" lightningStyleSheets="true">
<head>
<title>缁忛攢鍟嗘壒閲忎慨鏀硅浠风姸鎬�</title>
@@ -14,359 +14,397 @@
}
div.inline { float:left; }
+
.clearBoth { clear:both; }
-div.reportBlock table.list {
- width:auto;
-}
-div#out_Div { /* 銇撱亾銇儤銉冦儉銈掓牸绱� */
- position:relative;
- overflow: hidden;
- float:left;
- width:50.3%;
-
-}
-div#out_Div_L {
- position:relative;
- overflow:hidden;
- float:left;
- width:48%;
- border-right:2px solid #000
-}
-div#in_Div {/* tbody銇屽叆銇c仸銇勩倠銆傘亾銇撱亴銈广偗銉兗銉璞�*/
- position:relative;
- overflow: auto; /*銈广偗銉兗銉儛銉�*/
- float:left;
- width:51.8%;
- height: 373px; /* tbody銈掕〃绀恒仚銈嬮珮銇曘�佸緦銇s銇仸瑾挎暣 */
-
-}
-div#in_Div_L {
- position:relative;
- overflow-x:auto;
- overflow-y: hidden;
- float:left;
- width:48%;
- height: 373px;
- border-right:2px solid #000
-}
-body .pbBody table.list tr.headerRow td {
- box-sizing: border-box;
- text-align:center;font-weight:normal;
- padding:0px 0px 0px 1px;
-}
-body .pbBody table.list tr.headerRow td.header1 {
- text-align:center;font-weight:normal;
- padding:0px 0px 0px 0px;
-}
-body .pbBody table.list tr.dataRow td {
- box-sizing: border-box;
- padding:0px 0px 0px 1px; border-width: 0px 0px 1px 0px; vertical-align: middle; word-break:break-all;
-}
-body .pbBody table.list tr.dataRow td.dataCellBorder {
- /* 銇勩倝銇亜銆佷娇銇c仸銇勩仾銇� */
- padding:0px 0px 0px 1px; border-width: 0px 0px 1px 0px; vertical-align: middle; word-break:break-all;
-}
-body .pbBody table.list tr.dataRow td.dataCellBorder1 {
- padding:0px 0px 0px 1px;
- border-width: 0px 0px 1px 1px; vertical-align: middle; word-break:break-all;
-}
-@-moz-document url-prefix() {
-body .pbBody table.list tr.dataRow td.dataCellBorder1 {padding:0px 0px 0px 0px; border-width: 0px 0px 1px 1px; vertical-align: middle; word-break:break-all;}
-}
+ div.reportBlock table.list {
+ width:auto;
+ }
-table.list td {width:100px; }
-table.list td select {width:95%;}
-table.list td input {width:95%;}
-table.list td textarea {
- height:50px;
- width:90%;
-}
+ div#out_Div { /* 銇撱亾銇儤銉冦儉銈掓牸绱� */
+ position:relative;
+ overflow: hidden;
+ float:left;
+ width:50% !important;
+ }
-table.list .col_OCSM_Opportunity_No__c {width:120px;}
-table.list .col_Strategic_department_Class_Name__c{width:80px;}
-table.list .col_Change_To_Opportunity_T__c {width:155px;}
-table.list .col_Department_Cateogy__c {width: 90px;}
-table.list .col_Department_Name_Text__c {width: 80px;}
-table.list .col_Hospital_City_Master__c {width: 70px;}
-table.list .col_Agency_Hospital__c {width: 146px;}
-/*table.list .col_Oly_Forecasted_Date__c {width: 125px;}*/
-table.list .col_Oly_Forecast_this_month__c {width: 135px;}
-table.list .col_Oly_NM_Forecast__c {width: 135px;}
-table.list .col_Oly_Forecast_last_month__c {width: 135px;}
-table.list .col_Oly_Inquiry_Stage__c {width: 95px;}
-table.list .col_Oly_Authorized_DB_No__c {width: 95px;}
-table.list .col_Oly_Inquiry_Status2__c {width: 95px;}
-table.list .col_Oly_Inquiry_Status1__c {width: 50px;}
-table.list .col_Name {width:139px;} /*瀹㈡埛鍚�*/
-table.list .col_Salesdepartment_HP__c {width:95px;} /*閿�鍞湰閮�(鍖婚櫌)*/
-table.list .col_State_Master__c{width:80px;} /*鐪�*/
-table.list .col_HP_146POCM_Category_From_Dept__c {width:100px;} /*OCM鍒嗙被(鍏紡)*/
-table.list .col_Salesdepartment_DeptClass__c{width:120px;} /*閿�鍞湰閮�(绉戝鍒嗙被)*/
-table.list .col_OCM_man_province_HP__c{width:90px;} /*OCM绠$悊鐪�*/
-table.list .col_City_Master__c{width:80px;} /*甯�*/
-table.list .col_Grade__c {width:70px;} /*鏀垮簻绛夌骇*/
-table.list .col_Attribute_Type__c{width:90px;} /*鍖婚櫌鎵�灞炴�ц川*/
-table.list .col_Speciality_Type__c{width:90px;} /*鍖婚櫌涓撲笟鍖哄垎*/
-table.list .col_Service_customer__c{width:120px;} /*鍙绾︽湇鍔″悎鍚屽鎴�*/
-table.list .col_BF_owner__c{width:100px;} /*鍛煎惛绉戜富鎷呭綋*/
-table.list .col_ENT_owner_ID__c{width:100px;} /*鑰抽蓟鍠夌涓绘媴褰�*/
-table.list .col_GI_Main__c{width:100px;} /*娑堝寲绉戜富鎷呭綋*/
-table.list .col_URO_owner_ID__c{width:100px;} /*娉屽翱绉戜富鎷呭綋*/
-table.list .col_SP_Main__c{width:100px;} /*鏅绉戜富鎷呭綋*/
-table.list .col_GYN_owner__c{width:100px;} /*濡囩涓绘媴褰�*/
-table.list .col_Hospital_name_link__c{width:100px;} /*鍖婚櫌鍚�(閾炬帴)*/
-table.list .col_Segment__c{width:90px;} /*OCM绉戝绛夌骇*/
-table.list .col_Department_Budget_Sum_Price__c {width:128px;} /*绉戝棰勭畻鎬婚噾棰�(鍏�)*/
-table.list .col_Target_amount_CV290__c {width:118px;} /*鐩爣鏁帮細CV-290*/
-table.list .col_OPD_CV290__c {width:118px;} /*OPD瀵硅薄锛欳V-290*/
-table.list .col_Target_amount_EUME2__c {width:118px;} /*鐩爣鏁帮細EU-ME2*/
-table.list .col_OPD_EUME2__c {width:118px;} /*OPD瀵硅薄锛欵U-ME2*/
-table.list .col_Target_amount_CV170__c {width:118px;} /*鐩爣鏁帮細CV-170*/
-table.list .col_OPD_CV170__c {width:118px;} /*OPD瀵硅薄锛欳V-170*/
-table.list .col_Target_amount_OERAW__c {width:118px;} /*鐩爣鏁帮細OER-AW*/
-table.list .col_OPD_OERAW__c {width:118px;} /*OPD瀵硅薄锛歄ER-AW*/
-table.list .col_Target_amount_GW__c {width:118px;} /*鐩爣鏁帮細瀵间笣(GW)*/
-table.list .col_OPD_GW__c {width:118px;} /*OPD瀵硅薄锛氬涓�(GW)*/
-table.list .col_Target_amount_OTVS400__c {width:118px;} /*鐩爣鏁帮細OTV-S400*/
-table.list .col_OPD_OTVS400__c {width:118px;} /*OPD瀵硅薄锛歄TV-S400*/
-table.list .col_Target_amount_CHS400XZ__c {width:118px;} /*鐩爣鏁帮細CH-S400-XZ*/
-table.list .col_OPD_CHS400XZ__c {width:118px;} /*OPD瀵硅薄锛欳H-S400-XZ*/
-table.list .col_Target_amount_3D__c {width:118px;} /*鐩爣鏁帮細3D*/
-table.list .col_OPD_3D__c {width:118px;} /*OPD瀵硅薄锛�3D*/
-table.list .col_Target_amount_OTVS190__c {width:118px;} /*鐩爣鏁帮細OTV-S190*/
-table.list .col_OPD_OTVS190__c {width:118px;} /*OPD瀵硅薄锛歄TV-S190*/
-table.list .col_Target_amount_CV190__c {width:118px;} /*鐩爣鏁帮細CV-190*/
-table.list .col_OPD_CV190__c {width:118px;} /*OPD瀵硅薄锛欳V-190*/
-table.list .col_Target_amount_UCES3__c {width:118px;} /*鐩爣鏁帮細UCES-3*/
-table.list .col_OPD_UCES3__c {width:118px;} /*OPD瀵硅薄锛歎CES-3*/
-table.list .col_Target_amount_USG400__c {width:118px;} /*鐩爣鏁帮細USG-400*/
-table.list .col_OPD_USG400__c {width:118px;} /*OPD瀵硅薄锛歎SG-400*/
+ div#out_Div_L {
+ position:relative;
+ overflow:hidden;
+ float:left;
+ width:50% !important;
+ border-right:2px solid #808383
+ }
-table.list .col_Hospital_Name__c {width:139px;} /*鍖婚櫌鍚�*/
-table.list .col_Department_Name__c {width:60px;} /*绉戝鍚嶇О*/
+ div#in_Div {/* tbody銇屽叆銇c仸銇勩倠銆傘亾銇撱亴銈广偗銉兗銉璞�*/
+ position:relative;
+ overflow: auto; /*銈广偗銉兗銉儛銉�*/
+ float:left;
+ width:50% !important;
+ height: 600px;
+ }
-table.list .col_Province_formula__c {width:78px;} /*鐪�(鍏紡)*/
-table.list .col_X2_Largescale_Project__c {width:78px;} /****鏈夋棤涓ゅ勾浠ュ唴澶ч」鐩噰璐�*/
-table.list .col_Ideal_Image_Sales__c {width:148px;} /****鎷撳睍銉诲紑鎷撹鍒�/钀ラ攢鏂规(閿�鍞�)*/
-table.list .col_Review_Sales__c {width:148px;} /****杩涘睍鎯呭喌(閿�鍞�)*/
-table.list .col_Submit_proposal_document__c {width:58px;} /*鏄惁鎻愪氦鎻愭涔�*/
-table.list .col_OPP_Flag__c {width:58px;}
-table.list .col_Sales_activity_plan__c {width:178px;} /*娲诲姩璁″垝(閿�鍞�)*/
-/*table.list .col_Link1 {width:58px;}
-table.list .col_Link2 {width:58px;}
-table.list .col_Link3 {width:58px;}
-table.list .col_Link4 {width:58px;}
-table.list .col_Link5 {width:58px;}
-table.list .col_Link6 {width:58px;}
-table.list .col_Link7 {width:58px;}
-table.list .col_Link8 {width:58px;}*/
+ div#in_Div_L {
+ position:relative;
+ overflow-x:auto;
+ overflow-y: hidden;
+ float:left;
+ width:50% !important;
+ height: 600px;
+ border-right:2px solid #808383
+ }
-body .pbBody table.list tr.headerRow td.colViewing {
- /* 銉囥儠銈┿儷銉堝�ゃ�佹渶灏忓寲銈€偆銈炽兂銈掕〃绀� */
- background-image:url('{!URLFOR($Resource.IconResizeMinus_5)}') ;
- background-repeat:no-repeat;
-}
-body .pbBody table.list tr.headerRow td.colUnHideIcon {
- /* 鏈�澶у寲銈€偆銈炽兂銈掕〃绀� */
- background-image:url('{!URLFOR($Resource.IconResizePlus_5)}');
- background-repeat:no-repeat;
-}
-body .pbBody table.list tr.headerRow td.col_Scroll {width:0px; padding:0px; border-width:0px;}
-body .pbBody table.list tr.dataRow td.col_Scroll {width:0px; padding:0px; border-width:0px;}
-/*.zxk{
- margin-bottom: 3px;
-}*/
+ body .pbBody table.list tr.headerRow td {
+ box-sizing: border-box;
+ text-align:center;font-weight:normal;
+ padding:0px 0px 0px 1px;
+ }
+
+ body .pbBody table.list tr.headerRow td.header1 {
+ text-align:center;font-weight:normal;
+ padding:0px 0px 0px 0px;
+ }
+
+ body .pbBody table.list tr.dataRow td {
+ box-sizing: border-box;
+ padding:0px 0px 0px 1px; border-width: 0px 0px 1px 0px; vertical-align: middle; word-break:break-all;
+ }
+
+ body .pbBody table.list tr.dataRow td.dataCellBorder {
+ /* 銇勩倝銇亜銆佷娇銇c仸銇勩仾銇� */
+ padding:0px 0px 0px 1px; border-width: 0px 0px 1px 0px; vertical-align: middle; word-break:break-all;
+ }
+
+ body .pbBody table.list tr.dataRow td.dataCellBorder1 {
+ padding:0px 0px 0px 1px;
+ border-width: 0px 0px 1px 1px; vertical-align: middle; word-break:break-all;
+ }
+
+ @-moz-document url-prefix() {
+ body .pbBody table.list tr.dataRow td.dataCellBorder1 {padding:0px 0px 0px 0px; border-width: 0px 0px 1px 1px; vertical-align: middle; word-break:break-all;}
+ }
+
+ table.list td {width:100px; }
+
+ table.list td select {width:95%;}
+
+ table.list td input {width:95%;}
+
+ table.list td textarea {
+ height:50px;
+ width:90%;
+ }
+
+ table.list .col_OCSM_Opportunity_No__c {width:120px;}
+ table.list .col_Strategic_department_Class_Name__c{width:80px;}
+ table.list .col_Change_To_Opportunity_T__c {width:155px;}
+ table.list .col_Department_Cateogy__c {width: 90px;}
+ table.list .col_Department_Name_Text__c {width: 80px;}
+ table.list .col_Hospital_City_Master__c {width: 70px;}
+ table.list .col_Agency_Hospital__c {width: 146px;}
+ /*table.list .col_Oly_Forecasted_Date__c {width: 125px;}*/
+ table.list .col_Oly_Forecast_this_month__c {width: 135px;}
+ table.list .col_Oly_NM_Forecast__c {width: 135px;}
+ table.list .col_Oly_Forecast_last_month__c {width: 135px;}
+ table.list .col_Oly_Inquiry_Stage__c {width: 95px;}
+ table.list .col_Oly_Authorized_DB_No__c {width: 95px;}
+ table.list .col_Oly_Inquiry_Status2__c {width: 95px;}
+ table.list .col_Oly_Inquiry_Status1__c {width: 50px;}
+ table.list .col_Name {width:139px;} /*瀹㈡埛鍚�*/
+ table.list .col_Salesdepartment_HP__c {width:95px;} /*閿�鍞湰閮�(鍖婚櫌)*/
+ table.list .col_State_Master__c{width:80px;} /*鐪�*/
+ table.list .col_HP_146POCM_Category_From_Dept__c {width:100px;} /*OCM鍒嗙被(鍏紡)*/
+ table.list .col_Salesdepartment_DeptClass__c{width:120px;} /*閿�鍞湰閮�(绉戝鍒嗙被)*/
+ table.list .col_OCM_man_province_HP__c{width:90px;} /*OCM绠$悊鐪�*/
+ table.list .col_City_Master__c{width:80px;} /*甯�*/
+ table.list .col_Grade__c {width:70px;} /*鏀垮簻绛夌骇*/
+ table.list .col_Attribute_Type__c{width:90px;} /*鍖婚櫌鎵�灞炴�ц川*/
+ table.list .col_Speciality_Type__c{width:90px;} /*鍖婚櫌涓撲笟鍖哄垎*/
+ table.list .col_Service_customer__c{width:120px;} /*鍙绾︽湇鍔″悎鍚屽鎴�*/
+ table.list .col_BF_owner__c{width:100px;} /*鍛煎惛绉戜富鎷呭綋*/
+ table.list .col_ENT_owner_ID__c{width:100px;} /*鑰抽蓟鍠夌涓绘媴褰�*/
+ table.list .col_GI_Main__c{width:100px;} /*娑堝寲绉戜富鎷呭綋*/
+ table.list .col_URO_owner_ID__c{width:100px;} /*娉屽翱绉戜富鎷呭綋*/
+ table.list .col_SP_Main__c{width:100px;} /*鏅绉戜富鎷呭綋*/
+ table.list .col_GYN_owner__c{width:100px;} /*濡囩涓绘媴褰�*/
+ table.list .col_Hospital_name_link__c{width:100px;} /*鍖婚櫌鍚�(閾炬帴)*/
+ table.list .col_Segment__c{width:90px;} /*OCM绉戝绛夌骇*/
+ table.list .col_Department_Budget_Sum_Price__c {width:128px;} /*绉戝棰勭畻鎬婚噾棰�(鍏�)*/
+ table.list .col_Target_amount_CV290__c {width:118px;} /*鐩爣鏁帮細CV-290*/
+ table.list .col_OPD_CV290__c {width:118px;} /*OPD瀵硅薄锛欳V-290*/
+ table.list .col_Target_amount_EUME2__c {width:118px;} /*鐩爣鏁帮細EU-ME2*/
+ table.list .col_OPD_EUME2__c {width:118px;} /*OPD瀵硅薄锛欵U-ME2*/
+ table.list .col_Target_amount_CV170__c {width:118px;} /*鐩爣鏁帮細CV-170*/
+ table.list .col_OPD_CV170__c {width:118px;} /*OPD瀵硅薄锛欳V-170*/
+ table.list .col_Target_amount_OERAW__c {width:118px;} /*鐩爣鏁帮細OER-AW*/
+ table.list .col_OPD_OERAW__c {width:118px;} /*OPD瀵硅薄锛歄ER-AW*/
+ table.list .col_Target_amount_GW__c {width:118px;} /*鐩爣鏁帮細瀵间笣(GW)*/
+ table.list .col_OPD_GW__c {width:118px;} /*OPD瀵硅薄锛氬涓�(GW)*/
+ table.list .col_Target_amount_OTVS400__c {width:118px;} /*鐩爣鏁帮細OTV-S400*/
+ table.list .col_OPD_OTVS400__c {width:118px;} /*OPD瀵硅薄锛歄TV-S400*/
+ table.list .col_Target_amount_CHS400XZ__c {width:118px;} /*鐩爣鏁帮細CH-S400-XZ*/
+ table.list .col_OPD_CHS400XZ__c {width:118px;} /*OPD瀵硅薄锛欳H-S400-XZ*/
+ table.list .col_Target_amount_3D__c {width:118px;} /*鐩爣鏁帮細3D*/
+ table.list .col_OPD_3D__c {width:118px;} /*OPD瀵硅薄锛�3D*/
+ table.list .col_Target_amount_OTVS190__c {width:118px;} /*鐩爣鏁帮細OTV-S190*/
+ table.list .col_OPD_OTVS190__c {width:118px;} /*OPD瀵硅薄锛歄TV-S190*/
+ table.list .col_Target_amount_CV190__c {width:118px;} /*鐩爣鏁帮細CV-190*/
+ table.list .col_OPD_CV190__c {width:118px;} /*OPD瀵硅薄锛欳V-190*/
+ table.list .col_Target_amount_UCES3__c {width:118px;} /*鐩爣鏁帮細UCES-3*/
+ table.list .col_OPD_UCES3__c {width:118px;} /*OPD瀵硅薄锛歎CES-3*/
+ table.list .col_Target_amount_USG400__c {width:118px;} /*鐩爣鏁帮細USG-400*/
+ table.list .col_OPD_USG400__c {width:118px;} /*OPD瀵硅薄锛歎SG-400*/
+ table.list .col_Hospital_Name__c {width:139px;} /*鍖婚櫌鍚�*/
+ table.list .col_Department_Name__c {width:60px;} /*绉戝鍚嶇О*/
+ table.list .col_Province_formula__c {width:78px;} /*鐪�(鍏紡)*/
+ table.list .col_X2_Largescale_Project__c {width:78px;} /****鏈夋棤涓ゅ勾浠ュ唴澶ч」鐩噰璐�*/
+ table.list .col_Ideal_Image_Sales__c {width:148px;} /****鎷撳睍銉诲紑鎷撹鍒�/钀ラ攢鏂规(閿�鍞�)*/
+ table.list .col_Review_Sales__c {width:148px;} /****杩涘睍鎯呭喌(閿�鍞�)*/
+ table.list .col_Submit_proposal_document__c {width:58px;} /*鏄惁鎻愪氦鎻愭涔�*/
+ table.list .col_OPP_Flag__c {width:58px;}
+ table.list .col_Sales_activity_plan__c {width:178px;} /*娲诲姩璁″垝(閿�鍞�)*/
+ /*table.list .col_Link1 {width:58px;}
+ table.list .col_Link2 {width:58px;}
+ table.list .col_Link3 {width:58px;}
+ table.list .col_Link4 {width:58px;}
+ table.list .col_Link5 {width:58px;}
+ table.list .col_Link6 {width:58px;}
+ table.list .col_Link7 {width:58px;}
+ table.list .col_Link8 {width:58px;}*/
+ body .pbBody table.list tr.headerRow td.colViewing {
+ /* 銉囥儠銈┿儷銉堝�ゃ�佹渶灏忓寲銈€偆銈炽兂銈掕〃绀� */
+ background-image:url('{!URLFOR($Resource.IconResizeMinus_5)}') ;
+ background-repeat:no-repeat;
+ }
+ body .pbBody table.list tr.headerRow td.colUnHideIcon {
+ /* 鏈�澶у寲銈€偆銈炽兂銈掕〃绀� */
+ background-image:url('{!URLFOR($Resource.IconResizePlus_5)}');
+ background-repeat:no-repeat;
+ }
+ body .pbBody table.list tr.headerRow td.col_Scroll {width:0px; padding:0px; border-width:0px;}
+ body .pbBody table.list tr.dataRow td.col_Scroll {width:0px; padding:0px; border-width:0px;}
+ /*.zxk{
+ margin-bottom: 3px;
+ }*/
+ .buttonStyle{
+ font-size: 14px !important;
+ font-family: 'sans-serif' !important;
+ font-weight:500 !important;
+ width: 70px !important;
+ height: 32px !important;
+ border-radius: 4px !important;
+ opacity: 1 !important;
+ background:#090F84 !important;
+ color:#FFFFFF !important;
+
+ }
+
+
</style>
<script type="text/javascript">
var heightAjustment = 120;
var widthAjustment = 30;
function setChangeFlgRight(cnt) {
document.getElementById('allPage:allForm:oppBlock:oppTable:' + cnt + ':changeFlgRt').value = 1;
+
}
</script>
</head>
+ <apex:slds />
+ <div id="spinner" class="slds-spinner_container" style="display:none;">
+ <div role="status" class="slds-spinner slds-spinner_medium slds-spinner_brand">
+ <span class="slds-assistive-text">Loading</span>
+ <div class="slds-spinner__dot-a"></div>
+ <div class="slds-spinner__dot-b"></div>
+ </div>
+ </div>
<apex:form id="allForm">
-
- <apex:actionFunction name="saveAndSearch" action="{!save}" rerender="allPanel" oncomplete="unblockUI();expandAll();">
+ <apex:actionFunction name="saveAndSearch" action="{!save}" rerender="allPanel" oncomplete="closeSpinner();expandAll();">
<apex:param name="firstParam" assignTo="{!saveType}" value="" />
</apex:actionFunction>
- <apex:actionFunction name="saveAndSort" action="{!save}" rerender="allPanel" oncomplete="unblockUI();expandAll();">
+ <apex:actionFunction name="saveAndSort" action="{!save}" rerender="allPanel" oncomplete="closeSpinner();expandAll();">
<apex:param name="firstParam" assignTo="{!saveType}" value="" />
<apex:param name="secondParam" assignTo="{!sortKey}" value="" />
</apex:actionFunction>
- <apex:actionFunction name="searchOpp" action="{!chick}" rerender="allPanel" oncomplete="unblockUI();expandAll();"/>
- <apex:actionFunction name="sortTable" action="{!sortTable}" rerender="allPanel" oncomplete="unblockUI();expandAll();">
+ <apex:actionFunction name="searchOpp" action="{!chick}" rerender="allPanel" oncomplete="closeSpinner();expandAll();"/>
+ <apex:actionFunction name="sortTable" action="{!sortTable}" rerender="allPanel" oncomplete="closeSpinner();expandAll();">
<apex:param name="firstParam" assignTo="{!sortKey}" value="" />
</apex:actionFunction>
<apex:outputPanel id="allPanel">
<div id="zxk" style="margin-bottom: -15px;">
<apex:pageBlock id="searchBlock" mode="maindetail">
- <!-- tabStyle="Report"绾㈣壊 mode="maindetail" 娑堝け mode="edit" 鍙樺ぇ -->
- <!-- <apex:pageMessages ></apex:pageMessages> -->
- <!-- <table style="border-bottom-width: 0px; font-size:12px;">
+ <table style="border-bottom-width: 0px; font-size:14px;color:#696969;">
<tr>
- <td width="150px">
- <apex:commandButton action="{!save}" value="淇濆瓨" rerender="allPanel" onclick="blockme();" oncomplete="unblockUI();expandAll();" style="height:30px;width:50px;"/>
- <apex:commandButton value="妫�绱�" onclick="searchOppJs_Account();return false;" style="height:30px;width:70px;"/>
+ <td width="283px">
+ <div style="color:#696969;">
+ 缁忛攢鍟嗗尰闄�
+ <apex:inputText styleClass="slds-input" value="{!accSearch}" style="width:170px"/>
+ </div>
</td>
- <td width="1000px">
- <apex:pageMessages />
+ <td width="250px">
+ <div style="color:#696969;">
+ 閿�鍞媴褰�
+ <apex:inputText styleClass="slds-input" value="{!aooSearch}" style="width:150px"/>
+ </div>
</td>
- </tr>
- </table> -->
- <table style="border-bottom-width: 0px; font-size:12px;">
- <tr>
- <!-- <td width="150px">鍒嗙被 <apex:selectList value="{!accType}" size="1" style="width:80px" id="accType"><apex:selectOptions value="{!accTypeOpts}" id="accTypeOptsId"/></apex:selectList></td> -->
- <td width="250px">缁忛攢鍟嗗尰闄� <apex:inputText value="{!accSearch}" style="width:170px"/>銆�</td>
- <td></td>
- <td width="250px"> 閿�鍞媴褰� <apex:inputText value="{!aooSearch}" style="width:150px"/>銆�</td>
- <td width="230px"> 鏄剧ず
- <apex:selectList value="{!limits}" size="1" onchange="searchOppJs_Account();return false;">
- <apex:selectOptions value="{!limitOpts}"/></apex:selectList>銆�鏉℃暟鎹�
+ <td width="230px">
+ <div style="color:#696969;">
+ 鏄剧ず
+ <apex:selectList styleClass="slds-input slds-combobox__input" style="width:100px;" value="{!limits}" size="1" onchange="searchOppJs_Account();return false;">
+ <apex:selectOptions value="{!limitOpts}"/>
+ </apex:selectList>
+ 鏉℃暟鎹�
+ </div>
</td>
- <!-- <td width="10px"></td> -->
- <td width="70px"><a href="#" onclick="expandAll();return false;" style="text-decoration: underline;">鍏ㄩ儴灞曞紑</a></td>
-<!-- text-decoration: underline; -->
+ <td><a href="#" onclick="expandAll();return false;" style="text-decoration: underline;color:#696969;">鍏ㄩ儴灞曞紑</a></td>
</tr>
</table>
- <table style="border-bottom-width: 0px; font-size:12px;">
+ <p style="height:10px;"></p>
+ <table style="border-bottom-width: 0px; font-size:12px;font-size:14px;color:#696969;">
<tr>
- <td width="200px">
- <font>鏁� 鎹� 瀛� 娈� </font>
- <apex:selectList value="{!numtext1}" size="1" style="width:110px"><apex:selectOptions value="{!textOpts}"/></apex:selectList>
+ <td width="220px">
+ <div style="color:#696969;">
+ <font>鏁� 鎹� 瀛� 娈�</font>
+ <apex:selectList styleClass="slds-input slds-combobox__input" value="{!numtext1}" size="1" style="width:110px">
+ <apex:selectOptions value="{!textOpts}"/>
+ </apex:selectList>
+ </div>
</td>
<td width="130px">
-
- <apex:selectList value="{!numtext2}" size="1" style="width:110px"><apex:selectOptions value="{!equalOpts}"/></apex:selectList>
+ <apex:selectList styleClass="slds-input slds-combobox__input" value="{!numtext2}" size="1" style="width:110px">
+ <apex:selectOptions value="{!equalOpts}"/>
+ </apex:selectList>
</td>
- <td width="200px">
- <apex:inputText style="width:150px" value="{!numtext}"/>
+ <td width="183px">
+ <apex:inputText styleClass="slds-input" style="width:150px" value="{!numtext}"/>
</td>
- <td width="150px">
- <apex:commandButton value="妫�绱�" onclick="searchOppJs_Account();return false;" style="height:30px;width:50px;"/>
- <apex:commandButton action="{!save}" value="淇濆瓨" rerender="allPanel" onclick="blockme();" oncomplete="unblockUI();expandAll();" style="height:30px;width:50px;"/>
+ <td width="188px">
+ <!-- slds-button slds-button_brand -->
+ <apex:commandButton styleClass="buttonStyle" value="妫�绱�" onclick="searchOppJs_Account();return false;" style="height:30px;width:70px;"/>
+ <apex:commandButton styleClass="buttonStyle" action="{!save}" value="淇濆瓨" rerender="allPanel" onclick="showSpinner();" oncomplete="closeSpinner();expandAll();" style="height:30px;width:70px;"/>
</td>
- <td width="500px">
- <apex:pageMessages />
+ <td>
+ <!-- <apex:pageMessages /> -->
+ <!-- add by Link 2023-6-2 -->
+ <apex:outputPanel rendered="{! remindMsg != '' && remindMsg != null}">
+ <div style="border: 1px solid #D4D4D4;height:32px;border-radius:5px;color:#ff6a00;font-size:18px;">
+ <span class="slds-icon_container slds-icon-custom-custom53 slds-icon-text-default" >
+ <svg aria-hidden="true" class="slds-icon">
+ <use xmlns:xlink="http://www.w3.org/1999/xlink"
+ xlink:href="/apexpages/slds/latest/assets/icons/custom-sprite/svg/symbols.svg#custom53">
+ </use>
+ </svg>
+ <span class="slds-assistive-text">Custom 53</span>
+ </span>
+ <strong style="padding-top: 2px;"> {!remindMsg}</strong>
+ </div>
+ </apex:outputPanel>
</td>
</tr>
- <!-- <tr>
- <td width="110px">
- <font> 鏃� 鏈� </font>
- <apex:selectList value="{!timetext1}" size="1" style="width:110px"><apex:selectOptions value="{!timeOpts}"/></apex:selectList>
- </td>
- <td>
- 浠�<apex:inputField style="width:150px" value="{!tmpAO.MaxActivityDate__c}"/> -->
- <!-- <apex:selectList value="{!timetext2}" size="1" style="width:110px"><apex:selectOptions value="{!timeequalOpts}"/></apex:selectList> -->
- <!-- </td>
- <td>
- 鍒�<apex:inputField style="width:150px" value="{!tmpBO.MaxActivityDate__c}"/>
- </td>
- </tr> -->
</table>
</apex:pageBlock>
</div>
- <apex:pageBlock id="oppBlock" >
- <!-- <apex:pageblocksection columns="1" id="oppSection"> -->
- <apex:outputPanel >
- <apex:inputHidden id="oppCount" value="{!oppCount}"/>
-
- <div id="out_Div_L">
- <table class="list" style="border-bottom-width: 0px; width:1100px; font-size:11px; border-spacing:0;" border="" id="tableHeader">
- <tr class="dataRow" height="1px">
- <apex:variable value="{!0}" var="cnt" />
- <apex:repeat value="{!titleRight}" var="t">
- <td class="col_{!columnRightCss[cnt]}"></td>
- <apex:variable value="{!cnt + 1}" var="cnt" />
- </apex:repeat>
- <td id="cell_Scroll" class="col_Scroll"></td>
- </tr>
+ <!-- <div style="border: 1px solid #D4D4D4;border-top: 3px solid #51606E;border-radius:5px;margin-bottom:7px;"> -->
+ <apex:pageBlock id="oppBlock" mode="maindetail">
+ <!-- <apex:pageblocksection columns="1" id="oppSection"> -->
+ <apex:outputPanel >
+ <apex:inputHidden id="oppCount" value="{!oppCount}"/>
+
+ <div id="out_Div_L">
+ <table class="list" style="border-bottom-width: 0px; width:1100px; font-size:14px !important; border-spacing:0;" border="" id="tableHeader">
+ <tr class="dataRow" height="1px">
+ <apex:variable value="{!0}" var="cnt" />
+ <apex:repeat value="{!titleRight}" var="t">
+ <td class="col_{!columnRightCss[cnt]}"></td>
+ <apex:variable value="{!cnt + 1}" var="cnt" />
+ </apex:repeat>
+ <td id="cell_Scroll" class="col_Scroll"></td>
+ </tr>
+ <tr class="headerRow" height="30px">
+ <apex:variable value="{!0}" var="cnt" />
+ <apex:repeat value="{!titleRight}" var="t">
+ <td class="col_{!columnRightCss[cnt]}">
+ <a href="#" onclick="sortTableJs_Account1('{!cnt + titleLeft.size}');return false;" style="text-decoration: underline;color:black;font-size:14px !important;font-weight: bold;"><apex:outputText value="{!t}"/></a>{!sortOrder[cnt + titleLeft.size]}
+ </td>
+ <apex:variable value="{!cnt + 1}" var="cnt" />
+ </apex:repeat>
+ <!-- <td id="cell_Scroll" class="col_Scroll"></td> -->
+ </tr>
+ </table>
+ </div>
+ <div id="out_Div">
+ <table class="list" style="border-bottom-width: 0px; width:2000px; font-size:14px !important; border-spacing:0;" border="" id="tableHeader_L">
+ <tr class="dataRow" height="1px">
+ <apex:variable value="{!0}" var="cnt" />
+ <apex:repeat value="{!titleLeft}" var="t">
+ <td class="col_{!columnLeftCss[cnt]}"></td>
+ <apex:variable value="{!cnt + 1}" var="cnt" />
+ </apex:repeat>
+ </tr>
<tr class="headerRow" height="30px">
- <apex:variable value="{!0}" var="cnt" />
- <apex:repeat value="{!titleRight}" var="t">
- <td class="col_{!columnRightCss[cnt]}">
- <a href="#" onclick="sortTableJs_Account1('{!cnt + titleLeft.size}');return false;" style="text-decoration: underline;"><apex:outputText value="{!t}"/></a>{!sortOrder[cnt + titleLeft.size]}
- </td>
- <apex:variable value="{!cnt + 1}" var="cnt" />
- </apex:repeat>
- <!-- <td id="cell_Scroll" class="col_Scroll"></td> -->
- </tr>
- </table>
- </div>
- <div id="out_Div">
- <table class="list" style="border-bottom-width: 0px; width:2000px; font-size:11px; border-spacing:0;" border="" id="tableHeader_L">
- <tr class="dataRow" height="1px">
- <apex:variable value="{!0}" var="cnt" />
- <apex:repeat value="{!titleLeft}" var="t">
- <td class="col_{!columnLeftCss[cnt]}"></td>
- <apex:variable value="{!cnt + 1}" var="cnt" />
- </apex:repeat>
- </tr>
- <tr class="headerRow" height="30px">
- <apex:variable value="{!0}" var="cnt" />
- <apex:repeat value="{!titleLeft}" var="t">
- <td class="col_{!columnLeftCss[cnt]}">
- <a href="#" onclick="sortTableJs_Account1('{!cnt}');return false;" style="text-decoration: underline;"><apex:outputText value="{!t}"/></a>{!sortOrder[cnt]}
- </td>
- <apex:variable value="{!cnt + 1}" var="cnt" />
- </apex:repeat>
- <!-- <td id="cell_Scroll" class="col_Scroll"></td> -->
+ <apex:variable value="{!0}" var="cnt" />
+ <apex:repeat value="{!titleLeft}" var="t">
+ <td class="col_{!columnLeftCss[cnt]}">
+ <a href="#" onclick="sortTableJs_Account1('{!cnt}');return false;" style="text-decoration: underline;color:black;font-size:14px !important;font-weight: bold;"><apex:outputText value="{!t}"/></a>{!sortOrder[cnt]}
+ </td>
+ <apex:variable value="{!cnt + 1}" var="cnt" />
+ </apex:repeat>
+ <!-- <td id="cell_Scroll" class="col_Scroll"></td> -->
</tr>
</table>
</div> <!-- out_Div -->
<div style="clear:both;height:0px;"></div>
<div id="in_Div_L">
- <table class="list" style="border-bottom-width: 0px;width:1100px; font-size:11px; border-spacing:0;" border="" id="tableData">
+ <table class="list" style="border-bottom-width: 0px;width:1100px; font-size:13px; border-spacing:0;" border="" id="tableData">
<apex:variable value="{!1}" var="cnt" />
<apex:repeat value="{!oppRecords}" var="or" id="oppTable">
- <tr class="dataRow {!IF(MOD(cnt, 2)==0, 'odd', 'even')} {!IF(cnt==1, 'first', '')}" onmouseover="if (window.hiOn){hiOn(this);} " onmouseout="if (window.hiOff){hiOff(this);} " onblur="if (window.hiOff){hiOff(this);}" onfocus="if (window.hiOn){hiOn(this);}">
- <apex:variable value="{!0}" var="cnt_3" />
- <apex:repeat value="{!columnsRightApi}" var="c">
- <td class="dataCellBorder1 col_{!columnRightCss[cnt_3]} {!cnt}_col_{!columnRightCss[cnt_3]}">
-
- <!-- vivek start -->
- <!-- <apex:outputLink rendered="{!c[0]=='Name'}" value="/{!or.opp.Id}" target="LINK_{!or.opp.Id}"><apex:outputField rendered="{!c[0]=='Name'}" value="{!or.opp[c[0]]}" /></apex:outputLink> -->
- <!-- vivek end -->
- <!-- <apex:outputField id="q1111111111" rendered="{!(c.size==1 && columnRightRW[c[0]]=='r' && or.opp.Id <> null && c[0] <> 'Name' && (c[0] <> 'Opp_Changed_Field__c' ||(c[0] == 'Opp_Changed_Field__c' &&
- or.opp.Opp_Changed_Field__c != '璇环闃舵鍙戠敓浜嗗彉鍖�' &&or.opp.Opp_Changed_Field__c != '棰勬祴绛剧害鏃ュ彂鐢熶簡鍙樺寲' &&or.opp.Opp_Changed_Field__c != '鍖婚櫌鍚堝悓閲戦鍙戠敓浜嗗彉鍖�' && or.opp.Opp_Changed_Field__c != '璁㈣揣閲戦鍙戠敓浜嗗彉鍖�')))}" value="{!or.opp[c[0]]}" /> && or.opp.Oly_Inquiry_Status1__c <> null AgcOpp -->
- <apex:outputField rendered="{!c[0] == 'Change_To_Opportunity_T__c' }" value="{!or.opp[c[0]]}" />
-
- <apex:outputField rendered="{!columnRightRW[c[0]]=='r' && c[0] <> 'Change_To_Opportunity_T__c' && c[0] <> 'Strategic_department_Class_Name__c' }" value="{!or.opp[c[0]]}" />
- <!-- <apex:outputField id="q1111111111" rendered="{!( columnRightRW[c[0]]=='r' && c[0] <> 'Name' && (c[0] <> 'StageName__c' ||(c[0] == 'StageName__c' &&
- or.opp.Oly_Inquiry_Stage__c != '璇环闃舵鍙戠敓浜嗗彉鍖�' &&or.opp.Oly_Inquiry_Stage__c != '棰勬祴绛剧害鏃ュ彂鐢熶簡鍙樺寲' &&or.opp.Oly_Inquiry_Stage__c != '鍖婚櫌鍚堝悓閲戦鍙戠敓浜嗗彉鍖�' && or.opp.Oly_Inquiry_Stage__c != '璁㈣揣閲戦鍙戠敓浜嗗彉鍖�')))}" value="{!or.opp[c[0]]}" /> -->
- <!-- <div style ="color:red"> -->
- <!-- <apex:outputField id="q2222222" rendered="{!(c.size==1 && columnRightRW[c[0]]=='r' && or.opp.Id <> null && c[0] <> 'Name' && c[0] == 'Opp_Changed_Field__c' && (
- or.opp.Opp_Changed_Field__c == '璇环闃舵鍙戠敓浜嗗彉鍖�' || or.opp.Opp_Changed_Field__c == '棰勬祴绛剧害鏃ュ彂鐢熶簡鍙樺寲' || or.opp.Opp_Changed_Field__c == '鍖婚櫌鍚堝悓閲戦鍙戠敓浜嗗彉鍖�' || or.opp.Opp_Changed_Field__c == '璁㈣揣閲戦鍙戠敓浜嗗彉鍖�'))}" value="{!or.opp[c[0]]}" /> -->
- <!-- <apex:outputField id="q2222222" rendered="{!(c.size==1 && columnRightRW[c[0]]=='r' && c[0] <> 'Name' && c[0] == 'StageName__c' && (
+ <tr class="dataRow {!IF(MOD(cnt, 2)==0, 'odd', 'even')} {!IF(cnt==1, 'first', '')}" style="height:35px;" onmouseover="if (window.hiOn){hiOn(this);} " onmouseout="if (window.hiOff){hiOff(this);} " onblur="if (window.hiOff){hiOff(this);}" onfocus="if (window.hiOn){hiOn(this);}">
+ <apex:variable value="{!0}" var="cnt_3" />
+ <apex:repeat value="{!columnsRightApi}" var="c">
+ <td class="dataCellBorder1 col_{!columnRightCss[cnt_3]} {!cnt}_col_{!columnRightCss[cnt_3]}">
+
+ <!-- vivek start -->
+ <!-- <apex:outputLink rendered="{!c[0]=='Name'}" value="/{!or.opp.Id}" target="LINK_{!or.opp.Id}"><apex:outputField rendered="{!c[0]=='Name'}" value="{!or.opp[c[0]]}" /></apex:outputLink> -->
+ <!-- vivek end -->
+ <!-- <apex:outputField id="q1111111111" rendered="{!(c.size==1 && columnRightRW[c[0]]=='r' && or.opp.Id <> null && c[0] <> 'Name' && (c[0] <> 'Opp_Changed_Field__c' ||(c[0] == 'Opp_Changed_Field__c' &&
+ or.opp.Opp_Changed_Field__c != '璇环闃舵鍙戠敓浜嗗彉鍖�' &&or.opp.Opp_Changed_Field__c != '棰勬祴绛剧害鏃ュ彂鐢熶簡鍙樺寲' &&or.opp.Opp_Changed_Field__c != '鍖婚櫌鍚堝悓閲戦鍙戠敓浜嗗彉鍖�' && or.opp.Opp_Changed_Field__c != '璁㈣揣閲戦鍙戠敓浜嗗彉鍖�')))}" value="{!or.opp[c[0]]}" /> && or.opp.Oly_Inquiry_Status1__c <> null AgcOpp -->
+ <apex:outputField rendered="{!c[0] == 'Change_To_Opportunity_T__c' }" value="{!or.opp[c[0]]}" />
+
+ <apex:outputField rendered="{!columnRightRW[c[0]]=='r' && c[0] <> 'Change_To_Opportunity_T__c' && c[0] <> 'Strategic_department_Class_Name__c' }" value="{!or.opp[c[0]]}" />
+ <!-- <apex:outputField id="q1111111111" rendered="{!( columnRightRW[c[0]]=='r' && c[0] <> 'Name' && (c[0] <> 'StageName__c' ||(c[0] == 'StageName__c' &&
+ or.opp.Oly_Inquiry_Stage__c != '璇环闃舵鍙戠敓浜嗗彉鍖�' &&or.opp.Oly_Inquiry_Stage__c != '棰勬祴绛剧害鏃ュ彂鐢熶簡鍙樺寲' &&or.opp.Oly_Inquiry_Stage__c != '鍖婚櫌鍚堝悓閲戦鍙戠敓浜嗗彉鍖�' && or.opp.Oly_Inquiry_Stage__c != '璁㈣揣閲戦鍙戠敓浜嗗彉鍖�')))}" value="{!or.opp[c[0]]}" /> -->
+ <!-- <div style ="color:red"> -->
+ <!-- <apex:outputField id="q2222222" rendered="{!(c.size==1 && columnRightRW[c[0]]=='r' && or.opp.Id <> null && c[0] <> 'Name' && c[0] == 'Opp_Changed_Field__c' && (
+ or.opp.Opp_Changed_Field__c == '璇环闃舵鍙戠敓浜嗗彉鍖�' || or.opp.Opp_Changed_Field__c == '棰勬祴绛剧害鏃ュ彂鐢熶簡鍙樺寲' || or.opp.Opp_Changed_Field__c == '鍖婚櫌鍚堝悓閲戦鍙戠敓浜嗗彉鍖�' || or.opp.Opp_Changed_Field__c == '璁㈣揣閲戦鍙戠敓浜嗗彉鍖�'))}" value="{!or.opp[c[0]]}" /> -->
+ <!-- <apex:outputField id="q2222222" rendered="{!(c.size==1 && columnRightRW[c[0]]=='r' && c[0] <> 'Name' && c[0] == 'StageName__c' && (
or.opp.Oly_Inquiry_Stage__c == '璇环闃舵鍙戠敓浜嗗彉鍖�' || or.opp.Oly_Inquiry_Stage__c == '棰勬祴绛剧害鏃ュ彂鐢熶簡鍙樺寲' || or.opp.Oly_Inquiry_Stage__c == '鍖婚櫌鍚堝悓閲戦鍙戠敓浜嗗彉鍖�' || or.opp.Oly_Inquiry_Stage__c == '璁㈣揣閲戦鍙戠敓浜嗗彉鍖�'))}" value="{!or.opp[c[0]]}" />
-
- </div> -->
+
+ </div> -->
<!-- <apex:inputField rendered="{!(c.size==1 && columnRightRW[c[0]]=='w' && or.opp.Id <> null && c[0] <> 'Name')}" value="{!or.opp[c[0]]}" onchange="setChangeFlgRight('{!or.lineNo}')"/>
- <apex:outputPanel rendered="{!(c.size==1 && columnRightRW[c[0]]=='wm' && c[0] <> 'Name' && or.opp.Id <> null)}" layout="none">
- <div class="requiredInput_r">
- <div class="requiredBlock_r"></div>
- <apex:inputField value="{!or.Opp[c[0]]}" onchange="setChangeFlg('{!or.lineNo}')"/>
- </div>
+ <apex:outputPanel rendered="{!(c.size==1 && columnRightRW[c[0]]=='wm' && c[0] <> 'Name' && or.opp.Id <> null)}" layout="none">
+ <div class="requiredInput_r">
+ <div class="requiredBlock_r"></div>
+ <apex:inputField value="{!or.Opp[c[0]]}" onchange="setChangeFlg('{!or.lineNo}')"/>
+ </div>
</apex:outputPanel> -->
<apex:outputField rendered="{!c[0] == 'Strategic_department_Class_Name__c'}" value="{!or.opp[c[0]]}" />
- <apex:inputField rendered="{!( columnRightRW[c[0]]=='w' && c[0] <> 'Strategic_department_Class_Name__c' && c[0] <> 'Change_To_Opportunity_T__c' && c[0] <> 'Name')}" value="{!or.opp[c[0]]}" onchange="setChangeFlgRight('{!or.lineNo}')"/>
+ <apex:inputField styleClass="slds-form-element" rendered="{!( columnRightRW[c[0]]=='w' && c[0] <> 'Strategic_department_Class_Name__c' && c[0] <> 'Change_To_Opportunity_T__c' && c[0] <> 'Name')}" value="{!or.opp[c[0]]}" onchange="setChangeFlgRight('{!or.lineNo}')"/>
<apex:outputPanel rendered="{!( columnRightRW[c[0]]=='wm' && c[0] <> 'Change_To_Opportunity_T__c' && c[0] <> 'Name' )}" layout="none">
- <div class="requiredInput_r">
+ <div class="requiredInput_r">
<div class="requiredBlock_r"></div>
- <apex:inputField value="{!or.Opp[c[0]]}" onchange="setChangeFlg('{!or.lineNo}')"/>
- </div>
- </apex:outputPanel>
- <apex:variable value="{!cnt_3 + 1}" var="cnt_3" />
- </td>
- </apex:repeat>
- <td id="cell_Scroll" class="col_Scroll">
- <apex:inputHidden value="{!or.changeFlg}" id="changeFlg"/>
- <apex:inputHidden value="{!or.changeFlgRt}" id="changeFlgRt"/>
- <script type="text/javascript">
+ <apex:inputField styleClass="slds-form-element" value="{!or.Opp[c[0]]}" onchange="setChangeFlg('{!or.lineNo}')"/>
+ </div>
+ </apex:outputPanel>
+ <apex:variable value="{!cnt_3 + 1}" var="cnt_3" />
+ </td>
+ </apex:repeat>
+ <td id="cell_Scroll" class="col_Scroll">
+ <apex:inputHidden value="{!or.changeFlg}" id="changeFlg"/>
+ <apex:inputHidden value="{!or.changeFlgRt}" id="changeFlgRt"/>
+ <script type="text/javascript">
if ("{!or.canEdit}" == "false") {
var right = j$("#tableData").find("tr").eq({!cnt-1});
var rightline = j$(right).find("td");
@@ -389,68 +427,69 @@
var leftFirst = j$(left).find("td").eq(1);
j$(leftFirst).css("background-color", "red");
}
- </script>
+ </script>
</td>
- </tr>
- <apex:variable value="{!cnt + 1}" var="cnt" />
- </apex:repeat>
- </table>
- </div>
- <div id="in_Div">
- <table class="list" style="border-bottom-width: 0px;width:2000px; font-size:11px; border-spacing:0;" border="" id="tableData_L">
- <apex:variable value="{!1}" var="cnt_2" />
- <apex:repeat value="{!oppRecords}" var="or" id="oppTable_L">
- <tr class="dataRow {!IF(MOD(cnt, 2)==0, 'odd', 'even')} {!IF(cnt==1, 'first', '')}" onmouseover="if (window.hiOn){hiOn(this);} " onmouseout="if (window.hiOff){hiOff(this);} " onblur="if (window.hiOff){hiOff(this);}" onfocus="if (window.hiOn){hiOn(this);}">
+ </tr>
+ <apex:variable value="{!cnt + 1}" var="cnt" />
+ </apex:repeat>
+ </table>
+ </div>
+ <div id="in_Div">
+ <table class="list" style="border-bottom-width: 0px;width:2000px; font-size:13px; border-spacing:0;" border="" id="tableData_L">
+ <apex:variable value="{!1}" var="cnt_2" />
+ <apex:repeat value="{!oppRecords}" var="or" id="oppTable_L">
+ <tr class="dataRow {!IF(MOD(cnt, 2)==0, 'odd', 'even')} {!IF(cnt==1, 'first', '')}" style="height:35px;" onmouseover="if (window.hiOn){hiOn(this);} " onmouseout="if (window.hiOff){hiOff(this);} " onblur="if (window.hiOff){hiOff(this);}" onfocus="if (window.hiOn){hiOn(this);}">
<apex:variable value="{!0}" var="cnt_2" />
<apex:repeat value="{!columnsLeftApi}" var="c">
<td class="dataCellBorder1 col_{!columnLeftCss[cnt_2]}">
- <!-- vivek start -->
-
+ <!-- vivek start -->
+
<apex:outputLink target="_blank" rendered="{!c[0]=='Name'}" value="/{!or.AgcOpp.Id}" >
<apex:outputField rendered="{!c[0]=='Name'}" value="{!or.AgcOpp[c[0]]}" />
- </apex:outputLink>
-
- <apex:outputPanel rendered="{!or.ifLock}">
+ </apex:outputLink>
+
+ <apex:outputPanel rendered="{!or.ifLock}">
<apex:outputField rendered="{!c[0]!='Name'}" value="{!or.AgcOpp[c[0]]}">
</apex:outputField>
- </apex:outputPanel>
- <!-- 閿�鍞媴褰� -->
- <apex:outputPanel rendered="{!or.ifLock == false}">
+ </apex:outputPanel>
+ <!-- 閿�鍞媴褰� -->
+ <apex:outputPanel rendered="{!or.ifLock == false}">
<!-- <apex:outputLink target="_blank" rendered="{!c[0]=='Agency_Person__c'}" value="/{!or.AgcOpp[c[0]]}" > -->
<!-- <apex:outputText value="{!or.AgcOpp.Agency_Person__r.Name }" /> -->
<!-- <apex:outputText rendered="{!c[0]=='Agency_PersonName__c'}" value="{!or.AgcOpp.Agency_PersonName__c }" /> -->
<!-- </apex:outputLink> -->
<!-- 缁忛攢鍟� -->
- <apex:outputLink target="_blank" rendered="{!c[0]=='Agency__c'}" value="/{!or.AgcOpp[c[0]]}" >
+ <apex:outputLink target="_blank" rendered="{!c[0]=='Agency__c'}" value="/{!or.AgcOpp[c[0]]}" >
<apex:outputText value="{!or.AgcOpp.Agency__r.Name }" />
- </apex:outputLink>
- <!-- OCSM璇环 -->
- <!-- <apex:outputLink target="_blank" rendered="{!c[0]=='Change_To_Opportunity__c'}" value="/{!or.AgcOpp[c[0]]}" >
+ </apex:outputLink>
+ <!-- OCSM璇环 -->
+ <!-- <apex:outputLink target="_blank" rendered="{!c[0]=='Change_To_Opportunity__c'}" value="/{!or.AgcOpp[c[0]]}" >
<apex:outputText value="{!or.AgcOpp.Agency__r.Name }" />
- </apex:outputLink> -->
- <!-- 蹇呭~瀛楁 -->
- <!-- <apex:outputField rendered="{!(c[0]<>'Name' && c[0]<>'Agency_Hospital__c' && c[0]<>'Product_Category1__c' && c[0]<>'Product_Category2__c' && c[0]<>'Product_Category3__c' && c[0]<>'Agency_Person__c' && c[0]<>'Agency__c' && c[0]<>'Change_To_Opportunity__c' && columnLeftRW[c[0]]=='wm')}" value="{!or.AgcOpp[c[0]] }"/> -->
- <apex:inputField rendered="{!(c[0]<>'Name' && c[0]<>'Product_Category1__c' && c[0]<>'Product_Category2__c' && c[0]<>'Product_Category3__c' && c[0]<>'Agency_Person__c' && c[0]<>'Agency__c' && c[0]<>'Change_To_Opportunity__c' && columnLeftRW[c[0]]=='wm')}" value="{!or.AgcOpp[c[0]] }" onchange="setChangeFlg('{!or.lineNo}')"/>
- <!-- vivek end -->
-
-
- <apex:outputField rendered="{!(c[0]<>'Name' && c[0]<>'Product_Category1__c' && c[0]<>'Product_Category2__c' && c[0]<>'Product_Category3__c' && c[0]<>'Agency_Person__c' && c[0]<>'Agency__c' && c[0]<>'Change_To_Opportunity__c' && columnLeftRW[c[0]]=='r')}" value="{!or.AgcOpp[c[0]] }"/>
- <!-- <apex:outputField rendered="{!(c[0]<>'Name' && columnLeftRW[c[0]]<>'w')}" value="{!or.AgcOpp[c[0]] }"/> -->
- <!-- 鍙紪杈戠殑瀛楁 -->
- <apex:inputField value="{!or.AgcOpp[c[0]]}" rendered="{!columnLeftRW[c[0]]=='w'}" onchange="setChangeFlg('{!or.lineNo}')"/>
- </apex:outputPanel>
- </td>
- <apex:variable value="{!cnt_2 + 1}" var="cnt_2" />
- </apex:repeat>
- </tr>
+ </apex:outputLink> -->
+ <!-- 蹇呭~瀛楁 -->
+ <!-- <apex:outputField rendered="{!(c[0]<>'Name' && c[0]<>'Agency_Hospital__c' && c[0]<>'Product_Category1__c' && c[0]<>'Product_Category2__c' && c[0]<>'Product_Category3__c' && c[0]<>'Agency_Person__c' && c[0]<>'Agency__c' && c[0]<>'Change_To_Opportunity__c' && columnLeftRW[c[0]]=='wm')}" value="{!or.AgcOpp[c[0]] }"/> -->
+ <apex:inputField styleClass="slds-form-element" rendered="{!(c[0]<>'Name' && c[0]<>'Product_Category1__c' && c[0]<>'Product_Category2__c' && c[0]<>'Product_Category3__c' && c[0]<>'Agency_Person__c' && c[0]<>'Agency__c' && c[0]<>'Change_To_Opportunity__c' && columnLeftRW[c[0]]=='wm')}" value="{!or.AgcOpp[c[0]] }" onchange="setChangeFlg('{!or.lineNo}')"/>
+ <!-- vivek end -->
+
+
+ <apex:outputField rendered="{!(c[0]<>'Name' && c[0]<>'Product_Category1__c' && c[0]<>'Product_Category2__c' && c[0]<>'Product_Category3__c' && c[0]<>'Agency_Person__c' && c[0]<>'Agency__c' && c[0]<>'Change_To_Opportunity__c' && columnLeftRW[c[0]]=='r')}" value="{!or.AgcOpp[c[0]] }"/>
+ <!-- <apex:outputField rendered="{!(c[0]<>'Name' && columnLeftRW[c[0]]<>'w')}" value="{!or.AgcOpp[c[0]] }"/> -->
+ <!-- 鍙紪杈戠殑瀛楁 -->
+ <apex:inputField styleClass="slds-form-element" value="{!or.AgcOpp[c[0]]}" rendered="{!columnLeftRW[c[0]]=='w'}" onchange="setChangeFlg('{!or.lineNo}')"/>
+ </apex:outputPanel>
+ </td>
+ <apex:variable value="{!cnt_2 + 1}" var="cnt_2" />
+ </apex:repeat>
+ </tr>
<apex:variable value="{!cnt + 1}" var="cnt" />
</apex:repeat>
</table>
</div><!-- /in_Div -->
</apex:outputPanel>
- </apex:pageBlock>
-<script type="text/javascript">
+ </apex:pageBlock>
+ <!-- </div> -->
+ <script type="text/javascript">
j$(function() {
var tableWidth = 0;
j$('body .pbBody table#tableHeader tr.headerRow td').each(function() {
@@ -462,9 +501,10 @@
});
// j$('table#tableData').css('width', (tableWidth + 2) + 'px');
// j$('table#tableHeader').css('width', (tableWidth + 2) + 'px');
-
+
// list 銇� headerRow 銇� td銇� toggleWidth() 銈掕拷鍔�
bindTdToggleWidth();
+ // j$("input").attr("styleClass","slds-input");
});
var elements = document.getElementsByTagName("select");
for (i = 0; i < elements.length; i++) {
diff --git a/force-app/main/default/pages/DealerInquiryModifyState.page-meta.xml b/force-app/main/default/pages/DealerInquiryModifyState.page-meta.xml
index c9d11cf..ba744e5 100644
--- a/force-app/main/default/pages/DealerInquiryModifyState.page-meta.xml
+++ b/force-app/main/default/pages/DealerInquiryModifyState.page-meta.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<ApexPage xmlns="http://soap.sforce.com/2006/04/metadata">
- <apiVersion>35.0</apiVersion>
+ <apiVersion>39.0</apiVersion>
<availableInTouch>true</availableInTouch>
<confirmationTokenRequired>false</confirmationTokenRequired>
<label>DealerInquiryModifyState</label>
diff --git a/force-app/main/default/triggers/ContentDocumentLink.trigger b/force-app/main/default/triggers/ContentDocumentLink.trigger
index 2ea867a..368da2a 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 319adf6..68a2e4e 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 6bb0960..63caf00 100644
--- a/manifest/LEXC01packagelexcommunitynew.xml
+++ b/manifest/LEXC01packagelexcommunitynew.xml
@@ -90,12 +90,5 @@
<members>navigateToRecord</members>
<name>LightningComponentBundle</name>
</types>
- <types>
- <members>invoiceStart</members>
- <members>View_Weekly_Report</members>
- <members>LexConInvoiceViewReport</members>
- <members>LexArrivegsDetailsPageHelpText</members>
- <name>CustomLabel</name>
- </types>
<version>57.0</version>
</Package>
\ No newline at end of file
diff --git a/manifest/LEXC02packagelexcommunityupdate.xml b/manifest/LEXC02packagelexcommunityupdate.xml
index 39b7ddd..89a67b5 100644
--- a/manifest/LEXC02packagelexcommunityupdate.xml
+++ b/manifest/LEXC02packagelexcommunityupdate.xml
@@ -23,12 +23,7 @@
</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>
\ No newline at end of file
--
Gitblit v1.9.1