批量审核
This commit is contained in:
@ -1,7 +1,7 @@
|
||||
<!--
|
||||
* @Author: your name
|
||||
* @Date: 2021-12-22 11:28:28
|
||||
* @LastEditTime: 2022-01-13 16:26:00
|
||||
* @LastEditTime: 2022-01-17 14:14:00
|
||||
* @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\vehicle\vehicle.component.html
|
||||
@ -98,17 +98,16 @@
|
||||
[(nzVisible)]="isVisible"
|
||||
[nzFooter]="nzModalFooter"
|
||||
nzTitle="货源审核"
|
||||
(nzOnOk)="handleOK()"
|
||||
(nzOnCancel)="handleCancel('suppliersType')"
|
||||
>
|
||||
<ng-container *nzModalContent>
|
||||
<div style="position: relative" *ngIf="auditMany">
|
||||
<nz-alert nzType="info" [nzMessage]="'已选择' + 6 + '项'" nzShowIcon [ngStyle]="{ margin: '0 0 1rem 0' }"> </nz-alert>
|
||||
<nz-alert nzType="info" [nzMessage]="'已选择' + selectedRows?.length+ '项'" nzShowIcon [ngStyle]="{ margin: '0 0 1rem 0' }"> </nz-alert>
|
||||
</div>
|
||||
<sf #sfFre [schema]="freightSchema" [ui]="ui2" [compact]="false" [button]="'none'"> </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)" [disabled]="">通过</button>
|
||||
<button nz-button nzType="default" (click)="handleOK(2)">不通过</button>
|
||||
</ng-template>
|
||||
</nz-modal>
|
||||
|
||||
@ -24,7 +24,7 @@ export class SupplyManagementVehicleComponent implements OnInit {
|
||||
auditMany = false;
|
||||
isVisible = false;
|
||||
_$expand = false;
|
||||
|
||||
|
||||
@ViewChild('st') private readonly st!: STComponent;
|
||||
@ViewChild('sf', { static: false }) sf!: SFComponent;
|
||||
@ViewChild('sfFre', { static: false }) sfFre!: SFComponent;
|
||||
@ -36,6 +36,7 @@ export class SupplyManagementVehicleComponent implements OnInit {
|
||||
stayQuantity: 0
|
||||
};
|
||||
resourceStatus: any;
|
||||
auditID: any;
|
||||
constructor(
|
||||
public service: SupplyManagementService,
|
||||
private modal: NzModalService,
|
||||
@ -67,7 +68,6 @@ export class SupplyManagementVehicleComponent implements OnInit {
|
||||
this.initSFFre();
|
||||
this.getGoodsSourceStatistical();
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始化查询表单
|
||||
*/
|
||||
@ -75,7 +75,7 @@ export class SupplyManagementVehicleComponent implements OnInit {
|
||||
initSFFre() {
|
||||
this.freightSchema = {
|
||||
properties: {
|
||||
roleDescription: {
|
||||
remarks: {
|
||||
title: '备注',
|
||||
type: 'string',
|
||||
maxLength: 50,
|
||||
@ -84,7 +84,8 @@ export class SupplyManagementVehicleComponent implements OnInit {
|
||||
widget: 'textarea'
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
require: ['remarks']
|
||||
};
|
||||
this.ui2 = { '*': { spanLabelFixed: 120, grid: { span: 24 } } };
|
||||
}
|
||||
@ -191,8 +192,18 @@ export class SupplyManagementVehicleComponent implements OnInit {
|
||||
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;
|
||||
@ -206,7 +217,50 @@ export class SupplyManagementVehicleComponent implements OnInit {
|
||||
/**
|
||||
* 审核通过按钮
|
||||
*/
|
||||
handleOK() {}
|
||||
handleOK(value: any) {
|
||||
console.log(this.sfFre.valid)
|
||||
console.log(this.sfFre.value)
|
||||
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();
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
/**
|
||||
* 跳转修改货源
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user