fix bug
This commit is contained in:
@ -41,8 +41,8 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
||||
maxPiece: 99999,
|
||||
maxDays: 999,
|
||||
intervalDays: 999,
|
||||
maxTimes: 999,
|
||||
}
|
||||
maxTimes: 999
|
||||
};
|
||||
sf1data: any; // 货源单设置回显
|
||||
sf3data: any; // 货源单设置回显
|
||||
sf4data: any; // 货源单设置回显
|
||||
@ -117,11 +117,10 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
||||
formatterRmb = (value: number): string => {
|
||||
if (value === null || value === undefined) {
|
||||
return '';
|
||||
}else{
|
||||
} else {
|
||||
let value2 = Number(value).toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 });
|
||||
return `¥${value2}`;
|
||||
}
|
||||
|
||||
};
|
||||
parserRmb = (value: string): string => value.replace('¥', '').replace(',', '');
|
||||
|
||||
@ -154,8 +153,8 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
||||
searchDebounceTime: 300,
|
||||
searchLoadingText: '搜索中...',
|
||||
onSearch: (q: any) => {
|
||||
console.log(q === ' ')
|
||||
let str =q.replace(/^\s+|\s+$/g,"");
|
||||
console.log(q === ' ');
|
||||
let str = q.replace(/^\s+|\s+$/g, '');
|
||||
if (str) {
|
||||
return this.service
|
||||
.request(this.service.$api_enterpriceList, { enterpriseName: str })
|
||||
@ -166,9 +165,10 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
||||
}
|
||||
},
|
||||
change: (q: any) => {
|
||||
let str =q.replace(/^\s+|\s+$/g,"");
|
||||
let str = q.replace(/^\s+|\s+$/g, '');
|
||||
if (str) {
|
||||
this.getRegionCode(str);
|
||||
this.payChange();
|
||||
}
|
||||
}
|
||||
} as SFSelectWidgetSchema
|
||||
@ -715,29 +715,28 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
||||
const receiptPay = this.sf7.value.receiptPay || 0;
|
||||
const oilCardPay = 0;
|
||||
const subtotal = prePay + toPay + receiptPay;
|
||||
console.log(this?.sf1.value?.enterpriseInfoName)
|
||||
if(this?.sf1.value?.enterpriseInfoName) {
|
||||
console.log(this?.sf1.value?.enterpriseInfoName);
|
||||
if (this?.sf1.value?.enterpriseInfoName) {
|
||||
console.log('5555');
|
||||
|
||||
}
|
||||
console.log(this?.sf1.value?.enterpriseInfoId)
|
||||
console.log(this?.sf1data?.enterpriseInfoId)
|
||||
console.log(this?.sf1?.value?.enterpriseInfoName ? this?.sf1?.value?.enterpriseInfoName : this?.sf1data?.enterpriseInfoId || '')
|
||||
console.log(this?.sf1.value?.enterpriseInfoId);
|
||||
console.log(this?.sf1data?.enterpriseInfoId);
|
||||
console.log(this?.sf1?.value?.enterpriseInfoName ? this?.sf1?.value?.enterpriseInfoName : this?.sf1data?.enterpriseInfoId || '');
|
||||
const params = {
|
||||
shipperId: this?.sf1?.value?.shipperAppUserId,
|
||||
enterpriseInfoId: this?.sf1data?.enterpriseInfoId || '',
|
||||
enterpriseInfoId: this?.sf1data?.enterpriseInfoId || '',
|
||||
totalFreight: subtotal,
|
||||
fuelCardAmount: oilCardPay,
|
||||
resourcetype: '1'
|
||||
};
|
||||
this.service.request(this.service.$api_getCalculatedSurcharge, params).subscribe(res => {
|
||||
if (res) {
|
||||
console.log(res)
|
||||
console.log(res);
|
||||
this.sf7.setValue('/appendFee', res.surcharge);
|
||||
this.sf7.setValue('/subtotal', subtotal);
|
||||
this.sf7.setValue('/total', subtotal + res.surcharge);
|
||||
let items = this?.sf1data?.enterpriseInfoId || '';
|
||||
console.log(items)
|
||||
let items = this?.sf1data?.enterpriseInfoId || '';
|
||||
console.log(items);
|
||||
this.service
|
||||
.request(
|
||||
this.service.$api_getAdditionalRate +
|
||||
@ -782,9 +781,9 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
||||
this.service.limitKeys.piece,
|
||||
this.service.limitKeys.maxDays,
|
||||
this.service.limitKeys.intervalDays,
|
||||
this.service.limitKeys.maxTimes,
|
||||
this.service.limitKeys.maxTimes
|
||||
];
|
||||
this.service.request(this.service.$api_findItemValueByItemKeys, getlimitvaluesParms).subscribe((res) => {
|
||||
this.service.request(this.service.$api_findItemValueByItemKeys, getlimitvaluesParms).subscribe(res => {
|
||||
const maxWeight = res.filter((item: any) => item.itemKey === this.service.limitKeys.weight)[0].itemValue;
|
||||
const maxVolume = res.filter((item: any) => item.itemKey === this.service.limitKeys.volume)[0].itemValue;
|
||||
const maxPiece = res.filter((item: any) => item.itemKey === this.service.limitKeys.piece)[0].itemValue;
|
||||
@ -797,9 +796,9 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
||||
maxPiece: Number(maxPiece),
|
||||
maxDays: Number(maxDays),
|
||||
intervalDays: Number(intervalDays),
|
||||
maxTimes: Number(maxTimes),
|
||||
}
|
||||
})
|
||||
maxTimes: Number(maxTimes)
|
||||
};
|
||||
});
|
||||
}
|
||||
subStartInfo(event: any, index: number) {
|
||||
this.startInfo.splice(index, 1);
|
||||
@ -921,7 +920,7 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
||||
this.service.msgSrv.warning('总费用不能为0!');
|
||||
return;
|
||||
}
|
||||
const num = (Number(this.validateForm1.value.unloadingTime) - Number(this.validateForm1.value.loadingTime))/(24*60*60*1000);
|
||||
const num = (Number(this.validateForm1.value.unloadingTime) - Number(this.validateForm1.value.loadingTime)) / (24 * 60 * 60 * 1000);
|
||||
if (num > this.limitValues.maxDays) {
|
||||
this.service.msgSrv.error(`当前计划装卸货时间间隔已超出限定值【${this.limitValues.maxDays}天】`);
|
||||
return;
|
||||
@ -1019,7 +1018,7 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
||||
nzContent: TranAgreementComponent,
|
||||
nzWidth: 900,
|
||||
nzFooter: null,
|
||||
nzComponentParams: {Object: params,}
|
||||
nzComponentParams: { Object: params }
|
||||
});
|
||||
modalRef.afterClose.subscribe(result => {
|
||||
if (result) {
|
||||
@ -1028,8 +1027,7 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
||||
});
|
||||
}
|
||||
// 提交
|
||||
submit(submitType?: string,params?: any): void {
|
||||
|
||||
submit(submitType?: string, params?: any): void {
|
||||
// const params: any = {
|
||||
// ...this.sf1.value,
|
||||
// ...this.sf5.value,
|
||||
@ -1249,7 +1247,7 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
||||
this.sf3data.goodsName1 = res?.goodsInfoVOList[0]?.goodsName || '';
|
||||
}
|
||||
this.changeGoodsType(this.sf3data.goodsTypeId, { label: this.sf3data.goodsTypeName, value: this.sf3data.goodsTypeId });
|
||||
|
||||
|
||||
if (res?.loadingTime) {
|
||||
this.loadingTime = res?.loadingTime;
|
||||
}
|
||||
@ -1279,7 +1277,7 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
||||
goodsValue: res?.goodsValue || '',
|
||||
insurancePremium: res?.insurancePremium || '',
|
||||
insuranceRate: res?.insuranceRate || '',
|
||||
insurancePackagedGoods: res?.insurancePackagedGoods || '',
|
||||
insurancePackagedGoods: res?.insurancePackagedGoods || ''
|
||||
};
|
||||
this.sf6data = {
|
||||
stateReceipt: res?.stateReceipt,
|
||||
@ -1356,14 +1354,14 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
||||
}
|
||||
});
|
||||
}
|
||||
// 不可选择的时间
|
||||
disabledDateStart = (current: Date): boolean => {
|
||||
// 不可选择的时间
|
||||
disabledDateStart = (current: Date): boolean => {
|
||||
let d = new Date();
|
||||
let year = d.getFullYear();
|
||||
let month = d.getMonth();
|
||||
let date = d.getDate();
|
||||
let hours = d.getHours();
|
||||
let mydate = new Date(year, month, date + this.limitValues.maxDays,hours+1);
|
||||
let mydate = new Date(year, month, date + this.limitValues.maxDays, hours + 1);
|
||||
return differenceInCalendarDays(new Date(), current) > 0 || new Date(current) > mydate;
|
||||
};
|
||||
// 装卸货地址互换
|
||||
|
||||
Reference in New Issue
Block a user