From 8a80a1de3ccc4ae2d0f7139cd1c6853207d8707f Mon Sep 17 00:00:00 2001 From: TaricXin <583259872@qq.com> Date: Mon, 14 Mar 2022 16:14:31 +0800 Subject: [PATCH] edit --- .../invoice-requested.component.ts | 14 +++++--- .../requested-invoice-modal.component.html | 2 +- .../requested-invoice-modal.component.ts | 34 ++++++++++--------- .../amap-path-simplifier.component.ts | 24 +++++++------ 4 files changed, 41 insertions(+), 33 deletions(-) diff --git a/src/app/routes/ticket-management/components/invoice-requested/invoice-requested.component.ts b/src/app/routes/ticket-management/components/invoice-requested/invoice-requested.component.ts index 663c4091..50dc913b 100644 --- a/src/app/routes/ticket-management/components/invoice-requested/invoice-requested.component.ts +++ b/src/app/routes/ticket-management/components/invoice-requested/invoice-requested.component.ts @@ -1,12 +1,13 @@ import { query } from '@angular/animations'; import { CurrencyPipe } from '@angular/common'; -import { Component, OnInit, ViewChild } from '@angular/core'; +import { Component, ViewChild } from '@angular/core'; import { Router } from '@angular/router'; import { STComponent, STColumn, STChange, STRequestOptions } from '@delon/abc/st'; import { SFComponent, SFSchema, SFDateWidgetSchema, SFUISchema } from '@delon/form'; import { isTemplateRef } from 'ng-zorro-antd/core/util'; import { NzMessageService } from 'ng-zorro-antd/message'; import { NzModalService } from 'ng-zorro-antd/modal'; + import { TicketService } from '../../services/ticket.service'; import { PrintOrderModalComponent } from './print-order-modal/print-order-modal.component'; import { RequestedInvoiceModalComponent } from './requested-invoice-modal/requested-invoice-modal.component'; @@ -16,7 +17,7 @@ import { RequestedInvoiceModalComponent } from './requested-invoice-modal/reques templateUrl: './invoice-requested.component.html', styleUrls: ['./invoice-requested.component.less', '../../../commom/less/box.less'] }) -export class InvoiceRequestedComponent implements OnInit { +export class InvoiceRequestedComponent { @ViewChild('st', { static: true }) st!: STComponent; @ViewChild('sf', { static: false }) @@ -33,8 +34,6 @@ export class InvoiceRequestedComponent implements OnInit { selectedRows: any[] = []; constructor(public service: TicketService, private nzModalService: NzModalService, private router: Router) {} - ngOnInit(): void {} - beforeReq = (requestOptions: STRequestOptions) => { if (this.resourceStatus) { Object.assign(requestOptions.body, { sts: this.resourceStatus }); @@ -219,6 +218,11 @@ export class InvoiceRequestedComponent implements OnInit { }, nzFooter: null }); + modal.afterClose.subscribe(res => { + if (res) { + this.st.load(1); + } + }); } /** @@ -421,7 +425,7 @@ export class InvoiceRequestedComponent implements OnInit { // }, { text: '订单明细
', - click: item => this.router.navigate(['/ticket/invoice-requested/detail/' + item?.id], { queryParams: { sts: item.sts } }) + click: item => this.router.navigate([`/ticket/invoice-requested/detail/${item?.id}`], { queryParams: { sts: item.sts } }) }, { text: '查看原因
', diff --git a/src/app/routes/ticket-management/components/invoice-requested/requested-invoice-modal/requested-invoice-modal.component.html b/src/app/routes/ticket-management/components/invoice-requested/requested-invoice-modal/requested-invoice-modal.component.html index 8e20fb35..14c7d14d 100644 --- a/src/app/routes/ticket-management/components/invoice-requested/requested-invoice-modal/requested-invoice-modal.component.html +++ b/src/app/routes/ticket-management/components/invoice-requested/requested-invoice-modal/requested-invoice-modal.component.html @@ -12,7 +12,7 @@ { Object.assign(requestOptions.body, { vatappHId: this.id }); return requestOptions; @@ -33,6 +32,7 @@ export class RequestedInvoiceModalComponent implements OnInit { /** * 移除订单 + * * @returns */ removeOrder(item: any[]) { @@ -45,7 +45,7 @@ export class RequestedInvoiceModalComponent implements OnInit { this.service.request(this.service.$api_remove_bill, ids).subscribe(res => { if (res) { this.service.msgSrv.success('移除成功'); - this.modal.destroy(); + this.modal.destroy(true); } }); } @@ -57,7 +57,7 @@ export class RequestedInvoiceModalComponent implements OnInit { this.selectedRows = e.checkbox!; break; case 'filter': - this.st.load(); + this.st1.load(); break; } } @@ -78,7 +78,7 @@ export class RequestedInvoiceModalComponent implements OnInit { width: 90, type: 'widget', className: 'text-right', - widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.billkpmoney }) } + widget: { type: 'currency-chy', params: ({ record }: any) => ({ value: record.billkpmoney }) } }, { title: '运输费', @@ -86,7 +86,7 @@ export class RequestedInvoiceModalComponent implements OnInit { width: 90, type: 'widget', className: 'text-right', - widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.fjfmoney2 }) } + widget: { type: 'currency-chy', params: ({ record }: any) => ({ value: record.fjfmoney2 }) } }, { title: '附加费', @@ -94,7 +94,7 @@ export class RequestedInvoiceModalComponent implements OnInit { width: 90, type: 'widget', className: 'text-right', - widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.fjfmoney }) } + widget: { type: 'currency-chy', params: ({ record }: any) => ({ value: record.fjfmoney }) } }, { title: '操作', @@ -104,7 +104,7 @@ export class RequestedInvoiceModalComponent implements OnInit { buttons: [ { text: '移除', - click: item => this.removeOrder([item]) + click: (item: any) => this.removeOrder([item]) } ] } @@ -116,17 +116,19 @@ export class RequestedInvoiceModalComponent implements OnInit { return; } const selectedRows = this.selectedRows.map(item => { - delete item._values; - return item; + return { ...item }; }); const params = { - ficoVatappBillVOList: selectedRows, + ficoVatappBillVOList: selectedRows.map(item => { + delete item._values; + return item; + }), id: this.id }; this.service.request(this.service.$api_get_applyFicoVatinv, params).subscribe((res: any) => { if (res) { this.service.msgSrv.success('开票成功'); - this.modal.destroy(); + this.modal.destroy(true); } }); } diff --git a/src/app/shared/components/amap/amap-path-simplifier/amap-path-simplifier.component.ts b/src/app/shared/components/amap/amap-path-simplifier/amap-path-simplifier.component.ts index ccac8683..928a066f 100644 --- a/src/app/shared/components/amap/amap-path-simplifier/amap-path-simplifier.component.ts +++ b/src/app/shared/components/amap/amap-path-simplifier/amap-path-simplifier.component.ts @@ -1,8 +1,8 @@ -import { Component, Input, OnChanges, OnInit, Output, SimpleChanges, EventEmitter } from '@angular/core'; -import { BaseService } from 'src/app/shared/services'; -import { throwError } from 'rxjs'; import AMapLoader from '@amap/amap-jsapi-loader'; +import { Component, Input, OnChanges, OnInit, Output, SimpleChanges, EventEmitter, OnDestroy } from '@angular/core'; import { amapConf } from '@conf/amap.config'; +import { throwError } from 'rxjs'; +import { BaseService } from 'src/app/shared/services'; declare var AMap: any; declare var AMapUI: any; declare var Loca: any; @@ -13,7 +13,7 @@ const CONFIG = amapConf; templateUrl: './amap-path-simplifier.component.html', styleUrls: ['./amap-path-simplifier.component.less'] }) -export class AmapPathSimplifierComponent implements OnInit, OnChanges { +export class AmapPathSimplifierComponent implements OnInit, OnChanges, OnDestroy { aMap: any; pathSimplifierIns: any; geocoder: any; @@ -32,7 +32,7 @@ export class AmapPathSimplifierComponent implements OnInit, OnChanges { mapHeight = '500px'; @Output() - clcikPointEvent = new EventEmitter(); + readonly clcikPointEvent = new EventEmitter(); @Input() pois: any = []; @@ -45,7 +45,7 @@ export class AmapPathSimplifierComponent implements OnInit, OnChanges { this.setPathIndex(this.selectedIndex); } if (changes?.MapList?.currentValue && this?.pathSimplifierIns && changes.MapList?.currentValue.length > 0) { - console.log(this.MapList); + // console.log(this.MapList); this.pathList = [ { name: '路线1', @@ -130,7 +130,7 @@ export class AmapPathSimplifierComponent implements OnInit, OnChanges { getHoverTitle: function (pathData: any, pathIndex: any, pointIndex: any) { if (pointIndex >= 0) { //point - return pathData.name + ',' + pathData.points[pointIndex].name; + return `${pathData.name},${pathData.points[pointIndex].name}`; } return ''; }, @@ -147,7 +147,7 @@ export class AmapPathSimplifierComponent implements OnInit, OnChanges { this.pathSimplifierIns.on('pointClick', (e: any, info: any) => { this.clcikPointEvent.emit({ e, info }); - console.log('Click: ' + info.pathData.points[info.pointIndex].name); + console.log(`Click: ${info.pathData.points[info.pointIndex].name}`); }); } @@ -202,7 +202,7 @@ export class AmapPathSimplifierComponent implements OnInit, OnChanges { }); } - setData(pathList: Array) { + setData(pathList: any[]) { this.pathSimplifierIns.setData(pathList); } @@ -224,7 +224,7 @@ export class AmapPathSimplifierComponent implements OnInit, OnChanges { } /** 根据经纬度获取地址信息 */ - getPoiByPositon(position: Array) { + getPoiByPositon(position: string[]) { this.geocoder.getAddress(position, (status: any, result: any) => { if (status === 'complete' && result.info === 'OK') { // result中对应详细地理坐标信息 @@ -239,6 +239,7 @@ export class AmapPathSimplifierComponent implements OnInit, OnChanges { /** * 选中标点,设置窗口信息 + * * @param location */ selectedPOI(location: any) { @@ -250,6 +251,7 @@ export class AmapPathSimplifierComponent implements OnInit, OnChanges { /** * 增加标记点 + * * @param poi */ setPOI(poi: POI) { @@ -278,5 +280,5 @@ export class AmapPathSimplifierComponent implements OnInit, OnChanges { export interface POI { markerLabel: string; color: string; - position: Array; + position: string[]; }