车辆对接
This commit is contained in:
@ -1,31 +1,43 @@
|
||||
<!--
|
||||
* @Author: your name
|
||||
* @Date: 2021-12-21 10:58:48
|
||||
* @LastEditTime: 2021-12-28 10:16:29
|
||||
* @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\add-driver\add-driver.component.html
|
||||
-->
|
||||
<div class="modal-header">
|
||||
<div class="modal-title">添加司机</div>
|
||||
<div class="modal-title">添加司机</div>
|
||||
</div>
|
||||
<!-- <nz-spin *ngIf="!i" class="modal-spin"></nz-spin> -->
|
||||
<div class="sfBox">
|
||||
<sf #sf [compact]="true" [ui]="ui" [schema]="schema" [button]="'none'" *ngIf="schema">
|
||||
<ng-template sf-template="tipsA" let-me let-ui="ui" let-schema="schema">
|
||||
<div class="pr">
|
||||
<dl class="tips">
|
||||
<dt>正面照</dt>
|
||||
<dd>示例</dd>
|
||||
</dl>
|
||||
<div class="pa"><img width="190" src="/assets/images/eg01.png" /></div>
|
||||
</div>
|
||||
</ng-template>
|
||||
<ng-template sf-template="tipsB" let-me let-ui="ui" let-schema="schema">
|
||||
<div class="pr">
|
||||
<dl class="tips">
|
||||
<dt>背面照</dt>
|
||||
<dd>示例</dd>
|
||||
</dl>
|
||||
<div class="pa"><img width="190" src="/assets/images/eg02.png" /></div>
|
||||
</div>
|
||||
</ng-template>
|
||||
</sf>
|
||||
<sf #sf1 [compact]="true" [ui]="ui" [schema]="schema1" [button]="'none'" *ngIf="schema1"></sf>
|
||||
<sf #sf2 [compact]="true" [ui]="ui" [schema]="schema2" [button]="'none'" *ngIf="schema2"></sf>
|
||||
<!-- <div class="example" (click)="showExample()">
|
||||
<sf #sf [compact]="true" [ui]="ui" [schema]="schema" [button]="'none'" *ngIf="schema">
|
||||
<ng-template sf-template="tipsA" let-me let-ui="ui" let-schema="schema">
|
||||
<div class="pr">
|
||||
<dl class="tips">
|
||||
<dt>正面照</dt>
|
||||
<dd>示例</dd>
|
||||
</dl>
|
||||
<div class="pa"><img height="104" src="/assets/images/eg01.png" /></div>
|
||||
</div>
|
||||
</ng-template>
|
||||
<ng-template sf-template="tipsB" let-me let-ui="ui" let-schema="schema">
|
||||
<div class="pr">
|
||||
<dl class="tips">
|
||||
<dt>背面照</dt>
|
||||
<dd>示例</dd>
|
||||
</dl>
|
||||
<div class="pa"><img height="104" src="/assets/images/eg02.png" /></div>
|
||||
</div>
|
||||
</ng-template>
|
||||
</sf>
|
||||
<sf #sf1 [compact]="true" [ui]="ui" [schema]="schema1" [button]="'none'" *ngIf="schema1">
|
||||
</sf>
|
||||
<sf #sf2 [compact]="true" [ui]="ui" [schema]="schema2" [button]="'none'" *ngIf="schema2">
|
||||
</sf>
|
||||
<img class="drivercard" height="104" src="/assets/images/drivercard.png" />
|
||||
<img class="jopcard" height="104" src="/assets/images/jopcard.png" />
|
||||
<!-- <div class="example" (click)="showExample()">
|
||||
查看示例
|
||||
<div class="popBox" *ngIf="showCardFlag">
|
||||
<img src="https://ng.ant.design/assets/img/logo.svg" alt="">
|
||||
@ -39,6 +51,6 @@
|
||||
</div> -->
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button nz-button type="button" (click)="close()">关闭</button>
|
||||
<button nz-button type="button" nzType="primary" (click)="submitForm()">确定</button>
|
||||
<button nz-button type="button" (click)="close()">关闭</button>
|
||||
<button nz-button type="button" nzType="primary" (click)="submitForm()">确定</button>
|
||||
</div>
|
||||
@ -453,18 +453,18 @@ export class CarAddDriverComponent implements OnInit {
|
||||
};
|
||||
}
|
||||
getProvinceData() {
|
||||
// return this.service.request(this.service.$api_getRegionByCode, { regionCode: '' }).pipe(
|
||||
// map(res => {
|
||||
// const result: any = []
|
||||
// if (res) {
|
||||
// res.map((m: any) => {
|
||||
// const item = { label: m.name, value: m.regionCode }
|
||||
// result.push(item)
|
||||
// });
|
||||
// }
|
||||
// return result
|
||||
// })
|
||||
// );
|
||||
return this.service.request(this.service.$api_getRegionByCode, { regionCode: '' }).pipe(
|
||||
map((res: any) => {
|
||||
const result: any = []
|
||||
if (res) {
|
||||
res.map((m: any) => {
|
||||
const item = { label: m.name, value: m.regionCode }
|
||||
result.push(item)
|
||||
});
|
||||
}
|
||||
return result
|
||||
})
|
||||
);
|
||||
}
|
||||
checkIdCard(imgurl: any, side: any, type: any) {
|
||||
// 识别身份证 参数side:0-正面、1-背面;type:0-申请人身份证,1-法定代表人身份证
|
||||
@ -472,18 +472,18 @@ export class CarAddDriverComponent implements OnInit {
|
||||
idCardUrl: imgurl,
|
||||
side,
|
||||
};
|
||||
// this.service.request(this.service.$api_checkIdCard, params).subscribe((res) => {
|
||||
// if (res) {
|
||||
// if (type === 0) {
|
||||
// // 法定代表人身份证
|
||||
// if (side === 'front') {
|
||||
// // 正面
|
||||
// this.sf.setValue('/name', res.name);
|
||||
// this.sf.setValue('/certificateNumber', res.number);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
this.service.request(this.service.$api_checkIdCard, params).subscribe((res: any) => {
|
||||
if (res) {
|
||||
if (type === 0) {
|
||||
// 法定代表人身份证
|
||||
if (side === 'front') {
|
||||
// 正面
|
||||
this.sf.setValue('/name', res.name);
|
||||
this.sf.setValue('/certificateNumber', res.number);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
checkDriverCard(imgurl: any, side: any, type: any) {
|
||||
// 识别身份证 参数side:0-正面、1-背面;type:0-申请人身份证,1-法定代表人身份证
|
||||
@ -491,21 +491,21 @@ export class CarAddDriverComponent implements OnInit {
|
||||
driverLicenseUrl: imgurl,
|
||||
side,
|
||||
};
|
||||
// this.service.request(this.service.$api_recognizeDriverLicense, params).subscribe((res) => {
|
||||
// if (res) {
|
||||
// if (type === 0) {
|
||||
// // 法定代表人身份证
|
||||
// if (side === 'front') {
|
||||
// // 正面
|
||||
// this.sf1.setValue('/licenseNo', res.number);
|
||||
// this.sf1.setValue('/driverModel', res.number);
|
||||
// this.sf1.setValue('/validStartTime', res.validFrom);
|
||||
// this.sf1.setValue('/validEndTime', res.validTo);
|
||||
// this.sf1.setValue('/signingOrganization', res.issuingAuthority);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
this.service.request(this.service.$api_recognizeDriverLicense, params).subscribe((res: any) => {
|
||||
if (res) {
|
||||
if (type === 0) {
|
||||
// 法定代表人身份证
|
||||
if (side === 'front') {
|
||||
// 正面
|
||||
this.sf1.setValue('/licenseNo', res.number);
|
||||
this.sf1.setValue('/driverModel', res.number);
|
||||
this.sf1.setValue('/validStartTime', res.validFrom);
|
||||
this.sf1.setValue('/validEndTime', res.validTo);
|
||||
this.sf1.setValue('/signingOrganization', res.issuingAuthority);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
close(): void {
|
||||
this.modal.destroy();
|
||||
@ -546,11 +546,11 @@ export class CarAddDriverComponent implements OnInit {
|
||||
delete params.userDriverLicenseDTO.tipsA;
|
||||
delete params.userPracticeSeniorityDTO.tipsC;
|
||||
delete params.showName
|
||||
// this.service.request(this.service.$api_enterpriseVehicleSave, params).subscribe(res => {
|
||||
// if(res){
|
||||
// this.service.msgSrv.success('添加成功')
|
||||
// this.close()
|
||||
// }
|
||||
// })
|
||||
this.service.request(this.service.$api_enterpriseVehicleSave, params).subscribe((res: any) => {
|
||||
if(res){
|
||||
this.service.msgSrv.success('添加成功')
|
||||
this.modal.close(true)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@ -130,14 +130,14 @@ export class CarAddmodalComponent implements OnInit {
|
||||
initData(flag?: any) {
|
||||
if (this.sf?.value.mobile) {
|
||||
this.flag = flag
|
||||
// this.service.request(this.service.$api_getCarCaptainByMobile, { mobile: this.sf?.value.mobile }).subscribe(res => {
|
||||
// if (res.userId) {
|
||||
// this.tableData = [res];
|
||||
// } else {
|
||||
// this.tableData = []
|
||||
// }
|
||||
// this.st.reload()
|
||||
// })
|
||||
this.service.request(this.service.$api_getCarCaptainByMobile, { mobile: this.sf?.value.mobile }).subscribe(res => {
|
||||
if (res.userId) {
|
||||
this.tableData = [res];
|
||||
} else {
|
||||
this.tableData = []
|
||||
}
|
||||
this.st.reload()
|
||||
})
|
||||
}
|
||||
}
|
||||
/**
|
||||
@ -158,11 +158,11 @@ export class CarAddmodalComponent implements OnInit {
|
||||
appUserId: item.appUserId ? item.appUserId : '',
|
||||
mobile: item.mobile
|
||||
}
|
||||
// this.service.request(this.service.$api_enterpriseVehicleSave, params).subscribe(res => {
|
||||
// if (res.data) {
|
||||
// this.service.msgSrv.success('添加成功')
|
||||
// }
|
||||
// })
|
||||
this.service.request(this.service.$api_enterpriseVehicleSave, params).subscribe(res => {
|
||||
if (res.data) {
|
||||
this.service.msgSrv.success('添加成功')
|
||||
}
|
||||
})
|
||||
}
|
||||
addModal() {
|
||||
this.modalHelper.create(CarAddDriverComponent, {mobile: this.sf?.value.mobile}, { size: 900 }).subscribe((res) => {
|
||||
|
||||
@ -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);
|
||||
|
||||
}
|
||||
/**
|
||||
|
||||
@ -5,7 +5,7 @@ import { _HttpClient } from '@delon/theme';
|
||||
import { NzMessageService } from 'ng-zorro-antd/message';
|
||||
import { NzModalService } from 'ng-zorro-antd/modal';
|
||||
import { SupplyManagementService } from '../../services/supply-management.service';
|
||||
import { SupplyManagementAssignedCarComponent } from '../assigned-car/assigned-car.component';
|
||||
import { SupplyManagementVehicleAssignedCarComponent } from '../assigned-car/assigned-car.component';
|
||||
import { SupplyManagementUpdateExternalSnComponent } from '../update-external-sn/update-external-sn.component';
|
||||
|
||||
@Component({
|
||||
@ -139,7 +139,7 @@ export class SupplyManagementVehicleDetailComponent implements OnInit {
|
||||
const modalRef = this.modal.create({
|
||||
nzTitle: '指派熟车',
|
||||
nzWidth: '1200px',
|
||||
nzContent: SupplyManagementAssignedCarComponent,
|
||||
nzContent: SupplyManagementVehicleAssignedCarComponent,
|
||||
nzComponentParams: {
|
||||
i: item,
|
||||
},
|
||||
|
||||
@ -6,7 +6,8 @@ import { ModalHelper, _HttpClient } from '@delon/theme';
|
||||
import { NzModalService } from 'ng-zorro-antd/modal';
|
||||
import { map } from 'rxjs/operators';
|
||||
import { SupplyManagementService } from '../../services/supply-management.service';
|
||||
import { SupplyManagementAssignedCarComponent } from '../assigned-car/assigned-car.component';
|
||||
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';
|
||||
|
||||
@ -150,11 +151,11 @@ export class SupplyManagementVehicleComponent implements OnInit {
|
||||
const modalRef = this.modal.create({
|
||||
nzTitle: '指派熟车',
|
||||
nzWidth: '1200px',
|
||||
nzContent: SupplyManagementAssignedCarComponent,
|
||||
nzContent: SupplyManagementVehicleAssignedCarComponent,
|
||||
nzComponentParams: {
|
||||
i: item,
|
||||
status: 'anew',
|
||||
// url: this.service.$api_save_assign_vehicle,
|
||||
url: this.service.$api_save_assign_vehicle,
|
||||
params: { resourceId }
|
||||
},
|
||||
nzFooter: null
|
||||
|
||||
Reference in New Issue
Block a user