fix bug
This commit is contained in:
@ -11,7 +11,9 @@
|
||||
</nz-card>
|
||||
|
||||
<nz-card>
|
||||
<div class="card-title">装卸货信息<span class="tip-font">预计公里数:-km,预计行程耗时:-小时</span></div>
|
||||
<div class="card-title"
|
||||
>装卸货信息<span class="tip-font">预计公里数:{{ totalDistance }}km,预计行程耗时:{{ totalTime }}小时</span></div
|
||||
>
|
||||
<form nz-form [formGroup]="validateForm1" role="form">
|
||||
<div nz-row [nzGutter]="24">
|
||||
<div nz-col [nzSpan]="8">
|
||||
|
||||
@ -10,11 +10,10 @@ import {
|
||||
SFUISchema
|
||||
} from '@delon/form';
|
||||
import { _HttpClient } from '@delon/theme';
|
||||
import { AmapPoiPickerComponent } from '@shared';
|
||||
import { AmapPoiPickerComponent, AmapService, ShipperBaseService } from '@shared';
|
||||
import { NzModalService } from 'ng-zorro-antd/modal';
|
||||
import { PublishGoodsChooseFamifiarComponent } from '../choose-famifiar/choose-famifiar.component';
|
||||
import { SupplyManagementService } from '../../services/supply-management.service';
|
||||
import { debug } from 'console';
|
||||
import { SupplyManagementService} from '../../services/supply-management.service';
|
||||
@Component({
|
||||
selector: 'app-publish-goods-bulk-publish',
|
||||
templateUrl: './bulk-publish.component.html',
|
||||
@ -31,6 +30,8 @@ export class SupplyManagementBulkPublishComponent implements OnInit {
|
||||
creatTime: any; // 货源单设置回显
|
||||
modifyTime: any; // 货源单设置回显
|
||||
totalFees: any; // 总数信息
|
||||
totalDistance = 0.0; //总里程
|
||||
totalTime = 0.0; //路程总时间
|
||||
id = this.route.snapshot.params.id;
|
||||
// // 单位
|
||||
unit1 = '吨';
|
||||
@ -40,7 +41,7 @@ export class SupplyManagementBulkPublishComponent implements OnInit {
|
||||
endInfo: any = [];
|
||||
PageStatus = '';
|
||||
dataList: any;
|
||||
constructor(private http: _HttpClient, fb: FormBuilder, private router: Router, private route: ActivatedRoute, private modalService: NzModalService, public service: SupplyManagementService) {
|
||||
constructor(private http: _HttpClient, fb: FormBuilder, private router: Router, private route: ActivatedRoute, private modalService: NzModalService, public service: SupplyManagementService, private amapService: AmapService, public service2: ShipperBaseService,) {
|
||||
this.validateForm1 = fb.group({
|
||||
createTime: [null, []],
|
||||
modifyTime: [null, []],
|
||||
@ -113,16 +114,8 @@ export class SupplyManagementBulkPublishComponent implements OnInit {
|
||||
ui: {
|
||||
widget: 'select',
|
||||
placeholder: '请选择',
|
||||
allowClear: true
|
||||
// asyncData: () =>
|
||||
// this.service.loadChildData2('0', '2').pipe(
|
||||
// map((data: any) => {
|
||||
// return data.map((m: any) => {
|
||||
// return { label: m.name, value: m.id };
|
||||
// });
|
||||
// }),
|
||||
// ),
|
||||
// change: (i) => this.updateCategory(i, '/categoryId2'),
|
||||
allowClear: true,
|
||||
asyncData: () => this.service2.getEnterpriseProject(),
|
||||
} as SFSelectWidgetSchema
|
||||
},
|
||||
enterpriseInfoName: {
|
||||
@ -530,39 +523,47 @@ export class SupplyManagementBulkPublishComponent implements OnInit {
|
||||
console.log(res)
|
||||
})
|
||||
}
|
||||
// 打开地图
|
||||
openMap(type: string, index: number) {
|
||||
const modalRef = this.modalService.create({
|
||||
nzTitle: '',
|
||||
nzContent: AmapPoiPickerComponent,
|
||||
nzWidth: 900,
|
||||
nzOnOk: item => {
|
||||
const poi = item.poi;
|
||||
console.log(item.poi);
|
||||
const locList = poi.location.toString().split(',');
|
||||
switch (type) {
|
||||
case 'start':
|
||||
this.startInfo[index].detailedAddress = poi.district + poi.name;
|
||||
this.startInfo[index].longitude = locList[0];
|
||||
this.startInfo[index].latitude = locList[1];
|
||||
this.startInfo[index].province = poi.cityInfo.province;
|
||||
this.startInfo[index].city = poi.cityInfo.city;
|
||||
this.startInfo[index].area = poi.cityInfo.district;
|
||||
break;
|
||||
case 'end':
|
||||
this.endInfo[index].detailedAddress = poi.district + poi.name;
|
||||
this.endInfo[index].longitude = locList[0];
|
||||
this.endInfo[index].latitude = locList[1];
|
||||
this.endInfo[index].province = poi.cityInfo.province;
|
||||
this.endInfo[index].city = poi.cityInfo.city;
|
||||
this.endInfo[index].area = poi.cityInfo.district;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
// 打开地图
|
||||
openMap(type: string, index: number) {
|
||||
const modalRef = this.modalService.create({
|
||||
nzTitle: '',
|
||||
nzContent: AmapPoiPickerComponent,
|
||||
nzWidth: 900,
|
||||
nzOnOk: item => {
|
||||
const poi = item.poi;
|
||||
const locList = poi.location.toString().split(',');
|
||||
switch (type) {
|
||||
case 'start':
|
||||
this.startInfo[index].detailedAddress = poi.district + poi.name;
|
||||
this.startInfo[index].longitude = locList[0];
|
||||
this.startInfo[index].latitude = locList[1];
|
||||
this.startInfo[index].province = poi.cityInfo.province;
|
||||
this.startInfo[index].city = poi.cityInfo.city;
|
||||
this.startInfo[index].area = poi.cityInfo.district;
|
||||
this.startInfo[index].address = poi.name;
|
||||
break;
|
||||
case 'end':
|
||||
this.endInfo[index].detailedAddress = poi.district + poi.name;
|
||||
this.endInfo[index].longitude = locList[0];
|
||||
this.endInfo[index].latitude = locList[1];
|
||||
this.endInfo[index].province = poi.cityInfo.province;
|
||||
this.endInfo[index].city = poi.cityInfo.city;
|
||||
this.endInfo[index].area = poi.cityInfo.district;
|
||||
this.endInfo[index].address = poi.name;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (this.startInfo[0]?.area && this.endInfo[0]?.area) {
|
||||
this.amapService.drivingCompute([...this.startInfo], [...this.endInfo]).subscribe((res: any) => {
|
||||
this.totalDistance = res.distance;
|
||||
this.totalTime = res.time;
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
goBack() {
|
||||
window.history.go(-1);
|
||||
}
|
||||
@ -662,19 +663,6 @@ export class SupplyManagementBulkPublishComponent implements OnInit {
|
||||
goodsName: res?.goodsInfoVOList[0]?.goodsName || '',
|
||||
}
|
||||
this.sf4data = {
|
||||
// weight: res?.goodsInfoVOList[0]?.weight || '',
|
||||
// volume: res?.goodsInfoVOList[0]?.volume || '',
|
||||
// vehicleDemand: res?.goodsInfoVOList[0]?.vehicleDemand || '',
|
||||
// maxCube: res?.goodsInfoVOList[0]?.maxCube?.split(',') || '',
|
||||
// maxWeight: res?.goodsInfoVOList[0]?.maxWeight?.split(',') || '',
|
||||
// number: res?.goodsInfoVOList[0]?.number || '',
|
||||
// goodsType: res?.goodsInfoVOList[0]?.goodsType || '',
|
||||
// modifyTime: res?.goodsInfoVOList[0]?.modifyTime || '',
|
||||
// modifyUserId: res?.goodsInfoVOList[0]?.modifyUserId || '',
|
||||
// resourceId: res?.goodsInfoVOList[0]?.resourceId || '',
|
||||
// rule: res?.goodsInfoVOList[0]?.rule || '',
|
||||
// settlementBasis: res?.goodsInfoVOList[0]?.settlementBasis || '',
|
||||
|
||||
freightPrice: res?.goodsInfoVOList[0]?.freightPrice || '',
|
||||
freightType: res?.goodsInfoVOList[0]?.freightType || '',
|
||||
rule: res?.goodsInfoVOList[0]?.rule || '',
|
||||
|
||||
@ -3,6 +3,7 @@ import { Router } from '@angular/router';
|
||||
import { STColumn, STComponent } from '@delon/abc/st';
|
||||
import { SFComponent, SFDateWidgetSchema, SFSchema, SFSelectWidgetSchema, SFUISchema } from '@delon/form';
|
||||
import { ModalHelper, _HttpClient } from '@delon/theme';
|
||||
import { ShipperBaseService } from '@shared';
|
||||
import { NzModalService } from 'ng-zorro-antd/modal';
|
||||
import { map } from 'rxjs/operators';
|
||||
import { SupplyManagementService } from '../../services/supply-management.service';
|
||||
@ -33,7 +34,7 @@ export class SupplyManagementBulkComponent implements OnInit {
|
||||
receivedQuantity: 0,
|
||||
stayQuantity: 0
|
||||
};
|
||||
constructor(public service: SupplyManagementService, private modal: NzModalService, private router: Router) { }
|
||||
constructor(public service: SupplyManagementService, private modal: NzModalService, private router: Router,public service2: ShipperBaseService) { }
|
||||
|
||||
ngOnInit(): void {
|
||||
this.initSF();
|
||||
@ -134,7 +135,7 @@ export class SupplyManagementBulkComponent implements OnInit {
|
||||
_$expand: (value: boolean) => value,
|
||||
},
|
||||
allowClear: true,
|
||||
asyncData: () => this.getCatalogueMember(),
|
||||
asyncData: () => this.service2.getEnterpriseProject(),
|
||||
},
|
||||
},
|
||||
no4: {
|
||||
|
||||
@ -11,7 +11,9 @@
|
||||
</nz-card>
|
||||
|
||||
<nz-card>
|
||||
<div class="card-title">装卸货信息<span class="tip-font">预计公里数:-km,预计行程耗时:-小时</span></div>
|
||||
<div class="card-title"
|
||||
>装卸货信息<span class="tip-font">预计公里数:{{ totalDistance }}km,预计行程耗时:{{ totalTime }}小时</span></div
|
||||
>
|
||||
<form nz-form [formGroup]="validateForm1" role="form">
|
||||
<div nz-row [nzGutter]="24">
|
||||
<div nz-col [nzSpan]="8">
|
||||
|
||||
@ -10,7 +10,7 @@ import {
|
||||
SFUISchema
|
||||
} from '@delon/form';
|
||||
import { _HttpClient } from '@delon/theme';
|
||||
import { AmapPoiPickerComponent } from '@shared';
|
||||
import { AmapPoiPickerComponent,AmapService } from '@shared';
|
||||
import { NzModalService } from 'ng-zorro-antd/modal';
|
||||
import { PublishGoodsChooseFamifiarComponent } from '../choose-famifiar/choose-famifiar.component';
|
||||
import { SupplyManagementService } from '../../services/supply-management.service';
|
||||
@ -35,6 +35,8 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
||||
loadingTime: any; // 货源单设置回显
|
||||
unloadingTime: any; // 货源单设置回显
|
||||
totalFees: any; // 总数信息
|
||||
totalDistance = 0.0; //总里程
|
||||
totalTime = 0.0; //路程总时间
|
||||
npp =false
|
||||
id = this.route.snapshot.params.id;
|
||||
// // 单位
|
||||
@ -45,7 +47,15 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
||||
endInfo: any = [];
|
||||
PageStatus = '';
|
||||
dataList: any;
|
||||
constructor(private http: _HttpClient, fb: FormBuilder, private router: Router, private route: ActivatedRoute, private modalService: NzModalService, public service: SupplyManagementService) {
|
||||
constructor(
|
||||
private http: _HttpClient,
|
||||
fb: FormBuilder,
|
||||
private router: Router,
|
||||
private route: ActivatedRoute,
|
||||
private modalService: NzModalService,
|
||||
public service: SupplyManagementService,
|
||||
private amapService: AmapService
|
||||
) {
|
||||
this.validateForm1 = fb.group({
|
||||
loadingTime: [null, []],
|
||||
unloadingTime: [null, []],
|
||||
@ -676,39 +686,47 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
||||
}
|
||||
})
|
||||
}
|
||||
// 打开地图
|
||||
openMap(type: string, index: number) {
|
||||
const modalRef = this.modalService.create({
|
||||
nzTitle: '',
|
||||
nzContent: AmapPoiPickerComponent,
|
||||
nzWidth: 900,
|
||||
nzOnOk: item => {
|
||||
const poi = item.poi;
|
||||
console.log(item.poi);
|
||||
const locList = poi.location.toString().split(',');
|
||||
switch (type) {
|
||||
case 'start':
|
||||
this.startInfo[index].detailedAddress = poi.district + poi.name;
|
||||
this.startInfo[index].longitude = locList[0];
|
||||
this.startInfo[index].latitude = locList[1];
|
||||
this.startInfo[index].province = poi.cityInfo.province;
|
||||
this.startInfo[index].city = poi.cityInfo.city;
|
||||
this.startInfo[index].area = poi.cityInfo.district;
|
||||
break;
|
||||
case 'end':
|
||||
this.endInfo[index].detailedAddress = poi.district + poi.name;
|
||||
this.endInfo[index].longitude = locList[0];
|
||||
this.endInfo[index].latitude = locList[1];
|
||||
this.endInfo[index].province = poi.cityInfo.province;
|
||||
this.endInfo[index].city = poi.cityInfo.city;
|
||||
this.endInfo[index].area = poi.cityInfo.district;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
// 打开地图
|
||||
openMap(type: string, index: number) {
|
||||
const modalRef = this.modalService.create({
|
||||
nzTitle: '',
|
||||
nzContent: AmapPoiPickerComponent,
|
||||
nzWidth: 900,
|
||||
nzOnOk: item => {
|
||||
const poi = item.poi;
|
||||
const locList = poi.location.toString().split(',');
|
||||
switch (type) {
|
||||
case 'start':
|
||||
this.startInfo[index].detailedAddress = poi.district + poi.name;
|
||||
this.startInfo[index].longitude = locList[0];
|
||||
this.startInfo[index].latitude = locList[1];
|
||||
this.startInfo[index].province = poi.cityInfo.province;
|
||||
this.startInfo[index].city = poi.cityInfo.city;
|
||||
this.startInfo[index].area = poi.cityInfo.district;
|
||||
this.startInfo[index].address = poi.name;
|
||||
break;
|
||||
case 'end':
|
||||
this.endInfo[index].detailedAddress = poi.district + poi.name;
|
||||
this.endInfo[index].longitude = locList[0];
|
||||
this.endInfo[index].latitude = locList[1];
|
||||
this.endInfo[index].province = poi.cityInfo.province;
|
||||
this.endInfo[index].city = poi.cityInfo.city;
|
||||
this.endInfo[index].area = poi.cityInfo.district;
|
||||
this.endInfo[index].address = poi.name;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (this.startInfo[0]?.area && this.endInfo[0]?.area) {
|
||||
this.amapService.drivingCompute([...this.startInfo], [...this.endInfo]).subscribe((res: any) => {
|
||||
this.totalDistance = res.distance;
|
||||
this.totalTime = res.time;
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
goBack() {
|
||||
window.history.go(-1);
|
||||
}
|
||||
|
||||
@ -23,6 +23,7 @@ export class SupplyManagementVehicleComponent implements OnInit {
|
||||
auditMany = false;
|
||||
isVisible = false;
|
||||
_$expand = false;
|
||||
|
||||
@ViewChild('st') private readonly st!: STComponent;
|
||||
@ViewChild('sf', { static: false }) sf!: SFComponent;
|
||||
@ViewChild('sfFre', { static: false }) sfFre!: SFComponent;
|
||||
|
||||
Reference in New Issue
Block a user