From 09e1dd38f1c60ec1956363ea9f8ab57f1bc8362f Mon Sep 17 00:00:00 2001 From: Taric Xin Date: Tue, 18 Jan 2022 17:00:48 +0800 Subject: [PATCH] edit --- .../payment-order.component.html | 4 +- .../payment-order/payment-order.component.ts | 9 +- .../receipt-order.component.html | 43 ++- .../receipt-order.component.less | 0 .../receipt-order.component.spec.ts | 25 -- .../receipt-order/receipt-order.component.ts | 263 +++++++++++++++++- .../services/freight-account.service.ts | 2 +- .../cancellation-invoice.component.ts | 22 +- .../invoice-detail.component.html | 4 +- .../invoice-detail.component.ts | 19 +- .../invoiced-list.component.html | 4 +- .../invoiced-list/invoiced-list.component.ts | 35 ++- .../services/ticket.service.ts | 3 + 13 files changed, 369 insertions(+), 64 deletions(-) delete mode 100644 src/app/routes/financial-management/components/receipt-order/receipt-order.component.less delete mode 100644 src/app/routes/financial-management/components/receipt-order/receipt-order.component.spec.ts diff --git a/src/app/routes/financial-management/components/payment-order/payment-order.component.html b/src/app/routes/financial-management/components/payment-order/payment-order.component.html index 7c25db5d..264f0092 100644 --- a/src/app/routes/financial-management/components/payment-order/payment-order.component.html +++ b/src/app/routes/financial-management/components/payment-order/payment-order.component.html @@ -12,8 +12,8 @@ [class.expend-options]="_$expand"> - - + + + + + + + + + + + + +
+ + +
+ 已选择 + {{ selectedRows.length }} 张单 + 清空 +
+
+ + + +
\ No newline at end of file diff --git a/src/app/routes/financial-management/components/receipt-order/receipt-order.component.less b/src/app/routes/financial-management/components/receipt-order/receipt-order.component.less deleted file mode 100644 index e69de29b..00000000 diff --git a/src/app/routes/financial-management/components/receipt-order/receipt-order.component.spec.ts b/src/app/routes/financial-management/components/receipt-order/receipt-order.component.spec.ts deleted file mode 100644 index 67886d32..00000000 --- a/src/app/routes/financial-management/components/receipt-order/receipt-order.component.spec.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { ComponentFixture, TestBed } from '@angular/core/testing'; - -import { ReceiptOrderComponent } from './receipt-order.component'; - -describe('ReceiptOrderComponent', () => { - let component: ReceiptOrderComponent; - let fixture: ComponentFixture; - - beforeEach(async () => { - await TestBed.configureTestingModule({ - declarations: [ ReceiptOrderComponent ] - }) - .compileComponents(); - }); - - beforeEach(() => { - fixture = TestBed.createComponent(ReceiptOrderComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/src/app/routes/financial-management/components/receipt-order/receipt-order.component.ts b/src/app/routes/financial-management/components/receipt-order/receipt-order.component.ts index 77e62656..18a5cff3 100644 --- a/src/app/routes/financial-management/components/receipt-order/receipt-order.component.ts +++ b/src/app/routes/financial-management/components/receipt-order/receipt-order.component.ts @@ -1,15 +1,270 @@ -import { Component, OnInit } from '@angular/core'; +import { Component, OnInit, ViewChild } from '@angular/core'; +import { Router } from '@angular/router'; +import { STComponent, STColumn, STRequestOptions, STChange } from '@delon/abc/st'; +import { SFComponent, SFSchema, SFDateWidgetSchema } from '@delon/form'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { AddCollectionInvoiceModalComponent } from 'src/app/routes/ticket-management/components/input-invoice/add-collection-invoice-modal/add-collection-invoice-modal.component'; +import { FreightAccountService } from '../../services/freight-account.service'; @Component({ selector: 'app-receipt-order', templateUrl: './receipt-order.component.html', - styleUrls: ['./receipt-order.component.less'] + styleUrls: ['../../../commom/less/box.less'] }) export class ReceiptOrderComponent implements OnInit { + @ViewChild('st', { static: true }) + st!: STComponent; + @ViewChild('sf', { static: false }) + sf!: SFComponent; + columns: STColumn[] = this.initST(); + searchSchema: SFSchema = this.initSF(); - constructor() { } + _$expand = false; - ngOnInit(): void { + selectedRows: any[] = []; + constructor(public service: FreightAccountService, private nzModalService: NzModalService, private router: Router) {} + + ngOnInit(): void {} + + beforeReq = (requestOptions: STRequestOptions) => { + if (this.sf) { + Object.assign(requestOptions.body, { + ...this.sf.value + }); + } + return requestOptions; + }; + + stChange(e: STChange): void { + switch (e.type) { + case 'checkbox': + this.selectedRows = e.checkbox!; + break; + } } + addInvoice() { + if (this.selectedRows?.length <= 0) { + this.service.msgSrv.warning('请选择收款单'); + return; + } + const modal = this.nzModalService.create({ + nzTitle: '收款单', + nzContent: AddCollectionInvoiceModalComponent, + nzComponentParams: { i: { userId: 0 } }, + nzFooter: null + }); + } + + /** + * 重置表单 + */ + resetSF() { + this.sf.reset(); + this._$expand = false; + } + + /** + * 伸缩查询条件 + */ + expandToggle() { + this._$expand = !this._$expand; + this.sf?.setValue('/expand', this._$expand); + } + + private initSF(): SFSchema { + return { + properties: { + expand: { + type: 'boolean', + ui: { + hidden: true + } + }, + paycodes: { + type: 'string', + title: '收款单号', + ui: { + widget: 'select', + placeholder: '请选择' + } + }, + ltdid: { + type: 'string', + title: '网络货运人', + ui: { + widget: 'select', + placeholder: '请选择', + allowClear: true, + asyncData: () => this.service.getNetworkFreightForwarder() + }, + default: null + }, + paycod1es: { + type: 'string', + title: '银行水单', + ui: { + widget: 'select', + placeholder: '请选择' + } + }, + paytype: { + type: 'string', + title: '收款类型', + ui: { + widget: 'select', + placeholder: '请选择', + visibleIf: { + expand: (value: boolean) => value + } + } + }, + paymode: { + type: 'string', + title: '收款方式', + ui: { + widget: 'select', + placeholder: '请选择', + visibleIf: { + expand: (value: boolean) => value + } + } + }, + arto: { + type: 'string', + title: '付款人', + ui: { + widget: 'select', + placeholder: '请选择', + visibleIf: { + expand: (value: boolean) => value + } + } + }, + orderS2n: { + type: 'string', + title: '收款状态', + ui: { + widget: 'dict-select', + params: { dictKey: 'refund:apply:status' }, + placeholder: '请选择', + visibleIf: { + expand: (value: boolean) => value + } + } + }, + paydate: { + title: '到账日期', + type: 'string', + ui: { + widget: 'sl-from-to-search', + format: 'yyyy-MM-dd', + visibleIf: { + expand: (value: boolean) => value + } + } as SFDateWidgetSchema + }, + createTi1me: { + title: '创建时间', + type: 'string', + ui: { + widget: 'sl-from-to-search', + format: 'yyyy-MM-dd', + visibleIf: { + expand: (value: boolean) => value + } + } as SFDateWidgetSchema + }, + billHCodes: { + type: 'string', + title: '订单号', + ui: { + widget: 'select', + placeholder: '请选择', + visibleIf: { + expand: (value: boolean) => value + } + } + }, + feeHCodes: { + type: 'string', + title: '费用号', + ui: { + widget: 'select', + placeholder: '请选择', + visibleIf: { + expand: (value: boolean) => value + } + } + }, + remarks: { + type: 'string', + title: '付款备注', + ui: { + placeholder: '请选择', + visibleIf: { + expand: (value: boolean) => value + } + } + } + } + }; + } + + private initST(): STColumn[] { + return [ + { title: '', index: 'key', type: 'checkbox' }, + { title: '收款单号', index: 'paycode', type: 'link' }, + { title: '网络货运人', index: 'ltdId' }, + { title: '到账日期', index: 'paydate', type: 'date', width: 140 }, + { title: '收款账户', index: 'call1N2o' }, + { + title: '到账金额', + index: 'paymoney', + width: 120, + type: 'widget', + className: 'text-right', + widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.paymoney }) } + }, + { + title: '核销金额', + index: 'paytype', + width: 120, + type: 'widget', + className: 'text-right', + widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.paymoney }) } + }, + { + title: '预收金额', + index: 'paytype', + width: 120, + type: 'widget', + className: 'text-right', + widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.paymoney }) } + }, + { title: '银行类型', index: 'paytype' }, + { title: '收款类型', index: 'paymode' }, + { title: '收款方式', index: 'paymode' }, + { title: '付款人', index: 'hrto' }, + { title: '银行水单', index: 'callNo' }, + { title: '创建时间', index: 'createTime', type: 'date' }, + { title: '创建人', index: 'createUserId' }, + { title: '收款状态', index: 'payremarks' }, + { title: '收款备注', index: 'payremarks' }, + { + title: '操作', + width: '90px', + buttons: [ + { + text: '浏览', + click: item => this.router.navigate(['/ticket/input-invoice/detail/' + item.id]) + }, + { + text: '修改', + click: item => this.router.navigate(['/ticket/input-invoice/edit/1']) + } + ] + } + ]; + } } diff --git a/src/app/routes/financial-management/services/freight-account.service.ts b/src/app/routes/financial-management/services/freight-account.service.ts index b88c588e..d2b67df5 100644 --- a/src/app/routes/financial-management/services/freight-account.service.ts +++ b/src/app/routes/financial-management/services/freight-account.service.ts @@ -77,7 +77,7 @@ export class FreightAccountService extends ShipperBaseService { $api_get_fico_vch__detail = '/api/fcc/ficoVcH/getDetail'; // 查询付款单抬头 - $api_get_payment_page = '/api/fcc/ficoPayH/list/page'; + $api_get_payment_page = '/api/fcc/ficoPayH/listFicoPayHPage'; // 查询付款单明细 $api_get_payment_detail = '/api/fcc/ficoPayL/list/page'; diff --git a/src/app/routes/ticket-management/components/cancellation-invoice/cancellation-invoice.component.ts b/src/app/routes/ticket-management/components/cancellation-invoice/cancellation-invoice.component.ts index 7a3906a9..9e6fb3d0 100644 --- a/src/app/routes/ticket-management/components/cancellation-invoice/cancellation-invoice.component.ts +++ b/src/app/routes/ticket-management/components/cancellation-invoice/cancellation-invoice.component.ts @@ -12,8 +12,7 @@ import { PushInvoiceComponent } from './push-invoice/push-invoice.component'; @Component({ selector: 'app-cancellation-invoice', templateUrl: './cancellation-invoice.component.html', - styleUrls: ['./cancellation-invoice.component.less'], - providers: [CurrencyPipe] + styleUrls: ['./cancellation-invoice.component.less'] }) export class CancellationInvoiceComponent implements OnInit { @ViewChild('st', { static: true }) @@ -31,12 +30,7 @@ export class CancellationInvoiceComponent implements OnInit { totalCallNo = 0; openInfo: any = { invoicedate: null, invoiceno: null }; - constructor( - public service: TicketService, - private nzModalService: NzModalService, - private router: Router, - private currencyPipe: CurrencyPipe - ) {} + constructor(public service: TicketService, private nzModalService: NzModalService, private router: Router) {} ngOnInit(): void {} @@ -282,9 +276,10 @@ export class CancellationInvoiceComponent implements OnInit { { title: '价税合计', index: 'vatmoney', - width: 90, - type: 'currency', - format: item => `${this.currencyPipe.transform(item.vatmoney)}` + width: 120, + type: 'widget', + className: 'text-right font-weight-bold', + widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.vatmoney }) } }, { title: '金额', @@ -314,7 +309,10 @@ export class CancellationInvoiceComponent implements OnInit { buttons: [ { text: '查看明细', - click: item => this.router.navigate(['ticket/cancellation-invoice/detail/' + item.id], { queryParams: { type: 1 } }) + click: item => + this.router.navigate(['ticket/cancellation-invoice/detail/' + item.id], { + queryParams: { type: 1, expressno: item.expressno } + }) }, { text: '手工开票', diff --git a/src/app/routes/ticket-management/components/invoice-detail/invoice-detail.component.html b/src/app/routes/ticket-management/components/invoice-detail/invoice-detail.component.html index af4b6962..020db5fd 100644 --- a/src/app/routes/ticket-management/components/invoice-detail/invoice-detail.component.html +++ b/src/app/routes/ticket-management/components/invoice-detail/invoice-detail.component.html @@ -144,9 +144,9 @@ -

顺丰快递: SF123456789 已签收 +

顺丰快递: {{routesInfo?.mailNo}} 已签收

- +
diff --git a/src/app/routes/ticket-management/components/invoice-detail/invoice-detail.component.ts b/src/app/routes/ticket-management/components/invoice-detail/invoice-detail.component.ts index cf1f7a78..1071adbf 100644 --- a/src/app/routes/ticket-management/components/invoice-detail/invoice-detail.component.ts +++ b/src/app/routes/ticket-management/components/invoice-detail/invoice-detail.component.ts @@ -33,11 +33,18 @@ export class InvoiceDetailComponent implements OnInit { isEdit = false; headerInfo: any = {}; - + routesInfo: any = { + mailNo: '', + routes: [] + }; constructor(public service: TicketService, private route: ActivatedRoute) { this.isCanEdit = !!route.snapshot.queryParams.type; + const expressno = route.snapshot.queryParams.expressno; const id = route.snapshot.params.id; this.loadInvoiceHeader(id); + if (expressno) { + this.loadRoutes(expressno); + } } ngOnInit(): void {} @@ -60,7 +67,15 @@ export class InvoiceDetailComponent implements OnInit { } }); } - + loadRoutes(expressno: string) { + this.service.request(this.service.$api_get_express_routes, expressno).subscribe(res => { + console.log(res); + if (res) { + res.routes = res.routes.map((route: any) => ({ time: route.acceptTime, value: route.remark + route.acceptAddress, color: 'gray' })); + this.routesInfo = res; + } + }); + } goBack() { history.go(-1); } diff --git a/src/app/routes/ticket-management/components/invoiced-list/invoiced-list.component.html b/src/app/routes/ticket-management/components/invoiced-list/invoiced-list.component.html index c709217a..f573fae2 100644 --- a/src/app/routes/ticket-management/components/invoiced-list/invoiced-list.component.html +++ b/src/app/routes/ticket-management/components/invoiced-list/invoiced-list.component.html @@ -52,8 +52,8 @@

- 顺丰快递: SF123456789 + 顺丰快递: {{routesInfo?.mailNo}} 已签收

- +
\ No newline at end of file diff --git a/src/app/routes/ticket-management/components/invoiced-list/invoiced-list.component.ts b/src/app/routes/ticket-management/components/invoiced-list/invoiced-list.component.ts index 5bedc872..1292a138 100644 --- a/src/app/routes/ticket-management/components/invoiced-list/invoiced-list.component.ts +++ b/src/app/routes/ticket-management/components/invoiced-list/invoiced-list.component.ts @@ -9,7 +9,7 @@ import { TicketService } from '../../services/ticket.service'; @Component({ selector: 'app-invoiced-list', templateUrl: './invoiced-list.component.html', - styleUrls: ['./invoiced-list.component.less'], + styleUrls: ['./invoiced-list.component.less'] }) export class InvoicedListComponent implements OnInit { @ViewChild('st', { static: true }) @@ -25,11 +25,12 @@ export class InvoicedListComponent implements OnInit { selectedRows: any[] = []; totalCallNo = 0; - constructor( - public service: TicketService, - private nzModalService: NzModalService, - private router: Router, - ) {} + + routesInfo: any = { + mailNo: '', + routes: [] + }; + constructor(public service: TicketService, private nzModalService: NzModalService, private router: Router) {} ngOnInit(): void {} @@ -80,11 +81,18 @@ export class InvoicedListComponent implements OnInit { } showlogosticsLogs(item: any) { - this.nzModalService.create({ - nzTitle: '查看物流', - nzWidth: 600, - nzContent: this.logosticsLogsModal, - nzFooter: [] + this.service.request(this.service.$api_get_express_routes, item.expressno).subscribe(res => { + console.log(res); + if (res) { + res.routes = res.routes.map((route: any) => ({ time: route.acceptTime, value: route.remark + route.acceptAddress, color: 'gray' })); + this.routesInfo = res; + this.nzModalService.create({ + nzTitle: '查看物流', + nzWidth: 600, + nzContent: this.logosticsLogsModal, + nzFooter: [] + }); + } }); } @@ -217,7 +225,10 @@ export class InvoicedListComponent implements OnInit { buttons: [ { text: '查看明细', - click: item => this.router.navigate(['/ticket/invoice-list/detail/' + item.id]) + click: item => + this.router.navigate(['/ticket/invoice-list/detail/' + item.id], { + queryParams: { expressno: item.expressno } + }) }, { text: '查看物流', diff --git a/src/app/routes/ticket-management/services/ticket.service.ts b/src/app/routes/ticket-management/services/ticket.service.ts index 40259878..288b5286 100644 --- a/src/app/routes/ticket-management/services/ticket.service.ts +++ b/src/app/routes/ticket-management/services/ticket.service.ts @@ -96,6 +96,9 @@ export class TicketService extends ShipperBaseService { // 查询进项发票明细 $api_get_input_invoice_detail_page = '/api/fcc/ficoInpinvL/list/page'; + // 查询快递轨迹 + $api_get_express_routes = '/api/fcc/ficoExpressH/searchRoutes'; + constructor(public injector: Injector, public eaCacheSrv: EACacheService) { super(injector, eaCacheSrv); }