解决冲突

This commit is contained in:
wangshiming
2022-02-25 16:32:47 +08:00
parent 8da9e7a56f
commit e9e4941bf9
2 changed files with 20 additions and 27 deletions

View File

@ -239,7 +239,7 @@
[nzMin]="50000"
[nzMax]="3000000"
[nzStep]="0.01"
(ngModelChange)="i.setValue($event);getInsurersPrice()"
(ngModelChange)="i.setValue($event);getInsurersPrice($event)"
nzPlaceHolder="请输入50000-3000000之间数值"
></nz-input-number>
</div>

View File

@ -849,10 +849,11 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
if (this.validateForm1.invalid || !this.sf3.valid || !this.sf1.valid || !this.sf4.valid || !this.sf6.valid || !this.sf7.valid) {
return;
}
console.log(this.validateForm1.value?.unloadingTime);
if (typeof this.validateForm1.value.unloadingTime !== 'string') {
var c = new Date(this.validateForm1.value.unloadingTime);
this.validateForm1.value.unloadingTime =
console.log(this?.loadingTime);
console.log(this?.unloadingTime);
if (typeof this.unloadingTime !== 'string') {
var c = new Date(this.unloadingTime);
this.unloadingTime =
c.getFullYear() +
'-' +
this.addPreZero(c.getMonth() + 1) +
@ -865,9 +866,9 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
':' +
this.addPreZero(c.getSeconds());
}
if (typeof this.validateForm1.value.loadingTime !== 'string') {
var c = new Date(this.validateForm1.value.loadingTime);
this.validateForm1.value.loadingTime =
if (typeof this.loadingTime !== 'string') {
var c = new Date(this.loadingTime);
this.loadingTime =
c.getFullYear() +
'-' +
this.addPreZero(c.getMonth() + 1) +
@ -880,13 +881,14 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
':' +
this.addPreZero(c.getSeconds());
}
console.log(this.loadingTime)
const params: any = {
...this.sf1.value,
...this.sf5.value,
...this.sf6.value,
paymentDays: this.sf7.value.paymentDays,
loadingTime: this.validateForm1?.value?.loadingTime,
unloadingTime: this.validateForm1?.value?.unloadingTime,
loadingTime: this.loadingTime,
unloadingTime: this.unloadingTime,
unLoadingPlaceDTOList: [...this.startInfo, ...this.endInfo],
goodsInfoDTOList: [
{
@ -1084,8 +1086,6 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
// 计算里程,时间
if (this.startInfo?.[0]?.area && this.endInfo?.[0]?.area) {
console.log(this.startInfo[0]?.area);
console.log(this.endInfo[0]?.area);
this.amapService.drivingCompute([...this.startInfo], [...this.endInfo]).subscribe(res => {
this.totalDistance = res.distance;
this.totalTime = res.time;
@ -1166,8 +1166,6 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
nzWidth: 900,
nzComponentParams: { spuStatus: '1' },
nzOnOk: item => {
console.log(item);
console.log(type);
const data = item.seleteData;
if (JSON.stringify(data) === '{}') return;
switch (type) {
@ -1204,18 +1202,16 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
});
}
changeUn(event: Date) {
console.log(event)
this.unloadingTime = event;
console.log(this.unloadingTime );
console.log(this.unloadingTime.getTime() );
if(typeof this.loadingTime === 'string') {
var a = new Date(this.loadingTime)
if ( a > this.unloadingTime.getTime() ) {
if ( a > this.unloadingTime?.getTime() ) {
this.service.msgSrv.error('卸货时间不能小于装货时间!');
this.unloadingTime = '';
console.log(this.unloadingTime)
}
} else {
if ( this.loadingTime.getTime() > this.unloadingTime.getTime() ) {
if ( this.loadingTime?.getTime() > this.unloadingTime?.getTime() ) {
this.service.msgSrv.error('卸货时间不能小于装货时间!');
this.unloadingTime = '';
}
@ -1223,19 +1219,14 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
}
changeLO(event: Date) {
this.loadingTime = event;
console.log(this.loadingTime.getTime() );
console.log(this.unloadingTime)
console.log( typeof this.unloadingTime)
if(typeof this.unloadingTime === 'string') {
var a = new Date(this.unloadingTime)
if ( a.getTime()< this.loadingTime.getTime()) {
console.log('错误');
if ( a.getTime()< this.loadingTime?.getTime()) {
this.service.msgSrv.error('装货时间不能大于卸货时间!');
this.loadingTime = '';
}
} else {
if ( this.unloadingTime.getTime()< this.loadingTime.getTime()) {
console.log('错误');
if ( this.unloadingTime?.getTime()< this.loadingTime?.getTime()) {
this.service.msgSrv.error('装货时间不能大于卸货时间!');
this.loadingTime = '';
}
@ -1299,7 +1290,9 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
});
}
}
getInsurersPrice() {
getInsurersPrice($event: any) {
console.log($event);
console.log(this.sf5.value.goodsValue)
console.log(this.sf5.value.insuranceType)
if (this.sf5.value.goodsValue >= 50000) {