@@ -125,7 +125,8 @@
@@ -177,7 +178,7 @@
-
+
@@ -205,18 +206,7 @@
-
-
-
+ {{i?.goodsInfoList?.[0]?.weight}}吨,{{i?.goodsInfoList?.[0]?.volume}}方,{{i?.goodsInfoList?.[0]?.number}}件
diff --git a/src/app/routes/order-management/components/bulk-detail-change/bulk-detail-change.component.ts b/src/app/routes/order-management/components/bulk-detail-change/bulk-detail-change.component.ts
index 86d1ae0f..8569a071 100644
--- a/src/app/routes/order-management/components/bulk-detail-change/bulk-detail-change.component.ts
+++ b/src/app/routes/order-management/components/bulk-detail-change/bulk-detail-change.component.ts
@@ -4,7 +4,7 @@
* @Author : Shiming
* @Date : 2021-12-24 16:58:02
* @LastEditors : Shiming
- * @LastEditTime : 2022-02-28 12:01:57
+ * @LastEditTime : 2022-03-04 13:26:50
* @FilePath : \\tms-obc-web\\src\\app\\routes\\order-management\\components\\bulk-detail-change\\bulk-detail-change.component.ts
* Copyright (C) 2022 huzhenhong. All rights reserved.
*/
@@ -438,7 +438,13 @@ loadTime: any; // 货源单设置回显
this.loadTime = res.loadTime
this.unloadTime = res.unloadTime
this.dirvingMessage = res.billExpenseDetails;
-
+ // 计算里程,时间
+ if (this.startInfo[0]?.area && this.endInfo[0]?.area) {
+ this.amapService.drivingCompute([...this.startInfo], [...this.endInfo]).subscribe(res => {
+ this.totalDistance = res.distance;
+ this.totalTime = res.time;
+ });
+ }
}
})
}
@@ -516,6 +522,7 @@ loadTime: any; // 货源单设置回显
// -------------------装卸货信息处理
// 打开地图
// 打开地图
+ // 打开地图
openMap(type: string, index: number) {
const modalRef = this.modalService.create({
nzTitle: '',
@@ -523,30 +530,32 @@ loadTime: any; // 货源单设置回显
nzWidth: 900,
nzOnOk: item => {
const poi = item.poi;
- const locList = poi.pois;
+ const locList = poi.location.toString().split(',');
switch (type) {
case 'start':
- this.startInfo[index].detailedAddress = poi.formattedAddress;
+ 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.addressComponent.province;
- this.startInfo[index].city = poi.addressComponent.city;
- this.startInfo[index].area = poi.addressComponent.district;
+ 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.formattedAddress;
+ 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.addressComponent.province;
- this.endInfo[index].city = poi.addressComponent.city;
- this.endInfo[index].area = poi.addressComponent.district;
+ 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 => {
+ this.amapService.drivingCompute([...this.startInfo], [...this.endInfo]).subscribe((res: any) => {
this.totalDistance = res.distance;
this.totalTime = res.time;
});
@@ -554,7 +563,6 @@ loadTime: any; // 货源单设置回显
}
});
}
-
initSF3() {
this.schema3 = {
properties: {
@@ -631,94 +639,6 @@ loadTime: any; // 货源单设置回显
}
};
}
- initSF4() {
- this.schema4 = {
- properties: {
- weight: {
- type: 'string',
- title: '货物数量',
- ui: {
- widget: 'custom',
- placeholder: '请输入',
- errors: { required: '必填项' }
- }
- },
- volume: {
- type: 'string',
- title: '',
- ui: {
- widget: 'custom',
- placeholder: '请输入'
- }
- },
- number: {
- type: 'string',
- title: '',
- ui: {
- widget: 'custom',
- placeholder: '请输入'
- }
- },
- carModel: {
- type: 'string',
- title: '车型/车长',
- ui: {
- widget: 'select',
- mode: 'multiple',
- maxMultipleCount:3,
- placeholder: '请选择车型',
- errors: { required: '请选择车型' },
- asyncData: () => this.service.getDictOptions({ dictKey: 'car:model' }),
- change:(tag:any , org:any)=>{
- if(tag.includes("999")){
- this.sf4.setValue('/carModel',["999"]);
- }
- }
- }
- },
- carLength: {
- type: 'string',
- title: '',
- ui: {
- widget: 'select',
- mode: 'multiple',
- maxMultipleCount:3,
- placeholder: '请选择车长',
- errors: { required: '请选择车长' },
- asyncData: () => this.service.getDictOptions({ dictKey: 'car:length' }),
- change:(tag:any , org:any)=>{
- if(tag.includes("999")){
- this.sf4.setValue('/carModel',["999"]);
- }
- }
- }
- },
- },
- required: ['weight', 'carModel', 'carLength']
- };
- this.ui4 = {
- '*': {
- spanLabelFixed: 90,
- grid: { span: 24 }
- },
- $weight: {
- grid: { lg: 8, md: 12, sm: 12, xs: 24 }
- },
- $volume: {
- grid: { lg: 8, md: 12, sm: 12, xs: 24 }
- },
- $number: {
- grid: { lg: 8, md: 12, sm: 12, xs: 24 }
- },
- $carModel: {
- spanLabelFixed: 100,
- grid: { span: 8 }
- },
- $carLength: {
- grid: { span: 8 }
- }
- };
- }
changeGoodsType(value: string, data: any) {
if (data.label === '其它') return;
const params = {
@@ -745,165 +665,143 @@ changeGoodsType(value: string, data: any) {
}
});
}
-// initSF4() {
-// this.schema4 = {
-// properties: {
-// weight: {
-// type: 'string',
-// title: '货物数量',
-// ui: {
-// widget: 'custom',
-// placeholder: '请输入',
-// errors: { required: '必填项' }
-// }
-// },
-// volume: {
-// type: 'string',
-// title: '',
-// ui: {
-// widget: 'custom',
-// placeholder: '请输入'
-// }
-// },
-// number: {
-// type: 'string',
-// title: '',
-// ui: {
-// widget: 'custom',
-// placeholder: '请输入'
-// }
-// },
-// carmand: {
-// type: 'string',
-// title: '用车需求',
-// ui: {
-// widget: 'custom',
-// placeholder: '请输入'
-// }
-// },
-// drivers: {
-// type: 'string',
-// title: '承运司机',
-// ui: {
-// widget: 'custom',
-// placeholder: '请输入'
-// }
-// },
-// weightModel: {
-// type: 'string',
-// title: '车型车长承重',
-// ui: {
-// widget: 'custom',
-// placeholder: '请输入'
-// }
-// },
-// loadTime: {
-// type: 'string',
-// title: '发车时间',
-// ui: {
-// widget: 'custom',
-// placeholder: '请输入'
-// }
-// },
-// unloadTime: {
-// type: 'string',
-// title: '到车时间',
-// ui: {
-// widget: 'custom',
-// placeholder: '请输入'
-// }
-// },
-// acceptWeight: {
-// type: 'number',
-// title: '装货重量',
-// minimum:0,
-// maximum:99999,
-// ui: {
-// unit: '吨',
-// placeholder: '请输入',
-// grid: {
-// span: 12
-// },
-// hideStep: true,
-// } as SFNumberWidgetSchema
-// },
-// acceptVolume: {
-// type: 'number',
-// title: '装货体积',
-// minimum:0,
-// maximum:99999,
-// ui: {
-// unit: '吨',
-// placeholder: '请输入',
-// grid: {
-// span: 12
-// },
-// hideStep: true,
-// } as SFNumberWidgetSchema
-// },
-// settlementWeight: {
-// type: 'number',
-// title: '卸货重量',
-// minimum:0,
-// maximum:99999,
-// ui: {
-// unit: '吨',
-// placeholder: '请输入',
-// grid: {
-// span: 12
-// },
-// hideStep: true,
-// } as SFNumberWidgetSchema
-// },
-// settlementVolume: {
-// type: 'number',
-// title: '卸货体积',
-// minimum:0,
-// maximum:99999,
-// ui: {
-// unit: '吨',
-// placeholder: '请输入',
-// grid: {
-// span: 12
-// },
-// hideStep: true,
-// } as SFNumberWidgetSchema
-// }
-// },
-// required: ['weight','loadTime','unloadTime']
-// };
-// this.ui4 = {
-// '*': {
-// spanLabelFixed: 90,
-// grid: { span: 24 }
-// },
-// $weight: {
-// grid: { span: 8 }
-// },
-// $volume: {
-// grid: { span: 8 }
-// },
-// $number: {
-// grid: { span: 8 }
-// },
-// $carmand: {
-// grid: { span: 24 }
-// },
-// $weightModel: {
-// spanLabelFixed: 120,
-// grid: { span: 12 }
-// },
-// $drivers: {
-// grid: { span: 12 }
-// },
-// $loadTime: {
-// grid: { span: 12 }
-// },
-// $unloadTime: {
-// grid: { span: 12 }
-// },
-// };
-// }
+initSF4() {
+ this.schema4 = {
+ properties: {
+ weight: {
+ type: 'string',
+ title: '货物数量',
+ ui: {
+ widget: 'custom',
+ placeholder: '请输入',
+ errors: { required: '必填项' }
+ }
+ },
+ carmand: {
+ type: 'string',
+ title: '用车需求',
+ ui: {
+ widget: 'custom',
+ placeholder: '请输入'
+ }
+ },
+ drivers: {
+ type: 'string',
+ title: '承运司机',
+ ui: {
+ widget: 'custom',
+ placeholder: '请输入'
+ }
+ },
+ weightModel: {
+ type: 'string',
+ title: '车型车长承重',
+ ui: {
+ widget: 'custom',
+ placeholder: '请输入'
+ }
+ },
+ loadTime: {
+ type: 'string',
+ title: '发车时间',
+ ui: {
+ widget: 'custom',
+ placeholder: '请输入'
+ }
+ },
+ unloadTime: {
+ type: 'string',
+ title: '到车时间',
+ ui: {
+ widget: 'custom',
+ placeholder: '请输入'
+ }
+ },
+ acceptWeight: {
+ type: 'number',
+ title: '装货重量',
+ minimum:0,
+ maximum:99999,
+ ui: {
+ unit: '吨',
+ placeholder: '请输入',
+ grid: {
+ span: 12
+ },
+ hideStep: true,
+ } as SFNumberWidgetSchema
+ },
+ acceptVolume: {
+ type: 'number',
+ title: '装货体积',
+ minimum:0,
+ maximum:99999,
+ ui: {
+ unit: '吨',
+ placeholder: '请输入',
+ grid: {
+ span: 12
+ },
+ hideStep: true,
+ } as SFNumberWidgetSchema
+ },
+ settlementWeight: {
+ type: 'number',
+ title: '卸货重量',
+ minimum:0,
+ maximum:99999,
+ ui: {
+ unit: '吨',
+ placeholder: '请输入',
+ grid: {
+ span: 12
+ },
+ hideStep: true,
+ } as SFNumberWidgetSchema
+ },
+ settlementVolume: {
+ type: 'number',
+ title: '卸货体积',
+ minimum:0,
+ maximum:99999,
+ ui: {
+ unit: '吨',
+ placeholder: '请输入',
+ grid: {
+ span: 12
+ },
+ hideStep: true,
+ } as SFNumberWidgetSchema
+ }
+ },
+ required: ['loadTime','unloadTime']
+ };
+ this.ui4 = {
+ '*': {
+ spanLabelFixed: 90,
+ grid: { span: 24 }
+ },
+ $weight: {
+ grid: { span: 24 }
+ },
+ $carmand: {
+ grid: { span: 24 }
+ },
+ $weightModel: {
+ spanLabelFixed: 120,
+ grid: { span: 12 }
+ },
+ $drivers: {
+ grid: { span: 12 }
+ },
+ $loadTime: {
+ grid: { span: 12 }
+ },
+ $unloadTime: {
+ grid: { span: 12 }
+ },
+ };
+}
// 处理上传图片
handlePreview1 = async (file: NzUploadFile) => {
if (!file.url && !file.preview) {
@@ -970,4 +868,25 @@ goDistance(elf: NzCardComponent) {
elf['elementRef'].nativeElement.scrollIntoView({ behavior: 'smooth', block: 'start', inline: 'start' });
}
}
+ // 装卸货地址互换
+ swapAddress() {
+ let item = this.startInfo;
+ this.startInfo = this.endInfo;
+ this.endInfo = item;
+
+ this.startInfo.forEach((element: any) => {
+ element.type = '1';
+ });
+ this.endInfo.forEach((element: any) => {
+ element.type = '2';
+ });
+
+ // 计算里程,时间
+ if (this.startInfo[0]?.area && this.endInfo[0]?.area) {
+ this.amapService.drivingCompute([...this.startInfo], [...this.endInfo]).subscribe(res => {
+ this.totalDistance = res.distance;
+ this.totalTime = res.time;
+ });
+ }
+ }
}
diff --git a/src/app/routes/order-management/components/vehicle-detail-change/vehicle-detail-change.component.html b/src/app/routes/order-management/components/vehicle-detail-change/vehicle-detail-change.component.html
index 2b0a8b4a..1901a4c1 100644
--- a/src/app/routes/order-management/components/vehicle-detail-change/vehicle-detail-change.component.html
+++ b/src/app/routes/order-management/components/vehicle-detail-change/vehicle-detail-change.component.html
@@ -112,7 +112,8 @@
diff --git a/src/app/routes/order-management/components/vehicle-detail-change/vehicle-detail-change.component.ts b/src/app/routes/order-management/components/vehicle-detail-change/vehicle-detail-change.component.ts
index 85026bb9..364de33d 100644
--- a/src/app/routes/order-management/components/vehicle-detail-change/vehicle-detail-change.component.ts
+++ b/src/app/routes/order-management/components/vehicle-detail-change/vehicle-detail-change.component.ts
@@ -4,7 +4,7 @@
* @Author : Shiming
* @Date : 2021-12-23 13:39:58
* @LastEditors : Shiming
- * @LastEditTime : 2022-03-04 10:45:54
+ * @LastEditTime : 2022-03-04 10:48:50
* @FilePath : \\tms-obc-web\\src\\app\\routes\\order-management\\components\\vehicle-detail-change\\vehicle-detail-change.component.ts
* Copyright (C) 2022 huzhenhong. All rights reserved.
*/
@@ -883,5 +883,41 @@ export class OrderManagementVehicleDetailChangeComponent implements OnInit {
}
console.log(elf);
}
-
+ // 装卸货地址互换
+ swapAddress() {
+ this.startInfo.forEach((element: any, index: any) => {
+ this.validateForm1.removeControl(`loadAddress${index}`);
+ this.validateForm1.removeControl(`loadName${index}`);
+ this.validateForm1.removeControl(`loadPhone${index}`);
+ });
+ this.endInfo.forEach((element: any, index: any) => {
+ this.validateForm1.removeControl(`unloadAddress${index}`);
+ this.validateForm1.removeControl(`unloadName${index}`);
+ this.validateForm1.removeControl(`unloadPhone${index}`);
+ });
+
+ let item = this.startInfo;
+ this.startInfo = this.endInfo;
+ this.endInfo = item;
+
+ this.startInfo.forEach((element: any, index: any) => {
+ element.type = '1';
+ this.validateForm1.addControl(`loadAddress${index}`, new FormControl(null, Validators.required));
+ this.validateForm1.addControl(`loadName${index}`, new FormControl(null, Validators.required));
+ this.validateForm1.addControl(`loadPhone${index}`, new FormControl(null, [Validators.required, Validators.pattern('^[0-9]*$')]));
+ });
+ this.endInfo.forEach((element: any, index: any) => {
+ element.type = '2';
+ this.validateForm1.addControl(`unloadAddress${index}`, new FormControl(null, Validators.required));
+ this.validateForm1.addControl(`unloadName${index}`, new FormControl(null, Validators.required));
+ this.validateForm1.addControl(`unloadPhone${index}`, new FormControl(null, [Validators.required, Validators.pattern('^[0-9]*$')]));
+ });
+ // 计算里程,时间
+ if (this.startInfo[0]?.area && this.endInfo[0]?.area) {
+ this.amapService.drivingCompute([...this.startInfo], [...this.endInfo]).subscribe(res => {
+ this.totalDistance = res.distance;
+ this.totalTime = res.time;
+ });
+ }
+ }
}
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 0bf4285d..89fc5b4b 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
@@ -1024,6 +1024,13 @@ export class SupplyManagementBulkPublishComponent implements OnInit {
if (this.PageStatus === '大宗修改') {
this.sf4data.id = res?.goodsInfoVOList[0]?.id;
}
+ // 计算里程,时间
+ if (this.startInfo[0]?.area && this.endInfo[0]?.area) {
+ this.amapService.drivingCompute([...this.startInfo], [...this.endInfo]).subscribe(res => {
+ this.totalDistance = res.distance;
+ this.totalTime = res.time;
+ });
+ }
this.totalFees = res?.freightPrice || '0';
this.sf7data = {
stateReceipt: res?.stateReceipt,