车辆对接
This commit is contained in:
@ -1,11 +1,3 @@
|
||||
<!--
|
||||
* @Author: your name
|
||||
* @Date: 2021-12-03 11:10:14
|
||||
* @LastEditTime: 2021-12-21 10:56:30
|
||||
* @LastEditors: your name
|
||||
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
||||
* @FilePath: \tms-obc-web\src\app\routes\supply-management\components\assigned-car\assigned-car.component.html
|
||||
-->
|
||||
<div>
|
||||
<div nz-row>
|
||||
<div nz-col nzSpan="18">
|
||||
@ -19,7 +11,7 @@
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<st #st [data]="service.$api_get_catalogue_member"
|
||||
<st #st [data]="service.$api_get_practice_car_list"
|
||||
[req]="{ method: 'POST', allInBody: true, reName: { pi: 'pageIndex', ps: 'pageSize' }, params: reqParams }"
|
||||
[columns]="columns" [res]="{ reName: { list: 'data.records', total: 'data.total' },process:dataProcess }"
|
||||
[page]="{ show: true, showSize: true, pageSizes: [10, 20, 30, 50, 100, 200, 300, 500, 1000] }"
|
||||
@ -39,7 +31,7 @@
|
||||
</nz-select>
|
||||
</ng-template>
|
||||
<ng-template st-row="carCaptain" let-item let-index>
|
||||
<span>{{item.name}} {{item.phone}}</span>
|
||||
<span>{{item.captainName}} {{item.captainPhone}}</span>
|
||||
<a (click)="setCarCaptain(item)">设置</a>
|
||||
</ng-template>
|
||||
<ng-template st-row="driverStatus" let-item let-index>
|
||||
|
||||
@ -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);
|
||||
|
||||
}
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user