This commit is contained in:
wangshiming
2021-12-08 14:21:05 +08:00
parent 55811ba396
commit a299e56181
11 changed files with 255 additions and 123 deletions

View File

@ -1,7 +1,7 @@
<!--
* @Author: your name
* @Date: 2021-12-03 11:10:14
* @LastEditTime: 2021-12-03 14:51:38
* @LastEditTime: 2021-12-08 09:57:47
* @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
@ -41,10 +41,6 @@
</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
@ -55,15 +51,32 @@
>
</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]="'/supply-management/vehicle-detail/'+item.id">{{item.no}}</a>
<st
#st
size="small"
[bordered]="true"
[scroll]="{ x: '2000px' }"
[data]="service.$api_get_wholePage_list"
[columns]="columns"
[req]="{ method: 'POST', 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"
>
<ng-template st-row="resourceCode" let-item let-index="index">
<a [routerLink]="'/supply-management/vehicle-detail/'+item.id">{{item.resourceCode}}</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">
<ng-template st-row="LoadingAddressArr" let-item let-index="index">
<div *ngFor="let i of item?.LoadingAddressArr">
<span>{{item?.LoadingAddressArr[i]}}</span>
</div>
</ng-template>
<ng-template st-row="serviceType" let-item let-index="index">
<span *ngIf="item?.serviceType === 1 || item?.serviceType === '1'">抢单</span>
<span *ngIf="item?.serviceType === 2 || item?.serviceType === '2'">指派</span>
</ng-template>
<ng-template st-row="totalAmount" let-item let-index="index">
<div class="mr-xs" nzPopoverTitle="Title" nz-popover [nzPopoverContent]="contentTemplate">{{item.no}}</div>
</ng-template>
<ng-template #contentTemplate>

View File

@ -16,7 +16,6 @@ import { SupplyManagementUpdateFreightComponent } from '../update-freight/update
styleUrls: ['./vehicle.component.less']
})
export class SupplyManagementVehicleComponent implements OnInit {
url = `/user?_allow_anonymous=true`;
ui: SFUISchema = {};
ui2: SFUISchema = {};
schema: SFSchema = {};
@ -30,32 +29,40 @@ export class SupplyManagementVehicleComponent implements OnInit {
columns: STColumn[] = [];
tabs = [ {
name: '全部',
type: 5,
type: 0,
count: 0,
},
{
name: '待接单',
type: 5,
type: 1,
count: 0,
},
{
name: '已接单',
type: 5,
type: 2,
count: 0,
},
{
name: '已取消',
type: 5,
type: 3,
count: 0,
},
];
resourceStatus: any;
constructor(public service: SupplyManagementService, private modal: NzModalService, private router: Router,private ar: ActivatedRoute) { }
/**
* 查询参数
*/
get reqParams() {
console.log(this.resourceStatus)
const a:any = {};
if(this.resourceStatus) {
a.resourceStatus = this.resourceStatus
}
console.log(a)
return {
...a,
...this.sf?.value,
};
}
@ -77,35 +84,35 @@ export class SupplyManagementVehicleComponent implements OnInit {
this.schema = {
properties: {
_$expand: { type: 'boolean', ui: { hidden: true } },
no: {
resourceCode: {
type: 'string',
title: '货源编号',
},
sex2: {
serviceType: {
title: '服务类型',
type: 'string',
default: 0,
enum: [
{ label: '未知', value: 0 },
{ label: '', value: 1 },
{ label: '女', value: 2 },
{ label: '保密', value: 3 },
{ label: '抢单', value: 1 },
{ label: '指派', value: 2 },
],
ui: {
widget: 'select',
} as SFSelectWidgetSchema,
},
categoryId: {
goodsName: {
type: 'string',
title: '货物名称',
// enum: this.secondCatList || [],
enum: [
{ label: '普货', value: 1 },
{ label: '指派', value: 2 },
],
ui: {
widget: 'select',
placeholder: '请选择',
} as SFSelectWidgetSchema,
},
no2: {
loadingPlace: {
type: 'string',
title: '装货地',
ui: {
@ -135,12 +142,11 @@ export class SupplyManagementVehicleComponent implements OnInit {
sex: {
title: '审核状态',
type: 'string',
default: 0,
enum: [
{ label: '未知', value: 0 },
{ label: '', value: 1 },
{ label: '', value: 2 },
{ label: '保密', value: 3 },
{ label: '待审核', value: 1 },
{ label: '审核通过', value: 2 },
{ label: '不通过', value: 3 },
{ label: '已取消', value: 4 },
],
ui: {
widget: 'select',
@ -159,7 +165,7 @@ export class SupplyManagementVehicleComponent implements OnInit {
_$expand: (value: boolean) => value,
},
allowClear: true,
asyncData: () => this.getCatalogueMember(),
// asyncData: () => this.getCatalogueMember(),
},
},
},
@ -193,26 +199,31 @@ export class SupplyManagementVehicleComponent implements OnInit {
title: '货源编号',
width: '100px',
className: 'text-center',
render: 'goodsId'
render: 'resourceCode'
},
{ title: '服务类型', index: 'externalSn', width: '120px', className: 'text-center' },
{ title: '货主', index: 'linkUrl', width: '120px', className: 'text-center' },
{ title: '服务类型', index: 'serviceType', width: '120px', className: 'text-center',render: 'serviceType'},
{ title: '货主', index: 'shipperAppUserName', width: '120px', className: 'text-center' },
{
title: '项目名称',
index: 'enterpriseProjectName',
className: 'text-center',
width: '120px',
},
{
title: '装货地',
index: 'loadingAddressArr',
className: 'text-center',
width: '120px',
render: 'loadingAddressArr'
}, {
title: '卸货地',
index: 'unloadingAddressArr',
className: 'text-center',
width: '120px',
},
{
title: '货物名称',
index: 'goodsName',
className: 'text-center',
width: '120px',
},
@ -220,9 +231,12 @@ export class SupplyManagementVehicleComponent implements OnInit {
title: '货物数量',
className: 'text-center',
width: '120px',
index: 'goodsNumber',
},
{
title: '用车需求',
index: 'vehicleDemand',
className: 'text-center',
width: '120px',
},
@ -230,41 +244,43 @@ export class SupplyManagementVehicleComponent implements OnInit {
title: '总费用',
className: 'text-center',
width: '120px',
index: 'goodsId',
render: 'enStatusStr27878'
index: 'totalAmount',
render: 'totalAmount'
},
{
title: '附加费',
className: 'text-center',
width: '120px',
index: 'surcharge',
},
{
title: '货源状态',
className: 'text-center',
index: 'enStatusStr2',
index: 'resourceStatus',
type: 'badge',
width: '120px',
badge: {
: { text: '正常', color: 'success' },
: { text: '冻结', color: 'warning' },
: { text: '废弃', color: 'default' },
1: { text: '待接单', color: 'success' },
2: { text: '已接单', color: 'warning' },
},
},
{
title: '创建时间',
width: '170px',
index: 'releaseTime',
className: 'text-center',
},
{
title: '审核状态',
className: 'text-center',
index: 'enStatusStr3',
index: 'auditStatus',
type: 'badge',
width: '170px',
badge: {
: { text: '正常', color: 'success' },
: { text: '冻结', color: 'warning' },
: { text: '废弃', color: 'default' },
1: { text: '待审核', color: 'warning' },
2: { text: '审核通过', color: 'success' },
3: { text: '不通过', color: 'default' },
4: { text: '已取消', color: 'default' },
},
},
{
@ -276,10 +292,12 @@ export class SupplyManagementVehicleComponent implements OnInit {
{
text: '货源审核',
click: (_record) => this.audit(_record, 1),
iif: item => item.status === 1,
},
{
text: '修改货源',
click: (_record) => this.amend(_record),
iif: item => item.status === 1 || item.status === 2,
},
{
text: '修改运费',
@ -287,6 +305,7 @@ export class SupplyManagementVehicleComponent implements OnInit {
},
{
text: '取消货源',
iif: item => item.status === 1 || item.status === 2,
// click: (_record) => this.delOne(_record),
},
{
@ -296,6 +315,7 @@ export class SupplyManagementVehicleComponent implements OnInit {
{
text: '重新指派',
click: (_record) => this.assignedCar(_record),
iif: item => item.status === 2,
},
],
},
@ -332,21 +352,14 @@ export class SupplyManagementVehicleComponent implements OnInit {
// 获取录单员
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);
this.resourceStatus = e;
this.initST();
setTimeout(() => {
this.st.load();
}, 500);
}
/**