指派熟车优化
This commit is contained in:
@ -112,7 +112,17 @@ export class SupplyManagementVehicleAssignedCarComponent implements OnInit {
|
||||
console.log(this.params)
|
||||
}
|
||||
|
||||
dataProcess(data: STData[]): STData[] {
|
||||
dataProcess = (data: STData[], rawData: any): STData[] => {
|
||||
if (rawData.status === 505016) {
|
||||
this.modalSrv.confirm({
|
||||
nzTitle: '系统提示',
|
||||
nzContent: '<b>该司机还未注册,是否邀请他注册?点击"是"系统将发送邀请短信给司机</b>',
|
||||
nzOkText: '确定',
|
||||
nzCancelText: '取消',
|
||||
nzOnOk: () => console.log('OK')
|
||||
});
|
||||
return [];
|
||||
}
|
||||
return data.map((i, index) => {
|
||||
i.carId = '';
|
||||
i.disabled = (i?.certificationStatus === 1 && i.driverStatus === 1);
|
||||
|
||||
@ -1,17 +1,15 @@
|
||||
import { ChangeDetectorRef, Component, Input, OnInit, ViewChild } from '@angular/core';
|
||||
import { Component, Input, OnInit, ViewChild } from '@angular/core';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { STChange, STColumn, STComponent, STData, STRequestOptions } from '@delon/abc/st';
|
||||
import { SFComponent, SFSchema, SFSelectWidgetSchema, SFUISchema } from '@delon/form';
|
||||
import { STColumn, STComponent, STData } from '@delon/abc/st';
|
||||
import { SFComponent, SFSchema, SFUISchema } from '@delon/form';
|
||||
import { ModalHelper } from '@delon/theme';
|
||||
import { EAEnvironmentService, processSingleSort } from '@shared';
|
||||
import { NzDrawerRef, NzDrawerService } from 'ng-zorro-antd/drawer';
|
||||
import { EAEnvironmentService } from '@shared';
|
||||
import { NzDrawerService } from 'ng-zorro-antd/drawer';
|
||||
import { NzModalRef, NzModalService } from 'ng-zorro-antd/modal';
|
||||
import { SupplyManagementAddDriversComponent } from 'src/app/routes/supply-management/components/add-drivers/add-drivers.component';
|
||||
|
||||
import { SupplyManagementService } from '../../services/supply-management.service';
|
||||
import { CarAddmodalComponent } from '../addmodal/addmodal.component';
|
||||
import { PublishchooseFamifiarAddComponent } from './add/add.component';
|
||||
import { PublishchooseFamifiarSetCaptainComponent } from './set-captain/set-captain.component';
|
||||
|
||||
|
||||
@Component({
|
||||
selector: 'app-publish-goods-choose-famifiar',
|
||||
@ -37,7 +35,7 @@ export class PublishGoodsChooseFamifiarComponent implements OnInit {
|
||||
submitUrl = '';
|
||||
|
||||
@Input()
|
||||
submitParams:any;
|
||||
submitParams: any;
|
||||
|
||||
constructor(
|
||||
private modal: NzModalRef,
|
||||
@ -241,7 +239,17 @@ export class PublishGoodsChooseFamifiarComponent implements OnInit {
|
||||
}
|
||||
|
||||
// 熟车请求数据处理
|
||||
reqProcess(data: STData[]): STData[] {
|
||||
reqProcess = (data: STData[], rawData: any): STData[] => {
|
||||
if (rawData.status === 505016) {
|
||||
this.modalService.confirm({
|
||||
nzTitle: '系统提示',
|
||||
nzContent: '<b>该司机还未注册,是否邀请他注册?点击"是"系统将发送邀请短信给司机</b>',
|
||||
nzOkText: '确定',
|
||||
nzCancelText: '取消',
|
||||
nzOnOk: () => console.log('OK')
|
||||
});
|
||||
return [];
|
||||
}
|
||||
return data.map((i, index) => {
|
||||
const defaultCart = i.userCarLicenseDesensitizationVOList.find((cart: any) => cart.isDefault);
|
||||
return { ...i, default: defaultCart || '' };
|
||||
@ -274,49 +282,49 @@ export class PublishGoodsChooseFamifiarComponent implements OnInit {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 验证车辆的状态
|
||||
*/
|
||||
verifyVechicleStatus(_record: STData) {
|
||||
const { carId, appUserId: driverId, captainAppUserId: carCaptainId } = _record;
|
||||
const carInfo: any = { carId, driverId, carCaptainId };
|
||||
const goodsInfoList = this.submitParams?.goodsInfoList;
|
||||
this.service.request(this.service.$api_verify_vehicle_status, { ...carInfo, goodsInfoList }).subscribe((res: any) => {
|
||||
if (res) {
|
||||
const { title, alert, subContent, content } = res;
|
||||
switch (alert) {
|
||||
case 'Error':
|
||||
this.error(title, content, subContent);
|
||||
break;
|
||||
case 'Warn':
|
||||
this.showConfirm(_record, title, content, subContent);
|
||||
break;
|
||||
case 'Success':
|
||||
this.choose(_record);
|
||||
break;
|
||||
}
|
||||
/**
|
||||
* 验证车辆的状态
|
||||
*/
|
||||
verifyVechicleStatus(_record: STData) {
|
||||
const { carId, appUserId: driverId, captainAppUserId: carCaptainId } = _record;
|
||||
const carInfo: any = { carId, driverId, carCaptainId };
|
||||
const goodsInfoList = this.submitParams?.goodsInfoList;
|
||||
this.service.request(this.service.$api_verify_vehicle_status, { ...carInfo, goodsInfoList }).subscribe((res: any) => {
|
||||
if (res) {
|
||||
const { title, alert, subContent, content } = res;
|
||||
switch (alert) {
|
||||
case 'Error':
|
||||
this.error(title, content, subContent);
|
||||
break;
|
||||
case 'Warn':
|
||||
this.showConfirm(_record, title, content, subContent);
|
||||
break;
|
||||
case 'Success':
|
||||
this.choose(_record);
|
||||
break;
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
error(title: string, content: string, subContent: string): void {
|
||||
this.modalService.error({
|
||||
nzTitle: title,
|
||||
nzContent: `<span class="text-error-dark">${content ? content : ''}</span><span class="text-grey-dark">${subContent ? subContent : ''}</span>`,
|
||||
nzOkText: '知道了'
|
||||
});
|
||||
}
|
||||
error(title: string, content: string, subContent: string): void {
|
||||
this.modalService.error({
|
||||
nzTitle: title,
|
||||
nzContent: `<span class="text-error-dark">${content ? content : ''}</span><span class="text-grey-dark">${subContent ? subContent : ''}</span>`,
|
||||
nzOkText: '知道了'
|
||||
});
|
||||
}
|
||||
|
||||
showConfirm(_record: STData, title: string, content: string, subContent: string): void {
|
||||
this.modalService.confirm({
|
||||
nzTitle: title,
|
||||
nzContent: `<span class="text-error-dark">${content ? content : ''}</span><span class="text-grey-dark">${subContent ? subContent : ''}</span>`,
|
||||
nzOkText: '继续',
|
||||
nzCancelText: '取消',
|
||||
nzOnOk: () => {
|
||||
this.choose(_record);
|
||||
}
|
||||
});
|
||||
}
|
||||
showConfirm(_record: STData, title: string, content: string, subContent: string): void {
|
||||
this.modalService.confirm({
|
||||
nzTitle: title,
|
||||
nzContent: `<span class="text-error-dark">${content ? content : ''}</span><span class="text-grey-dark">${subContent ? subContent : ''}</span>`,
|
||||
nzOkText: '继续',
|
||||
nzCancelText: '取消',
|
||||
nzOnOk: () => {
|
||||
this.choose(_record);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user