This commit is contained in:
Taric Xin
2022-01-05 21:02:28 +08:00
parent e4c007f0d5
commit fb87845bde
29 changed files with 574 additions and 1717 deletions

View File

@ -0,0 +1,67 @@
<page-header-wrapper [title]="'收票信息'" [logo]="logo">
<ng-template #logo>
<button nz-button nz-tooltip nzTooltipTitle="返回上一页" (click)="goBack()">
<i nz-icon nzType="left" nzTheme="outline"></i>
</button>
</ng-template>
</page-header-wrapper>
<nz-card class="statistics-box">
<div nz-row nzGutter="8">
<div nz-col [nzXl]="8" [nzLg]="8" [nzSm]="8" [nzXs]="8" se-container [labelWidth]="150" col="1">
<se label="网络货运人" required>
{{headerInfo?.ltdidName}}
</se>
<se label="发票日期" required>
2021-12-11
</se>
</div>
<div nz-col [nzXl]="8" [nzLg]="8" [nzSm]="8" [nzXs]="8" se-container [labelWidth]="100" col="1">
<se label="销售方" required>
{{headerInfo?.projectName}}
</se>
<se label="发票号" required>
{{headerInfo?.taxNumber}}
</se>
</div>
<div nz-col [nzXl]="8" [nzLg]="8" [nzSm]="8" [nzXs]="8" se-container [labelWidth]="100" col="1">
<se label="收票类型" required>
{{headerInfo?.vatname}}
</se>
<se label="收票备注">
{{headerInfo?.isdetail}}
</se>
</div>
</div>
</nz-card>
<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: 90,grid: { lg: 8, md: 12, sm: 12, xs: 24 } }}" [compact]="true"
[button]="'none'"></sf>
</div>
<div nz-col [nzXl]="_$expand ? 24 : 6" [nzLg]="24" [nzSm]="24" [nzXs]="24" [class.expend-options]="_$expand"
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 nzType="link" (click)="expandToggle()">
{{ !_$expand ? '展开' : '收起' }}
<i nz-icon [nzType]="!_$expand ? 'down' : 'up'"></i>
</button>
</div>
</div>
</nz-card>
<nz-card class="content-box" nzBordered>
<st #st [data]="service.$api_get_invoice_requested_order_detail" [columns]="columns" size="small"
[req]="{ method: 'POST', allInBody: true, reName: { pi: 'pageIndex', ps: 'pageSize' }, 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: '200px' }">
<ng-template st-row="billHCode" let-item let-index="index" let-column="column">
{{index+1}}
</ng-template>
</st>
</nz-card>

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,140 @@
import { Component, OnInit, ViewChild } from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router';
import { STComponent, STColumn, STRequestOptions, STChange } from '@delon/abc/st';
import { SFComponent, SFDateWidgetSchema, SFSchema } from '@delon/form';
import { NzModalService } from 'ng-zorro-antd/modal';
import { TicketService } from '../../../services/ticket.service';
import { RequestedDetailComponent } from '../../invoice-requested/requested-detail/requested-detail.component';
@Component({
selector: 'app-input-invoice-detail',
templateUrl: './input-invoice-detail.component.html',
styleUrls: ['./input-invoice-detail.component.less', '../../../../commom/less/expend-but.less', '../../../../commom/less/box.less']
})
export class InputInvoiceDetailComponent implements OnInit {
@ViewChild('st', { static: true })
st!: STComponent;
@ViewChild('sf', { static: false })
sf!: SFComponent;
columns: STColumn[] = this.initST();
searchSchema: SFSchema = this.initSF();
_$expand = false;
id = null;
headerInfo: any = {};
constructor(public service: TicketService, private route: ActivatedRoute) {
this.id = route.snapshot.params.id;
this.loadHeadInfo();
}
ngOnInit(): void {}
loadHeadInfo() {
this.service.request(this.service.$api_get_invoice_requested_header_detail, { id: this.id }).subscribe(res => {
console.log(res);
if (res) {
this.headerInfo = res;
}
});
}
beforeReq = (requestOptions: STRequestOptions) => {
if (this.sf) {
Object.assign(requestOptions.body, { ...this.sf.value });
}
return requestOptions;
};
goBack() {
history.go(-1);
}
/**
* 重置表单
*/
resetSF() {
this.sf.reset();
}
/**
* 伸缩查询条件
*/
expandToggle() {
this._$expand = !this._$expand;
this.sf?.setValue('/expand', this._$expand);
}
private initSF(): SFSchema {
return {
properties: {
expand: {
type: 'boolean',
ui: {
hidden: true
}
},
billHCode: {
type: 'string',
title: '费用单',
ui: {
placeholder: '请输入'
}
},
billHC2ode: {
type: 'string',
title: '订单号',
ui: {
placeholder: '请输入'
}
},
vatappSts: {
type: 'string',
title: '结算客户',
enum: [{ label: '全部', value: '' }],
ui: {
widget: 'select',
placeholder: '请选择'
},
default: ''
},
createTime: {
title: '费用日期',
type: 'string',
ui: {
widget: 'sl-from-to-search',
format: 'yyyy-MM-dd',
visibleIf: {
expand: (value: boolean) => value
}
} as SFDateWidgetSchema
},
create2Time: {
title: '订单日期',
type: 'string',
ui: {
widget: 'sl-from-to-search',
format: 'yyyy-MM-dd',
visibleIf: {
expand: (value: boolean) => value
}
} as SFDateWidgetSchema
}
}
};
}
private initST(): STColumn[] {
return [
{ title: '序号', render: 'billHCode', width: 80 },
{ title: '费用号', index: 'vatappSts', width: 100 },
{ title: '费用日期', index: 'billTime', type: 'date', width: 150 },
{ title: '订单号', index: 'projectId', width: 100 },
{ title: '订单日期', index: 'loadingfrom', width: 150 },
{ title: '结算客户', index: 'loadingto', width: 90 },
{ title: '费用科目', index: 'goodsinfo', width: 100 },
{ title: '收票金额', index: 'driverinfo', width: 140 },
{ title: '收票税额', index: 'billkpmoney', width: 100 }
];
}
}

View File

@ -0,0 +1,40 @@
<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: 100,grid: { lg: 8, md: 12, sm: 12, xs: 24 } }}" [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>
<div class="d-flex align-items-center mb-md mt-md">
<button nz-button (click)="this.auditAction()" nzType="primary">添加发票</button>
<div class="ml-md">
已选择
<strong class="text-primary">{{ selectedRows.length }}</strong> 张发票
<a *ngIf="selectedRows.length > 0" (click)="st.clearCheck()" class="ml-lg">清空</a>
</div>
</div>
<st #st [data]="service.$mock_url" [columns]="columns"
[req]="{ method: 'POST', allInBody: true, reName: { pi: 'pageIndex', ps: 'pageSize' }, 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)">
</st>
</nz-card>

View File

@ -0,0 +1,231 @@
import { Component, OnInit, ViewChild } from '@angular/core';
import { Router } from '@angular/router';
import { STComponent, STColumn, STRequestOptions, STChange } from '@delon/abc/st';
import { SFComponent, SFDateWidgetSchema, SFSchema } from '@delon/form';
import { NzModalService } from 'ng-zorro-antd/modal';
import { TicketService } from '../../services/ticket.service';
@Component({
selector: 'app-input-invoice',
templateUrl: './input-invoice.component.html',
styleUrls: ['../../../commom/less/box.less']
})
export class InputInvoiceComponent implements OnInit {
@ViewChild('st', { static: true })
st!: STComponent;
@ViewChild('sf', { static: false })
sf!: SFComponent;
@ViewChild('auditModal', { static: false })
auditModal!: any;
columns: STColumn[] = this.initST();
searchSchema: SFSchema = this.initSF();
_$expand = false;
selectedRows: any[] = [];
constructor(public service: TicketService, 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;
}
}
auditAction() {
if (this.selectedRows?.length <= 0) {
this.service.msgSrv.warning('请选择申请记录');
return;
}
const modal = this.nzModalService.warning({
nzTitle: '确定对已选运单批量申请开票?',
nzOnOk: () => {}
});
}
/**
* 重置表单
*/
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: {
autocomplete: 'off',
placeholder: '请输入'
}
},
ltdId: {
type: 'string',
title: '网络货运人',
ui: {
widget: 'select',
placeholder: '请选择',
allowClear: true,
asyncData: () => this.service.getNetworkFreightForwarder()
},
default: ''
},
orderS2n: {
type: 'string',
title: '发票号码',
ui: {
autocomplete: 'off',
placeholder: '请输入'
}
},
order2S2n: {
type: 'string',
title: '发票类型',
ui: {
widget: 'dict-select',
params: { dictKey: 'refund:apply:status' },
placeholder: '请选择',
visibleIf: {
expand: (value: boolean) => value
}
}
},
orderSn1: {
type: 'string',
title: '销售方',
ui: {
placeholder: '请输入',
visibleIf: {
expand: (value: boolean) => value
}
}
},
createTime: {
title: '创建时间',
type: 'string',
ui: {
widget: 'sl-from-to-search',
format: 'yyyy-MM-dd',
visibleIf: {
expand: (value: boolean) => value
}
} as SFDateWidgetSchema
},
ord0erSn1: {
type: 'string',
title: '收票状态',
ui: {
widget: 'dict-select',
params: { dictKey: 'refund:apply:status' },
placeholder: '请选择',
visibleIf: {
expand: (value: boolean) => value
}
}
},
orderSn2: {
type: 'string',
title: '发票日期',
ui: {
widget: 'sl-from-to-search',
format: 'yyyy-MM-dd',
visibleIf: {
expand: (value: boolean) => value
}
}
},
orderS1n2: {
type: 'string',
title: '收票备注',
ui: {
placeholder: '请输入',
visibleIf: {
expand: (value: boolean) => value
}
}
},
orderS3: {
type: 'string',
title: '订单号',
ui: {
autocomplete: 'off',
placeholder: '请选择',
visibleIf: {
expand: (value: boolean) => value
}
}
},
orderSn4: {
type: 'string',
title: '费用号',
ui: {
autocomplete: 'off',
placeholder: '请选择',
visibleIf: {
expand: (value: boolean) => value
}
}
}
}
};
}
private initST(): STColumn[] {
return [
{ title: '', index: 'key', type: 'checkbox' },
{ title: '收票单号', index: 'no', type: 'link' },
{ title: '网络货运人', index: 'no' },
{ title: '发票日期', index: 'no', type: 'date' },
{ title: '发票号', index: 'callNo' },
{ title: '发票金额', index: 'callNo' },
{ title: '税额', render: 'call1No' },
{ title: '发票类型', render: 'call1N2o' },
{ title: '销售方', index: 'callNo' },
{ title: '创建时间', index: 'updatedAt', type: 'date' },
{ title: '创建人', index: 'updatedAt' },
{ title: '收票状态', index: 'updatedAt' },
{
title: '操作',
buttons: [
{
text: '浏览',
click: item => this.router.navigate(['/ticket/input-invoice/detail/1'])
},
{
text: '修改',
// click: item => this.router.navigate([''])
}
]
}
];
}
}

View File

@ -29,7 +29,7 @@
</div>
</nz-card>
<nz-card class="content-box" nzBordered >
<nz-card class="content-box" nzBordered>
<nz-tabset [nzTabBarExtraContent]="extraTemplate" (nzSelectedIndexChange)="selectChange($event)">
<nz-tab nzTitle="待受理"></nz-tab>
<nz-tab nzTitle="处理中"></nz-tab>
@ -50,20 +50,11 @@
</div>
</ng-template>
<st
#st
size="small"
[bordered]="true"
[scroll]="{ x: '2000px' }"
[data]="service.$api_get_invoice_requested_page"
[columns]="columns"
[req]="{ method: 'POST', allInBody: true, reName: { pi: 'pageIndex', ps: 'pageSize' }, params: reqParams }"
[res]="{ reName: { list: 'data.records', total: 'data.total' } }"
[page]="{ show: true, showSize: true, pageSizes: [10, 20, 30, 50, 100, 200, 300, 500, 1000] }"
[loadingDelay]="500"
[loading]="service.http.loading"
>
<st #st [data]="service.$api_get_invoice_requested_page" [columns]="columns"
[req]="{ method: 'POST', allInBody: true, reName: { pi: 'pageIndex', ps: 'pageSize' }, 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="vatappcode" let-item let-index="index" let-column="column">
{{ item.vatappcode }} <br> <label class="text-primary">待受理</label>
</ng-template>

View File

@ -27,45 +27,35 @@ export class InvoiceRequestedComponent implements OnInit {
_$expand = false;
totalCallNo = 0;
selectedRows: any[] = [];
constructor(public service: TicketService, private nzModalService: NzModalService, private router: Router) {}
ngOnInit(): void {}
get reqParams() {
// if (this.sf) {
// Object.assign(requestOptions.body, {
// ...this.sf.value,
// sts: this?.resourceStatus,
// createTime: {
// start: this.sf.value.createTime?.[0] || null,
// end: this.sf.value.createTime?.[1] || null
// }
// });
// }
const a:any = {};
if(this.resourceStatus) {
a.sts = this.resourceStatus
beforeReq = (requestOptions: STRequestOptions) => {
if (this.resourceStatus) {
Object.assign(requestOptions.body, { sts: this.resourceStatus });
}
return {
...a,
...this.sf?.value,
createTime: {
start: this.sf?.value?.createTime?.[0] || null,
end: this.sf?.value?.createTime?.[1] || null
}
};
if (this.sf) {
Object.assign(requestOptions.body, {
...this.sf.value,
createTime: {
start: this.sf?.value?.createTime?.[0] || null,
end: this.sf?.value?.createTime?.[1] || null
}
});
}
return requestOptions;
};
get selectedRows() {
return this.st?.list.filter((item) => item.checked) || [];
stChange(e: STChange): void {
switch (e.type) {
case 'checkbox':
this.selectedRows = e.checkbox!;
this.totalCallNo = this.selectedRows.reduce((total, cv) => total + cv.applyAmount, 0);
break;
}
}
// 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;
// }
// }
rejectAction(item: any[]) {
const modal = this.nzModalService.create({
@ -122,21 +112,19 @@ export class InvoiceRequestedComponent implements OnInit {
type: 'default',
label: '手工处理',
onClick: () => {
console.log('11111')
const params = {
ficoVatappBillVOList: this.selectedRows,
ficoVatappBillVOList: this.selectedRows
// id: this.id
}
};
this.service.request(this.service.$api_get_applyBatchFicoVatinv, params).subscribe((res: any) => {
console.log(res)
if(res) {
this.service.msgSrv.success('开票成功!')
console.log(res);
if (res) {
this.service.msgSrv.success('开票成功!');
modal.destroy();
} else {
this.service.msgSrv.error(res?.msg)
this.service.msgSrv.error(res?.msg);
}
})
modal.destroy();
});
}
},
{
@ -144,13 +132,15 @@ export class InvoiceRequestedComponent implements OnInit {
label: '自动开票',
onClick: () => {
const params = {
ficoVatappBillVOList: this.selectedRows,
ficoVatappBillVOList: this.selectedRows
// id: this.id
}
};
this.service.request(this.service.$api_get_applyBatchFicoVatinv, params).subscribe((res: any) => {
console.log(res)
})
modal.destroy();
if (res) {
this.service.msgSrv.success('开票成功!');
modal.destroy();
}
});
}
}
]
@ -164,7 +154,7 @@ export class InvoiceRequestedComponent implements OnInit {
nzWidth: 1200,
nzComponentParams: {
id: item.id
},
},
nzFooter: null
});
}
@ -357,16 +347,17 @@ export class InvoiceRequestedComponent implements OnInit {
}
];
}
orderDetail(item: any){
console.log(item)
this.router.navigate(['/ticket/invoice-requested/detail/' + item?.id,
{
queryParams: { id : item?.id }
}
])
orderDetail(item: any) {
console.log(item);
this.router.navigate([
'/ticket/invoice-requested/detail/' + item?.id,
{
queryParams: { id: item?.id }
}
]);
}
selectChange(e: any) {
console.log(e)
console.log(e);
this.resourceStatus = e;
this.initST();
setTimeout(() => {

View File

@ -9,19 +9,18 @@
<app-requested-detail [id]="id"></app-requested-detail>
<st #st [data]="service.$api_get_invoice_requested_order_detail" [columns]="columns"
[req]="{ method: 'POST', allInBody: true, reName: { pi: 'pageIndex', ps: 'pageSize' }}"
[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: '200px' }" (change)="stChange($event)" >
<ng-template st-row="billHCode" let-item let-index="index" let-column="column">
<a class="text-primary" > {{ item.billHCode }}</a>
</ng-template>
[req]="{ method: 'POST', allInBody: true, reName: { pi: 'pageIndex', ps: 'pageSize' }}"
[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: '200px' }" (change)="stChange($event)">
<ng-template st-row="billHCode" let-item let-index="index" let-column="column">
<a class="text-primary"> {{ item.billHCode }}</a>
</ng-template>
</st>
<div class="modal-footer text-center">
<button nz-button type="button" >移除</button>
<button nz-button type="button">移除</button>
<button nz-button type="button" (click)="saveManage()">手工处理</button>
<button nz-button type="submit" nzType="primary"
[nzLoading]="service.http.loading" (click)="saveManage()">自动开票</button>
</div>
<button nz-button type="submit" nzType="primary" [nzLoading]="service.http.loading"
(click)="saveManage()">自动开票</button>
</div>