车辆对接

This commit is contained in:
wangshiming
2022-01-04 11:23:50 +08:00
parent 4f51c487cc
commit c276ce4726
9 changed files with 169 additions and 90 deletions

View File

@ -1,7 +1,7 @@
import { ActivatedRoute, Router } from '@angular/router';
import { Component, OnInit, ViewChild } from '@angular/core';
import { STColumn, STComponent } from '@delon/abc/st';
import { SFComponent, SFSchema, SFSelectWidgetSchema, SFUISchema } from '@delon/form';
import { SFComponent, SFSchema, SFSchemaEnum, SFSelectWidgetSchema, SFUISchema } from '@delon/form';
import { ModalHelper, _HttpClient } from '@delon/theme';
import { NzModalService } from 'ng-zorro-antd/modal';
import { map } from 'rxjs/operators';
@ -10,6 +10,8 @@ import { SupplyManagementVehicleAssignedCarComponent,
} from '../assigned-car/assigned-car.component';
import { SupplyManagementUpdateExternalSnComponent } from '../update-external-sn/update-external-sn.component';
import { SupplyManagementUpdateFreightComponent } from '../update-freight/update-freight.component';
import { of } from 'rxjs';
import { ShipperBaseService } from '@shared';
@Component({
selector: 'app-supply-management-vehicle',
@ -35,19 +37,28 @@ export class SupplyManagementVehicleComponent implements OnInit {
stayQuantity: 0
};
resourceStatus: any;
constructor(public service: SupplyManagementService, private modal: NzModalService, private router: Router, private ar: ActivatedRoute) {}
constructor(
public service: SupplyManagementService,
private modal: NzModalService,
private router: Router,
private ar: ActivatedRoute,
public shipperSrv: ShipperBaseService
) {}
/**
* 查询参数
*/
get reqParams() {
const a: any = {};
const params = Object.assign({}, this.sf?.value || {});
delete params._$expand;
const a: any = {
...params
};
if (this.resourceStatus) {
a.resourceStatus = this.resourceStatus;
}
return {
...a,
...this.sf?.value
};
}
get selectedRows() {
@ -262,27 +273,42 @@ export class SupplyManagementVehicleComponent implements OnInit {
title: '卸货地',
ui: { placeholder: '请输入' }
},
shipperAppUserName: {
shipperAppUserId: {
type: 'string',
title: '货主',
ui: {
widget: 'select',
serverSearch: true,
searchDebounceTime: 300,
searchLoadingText: '搜索中...',
visibleIf: {
_$expand: (value: boolean) => value
},
onSearch: (q: any) => {
console.log(q)
if (!!q) {
return this.service
.request(this.service.$api_enterpriceList, { enterpriseName: q})
.pipe(map((res: any) => (res as any[]).map((i) => ({ label: i.enterpriseName, value: i.id } as SFSchemaEnum))))
.toPromise();
} else {
return of([]);
}
},
} as SFSelectWidgetSchema,
},
enterpriseProjectId: {
type: 'string',
title: '所属项目',
ui: {
widget: 'select',
placeholder: '请选择',
asyncData: () => this.shipperSrv.getEnterpriseProject(),
visibleIf: {
_$expand: (value: boolean) => value
}
}
},
goodsName: {
title: '所属项目',
type: 'string',
default: '',
ui: {
widget: 'select',
visibleIf: {
_$expand: (value: boolean) => value
}
// asyncData: () =>[]
} as SFSelectWidgetSchema
},
serviceType: {
title: '服务类型',
type: 'string',
@ -306,17 +332,17 @@ export class SupplyManagementVehicleComponent implements OnInit {
}
} as SFSelectWidgetSchema
},
enterpriseInfoName: {
enterpriseInfoId: {
type: 'string',
title: '网络货运人',
ui: {
widget: 'select',
placeholder: '请选择',
asyncData: () => this.shipperSrv.getNetworkFreightForwarder(),
visibleIf: {
_$expand: (value: boolean) => value
},
allowClear: true
// asyncData: () => this.getCatalogueMember(),
}
}
}