From 07390e2fcb4adf27c928335bf27ae7939c5a80ad Mon Sep 17 00:00:00 2001
From: buli <137736985@qq.com>
Date: 星期二, 23 五月 2023 11:28:12 +0800
Subject: [PATCH] bakcup20230523
---
force-app/main/default/lwc/lexArriveGoodsMain/lexArriveGoodsMain.js | 88 ++++++++++++++++++++++++++++++++++---------
1 files changed, 69 insertions(+), 19 deletions(-)
diff --git a/force-app/main/default/lwc/lexArriveGoodsMain/lexArriveGoodsMain.js b/force-app/main/default/lwc/lexArriveGoodsMain/lexArriveGoodsMain.js
index e88f4d3..03856ab 100644
--- a/force-app/main/default/lwc/lexArriveGoodsMain/lexArriveGoodsMain.js
+++ b/force-app/main/default/lwc/lexArriveGoodsMain/lexArriveGoodsMain.js
@@ -13,6 +13,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";
export default class LexArriveGoodsMain extends NavigationMixin(LightningElement) {
//椤甸潰鍩虹鍙橀噺
@@ -34,6 +37,9 @@
@track showPage = false;
@track showPop = false;
@track popTitle;
+ stylesLoaded = false;
+ //鏄惁涓�鐩存樉绀烘彁绀�
+ @track isNoteStay = true;
@track colms = [
// {label:'娑堣�楀搧璁㈠崟鍚嶇О',fieldName:'Name'},
@@ -49,7 +55,7 @@
type: 'Title',
recordId: { fieldName: "Id" }
},
- hideDefaultActions: true,initialWidth:180},
+ hideDefaultActions: true,initialWidth:200},
{label:'SAP鍚堝悓鍙�',fieldName:'ContractNo__c',hideDefaultActions: true},
{label:'璁㈠崟鎬绘暟',
type: "customOutputGood",
@@ -58,7 +64,7 @@
type: 'TotalNum',
recordId: { fieldName: "Id" }
},
- hideDefaultActions: true},
+ hideDefaultActions: true, initialWidth: 100},
{label:'宸插埌璐ф暟閲�',
type: "customOutputGood",
typeAttributes: {
@@ -66,7 +72,7 @@
type: 'ArrDet',
recordId: { fieldName: "Id" }
},
- hideDefaultActions: true},
+ hideDefaultActions: true, initialWidth: 110},
{label:'寰呯郴缁熸搷浣滃叆搴撴暟閲�',
type: "customOutputGood",
typeAttributes: {
@@ -74,7 +80,7 @@
type: 'DeliveryDet',
recordId: { fieldName: "Id" }
},
- hideDefaultActions: true},
+ hideDefaultActions: true, initialWidth: 180},
{label:'杩樻病鍙戣揣鏁伴噺',
type: "customOutputGood",
typeAttributes: {
@@ -82,7 +88,7 @@
type: 'NotArrDet',
recordId: { fieldName: "Id" }
},
- hideDefaultActions: true},
+ hideDefaultActions: true, initialWidth: 120},
{label:'鍙戣揣涓冨ぉ杩樻湭鍒拌揣鏁�',
type: "customOutputGood",
typeAttributes: {
@@ -90,14 +96,14 @@
type: 'MoreThan7',
recordId: { fieldName: "Id" }
},
- hideDefaultActions: true},
- {label:'鏈�鏂板彂璐ф棩鏈�',fieldName:'Shipment_date__c',hideDefaultActions: true},
- {label:'棣栨鍙戣揣鏃ユ湡',fieldName:'First_Delivery__c',hideDefaultActions: true}
+ hideDefaultActions: true, initialWidth: 180},
+ {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}
+ {label:'鏁伴噺',fieldName:'recordCount',type:'number',hideDefaultActions: true,cellAttributes: { alignment: "right" }}
];
//鑾峰彇鍙傛暟
@@ -108,11 +114,25 @@
// this.eSetId = currentPageReference.state?.ESetid;
// }
// }
+
+ 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()
.then(result=>{
+ this.isNoteStay = result.isNoteStay;
if(result.result == 'Success'){
this.agencyProType = result.agencyProType;
this.accountId = result.accountId;
@@ -154,7 +174,9 @@
initTotalNum({ordId:recordId, type:'all'})
.then(result=>{
if(result.result == 'Success'){
- this.recordList = result.recordList;
+ // this.recordList = result.recordList;
+ var dataStr = JSON.stringify(result.recordList);
+ this.recordList = JSON.parse(dataStr);
console.log('data:'+JSON.stringify(this.recordList));
this.showPop = true;
}else{
@@ -167,7 +189,9 @@
initArrDetAll({type:'all'})
.then(result=>{
if(result.result == 'Success'){
- this.recordList = result.recordList;
+ // this.recordList = result.recordList;
+ var dataStr = JSON.stringify(result.recordList);
+ this.recordList = JSON.parse(dataStr);
console.log('data:'+JSON.stringify(this.recordList));
this.showPop = true;
}else{
@@ -286,6 +310,7 @@
//妫�绱�
search(){
+ this.showSpinner = true;
searchConsumableorderdetails({
category1Str:this.category1,
cate2Str:this.cate2,
@@ -293,6 +318,7 @@
userWorkLocationStr:this.userWorkLocation,
agencyProTypeStr:this.agencyProType})
.then(result=>{
+ this.showSpinner = false;
if(result.result == 'Success'){
this.raesList = result.raesList;
this.raesList.push({Id:'1',Name:'璁㈠崟鏄庣粏姹囨��',Total_num__c:this.totalNum,OrderNumber_arrived__c:this.orderNumberArrived,Delivery_detail_count__c:this.deliveryDetailCount,OrderNumber_notarrive__c:this.orderNumberNotarrive,More_than_seven_days__c:this.moreThanSevenDays});
@@ -310,6 +336,7 @@
//娓呯┖鎼滅储妗�
clear(){
+ this.showSpinner = true;
this.category1 = '';
this.cate2 = null;
searchConsumableorderdetails({
@@ -319,6 +346,7 @@
userWorkLocationStr:this.userWorkLocation,
agencyProTypeStr:this.agencyProType})
.then(result=>{
+ this.showSpinner = false;
if(result.result == 'Success'){
this.raesList = result.raesList;
this.raesList.push({Id:'1',Name:'璁㈠崟鏄庣粏姹囨��',Total_num__c:this.totalNum,OrderNumber_arrived__c:this.orderNumberArrived,Delivery_detail_count__c:this.deliveryDetailCount,OrderNumber_notarrive__c:this.orderNumberNotarrive,More_than_seven_days__c:this.moreThanSevenDays});
@@ -356,12 +384,34 @@
this[NavigationMixin.Navigate](config);
}
- showMyToast(title,message,variant){
- const evt = new ShowToastEvent({
- title : title,
- message: message,
- variant: variant
- });
- 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(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
--
Gitblit v1.9.1