车辆对接

This commit is contained in:
wangshiming
2021-12-16 20:28:23 +08:00
parent 7150f45b31
commit 4350fecab1
23 changed files with 494 additions and 231 deletions

View File

@ -1,7 +1,7 @@
<!--
* @Author: your name
* @Date: 2021-12-03 11:10:14
* @LastEditTime: 2021-12-16 10:36:33
* @LastEditTime: 2021-12-16 17:22:31
* @LastEditors: Please set LastEditors
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: \tms-obc-web\src\app\routes\supply-management\components\vehicle\vehicle.component.html
@ -38,7 +38,7 @@
</nz-card>
<nz-card>
<nz-tabset (nzSelectedIndexChange)="selectChange($event)" >
<nz-tabset (nzSelectedIndexChange)="selectChange($event)" [nzTabBarExtraContent]="extraTemplate">
<nz-tab *ngFor="let tab of tabs; let i = index" [nzTitle]="tab.name + ' (' + tab.count + ') '" (nzClick)="tabChange(i)">
</nz-tab>
</nz-tabset>
@ -58,6 +58,11 @@
<ng-template st-row="billCode" let-item let-index="index">
<a [routerLink]="'/order-management/risk-detail/'+item.id">{{item?.billCode}}</a>
</ng-template>
<ng-template st-row="timeer" let-item let-index="index">
<p>创建时间:{{item?.createTime}}</p>
<p>装货时间:{{item?.loadTime}}</p>
<p>卸货时间:{{item?.unloadTime}}</p>
</ng-template>
<ng-template st-row="billExpenseDetailVOList" let-item let-index="index">
<div *ngFor="let i of item?.billExpenseDetailVOList">
<p>{{i?.costName}}:¥{{i?.price}}</p>
@ -74,15 +79,23 @@
</div>
</nz-card>
<nz-modal [(nzVisible)]="isVisibleRE" [nzWidth]="600" [nzFooter]="nzModalFooterview2" (nzOnOk)="handleOK()" nzTitle="审核" (nzOnCancel)="handleCancel('1')">
<nz-modal [(nzVisible)]="isVisibleRE" [nzWidth]="600" [nzFooter]="nzModalFooterview2" (nzOnOk)="handleOK()" nzTitle="审核" (nzOnCancel)="handleCancel()">
<ng-container *nzModalContent>
<sf #sfView [schema]="schemaView" [ui]="uiView" [compact]="true" [button]="'none'">
</sf>
</ng-container>
<ng-template #nzModalFooterview2>
<button nz-button nzType="default" (click)="handleCancel('1')">取消</button>
<button nz-button nzType="primary" (click)="handleOK()">确定</button>
<button nz-button nzType="default" (click)="reject()">拒绝</button>
<button nz-button nzType="primary" (click)="handleOK()">通过</button>
</ng-template>
</nz-modal>
<ng-template #extraTemplate>
<div>
<button nz-button nzType="primary" (click)="audit()">
批量审核
</button>
</div>
</ng-template>

View File

@ -1,9 +1,11 @@
import { Router } from '@angular/router';
import { Component, OnInit, ViewChild } from '@angular/core';
import { STColumn, STComponent } from '@delon/abc/st';
import { SFComponent, SFDateWidgetSchema, SFSchema, SFSelectWidgetSchema, SFUISchema } from '@delon/form';
import { SFComponent, SFDateWidgetSchema, SFSchema, SFSchemaEnum, SFSelectWidgetSchema, SFUISchema } from '@delon/form';
import { ModalHelper, _HttpClient } from '@delon/theme';
import { ShipperBaseService } from '@shared';
import { NzModalService } from 'ng-zorro-antd/modal';
import { of } from 'rxjs';
import { map } from 'rxjs/operators';
import { SupplyManagementService } from '../../services/order-management.service';
@ -19,6 +21,7 @@ export class OrderManagementRiskComponent implements OnInit {
schema: SFSchema = {};
schemaView: SFSchema = {};
auditMany = false;
auditId : any;
isVisibleRE = false;
_$expand = false;
@ViewChild('st') private readonly st!: STComponent;
@ -65,7 +68,7 @@ export class OrderManagementRiskComponent implements OnInit {
count: 0,
},
];
constructor(public service: SupplyManagementService, public service2: ShipperBaseService, private modal: NzModalService) { }
constructor(public service: SupplyManagementService, public service2: ShipperBaseService, private modal: NzModalService, public router: Router) { }
/**
* 查询参数
@ -81,7 +84,6 @@ export class OrderManagementRiskComponent implements OnInit {
ngOnInit(): void {
this.initSF();
this.initST();
this.initSTAudit();
}
@ -123,14 +125,38 @@ export class OrderManagementRiskComponent implements OnInit {
},
}
},
driverName: {
type: 'string',
// driverName: {
// type: 'string',
// title: '承运司机',
// ui: {
// visibleIf: {
// _$expand: (value: boolean) => value,
// },
// }
// },
driverId: {
title: '承运司机',
type: 'string',
ui: {
visibleIf: {
_$expand: (value: boolean) => value,
widget: 'select',
serverSearch: true,
searchDebounceTime: 300,
searchLoadingText: '搜索中...',
onSearch: (q: any) => {
if (!!q) {
return this.service
.request(this.service.$api_get_getDriverInfo, { keyword: q,
model: 1, type: 1 })
.pipe(map((res) => (res as any[]).map((i) => ({ label: i.name, value: i.id } as SFSchemaEnum))))
.toPromise();
} else {
return of([]);
}
},
}
visibleIf: {
expand: (value: boolean) => value,
},
} as SFSelectWidgetSchema,
},
no9: {
type: 'string',
@ -150,12 +176,12 @@ export class OrderManagementRiskComponent implements OnInit {
},
}
},
freightType: {
wayBillType: {
title: '运单类型',
type: 'string',
ui: {
widget: 'dict-select',
params: { dictKey: 'BulkFreightUnitPriceType' },
params: { dictKey: 'goodresourceType' },
visibleIf: {
_$expand: (value: boolean) => value,
},
@ -208,6 +234,7 @@ export class OrderManagementRiskComponent implements OnInit {
*/
initST() {
this.columns = [
{ title: '', type: 'checkbox', width: '50px', className: 'text-center' },
{
title: '申诉状态',
width: '100px',
@ -238,7 +265,7 @@ export class OrderManagementRiskComponent implements OnInit {
title: '服务类型',
className: 'text-center',
width: '120px',
index: 'serviceType',
index: 'serviceTypeLabel',
}, {
title: '装货地',
className: 'text-center',
@ -286,7 +313,7 @@ export class OrderManagementRiskComponent implements OnInit {
buttons: [
{
text: '审核',
click: (_record) => this.viewEvaluate(_record),
click: (_record) => this.audit(_record),
},
{
text: '详情',
@ -296,21 +323,55 @@ export class OrderManagementRiskComponent implements OnInit {
},
];
}
initSTAudit() {
this.schemaView = {
properties: {
roleDescription: {
title: '备注',
type: 'string',
maxLength: 50,
ui: {
placeholder: '通过可以不用填写原因 ,拒绝必须说明原因',
widget: 'textarea',
autosize: { minRows: 3, maxRows: 6 }
initSTAudit(value: number) {
if(value == 1) {
this.schemaView = {
properties: {
billCode: {
title: '订单号',
type: 'string',
default: this.auditId,
ui: {
widget: 'text',
},
},
representationsCause: {
title: '备注',
type: 'string',
maxLength: 50,
ui: {
placeholder: '通过可以不用填写原因 ,拒绝必须说明原因',
widget: 'textarea',
autosize: { minRows: 3, maxRows: 6 }
},
},
},
},
};
};
} else {
this.schemaView = {
properties: {
billCode: {
title: '',
type: 'string',
default: `已选${this.selectedRows?.length}条订单`,
ui: {
widget: 'text',
},
},
representationsCause: {
title: '备注',
type: 'string',
maxLength: 50,
ui: {
placeholder: '通过可以不用填写原因 ,拒绝必须说明原因',
widget: 'textarea',
autosize: { minRows: 3, maxRows: 6 }
},
},
},
};
}
this.uiView = { '*': { spanLabelFixed: 110, grid: { span: 24 } } };
}
/**
@ -361,30 +422,71 @@ export class OrderManagementRiskComponent implements OnInit {
importGoodsSource() {
}
audit(item: any) {
console.log(item)
}
/*
* 审核关闭弹窗
view: 1
浮动费用: 0
查看评价: 3
*/
handleCancel(type: string) {
console.log(type)
handleCancel() {
this.isVisibleRE = false
}
/**
* 审核通过按钮
*/
handleOK() {
console.log(this.sfView.value)
const parms = {
id: this.sfView.value.billCode,
representationsCause: this.sfView.value.representationsCause,
}
this.service.request(this.service.$api_get_catalogue_member, parms).subscribe((res) => {
console.log(res)
if(res) {
this.service.msgSrv.success('审核通过!')
this.isVisibleRE = false
} else{
this.service.msgSrv.error(res.msg)
}
})
}
/**
* 审核拒绝按钮
*/
reject() {
console.log(this.sfView.value)
const parms = {
id: this.sfView.value.billCode,
representationsCause: this.sfView.value.representationsCause,
}
this.service.request(this.service.$api_get_catalogue_member, parms).subscribe((res) => {
console.log(res)
if(res) {
this.service.msgSrv.success('审核通过!')
this.isVisibleRE = false
} else{
this.service.msgSrv.error(res.msg)
}
})
}
/**
*查看评价
*审核
*/
audit(item?: any) {
this.isVisibleRE = true
if(item) {
this.auditId = item.id;
this.initSTAudit(1);
} else {
this.initSTAudit(2);
}
console.log(item)
}
/**
*查看详情
*/
viewEvaluate(item: any) {
this.isVisibleRE = true
console.log(item)
this.router.navigate(['/order-management/risk-detail', item.id])
}
}