车辆对接

This commit is contained in:
wangshiming
2021-12-28 10:27:34 +08:00
parent 2d67ea537d
commit c904aeba46
17 changed files with 564 additions and 355 deletions

View File

@ -6,9 +6,9 @@ import { NzMessageService } from 'ng-zorro-antd/message';
import { NzModalRef } from 'ng-zorro-antd/modal';
import { SupplyManagementService } from '../../services/supply-management.service';
import { SupplyManagementAddDriversComponent } from '../add-drivers/add-drivers.component';
import { CarAddmodalComponent } from '../addmodal/addmodal.component';
const BADGE: STColumnBadge = {
1: { text: '空闲', color: 'success' },
2: { text: '未实名', color: 'error' },
@ -19,7 +19,7 @@ const BADGE: STColumnBadge = {
selector: 'app-supply-management-assigned-car',
templateUrl: './assigned-car.component.html',
})
export class SupplyManagementAssignedCarComponent implements OnInit {
export class SupplyManagementVehicleAssignedCarComponent implements OnInit {
record: any = {};
i: any;
schema: SFSchema = {};
@ -105,19 +105,18 @@ export class SupplyManagementAssignedCarComponent implements OnInit {
return data.map((i, index) => {
i.carId = '';
i.disabled = i.carStatus === '1';
const defaultCar = i?.userCarLicenseDesensitizationVOList?.filter((item: any) => item.isDefault);
if (defaultCar.length > 0) {
i.carId = defaultCar[0].carId;
const defaultCar = i?.userCarLicenseDesensitizationVOList?.find((item: any) => item.isDefault);
if (defaultCar) {
i.carId = defaultCar?.carId;
}
return i;
});
}
save(): void {
console.log(this.selectedRows);
if (this.selectedRows) {
const { carId, userId: driverId } = this.selectedRows;
const params: any = { carId, driverId };
const { carId, appUserId: driverId, captainAppUserId: carCaptainId } = this.selectedRows;
const params: any = { carId, driverId, carCaptainId };
this.service.request(this.url, { ...params, ...this.params }).subscribe((res: any) => {
if (res) {
this.modal.close(res);
@ -130,7 +129,6 @@ export class SupplyManagementAssignedCarComponent implements OnInit {
changeSt(e: STChange): void {
if (e?.type === 'loaded') this.selectedRows = null;
if (e?.type === 'radio') this.selectedRows = e?.radio;
console.log(this.selectedRows);
}
/**