车辆对接

This commit is contained in:
wangshiming
2022-01-06 16:14:28 +08:00
parent c83c1e7a8e
commit bfcbe348b6
9 changed files with 272 additions and 141 deletions

View File

@ -20,6 +20,8 @@ import { PublishAddressListComponent } from './address-list/address-list.compone
import { PublishSuccessComponent } from './publish-success/publish-success.component';
import { map } from 'rxjs/operators';
import { of } from 'rxjs';
import { TranAgreementComponent } from '../tran-agreement/tran-agreement.component';
import { SupplyManagementVehicleAssignedCarComponent } from '../assigned-car/assigned-car.component';
@Component({
selector: 'app-publish-goods-onecar-publish',
templateUrl: './onecar-publish.component.html',
@ -694,29 +696,63 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
this.validateForm1.removeControl(`unloadPhone${index}`);
}
//指派熟车
chooseFamifiar() {
this.modalService.create({
//指派熟车
chooseFamifiar(item: any) {
console.log('999')
const modalRef = this.modalService.create({
nzTitle: '指派熟车',
nzContent: PublishGoodsChooseFamifiarComponent,
nzWidth: 1300
nzContent: SupplyManagementVehicleAssignedCarComponent,
nzWidth: 1200,
nzComponentParams: {
status: 'new',
url: this.service.$api_save_assign_whole,
params: item
},
nzFooter: null
});
modalRef.afterClose.subscribe(result => {
if (result) {
this.openFinishPage(result);
}
});
}
submit(): void {
// 打开下单完成页面
openFinishPage(resourceObj: any = null) {
this.modalService.create({
nzTitle: '',
nzContent: PublishSuccessComponent,
nzWidth: 900,
nzFooter: null,
nzComponentParams: { type: 'onecar', resourceObj }
});
}
// 提交前确认,委托运输协议弹窗
submitConfirm(submitType?: any) {
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 {
console.log('进来了');
console.log(this.startInfo);
// 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;
// }
console.log(this.validateForm1.value);
Object.keys(this.validateForm1.controls).forEach(key => {
this.validateForm1.controls[key].markAsDirty();
this.validateForm1.controls[key].updateValueAndValidity();
});
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.sf3.valid || !this.sf4.valid || !this.sf6.valid || !this.sf7.valid) {
return;
}
if (typeof this.validateForm1.value.unloadingTime !== 'string') {
var c = new Date(this.validateForm1.value.unloadingTime);
this.validateForm1.value.unloadingTime =
@ -747,10 +783,6 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
':' +
this.addPreZero(c.getSeconds());
}
// if (this.validateForm1.invalid) {
// return;
// }
console.log(this.sf7.value)
const params: any = {
...this.sf1.value,
...this.sf5.value,
@ -773,6 +805,12 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
totalFees: this.totalFees
};
console.log(params);
if(submitType) {
if (submitType == 'assign') {
this.chooseFamifiar(params);
return;
}
}
if (this.PageStatus === '整车修改') {
this.requests(this.service.$api_set_WholeModify, params);
} else if (this.PageStatus === '整车下一单') {