edit
This commit is contained in:
		| @ -36,16 +36,18 @@ | ||||
|                 <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> | ||||
|             <button nz-button *ngIf="resourceStatus===1 || !resourceStatus" (click)="this.batchPush()">推送开票</button> | ||||
|             <!-- <button nz-button *ngIf="resourceStatus===1 || !resourceStatus" | ||||
|                 (click)="this.batchRemove(selectedRows)">移除</button> | ||||
|             <button nz-button *ngIf="resourceStatus===2 || !resourceStatus" | ||||
|                 (click)="this.batchWithdraw(selectedRows)">撤回</button> --> | ||||
|         </div> | ||||
|     </ng-template> | ||||
|  | ||||
|  | ||||
|     <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"> | ||||
|             {{ item.vatinvcode }} <br> | ||||
|             <label class="text-primary" *ngIf="item.sts == '1'">待处理</label> | ||||
|  | ||||
| @ -23,7 +23,7 @@ export class CancellationInvoiceComponent implements OnInit { | ||||
|   requestedModal!: any; | ||||
|   columns: STColumn[] = this.initST(); | ||||
|   searchSchema: SFSchema = this.initSF(); | ||||
|   resourceStatus = ''; | ||||
|   resourceStatus: any = ''; | ||||
|   _$expand = false; | ||||
|  | ||||
|   selectedRows: any[] = []; | ||||
| @ -56,6 +56,15 @@ export class CancellationInvoiceComponent implements OnInit { | ||||
|     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) { | ||||
|     this.resourceStatus = e; | ||||
|     this.initST(); | ||||
| @ -103,17 +112,51 @@ export class CancellationInvoiceComponent implements OnInit { | ||||
|  | ||||
|   /** | ||||
|    * 批量推送发票 | ||||
|    * @param item | ||||
|    */ | ||||
|   batchPush(item?: any) { | ||||
|     if (this.selectedRows?.length <= 0 && !item) { | ||||
|   batchPush() { | ||||
|     if (this.selectedRows?.length <= 0) { | ||||
|       this.service.msgSrv.warning('请选择开票申请'); | ||||
|       return; | ||||
|     } | ||||
|     if (this.selectedRows.find(item => item.sts !== '1')) { | ||||
|       this.service.msgSrv.warning('请勿选择非待处理申请'); | ||||
|       return; | ||||
|     } | ||||
|     this.nzModalService.warning({ | ||||
|       nzTitle: '确定将所选待处理开票申请推送开票?', | ||||
|       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', | ||||
|             click: item => this.requestedAction(item) | ||||
|           }, | ||||
|           // { | ||||
|           //   text: '推送开票', | ||||
|           //   iif: item => item.sts != '3', | ||||
|           //   click: item => this.pushInvoiceAction(item) | ||||
|           // }, | ||||
|           { | ||||
|             text: '推送开票', | ||||
|             iif: item => item.sts === '1', | ||||
|             click: item => this.pushInvoice(item) | ||||
|           }, | ||||
|           // { | ||||
|           //   text: '移除', | ||||
|           //   click: item => this.batchRemove(item) | ||||
|  | ||||
| @ -34,6 +34,10 @@ export class TicketService extends ShipperBaseService { | ||||
|   $api_apply_fico = '/api/fcc/ficoVatinvH/crmPushInvo'; | ||||
|   // 运营端手工开票/确认/E税云开票成功后的回调 | ||||
|   $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'; | ||||
|  | ||||
		Reference in New Issue
	
	Block a user