edit
This commit is contained in:
@ -47,6 +47,8 @@
|
||||
</div>
|
||||
<button nz-button (click)="this.batchRequested()">开票</button>
|
||||
<button nz-button (click)="this.rejectAction(selectedRows)">驳回</button>
|
||||
<button nz-button (click)="changePice(selectedRows)">修改地址</button>
|
||||
<button nz-button (click)="printOrder(selectedRows)">打印面单</button>
|
||||
</div>
|
||||
</ng-template>
|
||||
|
||||
|
||||
@ -6,6 +6,7 @@ import { SFComponent, SFSchema, SFDateWidgetSchema, SFUISchema } from '@delon/fo
|
||||
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';
|
||||
|
||||
@Component({
|
||||
@ -83,6 +84,51 @@ export class InvoiceRequestedComponent implements OnInit {
|
||||
});
|
||||
}
|
||||
|
||||
changePice(item: any[]) {
|
||||
const modal = this.nzModalService.create({
|
||||
nzTitle: '驳回',
|
||||
nzContent: this.rejectModal,
|
||||
nzFooter: [
|
||||
{
|
||||
label: '拒绝',
|
||||
type: 'default',
|
||||
onClick: () => {
|
||||
modal.destroy();
|
||||
}
|
||||
},
|
||||
{
|
||||
label: '通过',
|
||||
type: 'primary',
|
||||
onClick: () => {
|
||||
modal.destroy();
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
modal.afterClose.subscribe(res => {
|
||||
this.st.load();
|
||||
});
|
||||
}
|
||||
|
||||
printOrder(item: any[]) {
|
||||
if (this.selectedRows?.length <= 0) {
|
||||
this.service.msgSrv.warning('请选择订单');
|
||||
return;
|
||||
}
|
||||
const modal = this.nzModalService.create({
|
||||
nzTitle: '打印面单',
|
||||
nzContent: PrintOrderModalComponent,
|
||||
nzWidth: 650,
|
||||
nzComponentParams: { vatappcodes: this.selectedRows.map(item => item.vatappcode) },
|
||||
nzFooter: null
|
||||
});
|
||||
modal.afterClose.subscribe(res => {
|
||||
if (res) {
|
||||
this.st.load();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
showReason(item: any) {
|
||||
const modal = this.nzModalService.create({
|
||||
nzTitle: '查看原因',
|
||||
@ -117,12 +163,10 @@ export class InvoiceRequestedComponent implements OnInit {
|
||||
// id: this.id
|
||||
};
|
||||
this.service.request(this.service.$api_get_applyBatchFicoVatinv, params).subscribe((res: any) => {
|
||||
console.log(res);
|
||||
if (res) {
|
||||
this.service.msgSrv.success('开票成功!');
|
||||
modal.destroy();
|
||||
} else {
|
||||
this.service.msgSrv.error(res?.msg);
|
||||
this.st.load(1);
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -139,6 +183,7 @@ export class InvoiceRequestedComponent implements OnInit {
|
||||
if (res) {
|
||||
this.service.msgSrv.success('开票成功!');
|
||||
modal.destroy();
|
||||
this.st.load(1);
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -318,6 +363,7 @@ export class InvoiceRequestedComponent implements OnInit {
|
||||
{ title: '其他要求', index: 'otherremarks', width: 100 },
|
||||
{ title: '申请人', index: 'applyName', width: 90 },
|
||||
{ title: '申请时间', index: 'applyTime', type: 'date', width: 150 },
|
||||
{ title: '快递是否下单成功', index: 'expressHSts', width: 150, type: 'enum', enum: { true: '是', false: '否' } },
|
||||
{
|
||||
title: '操作',
|
||||
width: 150,
|
||||
|
||||
@ -0,0 +1,48 @@
|
||||
<div nz-row class="statistics-box">
|
||||
<div nz-col nzSpan="24" se-container [labelWidth]="100" col="1">
|
||||
<se label="打印发票" required>
|
||||
<nz-radio-group [(ngModel)]="type">
|
||||
<label nz-radio [nzValue]="1">分批下单</label>
|
||||
<label nz-radio [nzValue]="2">汇总下单</label>
|
||||
</nz-radio-group>
|
||||
</se>
|
||||
<se>
|
||||
{{type===1?'分批下单系统会根据网络货运人、货主以及收件地址自动拆分成多个包裹下单':'汇总下单系统会将所选申请单汇总成一个包裹下单'}}
|
||||
</se>
|
||||
<ng-container *ngIf="type===2">
|
||||
<se label="收件地址" required>
|
||||
<nz-select [(ngModel)]="data.rcontactInfo" [nzCustomTemplate]="rcontactInfosData">
|
||||
<nz-option [nzValue]="item" nzLabel="Jack" *ngFor="let item of rcontactInfos"
|
||||
[nzCustomContent]="true">
|
||||
{{item.contact}} {{item.tel}}<br />
|
||||
{{item.province}} {{item.city}} {{item.county}} {{item.address}}
|
||||
</nz-option>
|
||||
</nz-select>
|
||||
<ng-template #rcontactInfosData>
|
||||
{{data.rcontactInfo.contact}} {{data.rcontactInfo.tel}}<br />
|
||||
{{data.rcontactInfo.province}} {{data.rcontactInfo.city}} {{data.rcontactInfo.county}}
|
||||
{{data.rcontactInfo.address}}
|
||||
</ng-template>
|
||||
</se>
|
||||
<se label="寄件地址" required>
|
||||
<nz-select [(ngModel)]="data.scontactInfo" [nzCustomTemplate]="scontactInfosData">
|
||||
<nz-option [nzValue]="item" nzLabel="Jack" *ngFor="let item of scontactInfos"
|
||||
[nzCustomContent]="true">
|
||||
{{item.contact}} {{item.tel}}<br />
|
||||
{{item.province}} {{item.city}} {{item.county}} {{item.address}}
|
||||
</nz-option>
|
||||
</nz-select>
|
||||
<ng-template #scontactInfosData>
|
||||
{{data.scontactInfo.contact}} {{data.scontactInfo.tel}}<br />
|
||||
{{data.scontactInfo.province}} {{data.scontactInfo.city}} {{data.scontactInfo.county}}
|
||||
{{data.scontactInfo.address}}
|
||||
</ng-template>
|
||||
</se>
|
||||
</ng-container>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button nz-button type="button" (click)="close()">取消</button>
|
||||
<button nz-button type="button" nzType="primary" (click)="sure()">保存</button>
|
||||
</div>
|
||||
@ -0,0 +1,7 @@
|
||||
nz-select-top-control {
|
||||
height: 65px !important;
|
||||
}
|
||||
|
||||
cdk-virtual-scroll-viewport {
|
||||
height: 100px !important;
|
||||
}
|
||||
@ -0,0 +1,76 @@
|
||||
import { Component, Input, OnInit, ViewChild, ViewEncapsulation } from '@angular/core';
|
||||
import { SFComponent, SFSchema, SFUISchema } from '@delon/form';
|
||||
import { NzMessageService } from 'ng-zorro-antd/message';
|
||||
import { NzModalRef } from 'ng-zorro-antd/modal';
|
||||
import { map } from 'rxjs/operators';
|
||||
import { TicketService } from '../../../services/ticket.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-print-order-modal',
|
||||
templateUrl: './print-order-modal.component.html',
|
||||
styleUrls: ['./print-order-modal.component.less'],
|
||||
encapsulation: ViewEncapsulation.None
|
||||
})
|
||||
export class PrintOrderModalComponent implements OnInit {
|
||||
data: any = {};
|
||||
|
||||
type = 1;
|
||||
|
||||
rcontactInfos: any[] = [];
|
||||
scontactInfos: any[] = [];
|
||||
|
||||
@Input()
|
||||
vatappcodes: string[] = [];
|
||||
|
||||
constructor(private modal: NzModalRef, public msgSrv: NzMessageService, public service: TicketService) {}
|
||||
|
||||
ngOnInit(): void {
|
||||
this.loadAddress();
|
||||
}
|
||||
|
||||
loadAddress() {
|
||||
this.service.request(this.service.$api_get_order_summary_path, this.vatappcodes).subscribe(res => {
|
||||
if (res) {
|
||||
this.rcontactInfos = res.rcontactInfos || [];
|
||||
this.scontactInfos = res.scontactInfos || [];
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
sure() {
|
||||
console.log(this.data);
|
||||
if (this.type === 1) {
|
||||
this.service.request(this.service.$api_create_express, this.vatappcodes).subscribe(res => {
|
||||
if (res) {
|
||||
this.service.msgSrv.success('操作成功');
|
||||
this.modal.destroy(true);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
if (!this.data.rcontactInfo || !this.data.scontactInfo) {
|
||||
this.service.msgSrv.warning('请选择收件地址和寄件地');
|
||||
return;
|
||||
}
|
||||
const params = {
|
||||
rcontactInfo: this.data.rcontactInfo,
|
||||
ltdId: this.data.scontactInfo.ltdId,
|
||||
shipperId: this.data.scontactInfo.shipperId,
|
||||
vatappcodes: this.vatappcodes,
|
||||
scontactInfo: this.data.scontactInfo
|
||||
};
|
||||
delete this.data.scontactInfo.ltdId;
|
||||
delete this.data.scontactInfo.shipperId;
|
||||
delete this.data.scontactInfo.id;
|
||||
this.service.request(this.service.$api_get_order_summary, params).subscribe(res => {
|
||||
if (res) {
|
||||
this.service.msgSrv.success('操作成功');
|
||||
this.modal.destroy(true);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
close() {
|
||||
this.modal.destroy();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user