edit
This commit is contained in:
@ -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: '订单明细<br/>',
|
||||
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: '查看原因<br/>',
|
||||
|
||||
@ -12,7 +12,7 @@
|
||||
<app-requested-detail [id]="id"></app-requested-detail>
|
||||
|
||||
<st
|
||||
#st
|
||||
#st1
|
||||
[data]="service.$api_get_invoice_requested_order_detail"
|
||||
[columns]="columns"
|
||||
bordered
|
||||
|
||||
@ -6,9 +6,10 @@
|
||||
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
||||
* @FilePath : \\tms-obc-web\\src\\app\\routes\\ticket-management\\components\\invoice-requested\\requested-invoice-modal\\requested-invoice-modal.component.ts
|
||||
*/
|
||||
import { Component, OnInit, ViewChild } from '@angular/core';
|
||||
import { Component, ViewChild } from '@angular/core';
|
||||
import { STChange, STColumn, STComponent, STRequestOptions } from '@delon/abc/st';
|
||||
import { NzModalRef, NzModalService } from 'ng-zorro-antd/modal';
|
||||
|
||||
import { TicketService } from '../../../services/ticket.service';
|
||||
|
||||
@Component({
|
||||
@ -16,16 +17,14 @@ import { TicketService } from '../../../services/ticket.service';
|
||||
templateUrl: './requested-invoice-modal.component.html',
|
||||
styleUrls: ['./requested-invoice-modal.component.less']
|
||||
})
|
||||
export class RequestedInvoiceModalComponent implements OnInit {
|
||||
@ViewChild('st', { static: false })
|
||||
st!: STComponent;
|
||||
export class RequestedInvoiceModalComponent {
|
||||
@ViewChild('st1', { static: false })
|
||||
st1!: STComponent;
|
||||
columns: STColumn[] = this.initST();
|
||||
id: any;
|
||||
selectedRows: any[] = [];
|
||||
constructor(public service: TicketService, private nzModalService: NzModalService, private modal: NzModalRef) {}
|
||||
|
||||
ngOnInit(): void {}
|
||||
|
||||
beforeReq = (requestOptions: STRequestOptions) => {
|
||||
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);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@ -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<any>();
|
||||
readonly clcikPointEvent = new EventEmitter<any>();
|
||||
|
||||
@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<any>) {
|
||||
setData(pathList: any[]) {
|
||||
this.pathSimplifierIns.setData(pathList);
|
||||
}
|
||||
|
||||
@ -224,7 +224,7 @@ export class AmapPathSimplifierComponent implements OnInit, OnChanges {
|
||||
}
|
||||
|
||||
/** 根据经纬度获取地址信息 */
|
||||
getPoiByPositon(position: Array<string>) {
|
||||
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<string>;
|
||||
position: string[];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user