This commit is contained in:
Taric Xin
2021-12-24 13:18:34 +08:00
parent dc28444d16
commit 336dfd81f5
19 changed files with 886 additions and 217 deletions

View File

@ -0,0 +1,73 @@
<page-header-wrapper [title]="'销票处理'">
</page-header-wrapper>
<nz-card class="search-box" nzBordered>
<div nz-row nzGutter="8">
<div nz-col [nzXl]="_$expand ? 24 : 18" [nzLg]="24" [nzSm]="24" [nzXs]="24">
<sf #sf [schema]="searchSchema"
[ui]="{ '*': { spanLabelFixed: 110,grid: { lg: 8, md: 12, sm: 12, xs: 24,gutter:10 } }}"
[compact]="true" [button]="'none'"></sf>
</div>
<div nz-col [nzXl]="_$expand ? 24 : 6" [nzLg]="24" [nzSm]="24" [nzXs]="24" class="text-right">
<button nz-button nzType="primary" [nzLoading]="service.http.loading" (click)="st?.load(1)">查询</button>
<button nz-button (click)="resetSF()">重置</button>
<button nz-button> 导出</button>
<button nz-button nzType="link" (click)="expandToggle()">
{{ !_$expand ? '展开' : '收起' }}
<i nz-icon [nzType]="!_$expand ? 'down' : 'up'"></i>
</button>
</div>
</div>
</nz-card>
<nz-card class="content-box" nzBordered>
<nz-tabset [nzTabBarExtraContent]="extraTemplate">
<nz-tab nzTitle="待处理"></nz-tab>
<nz-tab nzTitle="待确认"></nz-tab>
<nz-tab nzTitle="全部"></nz-tab>
</nz-tabset>
<ng-template #extraTemplate>
<div class="d-flex align-items-center">
<div class="mr-md">
已选择
<strong class="text-red">{{ selectedRows.length }}</strong> 张发票&nbsp;&nbsp; 发票金额总计
<strong class="text-red">{{totalCallNo }}</strong>
<a *ngIf="totalCallNo > 0" (click)="st.clearCheck()" class="ml-lg">清空</a>
</div>
<button nz-button (click)="this.batchPush()">推送开票</button>
<button nz-button (click)="this.batchRemove(selectedRows)">移除</button>
<button nz-button (click)="this.batchWithdraw(selectedRows)">撤回</button>
</div>
</ng-template>
<st #st [data]="service.$mock_url" [columns]="columns"
[req]="{ method: 'POST', allInBody: true, reName: { pi: 'pageIndex', ps: 'pageSize' }, params: reqParams, process: beforeReq }"
[res]="{ reName: { list: 'data.records', total: 'data.total' } }"
[page]="{ show: true, showSize: true, pageSizes: [10, 20, 30, 50, 100, 200, 300, 500, 1000] }"
[loading]="service.http.loading" [scroll]="{ x:'1200px',y: '370px' }" (change)="stChange($event)">
<ng-template st-row="no" let-item let-index="index" let-column="column">
{{ item.no }} <br> <label class="text-primary">待受理</label>
</ng-template>
<ng-template st-row="description" let-item let-index="index" let-column="column">
起运地: 广东省深圳市南山区 <br>
目的地: 湖北省武汉市青山区 <br>
货物名称: 钢材 <br>
车型车牌: 高栏车 粤B36889 <br>
</ng-template>
</st>
</nz-card>
<ng-template #requestedModal>
<div nz-row nzGutter="8">
<div nz-col nzSpan="24" se-container [labelWidth]="100">
<se [col]="1" label="开票日期" required>
<input nz-input placeholder="请输入" />
</se>
<se [col]="1" label="开票日期" required>
<input nz-input placeholder="请输入" />
</se>
</div>
</div>
</ng-template>

View File

@ -0,0 +1,26 @@
:host::ng-deep {
.search-box {
.ant-card-body {
padding-bottom: 18px;
}
}
.content-box {
.ant-card-body {
padding-top: 0;
}
}
nz-range-picker {
width: 100%;
}
.ant-tabs-tab-btn {
padding-left : 16px;
padding-right: 16px;
}
.text-truncate {
white-space: normal;
}
}

View File

@ -0,0 +1,267 @@
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 { TicketService } from '../../services/ticket.service';
import { RequestedInvoiceModalComponent } from '../invoice-requested/requested-invoice-modal/requested-invoice-modal.component';
import { PushInvoiceComponent } from './push-invoice/push-invoice.component';
@Component({
selector: 'app-cancellation-invoice',
templateUrl: './cancellation-invoice.component.html',
styleUrls: ['./cancellation-invoice.component.less']
})
export class CancellationInvoiceComponent implements OnInit {
@ViewChild('st', { static: true })
st!: STComponent;
@ViewChild('sf', { static: false })
sf!: SFComponent;
@ViewChild('requestedModal', { static: false })
requestedModal!: any;
columns: STColumn[] = this.initST();
searchSchema: SFSchema = this.initSF();
reqParams = {};
_$expand = false;
selectedRows: any[] = [];
totalCallNo = 0;
constructor(public service: TicketService, private nzModalService: NzModalService, private router: Router) {}
ngOnInit(): void {}
beforeReq = (requestOptions: STRequestOptions) => {
if (this.sf) {
this.reqParams = { ...this.sf.value };
}
return requestOptions;
};
stChange(e: STChange): void {
switch (e.type) {
case 'checkbox':
this.selectedRows = e.checkbox!;
this.totalCallNo = this.selectedRows.reduce((total, cv) => total + cv.callNo, 0);
break;
}
}
approval(): void {}
add(): void {}
/**
* 手工开票
* @param item
*/
requestedAction(item: any) {
const modal = this.nzModalService.create({
nzTitle: '发票确认',
nzContent: this.requestedModal,
nzOnOk: () => {}
});
}
/**
* 批量推送发票
* @param item
*/
batchPush(item?: any) {
if (this.selectedRows?.length <= 0 && !item) {
this.service.msgSrv.warning('请选择开票申请');
return;
}
this.nzModalService.warning({
nzTitle: '确定将所选待处理开票申请推送开票?',
nzContent: '推送开票后发票信息不可修改,待系统开票完成后会自动返回开票结果',
nzOnOk: () => {}
});
}
/**
* 撤回
* @param item
* @returns
*/
batchWithdraw(item?: any) {
if (this.selectedRows?.length <= 0 && !item) {
this.service.msgSrv.warning('请选择开票申请');
return;
}
this.nzModalService.warning({
nzTitle: '确定将所选待确认开票申请撤回?',
nzContent: '提交税控后发票信息不可修改,待税控开票完成后返回开票结果',
nzOnOk: () => {}
});
}
/**
* 移除
* @param item
* @returns
*/
batchRemove(item?: any) {
if (this.selectedRows?.length <= 0 && !item) {
this.service.msgSrv.warning('请选择开票申请');
return;
}
this.nzModalService.warning({
nzTitle: '确定将所选待确认开票申请撤回?',
nzContent: '提交税控后发票信息不可修改,待税控开票完成后返回开票结果',
nzOnOk: () => {}
});
}
/**
* 推送发票
* @param item
*/
pushInvoiceAction(item: any) {
const modal = this.nzModalService.create({
nzTitle: '推送开票',
nzContent: PushInvoiceComponent,
nzWidth: 1200,
});
}
/**
* 重置表单
*/
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
}
},
orderSn: {
type: 'string',
title: '申请编号',
ui: {
placeholder: '请输入'
}
},
receiveName2: {
type: 'string',
title: '购买人',
enum: [{ label: '全部', value: '全部' }],
ui: {
widget: 'select',
placeholder: '请选择'
}
},
receiveName3: {
type: 'string',
title: '网络货运人',
enum: [{ label: '全部', value: '全部' }],
ui: {
widget: 'select',
placeholder: '请选择'
}
},
receiveName23: {
type: 'string',
title: '发票状态',
enum: [{ label: '全部', value: '全部' }],
ui: {
widget: 'select',
placeholder: '请选择',
visibleIf: {
expand: (value: boolean) => value
}
}
},
or2derSn: {
type: 'string',
title: '订单号',
ui: {
placeholder: '请输入',
visibleIf: {
expand: (value: boolean) => value
}
}
},
createTime: {
title: '申请时间',
type: 'string',
ui: {
widget: 'date',
mode: 'range',
format: 'yyyy-MM-dd',
visibleIf: {
expand: (value: boolean) => value
}
} as SFDateWidgetSchema
}
}
};
}
private initST(): STColumn[] {
return [
{ title: '', index: 'key', type: 'checkbox' },
{ title: '分票编号', render: 'no', width: 150 },
{ title: '申请编号', index: 'callNo', width: 120 },
{ title: '申请时间', index: 'updatedAt', type: 'date', width: 150 },
{ title: '网络货运人', index: 'callNo', width: 120 },
{ title: '购买方', index: 'callNo', width: 90 },
{ title: '订单数', index: 'callNo', width: 90 },
{ title: '价税合计', index: 'callNo', width: 90 },
{ title: '金额', index: 'callNo', width: 100 },
{ title: '税率', index: 'callNo', width: 90 },
{ title: '税额', index: 'callNo', width: 90 },
{ title: '服务名称', index: 'callNo', width: 100 },
{ title: '销货清单', index: 'callNo', width: 90 },
{ title: '票面备注', render: 'description', width: 250 },
{ title: '其他要求', index: 'callNo', width: 100 },
{
title: '操作',
width: 150,
fixed: 'right',
buttons: [
{
text: '查看明细',
click: item => this.router.navigate(['ticket/cancellation-invoice/detail/1'], { queryParams: { type: 1 } })
},
{
text: '手工开票',
click: item => this.requestedAction(item)
},
{
text: '推送开票',
click: item => this.pushInvoiceAction(item)
},
{
text: '移除',
click: item => this.batchRemove(item)
},
{
text: '确认'
// click: item => this.rejectAction(item)
},
{
text: '撤回',
click: item => this.batchWithdraw(item)
}
]
}
];
}
}

View File

@ -0,0 +1,55 @@
<div nz-row nzGutter="8" class="statistics-box">
<div nz-col nzSpan="12" se-container [labelWidth]="100" col="1">
<se label="购买方">
茅台股份有限公司
</se>
<se label="纳税号">
912301046656930913
</se>
<se label="地址">
贵州省贵阳市
</se>
<se label="电话">
075588393198
</se>
<se label="开户行">
中国工商银行股份有限公司哈贵阳支行
</se>
<se label="银行账户">
3500044119068126788
</se>
<se label="票面备注">
<p style="margin-bottom: 0;margin-top: 5px;">起运地:广东省深圳市南山区</p>
<p style="margin-bottom: 0;">目的地:湖北省武汉市青山区</p>
<p style="margin-bottom: 0;">货物名称:钢材</p>
<p style="margin-bottom: 0;">车型车牌:高栏车 粤B36889</p>
</se>
</div>
<div nz-col nzSpan="12" se-container [labelWidth]="100" col="1">
<se label="销售方">
天津怡亚通物流科技有限公司
</se>
<se label="申请编号">
VP12301046656
</se>
<se label="订单数">
100笔
</se>
<se label="价税合计">
300,000.00元
</se>
<se label="服务名称">
运输服务费
</se>
<se label="销货清单">
需要
</se>
<se label="其他要求">
单位按吨
</se>
</div>
</div>
<st #st [data]="data" [columns]="columns" [page]="{ show: false}" [scroll]="{ x:'800px',y: '300px' }" class="mt-md">
</st>

View File

@ -0,0 +1,13 @@
:host::ng-deep {
.statistics-box {
.ant-form-item {
margin-bottom: 0;
.ant-form-item-control-input-content {
color: #f5222d;
}
}
}
}

View File

@ -0,0 +1,52 @@
import { Component, OnInit, ViewChild } from '@angular/core';
import { STComponent, STColumn } from '@delon/abc/st';
import { NzModalService } from 'ng-zorro-antd/modal';
import { TicketService } from '../../../services/ticket.service';
@Component({
selector: 'app-push-invoice',
templateUrl: './push-invoice.component.html',
styleUrls: ['./push-invoice.component.less']
})
export class PushInvoiceComponent implements OnInit {
@ViewChild('st', { static: false })
st!: STComponent;
columns: STColumn[] = this.initST();
data = [
{
key: 0,
disabled: true,
href: 'https://ant.design',
avatar: 'https://gw.alipayobjects.com/zos/rmsportal/eeHMaZBwmTvLdIwMfBpg.png',
no: 'TradeCode 0'
},
{
key: 1,
disabled: false,
href: 'https://ant.design',
avatar: 'https://gw.alipayobjects.com/zos/rmsportal/udxAbMEhpwthVVcjLXik.png',
no: 'TradeCode 1'
}
];
info = {};
constructor(public service: TicketService, private nzModalService: NzModalService) {}
ngOnInit(): void {}
private initST(): STColumn[] {
return [
{ title: '服务名称', index: 'no', width: 100 },
{ title: '规格型号', index: 'callNo', width: 100 },
{ title: '单位', index: 'callNo', width: 90 },
{ title: '数量', index: 'callNo', width: 90 },
{ title: '金额', index: 'callNo', width: 90 },
{ title: '税率', index: 'callNo', width: 90 },
{ title: '税额', index: 'callNo', width: 90 },
];
}
}