diff --git a/src/app/routes/supply-management/components/bulk-publish/bulk-publish.component.ts b/src/app/routes/supply-management/components/bulk-publish/bulk-publish.component.ts
index b57eb0b4..82c211f8 100644
--- a/src/app/routes/supply-management/components/bulk-publish/bulk-publish.component.ts
+++ b/src/app/routes/supply-management/components/bulk-publish/bulk-publish.component.ts
@@ -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 || '',
diff --git a/src/app/routes/supply-management/components/bulk/bulk.component.ts b/src/app/routes/supply-management/components/bulk/bulk.component.ts
index e09c9514..e72a22af 100644
--- a/src/app/routes/supply-management/components/bulk/bulk.component.ts
+++ b/src/app/routes/supply-management/components/bulk/bulk.component.ts
@@ -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: {
diff --git a/src/app/routes/supply-management/components/onecar-publish/onecar-publish.component.html b/src/app/routes/supply-management/components/onecar-publish/onecar-publish.component.html
index ae9b3949..b11b0eec 100644
--- a/src/app/routes/supply-management/components/onecar-publish/onecar-publish.component.html
+++ b/src/app/routes/supply-management/components/onecar-publish/onecar-publish.component.html
@@ -11,7 +11,9 @@
- 装卸货信息预计公里数:-km,预计行程耗时:-小时
+ 装卸货信息预计公里数:{{ totalDistance }}km,预计行程耗时:{{ totalTime }}小时