diff --git a/src/app/routes/supply-management/components/bulk-publish/bulk-publish.component.html b/src/app/routes/supply-management/components/bulk-publish/bulk-publish.component.html index 677576ae..605c2540 100644 --- a/src/app/routes/supply-management/components/bulk-publish/bulk-publish.component.html +++ b/src/app/routes/supply-management/components/bulk-publish/bulk-publish.component.html @@ -40,7 +40,7 @@ 联系人 -
+
联系人 -
+
- + - +
diff --git a/src/app/routes/supply-management/components/bulk-publish/bulk-publish.component.ts b/src/app/routes/supply-management/components/bulk-publish/bulk-publish.component.ts index 4e1d92cb..b8011b3f 100644 --- a/src/app/routes/supply-management/components/bulk-publish/bulk-publish.component.ts +++ b/src/app/routes/supply-management/components/bulk-publish/bulk-publish.component.ts @@ -1,5 +1,5 @@ import { Component, OnInit, ViewChild } from '@angular/core'; -import { FormBuilder, FormGroup,Validators,FormControl } from '@angular/forms'; +import { FormBuilder, FormGroup, Validators, FormControl } from '@angular/forms'; import { ActivatedRoute, Router } from '@angular/router'; import { SFComponent, @@ -14,17 +14,18 @@ import { _HttpClient } from '@delon/theme'; import { AmapPoiPickerComponent, AmapService, ShipperBaseService } from '@shared'; import { NzModalService } from 'ng-zorro-antd/modal'; import { PublishGoodsChooseFamifiarComponent } from '../choose-famifiar/choose-famifiar.component'; -import { SupplyManagementService} from '../../services/supply-management.service'; +import { SupplyManagementService } from '../../services/supply-management.service'; import { map } from 'rxjs/operators'; import { of } from 'rxjs'; import { PublishSuccessComponent } from '../onecar-publish/publish-success/publish-success.component'; import { PublishAddressListComponent } from '../onecar-publish/address-list/address-list.component'; +import { TranAgreementComponent } from '../tran-agreement/tran-agreement.component'; @Component({ selector: 'app-publish-goods-bulk-publish', templateUrl: './bulk-publish.component.html', styleUrls: ['./bulk-publish.component.less'] }) -export class SupplyManagementBulkPublishComponent implements OnInit { +export class SupplyManagementBulkPublishComponent implements OnInit { validateForm1: FormGroup; sf1data: any; // 货源单设置回显 sf3data: any; // 货源单设置回显 @@ -38,7 +39,7 @@ export class SupplyManagementBulkPublishComponent implements OnInit { totalTime = 0.0; //路程总时间 currentGoodsTypeName: any; enterpriseProjectIds: any; - id = this.route.snapshot.params.id; // 传参id + id = this.route.snapshot.params.id; // 传参id // // 单位 startInfo: any = []; endInfo: any = []; @@ -51,16 +52,15 @@ export class SupplyManagementBulkPublishComponent implements OnInit { private modalService: NzModalService, public service: SupplyManagementService, private amapService: AmapService, - public shipperSrv: ShipperBaseService,) { + public shipperSrv: ShipperBaseService + ) { this.validateForm1 = fb.group({ - createTime: [null, []], - modifyTime: [null, []], loadAddress0: [null, [Validators.required]], loadName0: [null, [Validators.required]], - loadPhone0: [null, [Validators.required]], + loadPhone0: [null, [Validators.required, Validators.pattern('^[0-9]*$')]], unloadAddress0: [null, [Validators.required]], unloadName0: [null, [Validators.required]], - unloadPhone0: [null, [Validators.required]] + unloadPhone0: [null, [Validators.required, Validators.pattern('^[0-9]*$')]] }); } @ViewChild('sf1', { static: false }) sf1!: SFComponent; @@ -84,11 +84,11 @@ export class SupplyManagementBulkPublishComponent implements OnInit { ui7!: SFUISchema; // 初始化 ngOnInit(): void { - if(this.route.snapshot?.queryParams?.sta === '3') { + if (this.route.snapshot?.queryParams?.sta === '3') { this.PageStatus = '大宗修改'; - } else if(this.route.snapshot?.queryParams?.sta === '4') { + } else if (this.route.snapshot?.queryParams?.sta === '4') { this.PageStatus = '大宗下一单'; - } + } this.initSF1(); this.initSF3(); this.initSF4(); @@ -110,27 +110,27 @@ export class SupplyManagementBulkPublishComponent implements OnInit { onSearch: (q: any) => { if (!!q) { return this.service - .request(this.service.$api_enterpriceList, { enterpriseName: q}) - .pipe(map((res) => (res as any[]).map((i) => ({ label: i.enterpriseName, value: i.id } as SFSchemaEnum)))) + .request(this.service.$api_enterpriceList, { enterpriseName: q }) + .pipe(map(res => (res as any[]).map(i => ({ label: i.enterpriseName, value: i.id } as SFSchemaEnum)))) .toPromise(); } else { return of([]); } }, change: (q: any) => { - this.getRegionCode(q) + this.getRegionCode(q); }, visibleIf: { - _$expand: (value: boolean) => value, - }, - } as SFSelectWidgetSchema, - }, + _$expand: (value: boolean) => value + } + } as SFSelectWidgetSchema + }, enterpriseProjectId: { type: 'string', title: '项目', ui: { widget: 'select', - placeholder: '请选择', + placeholder: '请选择' } as SFSelectWidgetSchema }, enterpriseInfoName: { @@ -138,7 +138,7 @@ export class SupplyManagementBulkPublishComponent implements OnInit { title: '网络货运人', ui: { widget: 'text' - }, + } }, deadlineTime: { title: '截至日期', @@ -154,8 +154,8 @@ export class SupplyManagementBulkPublishComponent implements OnInit { title: '手机号', maxLength: 30, ui: { - hidden: true, - placeholder: '请输入' + hidden: true, + placeholder: '请输入' } }, dispatchName: { @@ -175,10 +175,10 @@ export class SupplyManagementBulkPublishComponent implements OnInit { placeholder: '请选择', allowClear: true, change: (value: any, data: any) => { - if(data.label) { - const dat = data.label.split('/') - this.sf1.setValue('/dispatchName', dat[0]); - this.sf1.setValue('/dispatchPhone', dat[1]); + if (data.label) { + const dat = data.label.split('/'); + this.sf1.setValue('/dispatchName', dat[0]); + this.sf1.setValue('/dispatchPhone', dat[1]); } }, optionalHelp: '选择调度员,司机直接联系调度员 ; 不选择,司机直接联系您', @@ -186,7 +186,7 @@ export class SupplyManagementBulkPublishComponent implements OnInit { } as SFSelectWidgetSchema } }, - required: ['shipperAppUserId', 'enterpriseProjectId','enterpriseInfoId', 'deadlineTime', ] + required: ['shipperAppUserId', 'enterpriseProjectId', 'enterpriseInfoId', 'deadlineTime'] }; this.ui1 = { '*': { @@ -497,7 +497,7 @@ export class SupplyManagementBulkPublishComponent implements OnInit { } as SFTextareaWidgetSchema } }, - required: ['paymentDays','stateReceipt'] + required: ['paymentDays', 'stateReceipt'] }; this.ui7 = { '*': { @@ -507,27 +507,32 @@ export class SupplyManagementBulkPublishComponent implements OnInit { }; } changeValue() { - this.totalFees = Number(this.sf7?.value?.appendFee) + Number(this.sf7?.value?.oilCardPay) + Number(this.sf7?.value?.prePay) + Number(this.sf7?.value?.receiptPay) + Number(this.sf7?.value?.toPay) + this.totalFees = + Number(this.sf7?.value?.appendFee) + + Number(this.sf7?.value?.oilCardPay) + + Number(this.sf7?.value?.prePay) + + Number(this.sf7?.value?.receiptPay) + + Number(this.sf7?.value?.toPay); } // 获取城市列表 getRegionCode(regionCode: any) { - return this.service - .request(this.service.$api_get_enterprise_project, { id: regionCode }) - .pipe( - map(res => - res.map((item: any) => ({ - label: item.projectName, - value: item.id - })) - ) + return this.service + .request(this.service.$api_get_enterprise_project, { id: regionCode }) + .pipe( + map(res => + res.map((item: any) => ({ + label: item.projectName, + value: item.id + })) ) - .subscribe(res => { - this.sf1.getProperty('/enterpriseProjectId')!.schema.enum = res; - this.sf1.getProperty('/enterpriseProjectId')!.widget.reset(res); - if(this.enterpriseProjectIds) { - this.sf1.setValue('/enterpriseProjectId', this.enterpriseProjectIds); - } - }); + ) + .subscribe(res => { + this.sf1.getProperty('/enterpriseProjectId')!.schema.enum = res; + this.sf1.getProperty('/enterpriseProjectId')!.widget.reset(res); + if (this.enterpriseProjectIds) { + this.sf1.setValue('/enterpriseProjectId', this.enterpriseProjectIds); + } + }); } addStartInfo(event: any) { if (this.startInfo.length < 5) { @@ -548,10 +553,9 @@ export class SupplyManagementBulkPublishComponent implements OnInit { this.validateForm1.addControl(`loadPhone${controlId}`, new FormControl(null, Validators.required)); } } - subStartInfo(event: any, index: number, id?:any) { - if(id) { - this.service.request(this.service.$api_delete_Wholedeletebatch, [id]).subscribe((res) => { - }) + subStartInfo(event: any, index: number, id?: any) { + if (id) { + this.service.request(this.service.$api_delete_Wholedeletebatch, [id]).subscribe(res => {}); } this.startInfo.splice(index, 1); this.validateForm1.removeControl(`loadAddress${index}`); @@ -577,13 +581,12 @@ export class SupplyManagementBulkPublishComponent implements OnInit { this.validateForm1.addControl(`unloadPhone${controlId}`, new FormControl(null, Validators.required)); } } - subEndInfo(event: any, index: number, id?:any) { - if(id) { - this.service.request(this.service.$api_delete_Wholedeletebatch, [id]).subscribe((res) => { - }) + subEndInfo(event: any, index: number, id?: any) { + if (id) { + this.service.request(this.service.$api_delete_Wholedeletebatch, [id]).subscribe(res => {}); } this.endInfo.splice(index, 1); - this.validateForm1.removeControl(`unloadAddress${index}`); + this.validateForm1.removeControl(`unloadAddress${index}`); this.validateForm1.removeControl(`unloadName${index}`); this.validateForm1.removeControl(`unloadPhone${index}`); } @@ -596,7 +599,7 @@ export class SupplyManagementBulkPublishComponent implements OnInit { submitParams: item, submitUrl: this.service.$api_save_bulk_assign }, - nzWidth: 1300, + nzWidth: 1300 }); modalRef.afterClose.subscribe(result => { if (result) { @@ -606,16 +609,16 @@ export class SupplyManagementBulkPublishComponent implements OnInit { } // 打开下单完成页面 openFinishPage(resourceObj: any = null) { - this.modalService.create({ - nzTitle: '', - nzContent: PublishSuccessComponent, - nzWidth: 900, - nzFooter: null, - nzComponentParams: { type: 'bulk' } - }); + this.modalService.create({ + nzTitle: '', + nzContent: PublishSuccessComponent, + nzWidth: 900, + nzFooter: null, + nzComponentParams: { type: 'bulk' } + }); } - // 确认提交 - submit(submitType?: string): void { + // 提交前确认,委托运输协议弹窗 + submitConfirm(submitType?: any) { // 校验规则 Object.keys(this.validateForm1.controls).forEach(key => { this.validateForm1.controls[key].markAsDirty(); @@ -625,40 +628,58 @@ export class SupplyManagementBulkPublishComponent implements OnInit { this.sf3.validator({ emitError: true }); this.sf4.validator({ emitError: true }); this.sf7.validator({ emitError: true }); - if (this.validateForm1.invalid || !this.sf3.valid || !this.sf1.valid|| !this.sf4.valid || !this.sf7.valid) { + if (this.validateForm1.invalid || !this.sf3.valid || !this.sf1.valid || !this.sf4.valid || !this.sf7.valid) { return; } - if(typeof(this.validateForm1.value.modifyTime) !== 'string' ) { - var c = new Date(this.validateForm1.value.modifyTime); - this.validateForm1.value.modifyTime = c.getFullYear() + '-' + (c.getMonth() + 1) + '-' + c.getDate() + ' ' + c.getHours() + ':' + c.getMinutes() + ':' + c.getSeconds() + + const modalRef = this.modalService.create({ + nzTitle: '运输协议', + nzContent: TranAgreementComponent, + nzWidth: 900, + nzFooter: null + }); + modalRef.afterClose.subscribe(result => { + if (result) { + this.submit(submitType); + } + }); + } + // 确认提交 + submit(submitType?: string): void { + if (typeof this.validateForm1.value.modifyTime !== 'string') { + var c = new Date(this.validateForm1.value.modifyTime); + this.validateForm1.value.modifyTime = + c.getFullYear() + '-' + (c.getMonth() + 1) + '-' + c.getDate() + ' ' + c.getHours() + ':' + c.getMinutes() + ':' + c.getSeconds(); } - if(typeof(this.validateForm1.value.createTime) !== 'string' ) { - var c = new Date(this.validateForm1.value.createTime); - this.validateForm1.value.createTime = c.getFullYear() + '-' + (c.getMonth() + 1) + '-' + c.getDate() + ' ' + c.getHours() + ':' + c.getMinutes() + ':' + c.getSeconds() + if (typeof this.validateForm1.value.createTime !== 'string') { + var c = new Date(this.validateForm1.value.createTime); + this.validateForm1.value.createTime = + c.getFullYear() + '-' + (c.getMonth() + 1) + '-' + c.getDate() + ' ' + c.getHours() + ':' + c.getMinutes() + ':' + c.getSeconds(); } const params: any = { ...this.sf1.value, ...this.sf7.value, - unLoadingPlaceDTOList: [...this.startInfo, ...this.endInfo,], + unLoadingPlaceDTOList: [...this.startInfo, ...this.endInfo], goodsInfoDTOList: [ - { - ...this.sf4.value, ...this.sf3.value, - maxWeight: this.sf4.value.maxWeight.join(','), - maxCube: this.sf4.value.maxCube.join(',') - } + { + ...this.sf4.value, + ...this.sf3.value, + maxWeight: this.sf4.value.maxWeight.join(','), + maxCube: this.sf4.value.maxCube.join(',') + } ] - } - params.freightPrice = this.totalFees - if(submitType) { + }; + params.freightPrice = this.totalFees; + if (submitType) { if (submitType == 'assign') { this.chooseFamifiar(params); return; } } - if(this.PageStatus === '大宗修改') { + if (this.PageStatus === '大宗修改') { this.requests(this.service.$api_set_bulkModify, params, 1); - } else if(this.PageStatus === '大宗下一单') { + } else if (this.PageStatus === '大宗下一单') { this.requests(this.service.$api_set_saveAnotherBulkOrder, params, 2); } } @@ -695,8 +716,8 @@ export class SupplyManagementBulkPublishComponent implements OnInit { if (res) { this.sf3.getProperty('/goodsNameId')!.schema.enum = res; this.sf3.getProperty('/goodsNameId')!.widget.reset(res); - if(this.sf3data.goodsNameId){ - this.sf3.setValue('/goodsNameId',this.sf3data.goodsNameId); + if (this.sf3data.goodsNameId) { + this.sf3.setValue('/goodsNameId', this.sf3data.goodsNameId); } } }); @@ -713,64 +734,64 @@ export class SupplyManagementBulkPublishComponent implements OnInit { this.sf7.setValue('/receiptAddressId', data.id); this.sf7.setValue('/receiptUserName', data.contactName); this.sf7.setValue('/phon', data.contactTelephone); - this.sf7.setValue('/area', `${data.province}-${data.city}-${data.area}`) + this.sf7.setValue('/area', `${data.province}-${data.city}-${data.area}`); this.sf7.setValue('/address', data.detailedAddress); } }); } - // 打开地图 + // 打开地图 openMap(type: string, index: number) { - const modalRef = this.modalService.create({ - nzTitle: '', - nzContent: AmapPoiPickerComponent, - nzWidth: 900, - nzOnOk: item => { - const poi = item.poi; - const locList = poi.location.toString().split(','); - switch (type) { - case 'start': - this.startInfo[index].detailedAddress = poi.district + poi.name; - this.startInfo[index].longitude = locList[0]; - this.startInfo[index].latitude = locList[1]; - this.startInfo[index].province = poi.cityInfo.province; - this.startInfo[index].city = poi.cityInfo.city; - this.startInfo[index].area = poi.cityInfo.district; - this.startInfo[index].address = poi.name; - break; - case 'end': - this.endInfo[index].detailedAddress = poi.district + poi.name; - this.endInfo[index].longitude = locList[0]; - this.endInfo[index].latitude = locList[1]; - this.endInfo[index].province = poi.cityInfo.province; - this.endInfo[index].city = poi.cityInfo.city; - this.endInfo[index].area = poi.cityInfo.district; - this.endInfo[index].address = poi.name; - break; - default: - break; - } + const modalRef = this.modalService.create({ + nzTitle: '', + nzContent: AmapPoiPickerComponent, + nzWidth: 900, + nzOnOk: item => { + const poi = item.poi; + const locList = poi.location.toString().split(','); + switch (type) { + case 'start': + this.startInfo[index].detailedAddress = poi.district + poi.name; + this.startInfo[index].longitude = locList[0]; + this.startInfo[index].latitude = locList[1]; + this.startInfo[index].province = poi.cityInfo.province; + this.startInfo[index].city = poi.cityInfo.city; + this.startInfo[index].area = poi.cityInfo.district; + this.startInfo[index].address = poi.name; + break; + case 'end': + this.endInfo[index].detailedAddress = poi.district + poi.name; + this.endInfo[index].longitude = locList[0]; + this.endInfo[index].latitude = locList[1]; + this.endInfo[index].province = poi.cityInfo.province; + this.endInfo[index].city = poi.cityInfo.city; + this.endInfo[index].area = poi.cityInfo.district; + this.endInfo[index].address = poi.name; + break; + default: + break; + } - if (this.startInfo[0]?.area && this.endInfo[0]?.area) { - this.amapService.drivingCompute([...this.startInfo], [...this.endInfo]).subscribe((res: any) => { - this.totalDistance = res.distance; - this.totalTime = res.time; - }); + if (this.startInfo[0]?.area && this.endInfo[0]?.area) { + this.amapService.drivingCompute([...this.startInfo], [...this.endInfo]).subscribe((res: any) => { + this.totalDistance = res.distance; + this.totalTime = res.time; + }); + } } - } - }); -} + }); + } goBack() { window.history.go(-1); } // 初始化信息 initdata() { - this.service.request(`${this.service.$api_get_getBulkDetail}`, {id:this.id}).subscribe((res) => { - this.dataR(res); - }) + this.service.request(`${this.service.$api_get_getBulkDetail}`, { id: this.id }).subscribe(res => { + this.dataR(res); + }); } // 初始化信息 - dataR (res: any) { + dataR(res: any) { // 注:区分编辑和下一单 区别是初始化的时候加不加ID if (res?.shipperAppUserName) { const List: any = []; @@ -786,26 +807,26 @@ export class SupplyManagementBulkPublishComponent implements OnInit { } }); } - if(res?.enterpriseProjectId) { - this.enterpriseProjectIds = res.enterpriseProjectId + if (res?.enterpriseProjectId) { + this.enterpriseProjectIds = res.enterpriseProjectId; } this.sf1data = { dispatchPhone: res?.dispatchPhone, dispatchName: res?.dispatchName, // shipperAppUserName: res?.shipperAppUserName || '', - enterpriseProjectId: res?.enterpriseProjectId || '', - enterpriseInfoName: res?.enterpriseInfoName || '', - externalResourceCode: res?.externalResourceCode || '', - dispatchId: res?.dispatchId || '', - deadlineTime: res?.deadlineTime || '', - } - if(this.PageStatus === '大宗修改') { + enterpriseProjectId: res?.enterpriseProjectId || '', + enterpriseInfoName: res?.enterpriseInfoName || '', + externalResourceCode: res?.externalResourceCode || '', + dispatchId: res?.dispatchId || '', + deadlineTime: res?.deadlineTime || '' + }; + if (this.PageStatus === '大宗修改') { this.sf1data.id = res?.id; } res?.unLoadingPlaceVOList.forEach((element: any) => { - if(element.type === 1 || element.type === '1') { + if (element.type === 1 || element.type === '1') { const controlId = this.startInfo.length; - if(this.PageStatus === '大宗修改') { + if (this.PageStatus === '大宗修改') { this.startInfo.push({ detailedAddress: element.detailedAddress, appUserName: element.appUserName, @@ -817,7 +838,7 @@ export class SupplyManagementBulkPublishComponent implements OnInit { area: element.area, type: element.type, id: element.id - }) + }); } else { this.startInfo.push({ detailedAddress: element.detailedAddress, @@ -828,19 +849,19 @@ export class SupplyManagementBulkPublishComponent implements OnInit { province: element.province, city: element.city, area: element.area, - type: element.type, - }) + type: element.type + }); } - if(element.createTime) { - this.creatTime = element?.createTime - this.modifyTime = element?.modifyTime + if (element.createTime) { + this.creatTime = element?.createTime; + this.modifyTime = element?.modifyTime; } this.validateForm1.addControl(`loadAddress${controlId}`, new FormControl(null, Validators.required)); this.validateForm1.addControl(`loadName${controlId}`, new FormControl(null, Validators.required)); this.validateForm1.addControl(`loadPhone${controlId}`, new FormControl(null, Validators.required)); - } else if(element.type === 2 || element.type === '2') { + } else if (element.type === 2 || element.type === '2') { const controlId = this.endInfo.length; - if( this.PageStatus === '大宗修改') { + if (this.PageStatus === '大宗修改') { this.endInfo.push({ detailedAddress: element?.detailedAddress, appUserName: element?.appUserName, @@ -852,7 +873,7 @@ export class SupplyManagementBulkPublishComponent implements OnInit { area: element.area, type: element.type, id: element.id - }) + }); } else { this.endInfo.push({ detailedAddress: element?.detailedAddress, @@ -864,7 +885,7 @@ export class SupplyManagementBulkPublishComponent implements OnInit { city: element.city, area: element.area, type: element.type - }) + }); } this.validateForm1.addControl(`unloadAddress${controlId}`, new FormControl(null, Validators.required)); this.validateForm1.addControl(`unloadName${controlId}`, new FormControl(null, Validators.required)); @@ -875,7 +896,7 @@ export class SupplyManagementBulkPublishComponent implements OnInit { goodsTypeId: res?.goodsInfoVOList[0]?.goodsTypeId || '', goodsTypeName: res?.goodsInfoVOList[0]?.goodsTypeName || '', goodsNameId: res?.goodsInfoVOList[0]?.goodsNameId || '', - goodsName: res?.goodsInfoVOList[0]?.goodsName || '', + goodsName: res?.goodsInfoVOList[0]?.goodsName || '' }; if (this.sf3data.goodsTypeName === '其它') { this.sf3data.goodsName1 = res?.goodsInfoVOList[0]?.goodsName || ''; @@ -892,11 +913,10 @@ export class SupplyManagementBulkPublishComponent implements OnInit { number: res?.goodsInfoVOList[0]?.number || '', maxWeight: res?.goodsInfoVOList[0]?.maxWeight?.split(',') || '', maxCube: res?.goodsInfoVOList[0]?.maxCube?.split(',') || '' - - } - if(this.PageStatus === '大宗修改') { + }; + if (this.PageStatus === '大宗修改') { this.sf4data.id = res?.goodsInfoVOList[0]?.id; - } + } this.totalFees = res?.freightPrice || '0'; this.sf7data = { stateReceipt: res?.supplementaryInformationVO?.stateReceipt, @@ -911,7 +931,7 @@ export class SupplyManagementBulkPublishComponent implements OnInit { }; } // 回退 - choose(){ + choose() { window.history.go(-1); } // 选择地址 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 cb996e6d..a5987f02 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,7 +17,9 @@ -
装卸货信息预计公里数:{{ totalDistance }}km,预计行程耗时:{{ totalTime }}小时
+
装卸货信息预计公里数:{{ totalDistance }}km,预计行程耗时:{{ totalTime }}小时
@@ -28,24 +30,44 @@
- + - +
联系人 -
+
- + - +
@@ -53,8 +75,7 @@
- +
@@ -64,24 +85,44 @@
- + - +
联系人 -
+
- + - +
@@ -100,12 +141,20 @@ - + - - + @@ -116,8 +165,9 @@ - +

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

保留小数,即 999.99

@@ -128,20 +178,41 @@
- + - + - +
@@ -165,12 +236,18 @@
-
+
- +
-
+
   天内支付运费
@@ -185,7 +262,7 @@
- - + +
- \ 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 e67e40be..bdad67a1 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 @@ -19,6 +19,7 @@ import { SupplyManagementService } from '../../services/supply-management.servic import { PublishGoodsChooseFamifiarComponent } from '../choose-famifiar/choose-famifiar.component'; import { PublishAddressListComponent } from '../onecar-publish/address-list/address-list.component'; import { PublishSuccessComponent } from '../onecar-publish/publish-success/publish-success.component'; +import { TranAgreementComponent } from '../tran-agreement/tran-agreement.component'; @Component({ selector: 'app-publish-goods-bulk-publish', templateUrl: './bulk-release-publish.component.html', @@ -53,7 +54,9 @@ export class SupplyManagementBulkReleasePublishComponent implements OnInit { private route: ActivatedRoute, private amapService: AmapService, public shipperSrv: ShipperBaseService - ) {} + ) { + + } @ViewChild('sf1', { static: false }) sf1!: SFComponent; schema1: SFSchema = {}; ui1!: SFUISchema; @@ -114,6 +117,7 @@ export class SupplyManagementBulkReleasePublishComponent implements OnInit { serverSearch: true, searchDebounceTime: 300, searchLoadingText: '搜索中...', + allowClear: true, onSearch: (q: any) => { if (!!q) { return this.service @@ -135,7 +139,7 @@ export class SupplyManagementBulkReleasePublishComponent implements OnInit { ui: { widget: 'select', placeholder: '请选择', - allowClear: true + allowClear: true, } as SFSelectWidgetSchema }, // enterpriseInfoName: { @@ -161,6 +165,7 @@ export class SupplyManagementBulkReleasePublishComponent implements OnInit { type: 'string', format: 'date-time', ui: { + placeholder: '请输入', format: 'yyyy-MM-dd HH:mm:ss' } @@ -569,19 +574,35 @@ export class SupplyManagementBulkReleasePublishComponent implements OnInit { nzComponentParams: { type: 'bulk' } }); } + // 提交前确认,委托运输协议弹窗 + submitConfirm(submitType?: any) { + // 校验规则 + 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 modalRef = this.modalService.create({ + nzTitle: '运输协议', + nzContent: TranAgreementComponent, + nzWidth: 900, + nzFooter: null + }); + modalRef.afterClose.subscribe(result => { + if (result) { + this.submit(submitType); + } + }); + } // 确认提交(下单) submit(submitType: string): void { - 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); // 货物信息 diff --git a/src/app/routes/supply-management/components/onecar-publish/onecar-publish.component.html b/src/app/routes/supply-management/components/onecar-publish/onecar-publish.component.html index d95e1f50..232087f4 100644 --- a/src/app/routes/supply-management/components/onecar-publish/onecar-publish.component.html +++ b/src/app/routes/supply-management/components/onecar-publish/onecar-publish.component.html @@ -329,9 +329,9 @@
- + -
diff --git a/src/app/routes/supply-management/components/onecar-publish/onecar-publish.component.ts b/src/app/routes/supply-management/components/onecar-publish/onecar-publish.component.ts index 9779a9ac..2fa509f2 100644 --- a/src/app/routes/supply-management/components/onecar-publish/onecar-publish.component.ts +++ b/src/app/routes/supply-management/components/onecar-publish/onecar-publish.component.ts @@ -744,6 +744,20 @@ export class SupplyManagementOnecarPublishComponent implements OnInit { } // 提交前确认,委托运输协议弹窗 submitConfirm(submitType?: any) { + 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 }); + this.sf7.validator({ emitError: true }); + console.log(this.sf1.valid); + if (this.validateForm1.invalid || !this.sf3.valid || !this.sf1.valid || !this.sf4.valid || !this.sf6.valid || !this.sf7.valid) { + return; + } + const modalRef = this.modalService.create({ nzTitle: '运输协议', nzContent: TranAgreementComponent, diff --git a/src/app/routes/supply-management/components/release-publish/release-publish.component.html b/src/app/routes/supply-management/components/release-publish/release-publish.component.html index d5c9fa72..072aa58e 100644 --- a/src/app/routes/supply-management/components/release-publish/release-publish.component.html +++ b/src/app/routes/supply-management/components/release-publish/release-publish.component.html @@ -49,7 +49,7 @@ 联系人 -
+
联系人 -
+
- - - - + +
diff --git a/src/app/routes/supply-management/components/release-publish/release-publish.component.ts b/src/app/routes/supply-management/components/release-publish/release-publish.component.ts index b1588b47..f4daf821 100644 --- a/src/app/routes/supply-management/components/release-publish/release-publish.component.ts +++ b/src/app/routes/supply-management/components/release-publish/release-publish.component.ts @@ -60,8 +60,14 @@ export class SupplyManagementReleasePublishComponent implements OnInit { public shipperSrv: ShipperBaseService ) { this.validateForm1 = fb.group({ - loadingTime: [null, [Validators.required]], - unloadingTime: [null, [Validators.required]] + loadAddress0: [null, [Validators.required]], + loadName0: [null, [Validators.required]], + loadPhone0: [null, [Validators.required,Validators.pattern('^[0-9]*$')]], + unloadAddress0: [null, [Validators.required]], + unloadName0: [null, [Validators.required]], + unloadPhone0: [null, [Validators.required,Validators.pattern('^[0-9]*$')]], + loadingTime: [null, []], + unloadingTime: [null, []] }); } @@ -684,6 +690,19 @@ export class SupplyManagementReleasePublishComponent implements OnInit { } // 提交前确认,委托运输协议弹窗 submitConfirm(submitType?: any) { + 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 }); + this.sf7.validator({ emitError: true }); + if (this.validateForm1.invalid || !this.sf1.valid || !this.sf3.valid || !this.sf4.valid || !this.sf6.valid || !this.sf7.valid) { + return; + } + const modalRef = this.modalService.create({ nzTitle: '运输协议', nzContent: TranAgreementComponent, @@ -698,19 +717,6 @@ export class SupplyManagementReleasePublishComponent 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 }); - this.sf7.validator({ emitError: true }); - if (this.validateForm1.invalid || !this.sf1.valid || !this.sf3.valid || !this.sf4.valid || !this.sf6.valid || !this.sf7.valid) { - return; - } - //装卸货信息 const LoadingList = this.startInfo.concat(this.endInfo); // 货物信息