From 478739e51aba6ec59176a80af66e922c69914a0c Mon Sep 17 00:00:00 2001 From: wangshiming Date: Tue, 22 Feb 2022 10:14:29 +0800 Subject: [PATCH 1/3] fix bug --- .../vehicle-detail.component.html | 14 +++-- .../vehicle-detail.component.ts | 54 ++++++++++++++----- .../services/order-management.service.ts | 4 +- 3 files changed, 55 insertions(+), 17 deletions(-) diff --git a/src/app/routes/order-management/components/vehicle-detail/vehicle-detail.component.html b/src/app/routes/order-management/components/vehicle-detail/vehicle-detail.component.html index efb2e553..7cf882ae 100644 --- a/src/app/routes/order-management/components/vehicle-detail/vehicle-detail.component.html +++ b/src/app/routes/order-management/components/vehicle-detail/vehicle-detail.component.html @@ -4,7 +4,7 @@ * @Author : Shiming * @Date : 2021-12-28 14:42:03 * @LastEditors : Shiming - * @LastEditTime : 2022-02-16 15:42:18 + * @LastEditTime : 2022-02-22 10:10:59 * @FilePath : \\tms-obc-web\\src\\app\\routes\\order-management\\components\\vehicle-detail\\vehicle-detail.component.html * Copyright (C) 2022 huzhenhong. All rights reserved. --> @@ -199,17 +199,23 @@
- +
- + +
+ + + + + +
diff --git a/src/app/routes/order-management/components/vehicle-detail/vehicle-detail.component.ts b/src/app/routes/order-management/components/vehicle-detail/vehicle-detail.component.ts index 5529d685..a471191c 100644 --- a/src/app/routes/order-management/components/vehicle-detail/vehicle-detail.component.ts +++ b/src/app/routes/order-management/components/vehicle-detail/vehicle-detail.component.ts @@ -4,7 +4,7 @@ * @Author : Shiming * @Date : 2021-12-28 14:42:03 * @LastEditors : Shiming - * @LastEditTime : 2022-02-16 16:37:16 + * @LastEditTime : 2022-02-22 10:13:22 * @FilePath : \\tms-obc-web\\src\\app\\routes\\order-management\\components\\vehicle-detail\\vehicle-detail.component.ts * Copyright (C) 2022 huzhenhong. All rights reserved. */ @@ -14,6 +14,7 @@ import { STColumn } from '@delon/abc/st'; import { NzCardComponent } from 'ng-zorro-antd/card'; import { NzMessageService } from 'ng-zorro-antd/message'; import { NzModalService } from 'ng-zorro-antd/modal'; +import format from 'date-fns/format'; import { OrderManagementService } from '../../services/order-management.service'; @Component({ selector: 'app-supply-management-vehicle-detail', @@ -54,6 +55,8 @@ export class OrderManagementVehicleDetailComponent implements OnInit { } } ]; + trajectory = "car" + addressItems:any[] = []; //打点地址数据组 constructor( private route: ActivatedRoute, @@ -126,20 +129,47 @@ export class OrderManagementVehicleDetailComponent implements OnInit { // elf['elementRef'].nativeElement.className = 'target-fix' } } - MapInit() { - this.service.request('/api/sdc/billShipper/getTrajectoryByBillId', { id: this.id }).subscribe(res => { - if (res?.trackArray) { - const points = res?.trackArray; - const list: any[] = []; - points.forEach((item: any) => { - list.push({ - name: item?.hgt, - lnglat: [Number((Number(item?.lon) / 600000).toFixed(6)), Number((Number(item?.lat) / 600000).toFixed(6))] + // MapInit() { + // this.service.request('/api/sdc/billShipper/getTrajectoryByBillId', { id: this.id }).subscribe(res => { + // if (res?.trackArray) { + // const points = res?.trackArray; + // const list: any[] = []; + // points.forEach((item: any) => { + // list.push({ + // name: item?.hgt, + // lnglat: [Number((Number(item?.lon) / 600000).toFixed(6)), Number((Number(item?.lat) / 600000).toFixed(6))] + // }); + // }); + // console.log(list); + // this.MapList = list; + // } + // }); + // } + + // 获取轨迹 + MapInit(){ + this.service.request(this.service.$api_get_getTrajectory, { id: this.id }).subscribe(res => { + if (res) { + const points = res.trackArray; + points?.forEach((item: any) => { + this.MapList.push({ + name: item.hgt, + lnglat: [Number((Number(item.lon) / 600000).toFixed(6)), Number((Number(item.lat) / 600000).toFixed(6))] }); }); - console.log(list); - this.MapList = list; + this.addressItems = res.parkArray; + if(this.addressItems && this.addressItems.length > 0){ + this.addressItems.forEach(item => { + item.parkBte = this.getLocalTime(item.parkBte); + item.parkEte = this.getLocalTime(item.parkEte); + }); + } } }); } + + getLocalTime(time:any) { + return format(new Date(parseInt(time)), 'yyyy-MM-dd HH:mm:ss'); + } + } diff --git a/src/app/routes/order-management/services/order-management.service.ts b/src/app/routes/order-management/services/order-management.service.ts index 2b1b0539..0a8de122 100644 --- a/src/app/routes/order-management/services/order-management.service.ts +++ b/src/app/routes/order-management/services/order-management.service.ts @@ -4,7 +4,7 @@ * @Author : Shiming * @Date : 2021-12-03 15:31:52 * @LastEditors : Shiming - * @LastEditTime : 2022-01-25 15:26:23 + * @LastEditTime : 2022-02-22 10:12:14 * @FilePath : \\tms-obc-web\\src\\app\\routes\\order-management\\services\\order-management.service.ts * Copyright (C) 2022 huzhenhong. All rights reserved. */ @@ -158,6 +158,8 @@ export class OrderManagementService extends ShipperBaseService { } // 获取数据字典 $api_getDictValue = `/api/mdc/pbc/dictItems/getDictValue`; + // 获取轨迹 + $api_get_getTrajectory = `/api/sdc/billShipper/getTrajectoryByBillId`; /** * 根据企业ID,获取企业历史网络货运人 * @returns From 67bb8b3ccfcfb44bd7562afe89d181c7122bb1fb Mon Sep 17 00:00:00 2001 From: wangshiming Date: Tue, 22 Feb 2022 10:16:19 +0800 Subject: [PATCH 2/3] fix bug --- .../bulk-detail/bulk-detail.component.html | 14 ++- .../bulk-detail/bulk-detail.component.ts | 99 ++++++++++++------- .../vehicle-detail.component.ts | 17 ++-- 3 files changed, 80 insertions(+), 50 deletions(-) diff --git a/src/app/routes/order-management/components/bulk-detail/bulk-detail.component.html b/src/app/routes/order-management/components/bulk-detail/bulk-detail.component.html index 9caa3594..860c4990 100644 --- a/src/app/routes/order-management/components/bulk-detail/bulk-detail.component.html +++ b/src/app/routes/order-management/components/bulk-detail/bulk-detail.component.html @@ -202,17 +202,23 @@
- +
- + +
- +
+ + + + + +
diff --git a/src/app/routes/order-management/components/bulk-detail/bulk-detail.component.ts b/src/app/routes/order-management/components/bulk-detail/bulk-detail.component.ts index 701800a8..01e93833 100644 --- a/src/app/routes/order-management/components/bulk-detail/bulk-detail.component.ts +++ b/src/app/routes/order-management/components/bulk-detail/bulk-detail.component.ts @@ -1,10 +1,10 @@ /* - * @Description : + * @Description : * @Version : 1.0 * @Author : Shiming * @Date : 2021-12-06 20:20:26 * @LastEditors : Shiming - * @LastEditTime : 2022-01-18 17:18:24 + * @LastEditTime : 2022-02-22 10:16:11 * @FilePath : \\tms-obc-web\\src\\app\\routes\\order-management\\components\\bulk-detail\\bulk-detail.component.ts * Copyright (C) 2022 huzhenhong. All rights reserved. */ @@ -17,14 +17,15 @@ import { NzMessageService } from 'ng-zorro-antd/message'; import { NzModalService } from 'ng-zorro-antd/modal'; import { OrderManagementService } from '../../services/order-management.service'; import { NzCardComponent } from 'ng-zorro-antd/card'; +import format from 'date-fns/format'; + @Component({ selector: 'app-supply-management-bulk-detail', templateUrl: './bulk-detail.component.html', styleUrls: ['./bulk-detail.component.less'] }) export class OrderManagementBulkeDetailComponent implements OnInit { - - + MapList: any; id = this.route.snapshot.params.id; i: any; imges: any; @@ -46,75 +47,99 @@ export class OrderManagementBulkeDetailComponent implements OnInit { '1': { text: '待申请', color: 'warning' }, '2': { text: '已支付', color: 'success' }, '3': { text: '已拒绝', color: 'warning' }, - '4': { text: '申请中', color: 'warning' }, - }, - }, + '4': { text: '申请中', color: 'warning' } + } + } ]; - + trajectory = 'car'; + addressItems: any[] = []; //打点地址数据组 constructor( private route: ActivatedRoute, private msgSrv: NzMessageService, private service: OrderManagementService, private router: Router, - private modal: NzModalService, - ) { - - } + private modal: NzModalService + ) {} ngOnInit(): void { - this.initData() + this.initData(); + this.MapInit(); } initData() { - this.service.request(this.service.$api_getBulkBillDetail, {id: this.id}).subscribe(res => { + this.service.request(this.service.$api_getBulkBillDetail, { id: this.id }).subscribe(res => { if (res) { - this.i =res; + this.i = res; this.attObj = this.i?.billExpenseDetails?.filter((data: any) => data.expenseCode === 'ATT')[0]; this.totalObj = this.i?.billExpenseDetails?.filter((data: any) => data.expenseCode === 'TOTAL')[0]; } - }) + }); } - goBack() { window.history.go(-1); } - // 修改订单 + // 修改订单 changeOrder() { - this.router.navigate(['order-management/bulk-detailChange', this.id]) + this.router.navigate(['order-management/bulk-detailChange', this.id]); } agreement(value: any) { - if(value === '1') { - this.imges = this.i?.supplementAgreement + if (value === '1') { + this.imges = this.i?.supplementAgreement; } else if (value === '2') { - this.imges = this.i?.supplementAgreement - } + this.imges = this.i?.supplementAgreement; + } this.isVisible = true; } handleCancel() { - this.isVisible = false + this.isVisible = false; } handleOK() { - this.isVisible = false + this.isVisible = false; } goDistance(elf: NzCardComponent) { if (elf) { elf['elementRef'].nativeElement.scrollIntoView({ behavior: 'smooth', block: 'start', inline: 'start' }); } } - // 取消订单 + // 取消订单 cancellation() { - // api_get_cancelAnOrder - this.modal.confirm({ - nzTitle: '确定取消该订单吗?', - nzContent: `取消后无法恢复,请确认`, - nzOnOk: () => - this.service.request(this.service.$api_get_cancelAnOrder, {id: this.id}).subscribe((res) => { - if (res === true) { - this.service.msgSrv.success('操作成功!'); - this.initData(); - } - }), + // api_get_cancelAnOrder + this.modal.confirm({ + nzTitle: '确定取消该订单吗?', + nzContent: `取消后无法恢复,请确认`, + nzOnOk: () => + this.service.request(this.service.$api_get_cancelAnOrder, { id: this.id }).subscribe(res => { + if (res === true) { + this.service.msgSrv.success('操作成功!'); + this.initData(); + } }) + }); + } + // 获取轨迹 + MapInit() { + this.service.request(this.service.$api_get_getTrajectory, { id: this.id }).subscribe(res => { + if (res) { + const points = res.trackArray; + points?.forEach((item: any) => { + this.MapList.push({ + name: item.hgt, + lnglat: [Number((Number(item.lon) / 600000).toFixed(6)), Number((Number(item.lat) / 600000).toFixed(6))] + }); + }); + this.addressItems = res.parkArray; + if (this.addressItems && this.addressItems.length > 0) { + this.addressItems.forEach(item => { + item.parkBte = this.getLocalTime(item.parkBte); + item.parkEte = this.getLocalTime(item.parkEte); + }); + } + } + }); + } + + getLocalTime(time: any) { + return format(new Date(parseInt(time)), 'yyyy-MM-dd HH:mm:ss'); } } diff --git a/src/app/routes/order-management/components/vehicle-detail/vehicle-detail.component.ts b/src/app/routes/order-management/components/vehicle-detail/vehicle-detail.component.ts index a471191c..29f2a898 100644 --- a/src/app/routes/order-management/components/vehicle-detail/vehicle-detail.component.ts +++ b/src/app/routes/order-management/components/vehicle-detail/vehicle-detail.component.ts @@ -55,8 +55,8 @@ export class OrderManagementVehicleDetailComponent implements OnInit { } } ]; - trajectory = "car" - addressItems:any[] = []; //打点地址数据组 + trajectory = 'car'; + addressItems: any[] = []; //打点地址数据组 constructor( private route: ActivatedRoute, @@ -145,9 +145,9 @@ export class OrderManagementVehicleDetailComponent implements OnInit { // } // }); // } - + // 获取轨迹 - MapInit(){ + MapInit() { this.service.request(this.service.$api_get_getTrajectory, { id: this.id }).subscribe(res => { if (res) { const points = res.trackArray; @@ -158,7 +158,7 @@ export class OrderManagementVehicleDetailComponent implements OnInit { }); }); this.addressItems = res.parkArray; - if(this.addressItems && this.addressItems.length > 0){ + if (this.addressItems && this.addressItems.length > 0) { this.addressItems.forEach(item => { item.parkBte = this.getLocalTime(item.parkBte); item.parkEte = this.getLocalTime(item.parkEte); @@ -167,9 +167,8 @@ export class OrderManagementVehicleDetailComponent implements OnInit { } }); } - - getLocalTime(time:any) { - return format(new Date(parseInt(time)), 'yyyy-MM-dd HH:mm:ss'); - } + getLocalTime(time: any) { + return format(new Date(parseInt(time)), 'yyyy-MM-dd HH:mm:ss'); + } } From 29da0fbb41156ea4ab8da7b63cb02c1737c134f0 Mon Sep 17 00:00:00 2001 From: wangshiming Date: Tue, 22 Feb 2022 10:59:05 +0800 Subject: [PATCH 3/3] fix bug --- .../abnormal-appear.component.ts | 32 ++++++++++++++++--- 1 file changed, 27 insertions(+), 5 deletions(-) diff --git a/src/app/routes/waybill-management/components/abnormal-appear/abnormal-appear.component.ts b/src/app/routes/waybill-management/components/abnormal-appear/abnormal-appear.component.ts index 4e471280..c2be082a 100644 --- a/src/app/routes/waybill-management/components/abnormal-appear/abnormal-appear.component.ts +++ b/src/app/routes/waybill-management/components/abnormal-appear/abnormal-appear.component.ts @@ -134,6 +134,9 @@ export class WaybillManagementAbnormalAppearComponent implements OnInit { return of([]); } }, + change: (q: any) => { + this.getRegionCode(q); + }, visibleIf: { _$expand: (value: boolean) => value, }, @@ -144,13 +147,11 @@ export class WaybillManagementAbnormalAppearComponent implements OnInit { title: '所属项目', ui: { widget: 'select', - allowClear: true, + placeholder: '请选择', visibleIf: { - _$expand: (value: boolean) => value, + _$expand: (value: boolean) => value }, - asyncData: () => - this.shipperSrv.getEnterpriseProject() - } as SFSelectWidgetSchema, + } as SFSelectWidgetSchema }, driverName: { title: '承运司机', @@ -214,4 +215,25 @@ export class WaybillManagementAbnormalAppearComponent implements OnInit { resetSF() { this.sf.reset(); } + // 获取城市列表 + getRegionCode(regionCode: any) { + console.log(regionCode); + return this.service + .request(this.service.$api_get_enterprise_project, { id: regionCode }) + .pipe( + map(res => + res.map((item: any) => ({ + label: item.projectName, + value: item.id + })) + ) + ) + .subscribe(res => { + this.sf.getProperty('/enterpriseProjectId')!.schema.enum = res; + this.sf.getProperty('/enterpriseProjectId')!.widget.reset(res); + // if (this.enterpriseProjectIds) { + // this.sf1.setValue('/enterpriseProjectId', this.enterpriseProjectIds); + // } + }); + } }