批量审核
This commit is contained in:
		| @ -1,7 +1,7 @@ | ||||
| <!-- | ||||
|  * @Author: your name | ||||
|  * @Date: 2021-12-03 11:10:14 | ||||
|  * @LastEditTime: 2022-01-13 16:37:16 | ||||
|  * @LastEditTime: 2022-01-17 14:29:40 | ||||
|  * @LastEditors: Please set LastEditors | ||||
|  * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE | ||||
|  * @FilePath: \tms-obc-web\src\app\routes\supply-management\components\bulk\bulk.component.html | ||||
| @ -102,12 +102,12 @@ | ||||
|     </st> | ||||
|   </div> | ||||
| </nz-card> | ||||
| <nz-modal [(nzVisible)]="isVisible"   [nzFooter]="nzModalFooter" nzTitle="货源审核" (nzOnOk)="handleOK()" (nzOnCancel)="handleCancel('suppliersType')"> | ||||
| <nz-modal [(nzVisible)]="isVisible"   [nzFooter]="nzModalFooter" nzTitle="货源审核" (nzOnCancel)="handleCancel('suppliersType')"> | ||||
|   <ng-container *nzModalContent> | ||||
|     <div style="position: relative" *ngIf="auditMany"> | ||||
|       <nz-alert | ||||
|         nzType="info" | ||||
|         [nzMessage]="'已选择' +  6 + '项'" | ||||
|         [nzMessage]="'已选择' +  selectedRows?.length + '项'" | ||||
|         nzShowIcon | ||||
|         [ngStyle]="{ margin: '0 0 1rem 0' }" | ||||
|       > | ||||
| @ -117,14 +117,13 @@ | ||||
|     </sf> | ||||
|   </ng-container> | ||||
|   <ng-template #nzModalFooter> | ||||
|     <button nz-button nzType="primary" (click)="handleOK()" [disabled]="">通过</button> | ||||
|     <button nz-button nzType="default" (click)="handleCancel('suppliersType')">不通过</button> | ||||
|     <button nz-button nzType="primary" (click)="handleOK(1)">通过</button> | ||||
|     <button nz-button nzType="default" (click)="handleOK(2)">不通过</button> | ||||
|   </ng-template> | ||||
| </nz-modal> | ||||
| <ng-template #extraTemplate> | ||||
| <!-- <ng-template #extraTemplate> | ||||
|   <div> | ||||
|     <button (click)="audit('',2)" nz-button nzType="primary">批量审核</button> | ||||
|     <button (click)="audit('')" nz-button nzType="primary">发布货源</button> | ||||
|   | ||||
|   </div> | ||||
| </ng-template> | ||||
| </ng-template> --> | ||||
| @ -23,6 +23,7 @@ export class SupplyManagementBulkComponent implements OnInit { | ||||
|   schema: SFSchema = {}; | ||||
|   auditMany = false; | ||||
|   isVisible = false; | ||||
|   auditID: any; | ||||
|   _$expand = false; | ||||
|   columns: STColumn[] = []; | ||||
|   freightSchema: SFSchema = {}; | ||||
| @ -131,7 +132,7 @@ export class SupplyManagementBulkComponent implements OnInit { | ||||
|             }, | ||||
|           } as SFDateWidgetSchema, | ||||
|         }, | ||||
|         enterpriseInfoName: { | ||||
|         enterpriseInfoId: { | ||||
|           type: 'string', | ||||
|           title: '网络货运人', | ||||
|           ui: { | ||||
| @ -411,13 +412,25 @@ export class SupplyManagementBulkComponent implements OnInit { | ||||
|   } | ||||
|    /** | ||||
|   * 审核 | ||||
|   * status : 1 单个  2:批量 | ||||
|   * value : 单个单条数据 | ||||
|   */ | ||||
|     audit(value: any, status?: any) { | ||||
|       console.log(value) | ||||
|       console.log(status) | ||||
|       if(status === 2) { | ||||
|         if(this.selectedRows.length <= 0) { | ||||
|           this.service.msgSrv.error('未选择货源单!'); | ||||
|           return | ||||
|         } | ||||
|         let list: any[] = []; | ||||
|         this.selectedRows.forEach(item => { | ||||
|           list.push(item.id); | ||||
|         }); | ||||
|         this.auditID = list; | ||||
|         this.auditMany = true; | ||||
|       } else { | ||||
|         this.auditID = value.id | ||||
|         this.auditMany = false; | ||||
|       } | ||||
|       this.isVisible = true; | ||||
| @ -437,8 +450,46 @@ export class SupplyManagementBulkComponent implements OnInit { | ||||
|   /** | ||||
|   * 审核通过按钮 | ||||
|   */ | ||||
|   handleOK() { | ||||
|    | ||||
|   handleOK(value: any) { | ||||
|     if(this.selectedRows.length <= 0) {  | ||||
|     const params: any = { | ||||
|       id: this.auditID, | ||||
|       remarks: this.sfFre.value.remarks, | ||||
|     } | ||||
|     if(value == 1) { | ||||
|       params.auditStatus = 2 | ||||
|     } else { | ||||
|       params.auditStatus = 3 | ||||
|     } | ||||
|     console.log(params) | ||||
|     this.service.request(this.service.$api_goodsResourceAudit, params).subscribe(res => { | ||||
|       if (res === true) { | ||||
|         this.service.msgSrv.success('审核成功!'); | ||||
|         this.isVisible = false; | ||||
|         this.st?.reload(); | ||||
|         this.getGoodsSourceStatistical(); | ||||
|       } | ||||
|     }) | ||||
|   } else { | ||||
|     const params: any = { | ||||
|       ids: this.auditID, | ||||
|       remarks: this.sfFre.value.remarks, | ||||
|     } | ||||
|     if(value == 1) { | ||||
|       params.auditStatus = 2 | ||||
|     } else { | ||||
|       params.auditStatus = 3 | ||||
|     } | ||||
|     console.log(params) | ||||
|     this.service.request(this.service.$api_batchGoodsResourceAudit, params).subscribe(res => { | ||||
|       if (res === true) { | ||||
|         this.service.msgSrv.success('审核成功!'); | ||||
|         this.isVisible = false; | ||||
|         this.st?.reload(); | ||||
|         this.getGoodsSourceStatistical(); | ||||
|       } | ||||
|     }) | ||||
|   } | ||||
|   } | ||||
|   // 修改单价 | ||||
|   modification(item: any) { | ||||
|  | ||||
		Reference in New Issue
	
	Block a user