This commit is contained in:
wangshiming
2022-03-11 10:18:57 +08:00
parent d499b524f7
commit ae22b93ac7
2 changed files with 48 additions and 54 deletions

View File

@ -4,7 +4,7 @@
* @Author : Shiming
* @Date : 2021-12-23 13:39:58
* @LastEditors : Shiming
* @LastEditTime : 2022-03-08 16:12:17
* @LastEditTime : 2022-03-11 10:11:31
* @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.
*/
@ -52,6 +52,7 @@ export class OrderManagementVehicleDetailChangeComponent implements OnInit {
dirverPhone: any; // 货源单设置回显
dirverBankCard: any; // 货源单设置回显
listImagUrls: any[] = []; // 货源单设置回显
billExpenses: any[] = []; //运费信息表格信息
dirvingMessage = [];
attObj: any;
totalObj: any;
@ -120,10 +121,9 @@ export class OrderManagementVehicleDetailChangeComponent implements OnInit {
this.initData();
this.initSF3();
this.initSF4();
this.initSF();
}
initSF() {
console.log(this.i);
console.log(this.i.billStatus == '4' || this.i.billStatus == '3');
this.schema = {
properties: {
loadingLadingBillFilePath: {
@ -332,22 +332,22 @@ export class OrderManagementVehicleDetailChangeComponent implements OnInit {
initData() {
this.service.request(this.service.$api_get_getWholeBillDetail, { id: this.id }).subscribe(res => {
console.log(res);
console.log(JSON.stringify(res));
if (res) {
this.i = res;
this.approvalLsit = res.scheduleVOList;
this.attObj = this.i?.billExpenseDetails?.filter((data: any) => data.expenseCode === 'ATT')[0];
this.totalObj = this.i?.billExpenseDetails?.filter((data: any) => data.expenseCode === 'TOTAL')[0];
// this.initSF();
this.approvalLsit = res?.scheduleVOList;
this.billExpenses = this.i?.billExpenseDetails?.filter(
(data: any) => data.expenseCode === 'PRE' || data.expenseCode === 'RECE' || data.expenseCode === 'BACK'
);
this.approvalLsit.map((item: any, key: any) => {
console.log(item);
if (item.displayStatus === 'HIDE') {
delete this.approvalLsit[key];
delete this?.approvalLsit?.[key];
}
});
this.initSF();
// 对装货凭证进行初始化
let arr: any = [];
res?.receiptFilePath.forEach((element: any, index: any) => {
console.log(index);
arr.push({
url: element,
status: 'done',
@ -365,7 +365,7 @@ export class OrderManagementVehicleDetailChangeComponent implements OnInit {
if (this.sf3data.goodsTypeName === '其它') {
this.sf3data.goodsName1 = res?.goodsInfoList[0]?.goodsName || '';
}
this.changeGoodsType(this.sf3data.goodsTypeId, { label: this.sf3data.goodsTypeName, value: this.sf3data.goodsTypeId });
this.changeGoodsType(this.sf3data?.goodsTypeId, { label: this.sf3data?.goodsTypeName, value: this.sf3data?.goodsTypeId });
// 对装卸货信息进行初始化
res?.unLoadingPlaceList.forEach((element: any) => {
if (element.type === 1 || element.type === '1') {
@ -405,16 +405,16 @@ export class OrderManagementVehicleDetailChangeComponent implements OnInit {
}
});
// 对装货凭证进行初始化
if (res.loadingLadingBillFilePath) {
if (res?.loadingLadingBillFilePath) {
this.formData = {
loadingLadingBillFilePath: [
{
uid: 'logo',
name: 'LOGO',
status: 'done',
url: res.loadingLadingBillFilePath,
url: res?.loadingLadingBillFilePath,
response: {
url: res.loadingLadingBillFilePath
url: res?.loadingLadingBillFilePath
}
}
],
@ -423,9 +423,9 @@ export class OrderManagementVehicleDetailChangeComponent implements OnInit {
uid: 'logo',
name: 'LOGO',
status: 'done',
url: res.loadingPeopleVehiclesGoodsFilePath,
url: res?.loadingPeopleVehiclesGoodsFilePath,
response: {
url: res.loadingPeopleVehiclesGoodsFilePath
url: res?.loadingPeopleVehiclesGoodsFilePath
}
}
],
@ -434,9 +434,9 @@ export class OrderManagementVehicleDetailChangeComponent implements OnInit {
uid: 'logo',
name: 'LOGO',
status: 'done',
url: res.unloadingLadingBillFilePath,
url: res?.unloadingLadingBillFilePath,
response: {
url: res.unloadingLadingBillFilePath
url: res?.unloadingLadingBillFilePath
}
}
],
@ -445,23 +445,23 @@ export class OrderManagementVehicleDetailChangeComponent implements OnInit {
uid: 'logo',
name: 'LOGO',
status: 'done',
url: res.unloadingPeopleVehiclesGoodsFilePath,
url: res?.unloadingPeopleVehiclesGoodsFilePath,
response: {
url: res.unloadingPeopleVehiclesGoodsFilePath
url: res?.unloadingPeopleVehiclesGoodsFilePath
}
}
]
};
}
// 发车时间到车时间初始化
this.loadTime = res.loadTime;
this.unloadTime = res.unloadTime;
this.dirvingMessage = res.billExpenseDetails;
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;
this.totalDistance = res?.distance;
this.totalTime = res?.time;
});
}
}
@ -480,8 +480,8 @@ export class OrderManagementVehicleDetailChangeComponent implements OnInit {
let imgList: any = [];
if (this.listImagUrls.length > 0) {
this.listImagUrls?.forEach((res: any) => {
if (res.url) {
imgList.push(res.url);
if (res?.url) {
imgList.push(res?.url);
}
});
}
@ -515,9 +515,6 @@ export class OrderManagementVehicleDetailChangeComponent implements OnInit {
':' +
this.addPreZero(c.getSeconds());
}
console.log('dirvingMessage=>>>>>>' + this.dirvingMessage);
console.log(this.dirvingMessage);
console.log(this.st._data);
const params = {
id: this.id,
unLoadingPlaceDTOList: [...this.startInfo, ...this.endInfo],
@ -554,9 +551,7 @@ export class OrderManagementVehicleDetailChangeComponent implements OnInit {
? this.sf.value?.unloadingPeopleVehiclesGoodsFilePath.data.fullFilePath
: this.sf.value?.unloadingPeopleVehiclesGoodsFilePath?.url
};
console.log(params);
this.service.request(this.service.$api_set_modifyWholeOrder, params).subscribe((res: any) => {
console.log(res);
if (res) {
this.service.msgSrv.success('修改成功!');
this.router.navigate(['/order-management/vehicle/vehicle-detail/', this.id], { relativeTo: this.ar });
@ -575,9 +570,6 @@ export class OrderManagementVehicleDetailChangeComponent implements OnInit {
// -------------------装卸货信息处理
// 打开地图
openMap(type: string, index: number, address: string) {
console.log(type);
console.log(index);
const modalRef = this.modalService.create({
nzTitle: '',
nzComponentParams: { selectedAddress: address },
@ -611,8 +603,8 @@ export class OrderManagementVehicleDetailChangeComponent implements OnInit {
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;
this.totalDistance = res?.distance;
this.totalTime = res?.time;
});
}
}
@ -839,7 +831,6 @@ export class OrderManagementVehicleDetailChangeComponent implements OnInit {
case 'done':
let fileList = [...info.fileList];
// 2. Read from response and show file link
console.log(fileList);
fileList = fileList.map((file: any) => {
if (file.response) {
file.url = file.response.data.fullFilePath;
@ -890,7 +881,6 @@ export class OrderManagementVehicleDetailChangeComponent implements OnInit {
elf['elementRef'].nativeElement.scrollIntoView({ behavior: 'smooth', block: 'start', inline: 'start' });
// elf['elementRef'].nativeElement.className = 'target-fix'
}
console.log(elf);
}
// 装卸货地址互换
swapAddress() {
@ -924,8 +914,8 @@ export class OrderManagementVehicleDetailChangeComponent implements OnInit {
// 计算里程,时间
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.totalDistance = res?.distance;
this.totalTime = res?.time;
});
}
}
@ -933,7 +923,7 @@ export class OrderManagementVehicleDetailChangeComponent implements OnInit {
getTrajectory(){
this.service.request(this.service.$api_get_getTrajectory, { id: this.id }).subscribe(res => {
if (res) {
const points = res.trackArray;
const points = res?.trackArray;
let list :any[] = [];
points?.forEach((item: any) => {
list.push({
@ -942,7 +932,7 @@ export class OrderManagementVehicleDetailChangeComponent implements OnInit {
});
});
this.mapList = list;
this.addressItems = res.cityArray;
this.addressItems = res?.cityArray;
if(this.addressItems && this.addressItems.length > 0){
this.addressItems.forEach(item => {
item.vinOutTime = this.getLocalTime(item.vinOutTime);
@ -956,7 +946,7 @@ export class OrderManagementVehicleDetailChangeComponent implements OnInit {
getDriverTrajectory(){
this.service.request(this.service.$api_get_getAppDriverPosition, { id: this.id }).subscribe(res => {
if (res) {
const points = res.tracks;
const points = res?.tracks;
let list :any[] = [];
points?.forEach((item: any) => {
list.push({
@ -965,7 +955,7 @@ export class OrderManagementVehicleDetailChangeComponent implements OnInit {
});
});
this.mapList = list;
this.addressItems = [...res.enclosureDataAppTrack];
this.addressItems = [...res?.enclosureDataAppTrack];
if(this.addressItems && this.addressItems.length > 0){
this.addressItems.forEach(item => {
item.vinOutTime = this.getLocalTime(item.gtm);