This commit is contained in:
Taric Xin
2022-02-23 16:44:27 +08:00
parent 307ee2a12a
commit b9981b5fb1
3 changed files with 64 additions and 15 deletions

View File

@ -36,16 +36,18 @@
<strong class="text-red">{{totalCallNo }}</strong> <strong class="text-red">{{totalCallNo }}</strong>
<a *ngIf="totalCallNo > 0" (click)="st.clearCheck()" class="ml-lg">清空</a> <a *ngIf="totalCallNo > 0" (click)="st.clearCheck()" class="ml-lg">清空</a>
</div> </div>
<button nz-button (click)="this.batchPush()">推送开票</button> <button nz-button *ngIf="resourceStatus===1 || !resourceStatus" (click)="this.batchPush()">推送开票</button>
<button nz-button (click)="this.batchRemove(selectedRows)">移除</button> <!-- <button nz-button *ngIf="resourceStatus===1 || !resourceStatus"
<button nz-button (click)="this.batchWithdraw(selectedRows)">撤回</button> (click)="this.batchRemove(selectedRows)">移除</button>
<button nz-button *ngIf="resourceStatus===2 || !resourceStatus"
(click)="this.batchWithdraw(selectedRows)">撤回</button> -->
</div> </div>
</ng-template> </ng-template>
<st #st [scroll]="{ x: '2000px' }" [data]="service.$api_ficoVatinvHList" [columns]="columns" <st #st [scroll]="{ x: '2000px' }" [data]="service.$api_ficoVatinvHList" [columns]="columns"
[req]="{process: beforeReq }" [res]="{process:afterRes }" [loading]="service.http.loading"> [req]="{process: beforeReq }" [res]="{process:afterRes }" [loading]="service.http.loading"
(change)="stChange($event)">
<ng-template st-row="vatinvcode" let-item let-index="index" let-column="column"> <ng-template st-row="vatinvcode" let-item let-index="index" let-column="column">
{{ item.vatinvcode }} <br> {{ item.vatinvcode }} <br>
<label class="text-primary" *ngIf="item.sts == '1'">待处理</label> <label class="text-primary" *ngIf="item.sts == '1'">待处理</label>

View File

@ -23,7 +23,7 @@ export class CancellationInvoiceComponent implements OnInit {
requestedModal!: any; requestedModal!: any;
columns: STColumn[] = this.initST(); columns: STColumn[] = this.initST();
searchSchema: SFSchema = this.initSF(); searchSchema: SFSchema = this.initSF();
resourceStatus = ''; resourceStatus: any = '';
_$expand = false; _$expand = false;
selectedRows: any[] = []; selectedRows: any[] = [];
@ -56,6 +56,15 @@ export class CancellationInvoiceComponent implements OnInit {
return data.map(node => ({ ...node, disabled: node.sts === '3' })); return data.map(node => ({ ...node, disabled: node.sts === '3' }));
}; };
stChange(e: STChange): void {
switch (e.type) {
case 'checkbox':
this.selectedRows = e.checkbox!;
this.totalCallNo = this.selectedRows.reduce((total, cv) => total + cv.vatmoney, 0).toFixed(2);
break;
}
}
selectChange(e: any) { selectChange(e: any) {
this.resourceStatus = e; this.resourceStatus = e;
this.initST(); this.initST();
@ -103,17 +112,51 @@ export class CancellationInvoiceComponent implements OnInit {
/** /**
* 批量推送发票 * 批量推送发票
* @param item
*/ */
batchPush(item?: any) { batchPush() {
if (this.selectedRows?.length <= 0 && !item) { if (this.selectedRows?.length <= 0) {
this.service.msgSrv.warning('请选择开票申请'); this.service.msgSrv.warning('请选择开票申请');
return; return;
} }
if (this.selectedRows.find(item => item.sts !== '1')) {
this.service.msgSrv.warning('请勿选择非待处理申请');
return;
}
this.nzModalService.warning({ this.nzModalService.warning({
nzTitle: '确定将所选待处理开票申请推送开票?', nzTitle: '确定将所选待处理开票申请推送开票?',
nzContent: '推送开票后发票信息不可修改,待系统开票完成后会自动返回开票结果', nzContent: '推送开票后发票信息不可修改,待系统开票完成后会自动返回开票结果',
nzOnOk: () => {} nzOnOk: () => {
this.service
.request(
this.service.$api_batch_push_invoic,
this.selectedRows.map(row => row.id)
)
.subscribe(res => {
if (res) {
this.service.msgSrv.success('推送开票成功');
this.st.load(1);
}
});
}
});
}
/**
* 推送发票
* @param item
*/
pushInvoice(item: any) {
this.nzModalService.warning({
nzTitle: '确定将所选待处理开票申请推送开票?',
nzContent: '推送开票后发票信息不可修改,待系统开票完成后会自动返回开票结果',
nzOnOk: () => {
this.service.request(this.service.$api_push_invoic, { id: item.id }).subscribe(res => {
if (res) {
this.service.msgSrv.success('推送开票成功');
this.st.load(1);
}
});
}
}); });
} }
@ -327,11 +370,11 @@ export class CancellationInvoiceComponent implements OnInit {
iif: item => item.sts != '3', iif: item => item.sts != '3',
click: item => this.requestedAction(item) click: item => this.requestedAction(item)
}, },
// { {
// text: '推送开票', text: '推送开票',
// iif: item => item.sts != '3', iif: item => item.sts === '1',
// click: item => this.pushInvoiceAction(item) click: item => this.pushInvoice(item)
// }, },
// { // {
// text: '移除', // text: '移除',
// click: item => this.batchRemove(item) // click: item => this.batchRemove(item)

View File

@ -34,6 +34,10 @@ export class TicketService extends ShipperBaseService {
$api_apply_fico = '/api/fcc/ficoVatinvH/crmPushInvo'; $api_apply_fico = '/api/fcc/ficoVatinvH/crmPushInvo';
// 运营端手工开票/确认/E税云开票成功后的回调 // 运营端手工开票/确认/E税云开票成功后的回调
$api_apply_fico_invoic = '/api/fcc/ficoVatinvH/operateAffirmVatinv'; $api_apply_fico_invoic = '/api/fcc/ficoVatinvH/operateAffirmVatinv';
// 运营端推送开票-E税云开票
$api_push_invoic = '/api/fcc/ficoVatinvH/crmPushInvo';
// 运营端批量推送开票-E税云开票
$api_batch_push_invoic = '/api/fcc/ficoVatinvH/crmPushInvoBath';
// 获取汇总下单路径 // 获取汇总下单路径
$api_get_order_summary_path = '/api/fcc/ficoExpressH/getSummaryOrderAddress'; $api_get_order_summary_path = '/api/fcc/ficoExpressH/getSummaryOrderAddress';