车辆对接
This commit is contained in:
@ -1,29 +1,14 @@
|
||||
<nz-card>
|
||||
<div nz-row nzGutter="20">
|
||||
<div nz-col nzSpan="13">
|
||||
<div style="height: 120px;">
|
||||
<div class="mb-md" nz-row>
|
||||
<button nzType="primary" (click)="add()" nz-button>
|
||||
<i nz-icon nzType="plus"></i>
|
||||
添加熟车
|
||||
</button>
|
||||
</div>
|
||||
<sf mode="search" [schema]="searchSchema" (formSubmit)="st.reset($event)" (formReset)="st.reset($event)"></sf>
|
||||
</div>
|
||||
<st #st [data]="url" [columns]="columns"></st>
|
||||
</div>
|
||||
<div nz-col nzSpan="11">
|
||||
<div style="height: 120px;"></div>
|
||||
<st #selectedST [data]="url" [columns]="selectedColumn"></st>
|
||||
<div nz-row nzGutter="20">
|
||||
<div nz-col nzSpan="13">
|
||||
<div class="mb-sm">
|
||||
<sf mode="search" [schema]="searchSchema" [button]="null" #sf>
|
||||
<button nzType="primary" nz-button (click)="search()" [nzLoading]="service.http.loading">搜索</button>
|
||||
</sf>
|
||||
</div>
|
||||
</div>
|
||||
</nz-card>
|
||||
<nz-modal [(nzVisible)]="isVisible" nzTitle="添加司机" (nzOnCancel)="handleCancel()" nzMaskClosable="false">
|
||||
<div *nzModalContent>
|
||||
<sf [schema]="addCarSchema" [button]="'none'"></sf>
|
||||
</div>
|
||||
<div *nzModalFooter>
|
||||
<button nz-button nzType="default" (click)="handleCancel()">取消</button>
|
||||
<button nz-button nzType="primary" (click)="handleOk()" [nzLoading]="service.http.loading">确定</button>
|
||||
</div>
|
||||
</nz-modal>
|
||||
</div>
|
||||
<nz-spin *ngIf="service.http.loading">
|
||||
</nz-spin>
|
||||
<div>
|
||||
<st #st [data]="diverList" [columns]="columns" [req]="{params: reqParams}"></st>
|
||||
</div>
|
||||
|
||||
@ -1,7 +1,8 @@
|
||||
import { Component, OnInit, ViewChild } from '@angular/core';
|
||||
import { STColumn, STColumnButton, STComponent, STData } from '@delon/abc/st';
|
||||
import { SFSchema, SFUISchema } from '@delon/form';
|
||||
import { SFComponent, SFSchema, SFUISchema } from '@delon/form';
|
||||
import { ModalHelper, _HttpClient } from '@delon/theme';
|
||||
import { NzModalRef } from 'ng-zorro-antd/modal';
|
||||
import { SupplyManagementService } from '../../services/supply-management.service';
|
||||
|
||||
@Component({
|
||||
@ -11,41 +12,29 @@ import { SupplyManagementService } from '../../services/supply-management.servic
|
||||
export class SupplyManagementAddDriversComponent implements OnInit {
|
||||
url = `/user?_allow_anonymous=true`;
|
||||
i: any;
|
||||
searchSchema: SFSchema = {
|
||||
properties: {
|
||||
no: {
|
||||
type: 'string',
|
||||
title: '编号'
|
||||
}
|
||||
}
|
||||
};
|
||||
searchSchema: SFSchema = {};
|
||||
@ViewChild('st') private readonly st!: STComponent;
|
||||
@ViewChild('selectedST') private readonly selectedST!: STComponent;
|
||||
ui: SFUISchema = {
|
||||
|
||||
}
|
||||
@ViewChild('sf') sf!: SFComponent;
|
||||
ui: SFUISchema = {}
|
||||
columns: STColumn[] = [];
|
||||
selectedColumn: STColumn[] = [];
|
||||
isVisible = false;
|
||||
addCarSchema: SFUISchema = {
|
||||
properties: {
|
||||
mobile: {
|
||||
type: 'string',
|
||||
title: '司机手机号',
|
||||
ui: {
|
||||
placeholder: '请输入'
|
||||
}
|
||||
},
|
||||
}
|
||||
};
|
||||
|
||||
constructor(public service: SupplyManagementService, private modal: ModalHelper) { }
|
||||
diverList: object[] = [];
|
||||
dirvierInfo: any = {};
|
||||
constructor(public service: SupplyManagementService, private modal: NzModalRef) { }
|
||||
|
||||
ngOnInit(): void {
|
||||
this.initSF();
|
||||
this.initST();
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询参数
|
||||
*/
|
||||
get reqParams() {
|
||||
return {
|
||||
...this.sf?.value
|
||||
};
|
||||
}
|
||||
/**
|
||||
* 初始化查询表单
|
||||
*/
|
||||
@ -54,16 +43,9 @@ export class SupplyManagementAddDriversComponent implements OnInit {
|
||||
properties: {
|
||||
mobile: {
|
||||
type: 'string',
|
||||
title: '',
|
||||
title: '车队长手机号',
|
||||
ui: {
|
||||
placeholder: '请输入司机姓名/手机号'
|
||||
}
|
||||
},
|
||||
no: {
|
||||
type: 'string',
|
||||
title: '',
|
||||
ui: {
|
||||
placeholder: '请输入车牌号'
|
||||
placeholder: '请输入'
|
||||
}
|
||||
},
|
||||
},
|
||||
@ -78,23 +60,14 @@ export class SupplyManagementAddDriversComponent implements OnInit {
|
||||
initST() {
|
||||
this.columns = [
|
||||
{
|
||||
title: '司机姓名',
|
||||
title: '司机头像',
|
||||
width: '100px',
|
||||
className: 'text-center',
|
||||
render: 'goodsId'
|
||||
index: 'avatar',
|
||||
type: 'img',
|
||||
},
|
||||
{ title: '手机号', render: 'externalSn', width: '120px', className: 'text-center' },
|
||||
{ title: '货源类型', index: 'linkUrl', width: '120px', className: 'text-center' },
|
||||
{
|
||||
title: '车牌号',
|
||||
className: 'text-center',
|
||||
width: '120px',
|
||||
}, {
|
||||
title: '状态',
|
||||
className: 'text-center',
|
||||
width: '120px',
|
||||
},
|
||||
|
||||
{ title: '司机姓名', index: 'name', width: '120px', className: 'text-center' },
|
||||
{ title: '实名认证状态', index: 'linkUrl', width: '120px', className: 'text-center' },
|
||||
{
|
||||
title: '操作',
|
||||
fixed: 'right',
|
||||
@ -102,51 +75,46 @@ export class SupplyManagementAddDriversComponent implements OnInit {
|
||||
className: 'text-center',
|
||||
buttons: [
|
||||
{
|
||||
text: '选择',
|
||||
iif: (item: STData, btn: STColumnButton, column: STColumn) => item?.status > 0,
|
||||
iifBehavior: 'disabled'
|
||||
// click: (_record) => this.editOne(_record),
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
this.selectedColumn = [
|
||||
{
|
||||
title: '司机姓名',
|
||||
width: '100px',
|
||||
className: 'text-center',
|
||||
render: 'goodsId'
|
||||
},
|
||||
{ title: '手机号', render: 'externalSn', width: '120px', className: 'text-center' },
|
||||
{ title: '车牌号', index: 'linkUrl', width: '120px', className: 'text-center' },
|
||||
{
|
||||
title: '操作',
|
||||
fixed: 'right',
|
||||
width: '200px',
|
||||
className: 'text-center',
|
||||
buttons: [
|
||||
{
|
||||
text: '移除',
|
||||
// click: (_record) => this.editOne(_record),
|
||||
text: '设置',
|
||||
click: (_record) => this.addCaptain(_record)
|
||||
// iif: (item: STData, btn: STColumnButton, column: STColumn) => item?.status > 0,
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
|
||||
search() {
|
||||
this.getDriverList();
|
||||
}
|
||||
|
||||
|
||||
getDriverList() {
|
||||
this.service.request(this.service.$api_get_car_captain_by_mobile, { ...this.sf?.value }).subscribe((res: any) => {
|
||||
this.diverList = [];
|
||||
if (res.userId) {
|
||||
this.diverList.push(res);
|
||||
}
|
||||
// this.st.reload();
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 添加熟车
|
||||
*
|
||||
*/
|
||||
add(): void {
|
||||
this.isVisible = true;
|
||||
}
|
||||
|
||||
handleCancel() {
|
||||
this.isVisible = false;
|
||||
}
|
||||
|
||||
handleOk() {
|
||||
|
||||
addCaptain(item: any) {
|
||||
this.modal.close(item); // 虚设置车队长
|
||||
// const { appUserId: carCaptain } = item;
|
||||
// const { appUserId } = this.dirvierInfo;
|
||||
// this.service.request(this.service.$api_add_car_caption, { carCaptain, appUserId }).subscribe(res => {
|
||||
// if (res) {
|
||||
// this.service.msgSrv.success('设置成功');
|
||||
// this.modal.close(true);
|
||||
// }
|
||||
// })
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -137,12 +137,24 @@
|
||||
</div>
|
||||
</ng-template>
|
||||
</st>
|
||||
<div>
|
||||
<div class="freight-info-box mt-md" nz-row>
|
||||
<div nz-col nzSpan="24">
|
||||
<h3>
|
||||
<label>总计 :</label>
|
||||
<span class="text-error-dark text-xl">
|
||||
{{(i?.totalAmount) | currency: '¥'}}
|
||||
</span>
|
||||
<span>(运费{{i?.totalFreight | currency: '¥'}}含附加运费 {{i?.totalSurcharge| currency: '¥' }})</span>
|
||||
</h3>
|
||||
<div>收款人:曹济发 / 18211579566 / 621483****6368</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div>
|
||||
总计:<span style="color: #da001b; font-size: 18px">{{ totalObj?.price | currency: '¥' }}</span> (运费¥{{
|
||||
totalObj?.price - attObj?.price
|
||||
}},附加运费¥{{ attObj?.price }},附加费率{{ (attObj?.price / totalObj?.price) * 100 | number: '0.2-2' }}%)
|
||||
</div>
|
||||
<div>收款人:{{ i?.payeeName }}/{{ i?.payeePhone }}</div>
|
||||
<div>收款人:{{ i?.payeeName }}/{{ i?.payeePhone }}</div> -->
|
||||
</nz-card>
|
||||
<nz-card nzTitle="补充信息">
|
||||
<sv-container>
|
||||
|
||||
Reference in New Issue
Block a user