From 91f850751b85ab0125679a6ea446cbd8a622b46d Mon Sep 17 00:00:00 2001
From: buli <137736985@qq.com>
Date: 星期一, 05 六月 2023 14:38:16 +0800
Subject: [PATCH] LEX Community UpdateComponent
---
force-app/main/default/lwc/lexConInvoiceView/lexConInvoiceView.js | 80 +++++++++++++++++++++++++++++++--------
1 files changed, 63 insertions(+), 17 deletions(-)
diff --git a/force-app/main/default/lwc/lexConInvoiceView/lexConInvoiceView.js b/force-app/main/default/lwc/lexConInvoiceView/lexConInvoiceView.js
index 213002a..eeb2a3f 100644
--- a/force-app/main/default/lwc/lexConInvoiceView/lexConInvoiceView.js
+++ b/force-app/main/default/lwc/lexConInvoiceView/lexConInvoiceView.js
@@ -96,6 +96,7 @@
hideDefaultActions: true,
wrapText: true,
cellAttributes: { alignment: 'right' },
+
type: "number",
typeAttributes: {
minimumFractionDigits: 2,
@@ -160,6 +161,7 @@
label: "浜у搧鍨嬪彿",
fieldName: "esdAssetModelNo",
hideDefaultActions: true,
+ wrapText: true,
},
{
label: "瑙勬牸",
@@ -211,13 +213,13 @@
},
{
label: "寮�绁ㄥ崟浣�",
- //fieldName: "esdInvoiceUnit",
hideDefaultActions: true,
type: "customUnit",
typeAttributes: {
unitValue: { fieldName: "unitValue" },
unitOptions: { fieldName: "unitOptions" },
recordId: { fieldName: "recordId" },
+ isDisabled: { fieldName: "isDisabled" },
},
},
{
@@ -247,6 +249,7 @@
fieldName: "invoiceAllprice",
hideDefaultActions: true,
type: "number",
+ initialWidth: 150,
typeAttributes: {
minimumFractionDigits: 2,
},
@@ -497,8 +500,14 @@
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]['unitValue'] = this.detailsData[i].esd.Invoice_Unit__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 = {};
@@ -585,6 +594,7 @@
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;
@@ -949,7 +959,22 @@
SaveJs() {
this.isShowSpinner = true;
let cloneData = this.outboundData
+
+ debugger
+ const selectedRows = this.template.querySelector("[data-field='outbound']").getSelectedRows();
+ console.log('selectedRows = ' + JSON.stringify(selectedRows));
+
for (var i in cloneData) {
+ let b = false;
+ for (var j in selectedRows) {
+ if (cloneData[i].esd.Id == selectedRows[j].esd.Id) {
+ b = true;
+ cloneData[i].check = true;
+ }
+ }
+ if(!b){
+ cloneData[i].check = false;
+ }
delete cloneData[i].esdOutboundDate;
delete cloneData[i].esdNameUrl;
delete cloneData[i].esdName;
@@ -1210,8 +1235,21 @@
InvoiceorderSearchJs() {
this.isShowSpinner = true;
+ 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;
+ for (var j in selectedRows) {
+ if (cloneData[i].esd.Id == selectedRows[j].esd.Id) {
+ b = true;
+ cloneData[i].check = true;
+ }
+ }
+ if(!b){
+ cloneData[i].check = false;
+ }
delete cloneData[i].esdOutboundDate;
delete cloneData[i].esdNameUrl;
delete cloneData[i].esdName;
@@ -1231,6 +1269,7 @@
console.log('this.HospitalInfo = ' + this.HospitalInfo);
console.log('SecondDealer = ' + this.secondaryDistributor);
console.log('invoiceOrderRecoedsLwc = ' + JSON.stringify(cloneData));
+
InvoiceorderSearch({
cocLwc: this.coc,
invoiceIdLwc: this.invoiceId,
@@ -1245,8 +1284,14 @@
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;
@@ -1292,6 +1337,7 @@
//璁$畻鍙戠エ绁ㄩ潰閲戦
this.sumPrice += this.outboundData[i].needInvoiceCount;
}
+ console.log('this.selectedRows = ' + JSON.stringify(this.selectedRows))
this.isShowSpinner = false;
} else {
this.showMyToast('鎼滅储澶辫触', r.msg, 'Error');
@@ -1303,20 +1349,20 @@
}
getSelectedRows(event) {
- console.log("getSelectedRows ");
- for (var i in this.outboundData) {
- this.outboundData[i].check = false;
- }
- const selectedRows = event.detail.selectedRows;
- for (var i in this.outboundData) {
- for (var j in selectedRows) {
- if (this.outboundData[i].esd.Id == selectedRows[j].esd.Id) {
- //this.outboundData[i].check = !this.outboundData[i].check;
- this.outboundData[i].check = true;
- }
- }
- }
- console.log('this.outboundData = ' + JSON.stringify(this.outboundData));
+ // console.log("getSelectedRows ");
+ // for (var i in this.outboundData) {
+ // this.outboundData[i].check = false;
+ // }
+ // const selectedRows = event.detail.selectedRows;
+ // for (var i in this.outboundData) {
+ // for (var j in selectedRows) {
+ // if (this.outboundData[i].esd.Id == selectedRows[j].esd.Id) {
+ // //this.outboundData[i].check = !this.outboundData[i].check;
+ // this.outboundData[i].check = true;
+ // }
+ // }
+ // }
+ // console.log('this.outboundData = ' + JSON.stringify(this.outboundData));
}
deleteButtonJs() {
@@ -1705,7 +1751,7 @@
contentVersionId: recordId
}).then(result => {
if (result.result == 'Success') {
- this.showMyToast('鎴愬姛', '鍒犻櫎鎴愬姛', 'Success');
+ this.showMyToast('鍒犻櫎鎴愬姛', '', 'Success');
if (this.fileData.length == 1)
window.location.reload();
else
--
Gitblit v1.9.1