This commit is contained in:
wangshiming
2022-03-04 13:34:13 +08:00
parent 3b884de222
commit a98a0592ea
5 changed files with 233 additions and 280 deletions

View File

@ -4,7 +4,7 @@
* @Author : Shiming
* @Date : 2021-12-24 16:58:02
* @LastEditors : Shiming
* @LastEditTime : 2022-03-01 13:42:44
* @LastEditTime : 2022-03-04 13:33:51
* @FilePath : \\tms-obc-web\\src\\app\\routes\\order-management\\components\\bulk-detail-change\\bulk-detail-change.component.html
* Copyright (C) 2022 huzhenhong. All rights reserved.
-->
@ -34,7 +34,7 @@
<sv label="货主">{{ i?.goodsResource?.shipperAppUserName }} </sv>
<sv label="所属项目">{{i?.goodsResource?.enterpriseProjectName}}</sv>
<sv label="服务类型">{{i?.goodsResource?.serviceTypeLabel}}</sv>
<sv label="录单员">{{i?.goodsResource?.createUserName}} /{{i?.goodsResource?.createUserPhone}} </sv>
<sv label="录单员">{{i?.createUserName}} /{{i?.createUserPhone}} </sv>
<sv label="调度员">{{i?.goodsResource?.dispatchName}}/{{i?.goodsResource?.dispatchPhone}} </sv>
</div>
<nz-tabset style="margin-top: 15px;">
@ -125,7 +125,8 @@
</div>
<div nz-col [nzSpan]="4">
<div style="display: flex; justify-content: center">
<span style="padding: 24 px; font-size: 30px; color: #7d7d7d"><i nz-icon nzType="swap" nzTheme="outline"></i></span>
<span class="swap-icon" (click)="swapAddress()"><i nz-icon nzType="swap"
nzTheme="outline"></i></span>
</div>
</div>
<div nz-col [nzSpan]="10">
@ -177,7 +178,7 @@
</div>
</div>
</div>
<div nz-row [nzGutter]="24" style="margin-top: 24px">
<!-- <div nz-row [nzGutter]="24" style="margin-top: 24px">
<div nz-col [nzSpan]="10">
<nz-form-item>
<nz-form-label [nzSpan]="4" nzRequired>装货时间</nz-form-label>
@ -195,7 +196,7 @@
</nz-form-control>
</nz-form-item>
</div>
</div>
</div> -->
<ng-template #endInconTemp1><i nz-icon nzType="environment" nzTheme="outline"></i></ng-template>
</form>
</nz-card>
@ -205,18 +206,7 @@
<sf #sf3 [schema]="schema3" [formData]="sf3data" [button]="'none'" [ui]="ui3"></sf>
<sf #sf4 [schema]="schema4" [formData]="sf4data" [button]="'none'" [ui]="ui4">
<ng-template sf-template="weight" let-item let-ui="ui">
<nz-input-group [nzAddOnAfter]="''">
<input
nz-input
type="number"
[ngModel]="item.value"
min="0"
[max]="999999"
step="0.01"
(ngModelChange)="item.setValue($event)"
placeholder="总重量,必填"
/>
</nz-input-group>
{{i?.goodsInfoList?.[0]?.weight}}吨,{{i?.goodsInfoList?.[0]?.volume}}方,{{i?.goodsInfoList?.[0]?.number}}件
</ng-template>
<ng-template sf-template="volume" let-item let-ui="ui">
<nz-input-group [nzAddOnAfter]="''">

View File

@ -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;
});
}
}
}

View File

@ -112,7 +112,8 @@
</div>
<div nz-col [nzSpan]="4">
<div style="display: flex; justify-content: center">
<span style="padding: 24 px; font-size: 30px; color: #7d7d7d"><i nz-icon nzType="swap" nzTheme="outline"></i></span>
<span class="swap-icon" (click)="swapAddress()"><i nz-icon nzType="swap"
nzTheme="outline"></i></span>
</div>
</div>
<div nz-col [nzSpan]="10">

View File

@ -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;
});
}
}
}

View File

@ -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,