This commit is contained in:
wangshiming
2021-12-03 16:01:55 +08:00
parent c34b8f7bc4
commit 7fbab89388
13 changed files with 814 additions and 1 deletions

View File

@ -0,0 +1,102 @@
<page-header-wrapper [title]="''" [logo]="logo">
<ng-template #logo>
<button nz-button nz-tooltip nzTooltipTitle="返回上一页" (click)="goBack()">
<i nz-icon nzType="left" nzTheme="outline"></i>
</button>
</ng-template>
</page-header-wrapper>
<nz-card>
<nz-spin *ngIf="!i" class="modal-spin"></nz-spin>
<div nz-row>
<div nz-col nzSpan="4">
<sv-container class="bdr">
<sv label="货源编号" col="1">{{ i?.no }}</sv>
<sv-title class="text-center text-lg">待接单</sv-title>
<sv-title>
<div class="">
<a class="btn-size">修改单价</a>
<a class="btn-size m-lg mr-lg">取消货源</a>
<a class="btn-size">再下一单</a>
</div>
</sv-title>
</sv-container>
</div>
<div nz-col nzSpan="16" class="approval-status">
<nz-steps style="width: 80%; margin: 0 auto" [nzLabelPlacement]="'vertical'">
<nz-step nzStatus="finish" nzIcon="user" [nzDescription]="i?.createAt" nzTitle="下单"></nz-step>
<nz-step nzStatus="finish" nzIcon="solution" nzTitle="完结"></nz-step>
</nz-steps>
</div>
</div>
<nz-divider></nz-divider>
<div sv-container *ngIf="i">
<sv label="外部货源号">{{ i?.owner }}</sv>
<sv label="项目名称">32943898021309809423</sv>
<sv label="服务类型">3321944288191034921</sv>
<sv label="录单员">18112345678</sv>
<sv label="调度员">曲丽丽 18100000000 </sv>
<sv label="承诺付款时间">曲丽丽 18100000000 </sv>
</div>
<nz-divider></nz-divider>
<div nz-row>
<div nz-col nzSpan="6">
<div class="source-info">
<h3>装卸货信息</h3>
<p>装货地:广东省深圳市龙岗区怡亚通大厦</p>
<p>联系人:奥利给/13680058545</p>
<p>卸货地广东省深圳市福田区岗厦村9巷8号405新村</p>
<p>联系人:花花世界/13680058545</p>
<p>发货日期广东省深圳市福田区岗厦村9巷8号405新村</p>
<p>卸货日期:花花世界/13680058545</p>
</div>
</div>
<div nz-col nzSpan="6">
<div class="source-info bdr bdl pl-md">
<h3>货物信息</h3>
<p>货物名称:广东省深圳市龙岗区怡亚通大厦</p>
<p>重量/体积广东省深圳市福田区岗厦村9巷8号405新村</p>
<p>车型/车长:花花世界/13680058545</p>
</div>
</div>
<div nz-col nzSpan="6">
<div class="source-info bdr pl-md">
<h3>承运信息</h3>
<p>司机:广东省深圳市龙岗区怡亚通大厦</p>
<p>车牌号广东省深圳市福田区岗厦村9巷8号405新村</p>
<p>车型/车长/承重:{{'拖车'}} | {{'4.5米'}} | {{'15吨'}}</p>
</div>
</div>
<div class="source-info pl-md">
<h3>补充信息</h3>
<p>需要回单</p>
<p>备注:奥利给/13680058545</p>
</div>
</div>
<nz-divider></nz-divider>
<div nz-row>
<div class="freight-info-box">
<h3>运费信息</h3>
<div class="text-right">
<p><label class="freigth-label">预付:</label><span>{{400 | currency }}</span></p>
<p><label class="freigth-label">油卡:</label><span>{{400 | currency }}</span></p>
<p><label class="freigth-label">到付:</label><span>{{400 | currency }}</span></p>
<p><label class="freigth-label">回单付:</label><span>{{400 | currency}}</span></p>
<p><label class="freigth-label">附加费:</label><span>{{400 | currency }}</span></p>
</div>
</div>
<nz-divider></nz-divider>
<div class="freight-info-box" nz-row>
<div nz-col nzSpan="24">
<h3 class="text-right"><label>总计 :</label> <span class="text-error-dark text-xl">{{400 | currency }}</span></h3>
</div>
</div>
</div>
<nz-divider></nz-divider>
<div nz-row>
<nz-card nzTitle="操作日志" style="width: 100%;">
<st #st [data]="i?.auditRecordList" [columns]="logColumns" [ps]="0" [page]="{ show: false, showSize: false }">
</st>
</nz-card>
</div>
</nz-card>

View File

@ -0,0 +1,37 @@
:host{
.btn-size{
font-size: 14px;
}
.bdr{
border-right: 1px solid #ccc;
}
.bdl{
border-left: 1px solid #ccc;
}
.title{
font-size: 26;
font-weight: bold;
}
.source-info{
p{
margin-bottom: .5em;
}
}
.freight-info-box{
width: 95%;
}
.freigth-label{
display: inline-block;
width: 50px;
text-align: right;
}
::ng-deep{
.approval-status{
.ant-steps{
width: 70%;
margin: 0 auto;
}
}
}
}

View File

@ -0,0 +1,24 @@
import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing';
import { SupplyManagementVehicleDetailComponent } from './vehicle-detail.component';
describe('SupplyManagementVehicleDetailComponent', () => {
let component: SupplyManagementVehicleDetailComponent;
let fixture: ComponentFixture<SupplyManagementVehicleDetailComponent>;
beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
declarations: [ SupplyManagementVehicleDetailComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(SupplyManagementVehicleDetailComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View File

@ -0,0 +1,53 @@
/*
* @Author: your name
* @Date: 2021-12-03 15:31:52
* @LastEditTime: 2021-12-03 15:59:54
* @LastEditors: your name
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: \tms-obc-web\src\app\routes\order-management\components\vehicle-detail\vehicle-detail.component.ts
*/
import { Component, OnInit } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import { STColumn } from '@delon/abc/st';
import { _HttpClient } from '@delon/theme';
import { NzMessageService } from 'ng-zorro-antd/message';
import { SupplyManagementService } from '../../services/order-management.service';
@Component({
selector: 'app-supply-management-vehicle-detail',
templateUrl: './vehicle-detail.component.html',
styleUrls: ['./vehicle-detail.component.less']
})
export class OrderManagementVehicleDetailComponent implements OnInit {
id = this.route.snapshot.params.id;
i: any;
logColumns: STColumn[] = [
{ title: '内容', index: 'theme' },
{ title: '操作人', index: 'operationUserPhone' },
{ title: '操作时间', index: ' createTime' },
];
constructor(
private route: ActivatedRoute,
private msgSrv: NzMessageService,
private service: SupplyManagementService,
) {
}
ngOnInit(): void {
this.service.http.get(`/user/${this.id}?_allow_anonymous=true&_allow_badcode=true`).subscribe(res => {
console.log(res);
this.i = res
});
}
goBack() {
window.history.go(-1);
}
}

View File

@ -0,0 +1,108 @@
<!--
* @Author: your name
* @Date: 2021-12-03 11:10:14
* @LastEditTime: 2021-12-03 16:01:20
* @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
-->
<!-- 搜索表单 -->
<nz-card>
<div nz-row nzGutter="8">
<!-- 查询字段小于或等于3个时不显示伸缩按钮 -->
<div nz-col nzSpan="24" *ngIf="queryFieldCount <= 4">
<sf #sf [schema]="schema" [ui]="ui" [mode]="'search'" [disabled]="!sf?.valid" [loading]="service.http.loading"
(formSubmit)="st?.load(1)" (formReset)="resetSF()"></sf>
</div>
<!-- 查询字段大于3个时根据展开状态调整布局 -->
<ng-container *ngIf="queryFieldCount > 4">
<div nz-col [nzSpan]="_$expand ? 24 : 18">
<sf #sf [schema]="schema" [ui]="ui" [compact]="true" [button]="'none'"></sf>
</div>
<div nz-col [nzSpan]="_$expand ? 24 : 6" [class.text-right]="_$expand">
<button nz-button nzType="primary" [disabled]="!sf.valid" [nzLoading]="service.http.loading"
(click)="st?.load(1)">查询</button>
<button nz-button nzType="primary"
>导出</button>
<button nz-button (click)="resetSF()">重置</button>
<button nz-button nzType="link" (click)="expandToggle()">
{{ !_$expand ? '展开' : '收起' }}
<i nz-icon [nzType]="!_$expand ? 'down' : 'up'"></i>
</button>
</div>
</ng-container>
</div>
</nz-card>
<nz-card>
<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>
<div style="margin-top: 15px;">
<!-- [req]="{ method: 'GET', allInBody: true, reName: { pi: 'pageIndex', ps: 'pageSize' }, params: reqParams }"
[res]="{ reName: { list: 'data.records', total: 'data.total' } }"
[page]="{ show: true, showSize: true, pageSizes: [10, 20, 30, 50, 100, 200, 300, 500, 1000] }"
[loadingDelay]="500" [loading]="service.http.loading" -->
<!-- 选中提示框 -->
<div style="position: relative">
<nz-alert
nzType="info"
[nzMessage]="'当前共' + st?.total + '行记录已选择' + selectedRows.length + ''"
nzShowIcon
[ngStyle]="{ margin: '0 0 1rem 0' }"
>
</nz-alert>
</div>
<st #st [scroll]="{ x: '1200px' }" [data]="service.$api_get_catalogue_member" [columns]="columns">
<ng-template st-row="goodsId" let-item let-index="index">
<a [routerLink]="'/order-management/vehicle-detail/'+item.id">{{item.no}}</a>
</ng-template>
<!-- <ng-template st-row="externalSn" let-item let-index="index">
<span class="mr-xs">{{111111}}</span>
<a (click)="editEnternalSn(item)">编辑</a>
</ng-template> -->
<ng-template st-row="enStatusStr27878" let-item let-index="index">
<div class="mr-xs" nzPopoverTitle="Title" nz-popover [nzPopoverContent]="contentTemplate">{{item.no}}</div>
</ng-template>
<ng-template #contentTemplate>
<div>
<p>预付¥200.00</p>
<p>到付¥200.00</p>
<p>油卡¥200.00</p>
<p>回单付¥200.00</p>
<p>小计¥200.00</p>
<p>附加费¥200.00</p>
</div>
</ng-template>
</st>
</div>
</nz-card>
<ng-template #extraTemplate>
<div>
<button (click)="audit('',2)" nz-button nzType="primary">批量审核</button>
<button (click)="importGoodsSource()" nz-button nzType="primary">发布货源</button>
<button (click)="importGoodsSource()" nz-button nzType="primary">导入货源</button>
</div>
</ng-template>
<nz-modal [(nzVisible)]="isVisible" [nzFooter]="nzModalFooter" nzTitle="货源审核" (nzOnOk)="handleOK()" (nzOnCancel)="handleCancel('suppliersType')">
<ng-container *nzModalContent>
<div style="position: relative" *ngIf="auditMany">
<nz-alert
nzType="info"
[nzMessage]="'已选择' + 6 + ''"
nzShowIcon
[ngStyle]="{ margin: '0 0 1rem 0' }"
>
</nz-alert>
</div>
<sf #sfFre [schema]="freightSchema" [ui]="ui2" [compact]="false" [button]="'none'">
</sf>
</ng-container>
<ng-template #nzModalFooter>
<button nz-button nzType="primary" (click)="handleOK()" [disabled]="">通过</button>
<button nz-button nzType="default" (click)="handleCancel('suppliersType')">不通过</button>
</ng-template>
</nz-modal>

View File

@ -0,0 +1,2 @@
:host {
}

View File

@ -0,0 +1,24 @@
import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing';
import { SupplyManagementVehicleComponent } from './vehicle.component';
describe('SupplyManagementVehicleComponent', () => {
let component: SupplyManagementVehicleComponent;
let fixture: ComponentFixture<SupplyManagementVehicleComponent>;
beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
declarations: [ SupplyManagementVehicleComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(SupplyManagementVehicleComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View File

@ -0,0 +1,381 @@
import { Component, OnInit, ViewChild } from '@angular/core';
import { STColumn, STComponent } from '@delon/abc/st';
import { SFComponent, SFSchema, SFSelectWidgetSchema, SFUISchema } from '@delon/form';
import { ModalHelper, _HttpClient } from '@delon/theme';
import { NzModalService } from 'ng-zorro-antd/modal';
import { map } from 'rxjs/operators';
import { SupplyManagementService } from '../../services/order-management.service';
@Component({
selector: 'app-supply-management-vehicle',
templateUrl: './vehicle.component.html',
styleUrls: ['./vehicle.component.less']
})
export class OrderManagementVehicleComponent implements OnInit {
url = `/user?_allow_anonymous=true`;
ui: SFUISchema = {};
ui2: SFUISchema = {};
schema: SFSchema = {};
freightSchema: SFSchema = {};
auditMany = false;
isVisible = false;
_$expand = false;
@ViewChild('st') private readonly st!: STComponent;
@ViewChild('sf', { static: false }) sf!: SFComponent;
@ViewChild('sfFre', { static: false }) sfFre!: SFComponent;
columns: STColumn[] = [];
tabs = [ {
name: '全部',
type: 5,
count: 0,
},
{
name: '待接单',
type: 5,
count: 0,
},
{
name: '已接单',
type: 5,
count: 0,
},
{
name: '已取消',
type: 5,
count: 0,
},
];
constructor(public service: SupplyManagementService, private modal: NzModalService) { }
/**
* 查询参数
*/
get reqParams() {
return {
...this.sf?.value,
};
}
get selectedRows() {
return this.st?.list.filter((item) => item.checked) || [];
}
ngOnInit(): void {
this.initSF();
this.initST();
this.initSFFre();
}
/**
* 初始化查询表单
*/
initSF() {
this.schema = {
properties: {
_$expand: { type: 'boolean', ui: { hidden: true } },
no: {
type: 'string',
title: '货源编号',
},
no2: {
type: 'string',
title: '装货地'
},
no1: {
type: 'string',
title: '卸货地'
},
sex: {
title: '货物类型',
type: 'string',
default: 0,
enum: [
{ label: '未知', value: 0 },
{ label: '男', value: 1 },
{ label: '女', value: 2 },
{ label: '保密', value: 3 },
],
ui: {
widget: 'select',
visibleIf: {
_$expand: (value: boolean) => value,
},
} as SFSelectWidgetSchema,
},
appId: {
type: 'string',
title: '录单员',
ui: {
widget: 'select',
placeholder: '请选择',
visibleIf: {
_$expand: (value: boolean) => value,
},
allowClear: true,
asyncData: () => this.getCatalogueMember(),
},
},
},
type: 'object',
};
this.ui = { '*': { spanLabelFixed: 80, grid: { span: 8, gutter: 4 } } };
}
initSFFre() {
this.freightSchema = {
properties: {
roleDescription: {
title: '备注',
type: 'string',
maxLength: 50,
ui: {
placeholder: '请输入备注',
widget: 'textarea',
},
},
}
};
this.ui2 = { '*': { spanLabelFixed: 120, grid: { span: 24 } } };
}
/**
* 初始化数据列表
*/
initST() {
this.columns = [
{ title: '', type: 'checkbox', width: '50px', className: 'text-center' },
{
title: '货源编号',
width: '100px',
className: 'text-center',
render: 'goodsId'
},
{ title: '服务类型', index: '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: '卸货地',
className: 'text-center',
width: '120px',
},
{
title: '货物名称',
className: 'text-center',
width: '120px',
},
{
title: '货物数量',
className: 'text-center',
width: '120px',
},
{
title: '用车需求',
className: 'text-center',
width: '120px',
},
{
title: '总费用',
className: 'text-center',
width: '120px',
index: 'goodsId',
render: 'enStatusStr27878'
},
{
title: '附加费',
className: 'text-center',
width: '120px',
},
{
title: '货源状态',
className: 'text-center',
index: 'enStatusStr2',
type: 'badge',
badge: {
: { text: '正常', color: 'success' },
: { text: '冻结', color: 'warning' },
: { text: '废弃', color: 'default' },
},
},
{
title: '创建时间',
width: '170px',
className: 'text-center',
},
{
title: '审核状态',
className: 'text-center',
index: 'enStatusStr3',
type: 'badge',
badge: {
: { text: '正常', color: 'success' },
: { text: '冻结', color: 'warning' },
: { text: '废弃', color: 'default' },
},
},
{
title: '操作',
fixed: 'right',
width: '200px',
className: 'text-center',
buttons: [
{
text: '货源审核',
click: (_record) => this.audit(_record, 1),
},
{
text: '修改货源',
// click: (_record) => this.editOne(_record),
},
{
text: '修改运费',
click: (_record) => this.updateFreight(_record),
},
{
text: '取消货源',
// click: (_record) => this.delOne(_record),
},
{
text: '再下一单',
// click: (_record) => this.editOne(_record),
},
{
text: '重新指派',
click: (_record) => this.assignedCar(_record),
},
],
},
];
}
add(): void {
// this.modal
// .createStatic(FormEditComponent, { i: { id: 0 } })
// .subscribe(() => this.st.reload());
}
/**
* 查询字段个数
*/
get queryFieldCount(): number {
return Object.keys(this.schema?.properties || {}).length;
}
/**
* 伸缩查询条件
*/
expandToggle(): void {
this._$expand = !this._$expand;
this.sf?.setValue('/_$expand', this._$expand);
}
tabChange(item: any) {
console.log(item)
}
/**
* 重置表单
*/
resetSF(): void {
this.sf.reset();
this._$expand = false;
}
// 获取录单员
getCatalogueMember() {
const params = {
};
return this.service.request(this.service.$api_get_catalogue_member, params, 'GET').pipe(
map((res) => {
if (res) {
console.log(res)
}
}),
);
}
selectChange(e: number) {
console.log(e);
}
/**
* 编辑外部货源号
* @param item st当前行对象
*/
editEnternalSn(item: any) {
const modalRef = this.modal.create({
nzWidth: '400px',
// nzContent: SupplyManagementUpdateExternalSnComponent,
nzComponentParams: {
orderObject: item,
},
nzFooter: null,
nzClosable: false
});
}
/**
* 导入货源
*/
importGoodsSource() {
}
/**
* 修改运费
*/
updateFreight(item: any) {
const modalRef = this.modal.create({
nzTitle: '修改运费',
nzWidth: '40%',
// nzContent: SupplyManagementUpdateFreightComponent,
nzComponentParams: {
i: item,
},
nzFooter: null,
});
}
/**
* 重新指派
*/
assignedCar(item: any) {
const modalRef = this.modal.create({
nzTitle: '指派熟车',
nzWidth: '800px',
// nzContent: SupplyManagementAssignedCarComponent,
nzComponentParams: {
i: item,
},
nzFooter: null,
});
}
/**
* 审核
*/
audit(value: any, status?: any) {
console.log(value)
console.log(status)
if(status === 2) {
this.auditMany = true;
} else {
this.auditMany = false;
}
this.isVisible = true;
}
/**
* 审核关闭弹窗
*/
handleCancel(type: any) {
this.isVisible = false
}
/**
* 审核通过按钮
*/
handleOK() {
}
}

View File

@ -0,0 +1,23 @@
/*
* @Author: your name
* @Date: 2021-12-03 15:31:52
* @LastEditTime: 2021-12-03 16:00:08
* @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\order-management\order-management-routing.module.ts
*/
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { OrderManagementVehicleDetailComponent } from './components/vehicle-detail/vehicle-detail.component';
import { OrderManagementVehicleComponent } from './components/vehicle/vehicle.component';
const routes: Routes = [
{ path: 'vehicle', component: OrderManagementVehicleComponent },
{ path: 'vehicle-detail/:id', component: OrderManagementVehicleDetailComponent },
@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule]
})
export class OrderManagementRoutingModule { }

View File

@ -0,0 +1,20 @@
import { NgModule, Type } from '@angular/core';
import { SharedModule } from '@shared';
import { OrderManagementVehicleDetailComponent } from './components/vehicle-detail/vehicle-detail.component';
import { OrderManagementVehicleComponent } from './components/vehicle/vehicle.component';
import { OrderManagementRoutingModule } from './order-management-routing.module';
const COMPONENTS: Type<void>[] = [
OrderManagementVehicleComponent,
OrderManagementVehicleDetailComponent
];
@NgModule({
imports: [
SharedModule,
OrderManagementRoutingModule
],
declarations: COMPONENTS,
})
export class OrderManagementModule { }

View File

@ -0,0 +1,14 @@
import { Injectable, Injector } from '@angular/core';
import { BaseService } from 'src/app/shared/services';
@Injectable({
providedIn: 'root'
})
export class SupplyManagementService extends BaseService {
$api_get_catalogue_member = `/user?_allow_anonymous=true`;
$api_del_driver = ``;
constructor(public injector: Injector) {
super(injector)
}
}

View File

@ -1,7 +1,7 @@
/*
* @Author: your name
* @Date: 2021-11-29 10:20:33
* @LastEditTime: 2021-12-03 11:10:47
* @LastEditTime: 2021-12-03 15:58:57
* @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\routes-routing.module.ts
@ -35,6 +35,7 @@ const routes: Routes = [
{ path: 'supplygoods', loadChildren: () => import('./supply-goods/supply-goods.module').then(m => m.SupplyGoodsModule) },
{ path: 'vehicle', loadChildren: () => import('./vehicle/vehicle.module').then(m => m.VehicleModule) },
{ path: 'supply-management', loadChildren: () => import('./supply-management/supply-management.module').then((m) => m.SupplyManagementModule) },
{ path: 'order-management', loadChildren: () => import('./order-management/order-management.module').then((m) => m.OrderManagementModule) },
]
},
// passport

View File

@ -125,6 +125,30 @@
}
]
},
{
"text": "订单管理",
"icon": "anticon anticon-dashboard",
"group": true,
"children": [{
"text": "整车订单",
"icon": "anticon anticon-dashboard",
"link": "/order-management/vehicle",
"reuse": true
},
{
"text": "整车订单详情",
"icon": "anticon anticon-dashboard",
"link": "/order-management/vehicle-detail/:id",
"hide": true
},
{
"text": "货源详情",
"icon": "anticon anticon-dashboard",
"link": "/order-management/vehicle-detail",
"hide": true
}
]
},
{
"text": "车辆管理",
"icon": "anticon anticon-dashboard",