From 024d7ff39dc250dbbbf613304b01afd5d43f708c Mon Sep 17 00:00:00 2001 From: Taric Xin Date: Thu, 6 Jan 2022 19:33:52 +0800 Subject: [PATCH] edit --- .../bulk-release-publish.component.html | 131 +++++------------- .../bulk-release-publish.component.ts | 46 +++--- 2 files changed, 50 insertions(+), 127 deletions(-) diff --git a/src/app/routes/supply-management/components/bulk-release-publish/bulk-release-publish.component.html b/src/app/routes/supply-management/components/bulk-release-publish/bulk-release-publish.component.html index 98b887bb..53824084 100644 --- a/src/app/routes/supply-management/components/bulk-release-publish/bulk-release-publish.component.html +++ b/src/app/routes/supply-management/components/bulk-release-publish/bulk-release-publish.component.html @@ -17,11 +17,9 @@ -
装卸货信息预计公里数:{{ totalDistance }}km,预计行程耗时:{{ totalTime }}小时
+
装卸货信息预计公里数:{{ totalDistance }}km,预计行程耗时:{{ totalTime }}小时
-
+
@@ -30,17 +28,11 @@
- + - +
@@ -48,23 +40,12 @@ 联系人
- + - +
@@ -72,7 +53,8 @@
- +
@@ -82,17 +64,11 @@
- + - +
@@ -100,23 +76,12 @@ 联系人
- + - +
@@ -139,7 +104,8 @@ - + + @@ -150,9 +116,8 @@ - +

例如 付司机运费 = 重量*单价 = 999.99

保留小数,即 999.99

@@ -163,41 +128,20 @@
- + - + - + @@ -214,15 +158,8 @@
- +
天内支付运费 @@ -237,10 +174,10 @@
- +
-
+ \ No newline at end of file diff --git a/src/app/routes/supply-management/components/bulk-release-publish/bulk-release-publish.component.ts b/src/app/routes/supply-management/components/bulk-release-publish/bulk-release-publish.component.ts index 656bb3fe..266a3e20 100644 --- a/src/app/routes/supply-management/components/bulk-release-publish/bulk-release-publish.component.ts +++ b/src/app/routes/supply-management/components/bulk-release-publish/bulk-release-publish.component.ts @@ -1,5 +1,5 @@ import { Component, OnInit, ViewChild } from '@angular/core'; -import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms'; +import { FormBuilder, FormControl, FormGroup, NgForm, Validators } from '@angular/forms'; import { ActivatedRoute, Router } from '@angular/router'; import { SFArrayWidgetSchema, @@ -31,7 +31,9 @@ import { PublishSuccessComponent } from '../onecar-publish/publish-success/publi styleUrls: ['./bulk-release-publish.component.less'] }) export class SupplyManagementBulkReleasePublishComponent implements OnInit { - validateForm1: FormGroup; + @ViewChild('ngForm') + ngForm!: NgForm; + sf1data: any; // 货源单设置回显 sf3data: any; // 货源单设置回显 sf4data: any; // 货源单设置回显 @@ -59,7 +61,6 @@ export class SupplyManagementBulkReleasePublishComponent implements OnInit { ruleOptions: any; constructor( private http: _HttpClient, - fb: FormBuilder, private modalService: NzModalService, private settingSrv: SettingsService, private service: SupplyManagementService, @@ -67,16 +68,7 @@ export class SupplyManagementBulkReleasePublishComponent implements OnInit { private route: ActivatedRoute, private amapService: AmapService, public shipperSrv: ShipperBaseService - ) { - this.validateForm1 = fb.group({ - loadAddress0: [null, [Validators.required]], - loadName0: [null, [Validators.required]], - loadPhone0: [null, [Validators.required]], - unloadAddress0: [null, [Validators.required]], - unloadName0: [null, [Validators.required]], - unloadPhone0: [null, [Validators.required]] - }); - } + ) {} @ViewChild('sf1', { static: false }) sf1!: SFComponent; schema1: SFSchema = {}; @@ -151,9 +143,6 @@ export class SupplyManagementBulkReleasePublishComponent implements OnInit { }, change: (q: any) => { this.getRegionCode(q); - }, - visibleIf: { - _$expand: (value: boolean) => value } } as SFSelectWidgetSchema }, @@ -180,9 +169,6 @@ export class SupplyManagementBulkReleasePublishComponent implements OnInit { ui: { widget: 'select', placeholder: '请选择', - visibleIf: { - _$expand: (value: boolean) => value - }, allowClear: true, asyncData: () => this.shipperSrv.getNetworkFreightForwarder() } @@ -481,17 +467,17 @@ export class SupplyManagementBulkReleasePublishComponent implements OnInit { }); } submit(submitType: string): void { - // Object.keys(this.validateForm1.controls).forEach(key => { - // this.validateForm1.controls[key].markAsDirty(); - // this.validateForm1.controls[key].updateValueAndValidity(); - // }); - // this.sf1.validator({ emitError: true }); - // this.sf3.validator({ emitError: true }); - // this.sf4.validator({ emitError: true }); - // this.sf6.validator({ emitError: true }); - // if (this.validateForm1.invalid || !this.sf1.valid || !this.sf3.valid || !this.sf4.valid || !this.sf6.valid) { - // return; - // } + Object.keys(this.ngForm.form.controls).forEach(key => { + this.ngForm.form.controls[key].markAsDirty(); + this.ngForm.form.controls[key].updateValueAndValidity(); + }); + this.sf1.validator({ emitError: true }); + this.sf3.validator({ emitError: true }); + this.sf4.validator({ emitError: true }); + this.sf6.validator({ emitError: true }); + if (this.ngForm.form.invalid || !this.sf1.valid || !this.sf3.valid || !this.sf4.valid || !this.sf6.valid) { + return; + } // //装卸货信息 const LoadingList = this.startInfo.concat(this.endInfo);