车辆对接
This commit is contained in:
@ -1,10 +1,8 @@
|
||||
import { Component, OnInit, ViewChild } from '@angular/core';
|
||||
import { FormBuilder, FormControl, FormGroup, NgForm, Validators } from '@angular/forms';
|
||||
import { NgForm } from '@angular/forms';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import {
|
||||
SFArrayWidgetSchema,
|
||||
SFComponent,
|
||||
SFNumberWidgetSchema,
|
||||
SFSchema,
|
||||
SFSchemaEnum,
|
||||
SFSelectWidgetSchema,
|
||||
@ -13,18 +11,14 @@ import {
|
||||
} from '@delon/form';
|
||||
import { SettingsService, _HttpClient } from '@delon/theme';
|
||||
import { ShipperBaseService } from '@shared';
|
||||
import format from 'date-fns/format';
|
||||
import { NzModalRef, NzModalService } from 'ng-zorro-antd/modal';
|
||||
import { NzModalService } from 'ng-zorro-antd/modal';
|
||||
import { of } from 'rxjs';
|
||||
import { map } from 'rxjs/operators';
|
||||
import { AmapPoiPickerComponent, AmapService } from 'src/app/shared/components/amap';
|
||||
import { SupplyManagementService } from '../../services/supply-management.service';
|
||||
import { PublishGoodsChooseFamifiarComponent } from '../choose-famifiar/choose-famifiar.component';
|
||||
|
||||
// import { PublishGoodsChooseFamifiarComponent } from '../choose-famifiar-bulk/choose-famifiar.component';
|
||||
import { PublishAddressListComponent } from '../onecar-publish/address-list/address-list.component';
|
||||
import { PublishSuccessComponent } from '../onecar-publish/publish-success/publish-success.component';
|
||||
// import { PublishSuccessComponent } from '../publish-success/publish-success.component';
|
||||
@Component({
|
||||
selector: 'app-publish-goods-bulk-publish',
|
||||
templateUrl: './bulk-release-publish.component.html',
|
||||
@ -33,7 +27,6 @@ import { PublishSuccessComponent } from '../onecar-publish/publish-success/publi
|
||||
export class SupplyManagementBulkReleasePublishComponent implements OnInit {
|
||||
@ViewChild('ngForm')
|
||||
ngForm!: NgForm;
|
||||
|
||||
sf1data: any; // 货源单设置回显
|
||||
sf3data: any; // 货源单设置回显
|
||||
sf4data: any; // 货源单设置回显
|
||||
@ -46,19 +39,11 @@ export class SupplyManagementBulkReleasePublishComponent implements OnInit {
|
||||
id = '';
|
||||
type = 'add';
|
||||
// // 单位
|
||||
unit1 = '吨';
|
||||
unit2 = '方';
|
||||
unit3 = '保价费金额';
|
||||
startInfo: any[] = [];
|
||||
endInfo: any[] = [];
|
||||
|
||||
totalDistance = 0.0; //总里程
|
||||
totalTime = 0.0; //路程总时间
|
||||
|
||||
currentGoodsTypeName: any;
|
||||
|
||||
freightTypeOptions: any;
|
||||
ruleOptions: any;
|
||||
constructor(
|
||||
private http: _HttpClient,
|
||||
private modalService: NzModalService,
|
||||
@ -69,7 +54,6 @@ export class SupplyManagementBulkReleasePublishComponent implements OnInit {
|
||||
private amapService: AmapService,
|
||||
public shipperSrv: ShipperBaseService
|
||||
) {}
|
||||
|
||||
@ViewChild('sf1', { static: false }) sf1!: SFComponent;
|
||||
schema1: SFSchema = {};
|
||||
ui1!: SFUISchema;
|
||||
@ -85,7 +69,7 @@ export class SupplyManagementBulkReleasePublishComponent implements OnInit {
|
||||
@ViewChild('sf6', { static: false }) sf6!: SFComponent;
|
||||
schema6: SFSchema = {};
|
||||
ui6!: SFUISchema;
|
||||
|
||||
// 初始化
|
||||
ngOnInit(): void {
|
||||
this.initSF1();
|
||||
this.initSF3();
|
||||
@ -118,7 +102,6 @@ export class SupplyManagementBulkReleasePublishComponent implements OnInit {
|
||||
}
|
||||
];
|
||||
}
|
||||
|
||||
initSF1() {
|
||||
this.schema1 = {
|
||||
properties: {
|
||||
@ -231,7 +214,6 @@ export class SupplyManagementBulkReleasePublishComponent implements OnInit {
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
initSF3() {
|
||||
this.schema3 = {
|
||||
properties: {
|
||||
@ -430,7 +412,6 @@ export class SupplyManagementBulkReleasePublishComponent implements OnInit {
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
initSF6() {
|
||||
this.schema6 = {
|
||||
properties: {
|
||||
@ -543,6 +524,7 @@ export class SupplyManagementBulkReleasePublishComponent implements OnInit {
|
||||
}
|
||||
};
|
||||
}
|
||||
// 选择收回单地址
|
||||
backBillChange() {
|
||||
const modalRef = this.modalService.create({
|
||||
nzTitle: '选择收回单地址',
|
||||
@ -587,6 +569,7 @@ export class SupplyManagementBulkReleasePublishComponent implements OnInit {
|
||||
nzComponentParams: { type: 'bulk' }
|
||||
});
|
||||
}
|
||||
// 确认提交(下单)
|
||||
submit(submitType: string): void {
|
||||
Object.keys(this.ngForm.form.controls).forEach(key => {
|
||||
this.ngForm.form.controls[key].markAsDirty();
|
||||
@ -599,7 +582,6 @@ export class SupplyManagementBulkReleasePublishComponent implements OnInit {
|
||||
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);
|
||||
// 货物信息
|
||||
@ -626,7 +608,6 @@ export class SupplyManagementBulkReleasePublishComponent implements OnInit {
|
||||
|
||||
let reqUrl = this.service.$api_consignBulk;
|
||||
if (submitType === 'assign') {
|
||||
console.log('params', params);
|
||||
this.chooseFamifiar(params);
|
||||
} else {
|
||||
this.service.request(reqUrl, params).subscribe(res => {
|
||||
@ -644,7 +625,6 @@ export class SupplyManagementBulkReleasePublishComponent implements OnInit {
|
||||
}
|
||||
// 获取城市列表
|
||||
getRegionCode(regionCode: any) {
|
||||
console.log(regionCode);
|
||||
return this.service
|
||||
.request(this.service.$api_get_enterprise_project, { id: regionCode })
|
||||
.pipe(
|
||||
@ -698,7 +678,7 @@ export class SupplyManagementBulkReleasePublishComponent implements OnInit {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// 选择地址
|
||||
chooseAddress(index: number, type: string) {
|
||||
const modalRef = this.modalService.create({
|
||||
nzTitle: '选择地址',
|
||||
@ -741,6 +721,7 @@ export class SupplyManagementBulkReleasePublishComponent implements OnInit {
|
||||
}
|
||||
});
|
||||
}
|
||||
// 返回上一页
|
||||
goBack() {
|
||||
window.history.go(-1);
|
||||
}
|
||||
@ -772,7 +753,4 @@ export class SupplyManagementBulkReleasePublishComponent implements OnInit {
|
||||
}
|
||||
});
|
||||
}
|
||||
choose() {
|
||||
window.history.go(-1);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user