This commit is contained in:
wangshiming
2022-04-21 16:39:03 +08:00
parent 4d521c068f
commit dd6cb763ef
2 changed files with 29 additions and 23 deletions

View File

@ -928,12 +928,14 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
this.service.msgSrv.warning('起终点相同,请重新选择装卸货地址!'); this.service.msgSrv.warning('起终点相同,请重新选择装卸货地址!');
return; return;
} }
if (this.validateForm1.value.loadingTime < new Date()) { let date1 = this.validateForm1.value.loadingTime
let date2 = new Date()
let min = date1.getMinutes()
date1.setMinutes(min+10)
if (date1 < date2 ) {
this.service.msgSrv.warning('装货时间必须大于当前时间!'); this.service.msgSrv.warning('装货时间必须大于当前时间!');
return; return;
} }
console.log(this.validateForm1.value.loadingTime);
console.log(new Date());
if (this.validateForm1.value.loadingTime > this.validateForm1.value.unloadingTime) { if (this.validateForm1.value.loadingTime > this.validateForm1.value.unloadingTime) {
this.service.msgSrv.warning('装货时间不能大于卸货时间!'); this.service.msgSrv.warning('装货时间不能大于卸货时间!');
@ -959,25 +961,25 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
return; return;
} }
// const getFreightParms = { carLengthKeys: this.sf4.value.carLength, km: this.totalDistance }; const getFreightParms = { carLengthKeys: this.sf4.value.carLength, km: this.totalDistance };
// this.service.request(this.service.$api_getFreight, getFreightParms).subscribe(res => { this.service.request(this.service.$api_getFreight, getFreightParms).subscribe(res => {
// if (this.sf7.value.subtotal > res.maxPrice) { if (this.sf7.value.subtotal > res.maxPrice) {
// this.service.msgSrv.error(`运费过高,请调整录入`); this.service.msgSrv.error(`运费过高,请调整录入`);
// return; return;
// } else if (this.sf7.value.subtotal > res.ewPrice) { } else if (this.sf7.value.subtotal > res.ewPrice) {
// this.modalService.confirm({ this.modalService.confirm({
// nzTitle: '', nzTitle: '',
// nzContent: `您的录入的运费过高,可能会影响支付,请仔细确认`, nzContent: `您的录入的运费过高,可能会影响支付,请仔细确认`,
// nzOkText: '继续', nzOkText: '继续',
// nzCancelText: '取消', nzCancelText: '取消',
// nzOnOk: () => { nzOnOk: () => {
// this.agreementConfirm(submitType); this.agreementConfirm(submitType);
// } }
// }); });
// } else { } else {
// this.agreementConfirm(submitType); this.agreementConfirm(submitType);
// } }
// }); });
} }
// 提交前协议弹窗 // 提交前协议弹窗
agreementConfirm(submitType?: string) { agreementConfirm(submitType?: string) {

View File

@ -892,7 +892,11 @@ export class SupplyManagementReleasePublishComponent implements OnInit {
this.service.msgSrv.warning('起终点相同,请重新选择装卸货地址!'); this.service.msgSrv.warning('起终点相同,请重新选择装卸货地址!');
return; return;
} }
if (this.validateForm1.value.loadingTime < new Date()) { let date1 = this.validateForm1.value.loadingTime
let date2 = new Date()
let min = date1.getMinutes()
date1.setMinutes(min+10)
if (date1 < date2 ) {
this.service.msgSrv.warning('装货时间必须大于当前时间!'); this.service.msgSrv.warning('装货时间必须大于当前时间!');
return; return;
} }