提交代码

master
胡锐 2 months ago
parent 49d0b70f29
commit 1bca473545
  1. 70
      src/app/pages/trade/order-after-sales/order-after-sales.component.html
  2. 14
      src/app/pages/trade/order-after-sales/order-after-sales.component.ts

@ -213,39 +213,41 @@
<nz-modal [(nzVisible)]="applyAuditVisible" nzWidth="500px" nzTitle="审核" [nzFooter]="null" (nzOnCancel)="closeAudit()" [nzBodyStyle]="{ 'padding': '10px' }"> <nz-modal [(nzVisible)]="applyAuditVisible" nzWidth="500px" nzTitle="审核" [nzFooter]="null" (nzOnCancel)="closeAudit()" [nzBodyStyle]="{ 'padding': '10px' }">
<ng-container *nzModalContent> <ng-container *nzModalContent>
<form nz-form [formGroup]="applyAuditForm" > <nz-spin nzTip="处理中......" [nzSpinning]="isSpinning">
<nz-form-item> <form nz-form [formGroup]="applyAuditForm">
<nz-form-label [nzSm]="6" [nzXs]="24">申请单号</nz-form-label> <nz-form-item>
<nz-form-control [nzSm]="14" [nzXs]="24"> <nz-form-label [nzSm]="6" [nzXs]="24">申请单号</nz-form-label>
<input nz-input formControlName="applyNo" /> <nz-form-control [nzSm]="14" [nzXs]="24">
</nz-form-control> <input nz-input formControlName="applyNo" />
</nz-form-item> </nz-form-control>
<nz-form-item> </nz-form-item>
<nz-form-label [nzSm]="6" [nzXs]="24">申请类型</nz-form-label> <nz-form-item>
<nz-form-control [nzSm]="14" [nzXs]="24"> <nz-form-label [nzSm]="6" [nzXs]="24">申请类型</nz-form-label>
<nz-select formControlName="type"> <nz-form-control [nzSm]="14" [nzXs]="24">
<nz-option *ngFor="let item of applyTypeArray" nzValue="{{item.codeValue}}" nzLabel="{{item.codeName}}"></nz-option> <nz-select formControlName="type">
</nz-select> <nz-option *ngFor="let item of applyTypeArray" nzValue="{{item.codeValue}}" nzLabel="{{item.codeName}}"></nz-option>
</nz-form-control> </nz-select>
</nz-form-item> </nz-form-control>
<nz-form-item> </nz-form-item>
<nz-form-label [nzSm]="6" [nzXs]="24" nzRequired>审核</nz-form-label> <nz-form-item>
<nz-form-control [nzSm]="14" [nzXs]="24" nzErrorTip="请选择审核状态!"> <nz-form-label [nzSm]="6" [nzXs]="24" nzRequired>审核</nz-form-label>
<nz-radio-group formControlName="auditStatus" > <nz-form-control [nzSm]="14" [nzXs]="24" nzErrorTip="请选择审核状态!">
<label nz-radio nzValue="true">通过</label> <nz-radio-group formControlName="auditStatus" >
<label nz-radio nzValue="false">驳回</label> <label nz-radio nzValue="true">通过</label>
</nz-radio-group> <label nz-radio nzValue="false">驳回</label>
</nz-form-control> </nz-radio-group>
</nz-form-item> </nz-form-control>
<nz-form-item> </nz-form-item>
<nz-form-label [nzSm]="6" [nzXs]="24">备注</nz-form-label> <nz-form-item>
<nz-form-control [nzSm]="14" [nzXs]="24" nzErrorTip=""> <nz-form-label [nzSm]="6" [nzXs]="24">备注</nz-form-label>
<textarea rows="4" formControlName="remarks" nz-input></textarea> <nz-form-control [nzSm]="14" [nzXs]="24" nzErrorTip="">
</nz-form-control> <textarea rows="4" formControlName="remarks" nz-input></textarea>
</nz-form-item> </nz-form-control>
</form> </nz-form-item>
<div nz-flex [nzJustify]="'center'"> </form>
<button nz-button nzType="primary" class="submit-btn" (click)="submitAuditForm()">确定</button> <div nz-flex [nzJustify]="'center'">
</div> <button nz-button nzType="primary" class="submit-btn" (click)="submitAuditForm()">确定</button>
</div>
</nz-spin>
</ng-container> </ng-container>
</nz-modal> </nz-modal>

@ -34,6 +34,8 @@ import {NzTimelineModule} from "ng-zorro-antd/timeline";
import {NzImageDirective, NzImageModule} from "ng-zorro-antd/image"; import {NzImageDirective, NzImageModule} from "ng-zorro-antd/image";
import {NzTypographyComponent} from "ng-zorro-antd/typography"; import {NzTypographyComponent} from "ng-zorro-antd/typography";
import {environment} from "../../../../environments/environment"; import {environment} from "../../../../environments/environment";
import {NzSpinComponent} from "ng-zorro-antd/spin";
import {NzAlertComponent} from "ng-zorro-antd/alert";
@Component({ @Component({
selector: 'app-order-after-sales', selector: 'app-order-after-sales',
@ -89,13 +91,16 @@ import {environment} from "../../../../environments/environment";
NzTimelineModule, NzTimelineModule,
NzImageDirective, NzImageDirective,
NzImageModule, NzImageModule,
NzTypographyComponent NzTypographyComponent,
NzSpinComponent,
NzAlertComponent
], ],
templateUrl: './order-after-sales.component.html', templateUrl: './order-after-sales.component.html',
styleUrl: './order-after-sales.component.less' styleUrl: './order-after-sales.component.less'
}) })
export class OrderAfterSalesComponent { export class OrderAfterSalesComponent {
imageUrl = environment.imageUrl; imageUrl = environment.imageUrl;
isSpinning = false;
// 表单页数 // 表单页数
tablePageNum = 1; tablePageNum = 1;
// 表单数据 // 表单数据
@ -241,15 +246,16 @@ export class OrderAfterSalesComponent {
this.applyAuditVisible = true; this.applyAuditVisible = true;
} }
/** /**
* *
*/ */
submitAuditForm() { submitAuditForm() {
this.isSpinning = true;
if (this.applyAuditForm.valid) { if (this.applyAuditForm.valid) {
this.applyAuditForm.controls['applyNo'].enable(); this.applyAuditForm.controls['applyNo'].enable();
this.orderAfterSalesService.audit(this.applyAuditForm.value, (data: any) => { this.orderAfterSalesService.audit(this.applyAuditForm.value, (data: any) => {
if (data['return_code'] == '000000') { if (data['return_code'] == '000000') {
this.message.create('success', '操作成功'); this.message.create('success', '操作成功');
// 清空表单 // 清空表单
this.closeAudit(); this.closeAudit();
@ -258,6 +264,7 @@ export class OrderAfterSalesComponent {
} else { } else {
this.message.create('error', data['return_msg']); this.message.create('error', data['return_msg']);
} }
this.isSpinning = false;
}); });
} else { } else {
this.applyAuditForm.controls['applyNo'].disable(); this.applyAuditForm.controls['applyNo'].disable();
@ -267,6 +274,7 @@ export class OrderAfterSalesComponent {
control.updateValueAndValidity({ onlySelf: true }); control.updateValueAndValidity({ onlySelf: true });
} }
}); });
this.isSpinning = false;
} }
} }
@ -290,6 +298,7 @@ export class OrderAfterSalesComponent {
}); });
} }
submitFinish(applyNo: string): void { submitFinish(applyNo: string): void {
this.isSpinning = true;
const param = { const param = {
applyNo: applyNo applyNo: applyNo
} }
@ -300,6 +309,7 @@ export class OrderAfterSalesComponent {
} else { } else {
this.message.create('error', data['return_msg']); this.message.create('error', data['return_msg']);
} }
this.isSpinning = false;
}); });
} }

Loading…
Cancel
Save