0">
diff --git a/src/app/routes/order-management/components/vehicle/vehicle.component.ts b/src/app/routes/order-management/components/vehicle/vehicle.component.ts
index 5acae83a..69ef767a 100644
--- a/src/app/routes/order-management/components/vehicle/vehicle.component.ts
+++ b/src/app/routes/order-management/components/vehicle/vehicle.component.ts
@@ -1,6 +1,6 @@
import { Component, OnInit, ViewChild } from '@angular/core';
import { Router, ActivatedRoute } from '@angular/router';
-import { STColumn, STComponent } from '@delon/abc/st';
+import { STColumn, STComponent, STRequestOptions } from '@delon/abc/st';
import { SFComponent, SFDateWidgetSchema, SFSchema, SFSchemaEnum, SFSelectWidgetSchema, SFUISchema } from '@delon/form';
import { ShipperBaseService } from '@shared';
import { NzModalService } from 'ng-zorro-antd/modal';
@@ -12,6 +12,7 @@ import { VehicleFreightPeopleComponent } from '../../modal/vehicle/freight-peopl
import { VehicleModifyCaptainComponent } from '../../modal/vehicle/modify-captain/modify-captain.component';
import { VehicleModifyRateComponent } from '../../modal/vehicle/modify-rate/modify-rate.component';
import { VehicleUpdateFreightComponent } from '../../modal/vehicle/update-freight/update-freight.component';
+import { OneCarOrderViewtrackComponent } from '../../modal/vehicle/view-track/view-track.component';
import { OrderManagementService } from '../../services/order-management.service';
@@ -27,6 +28,7 @@ export class OrderManagementVehicleComponent implements OnInit {
isVisibleView = false;
isVisibleEvaluate = false;
isVisible = false;
+ loading: boolean = true;
changeId: any; // 主页面查看运费变更记录id - 用于运费变更记录
changeViewId: any; // 查看运费变更记录id - 用于查看
ViewCause: any; // 变更运费查看数据
@@ -102,6 +104,33 @@ resourceStatus: any;
},
};
}
+ beforeReq = (requestOptions: STRequestOptions) => {
+ const a:any = {};
+ if(this.resourceStatus) {
+ a.billStatus = this.resourceStatus;
+ }
+ const params: any = Object.assign({}, this.sf?.value || {});
+ delete params._$expand;
+ if (this.sf) {
+ Object.assign(requestOptions.body, {
+ ...a,
+ ...params,
+ createTime: {
+ start: this.sf?.value?.createTime?.[0] || '',
+ end: this.sf?.value?.createTime?.[1] || '',
+ },
+ });
+ }
+ this.loading = true;
+ return requestOptions;
+ };
+ afterRes = (data: any[], rawData?: any) => {
+ console.log(data)
+ this.loading = false
+ return data.map(item => ({
+ ...item,
+ }));
+ };
get selectedRows() {
return this.st?.list.filter((item) => item.checked) || [];
}
@@ -178,9 +207,10 @@ resourceStatus: any;
searchLoadingText: '搜索中...',
allowClear: true,
onSearch: (q: any) => {
- if (!!q) {
+ let str =q.replace(/^\s+|\s+$/g,"");
+ if (str) {
return this.service
- .request(this.service.$api_enterpriceList, { enterpriseName: q})
+ .request(this.service.$api_enterpriceList, { enterpriseName: str})
.pipe(map((res: any) => (res as any[]).map((i) => ({ label: i.enterpriseName, value: i.id } as SFSchemaEnum))))
.toPromise();
} else {
@@ -360,6 +390,7 @@ resourceStatus: any;
className: 'text-right',
render: 'mybidDetailInfo',
},
+ { title: '录单员', render: 'createUserName', width: '200px', className: 'text-left' },
{ title: '网络货运人', index: 'enterpriseInfoName', width: '250px', className: 'text-left' },
{ title: '货主', index: 'shipperAppUserName', width: '250px', className: 'text-left' },
{ title: '关联运单号', index: 'wayBillCode', width: '170px', className: 'text-left' },
@@ -458,8 +489,8 @@ resourceStatus: any;
},
{
text: '查看轨迹 ',
- click: (_record) => this.cancellation(_record),
- iif: item => item.billStatus == '4' || item.billStatus == '5' || item.billStatus == '2' || item.billStatus == '3',
+ click: (_record) => this.viewTrack(_record),
+ iif: item => item.billStatus !== '1' && item.billStatus !== '6',
// acl: { ability: ['VEHICLE-LIST-view'] },
},
@@ -856,4 +887,22 @@ resourceStatus: any;
}
});
}
+ /**
+ *查看轨迹
+ */
+ viewTrack(item: any) {
+ const modalRef = this.modal.create({
+ nzTitle: '查看轨迹',
+ nzContent: OneCarOrderViewtrackComponent,
+ nzWidth: '800px',
+ nzComponentParams: {
+ i: item,
+ },
+ nzFooter: null
+ });
+ modalRef.afterClose.subscribe((res: boolean) => {
+ if(res) {
+ }
+ });
+ }
}
diff --git a/src/app/routes/order-management/modal/bulk/confir-receipt/confir-receipt.component.html b/src/app/routes/order-management/modal/bulk/confir-receipt/confir-receipt.component.html
index 3b22ef68..b1289919 100644
--- a/src/app/routes/order-management/modal/bulk/confir-receipt/confir-receipt.component.html
+++ b/src/app/routes/order-management/modal/bulk/confir-receipt/confir-receipt.component.html
@@ -4,7 +4,7 @@
* @Author : Shiming
* @Date : 2021-12-14 15:02:52
* @LastEditors : Shiming
- * @LastEditTime : 2022-01-18 17:20:49
+ * @LastEditTime : 2022-03-02 13:43:55
* @FilePath : \\tms-obc-web\\src\\app\\routes\\order-management\\modal\\bulk\\confir-receipt\\confir-receipt.component.html
* Copyright (C) 2022 huzhenhong. All rights reserved.
-->
@@ -18,7 +18,7 @@ nzMessage="签收后不可再修改运费,请确保运费等信息准确无误
- {{detailList?.goodsInfoVO?.freightPrice}} {{detailList?.goodsInfoVO?.freightType}}
+ {{detailList?.goodsInfoVO?.freightPrice}} {{detailList?.goodsInfoVO?.freightTypeLabel}}
@@ -37,7 +37,7 @@ nzMessage="签收后不可再修改运费,请确保运费等信息准确无误
{{detailList?.goodsInfoVO?.weight}}吨
- {{detailList?.goodsInfoVO?.volume}}吨
+ {{detailList?.goodsInfoVO?.volume}}方
@@ -50,7 +50,7 @@ nzMessage="签收后不可再修改运费,请确保运费等信息准确无误
- {{detailList?.price}} 元
+ {{detailList?.price | currency}} 元
{{detailList?.driverName}} / {{detailList?.driverPhone}}/ {{detailList?.carNo}}
@@ -69,7 +69,7 @@ nzMessage="签收后不可再修改运费,请确保运费等信息准确无误
[nzPreview]="handlePreview1"
[nzBeforeUpload]="beforeUpload"
(nzChange)="handleChange1($event)"
- >beforeUpload
+ >
请上传图片
diff --git a/src/app/routes/order-management/modal/bulk/update-freight/update-freight.component.html b/src/app/routes/order-management/modal/bulk/update-freight/update-freight.component.html
index 425e1621..b6803fd0 100644
--- a/src/app/routes/order-management/modal/bulk/update-freight/update-freight.component.html
+++ b/src/app/routes/order-management/modal/bulk/update-freight/update-freight.component.html
@@ -4,7 +4,7 @@
* @Author : Shiming
* @Date : 2021-12-14 14:03:07
* @LastEditors : Shiming
- * @LastEditTime : 2022-02-23 14:20:32
+ * @LastEditTime : 2022-03-01 19:27:32
* @FilePath : \\tms-obc-web\\src\\app\\routes\\order-management\\modal\\bulk\\update-freight\\update-freight.component.html
* Copyright (C) 2022 huzhenhong. All rights reserved.
-->
@@ -19,6 +19,7 @@
[ngModel]="i.value"
(ngModelChange)="i.setValue($event)"
placeholder="请输入"
+ (change)="changeNumVal()"
oninput="if(value>99999)value=99999;if(value<0)value=0"
/>
diff --git a/src/app/routes/order-management/modal/bulk/update-freight/update-freight.component.ts b/src/app/routes/order-management/modal/bulk/update-freight/update-freight.component.ts
index 8c89214c..9ee9df5e 100644
--- a/src/app/routes/order-management/modal/bulk/update-freight/update-freight.component.ts
+++ b/src/app/routes/order-management/modal/bulk/update-freight/update-freight.component.ts
@@ -4,7 +4,7 @@
* @Author : Shiming
* @Date : 2021-12-14 14:03:07
* @LastEditors : Shiming
- * @LastEditTime : 2022-02-23 14:23:26
+ * @LastEditTime : 2022-03-01 19:27:28
* @FilePath : \\tms-obc-web\\src\\app\\routes\\order-management\\modal\\bulk\\update-freight\\update-freight.component.ts
* Copyright (C) 2022 huzhenhong. All rights reserved.
*/
@@ -50,7 +50,6 @@ export class UpdateFreightComponent implements OnInit {
placeholder: '请输入',
widget: 'custom',
grid: { span: 12 },
- change: (val: any) => this.changeNumVal()
} as SFStringWidgetSchema,
default: data.freightPrice
},
@@ -181,18 +180,19 @@ export class UpdateFreightComponent implements OnInit {
}
changeNumVal() {
+ console.log('444')
if (this.calculateSub) {
this.calculateSub.unsubscribe();
}
const params = { billId: this.data.billId, changeCause: this.sf.value.changeCause, dto: {...this.sf.value} }
this.calculateSub = this.service
.request(this.service.$api_calculate_cost, params)
- .subscribe((res: any) => {
+ .subscribe(res => {
if (res) {
Object.assign(this.data, {
+ totalAmount: res.totalAmount,
totalFreight: res.totalFreight,
- freight: res.freight,
- surcharge: res.surcharge
+ totalSurcharge: res.totalSurcharge
});
}
});
diff --git a/src/app/routes/order-management/modal/vehicle/cancel-confirm/cancel-confirm.component.ts b/src/app/routes/order-management/modal/vehicle/cancel-confirm/cancel-confirm.component.ts
index 56e734b3..dc868538 100644
--- a/src/app/routes/order-management/modal/vehicle/cancel-confirm/cancel-confirm.component.ts
+++ b/src/app/routes/order-management/modal/vehicle/cancel-confirm/cancel-confirm.component.ts
@@ -4,7 +4,7 @@
* @Author : Shiming
* @Date : 2022-02-22 13:53:29
* @LastEditors : Shiming
- * @LastEditTime : 2022-02-22 15:51:53
+ * @LastEditTime : 2022-02-28 15:56:46
* @FilePath : \\tms-obc-web\\src\\app\\routes\\order-management\\modal\\vehicle\\cancel-confirm\\cancel-confirm.component.ts
* Copyright (C) 2022 huzhenhong. All rights reserved.
*/
@@ -75,6 +75,7 @@ export class OneCarOrderCancelConfirmComponent implements OnInit {
initData() {
let indexId = 0
let index = 0
+ let indexSurcharge = 0
this.i?.mybidDetailInfo.forEach((ele: any) => {
if(this.sts == 1) {
// 大宗
@@ -83,25 +84,21 @@ export class OneCarOrderCancelConfirmComponent implements OnInit {
}
if (ele?.paymentStatusLabel == '已支付') {
indexId += 1;
+ indexSurcharge += ele?.surcharge;
}
} else {
// 整车
if (ele?.paymentStatusLabel == '已支付') {
indexId += 1;
index += ele?.price;
+ indexSurcharge += ele?.surcharge;
}
console.log(ele.expenseCode)
}
- if (ele.expenseCode == '"ATT"' || ele.expenseCode == 'ATT'){
- if(ele?.paymentStatusLabel == '已支付') {
- this.ATTPrice = ele.price;
- } else {
- this.ATTPrice = 0;
- }
- }
});
this.index = indexId
this.List = index
+ this.ATTPrice = indexSurcharge
console.log(this.index)
console.log(this.List)
}
diff --git a/src/app/routes/order-management/modal/vehicle/confir-receipt/confir-receipt.component.html b/src/app/routes/order-management/modal/vehicle/confir-receipt/confir-receipt.component.html
index b94a1580..d4e298cb 100644
--- a/src/app/routes/order-management/modal/vehicle/confir-receipt/confir-receipt.component.html
+++ b/src/app/routes/order-management/modal/vehicle/confir-receipt/confir-receipt.component.html
@@ -4,7 +4,7 @@
* @Author : Shiming
* @Date : 2021-12-15 13:17:42
* @LastEditors : Shiming
- * @LastEditTime : 2022-01-18 17:21:57
+ * @LastEditTime : 2022-03-02 13:50:12
* @FilePath : \\tms-obc-web\\src\\app\\routes\\order-management\\modal\\vehicle\\confir-receipt\\confir-receipt.component.html
* Copyright (C) 2022 huzhenhong. All rights reserved.
-->
@@ -17,7 +17,20 @@
-
+
+
+ {{item.PRE | currency}}
+
+
+ {{ item.RECE | currency }}
+
+
+ {{ item.BACK | currency }}
+
+
+ {{ item.traiPrice | currency }}
+
+
{{ dataInfo?.driverName }} / {{ dataInfo?.driverPhone }}/ {{ dataInfo?.carNo }}
diff --git a/src/app/routes/order-management/modal/vehicle/confir-receipt/confir-receipt.component.ts b/src/app/routes/order-management/modal/vehicle/confir-receipt/confir-receipt.component.ts
index 86e57768..6d6170e4 100644
--- a/src/app/routes/order-management/modal/vehicle/confir-receipt/confir-receipt.component.ts
+++ b/src/app/routes/order-management/modal/vehicle/confir-receipt/confir-receipt.component.ts
@@ -4,7 +4,7 @@
* @Author : Shiming
* @Date : 2021-12-15 13:17:42
* @LastEditors : Shiming
- * @LastEditTime : 2022-02-25 15:34:07
+ * @LastEditTime : 2022-03-02 13:52:27
* @FilePath : \\tms-obc-web\\src\\app\\routes\\order-management\\modal\\vehicle\\confir-receipt\\confir-receipt.component.ts
* Copyright (C) 2022 huzhenhong. All rights reserved.
*/
@@ -143,23 +143,27 @@ export class VehicleConfirReceiptComponent implements OnInit {
this.columns = [
{
title: '预付',
- index: 'PRE'
+ index: 'PRE',
+ render:'PRE'
},
{
title: '到付',
- index: 'RECE'
- },
- {
- title: '油卡',
- index: 'OIL'
+ index: 'RECE',
+ render:'RECE'
},
+ // {
+ // title: '油卡',
+ // index: 'OIL'
+ // },
{
title: '回单付',
- index: 'BACK'
+ index: 'BACK',
+ render:'BACK'
},
{
title: '总运费',
- index: 'traiPrice'
+ index: 'traiPrice',
+ render:'traiPrice'
}
];
}
diff --git a/src/app/routes/order-management/modal/vehicle/view-track/view-track.component.html b/src/app/routes/order-management/modal/vehicle/view-track/view-track.component.html
new file mode 100644
index 00000000..36828461
--- /dev/null
+++ b/src/app/routes/order-management/modal/vehicle/view-track/view-track.component.html
@@ -0,0 +1,34 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/app/routes/order-management/modal/vehicle/view-track/view-track.component.less b/src/app/routes/order-management/modal/vehicle/view-track/view-track.component.less
new file mode 100644
index 00000000..ae775710
--- /dev/null
+++ b/src/app/routes/order-management/modal/vehicle/view-track/view-track.component.less
@@ -0,0 +1,11 @@
+:host {
+ ::ng-deep {
+ // .mapBox {
+ // iframe, canvas {
+ // width: 400px !important;
+ // }
+ // }
+
+ }
+
+ }
\ No newline at end of file
diff --git a/src/app/routes/order-management/modal/vehicle/view-track/view-track.component.ts b/src/app/routes/order-management/modal/vehicle/view-track/view-track.component.ts
new file mode 100644
index 00000000..5bb83e8a
--- /dev/null
+++ b/src/app/routes/order-management/modal/vehicle/view-track/view-track.component.ts
@@ -0,0 +1,84 @@
+/*
+ * @Description :
+ * @Version : 1.0
+ * @Author : Shiming
+ * @Date : 2022-02-22 13:53:29
+ * @LastEditors : Shiming
+ * @LastEditTime : 2022-03-02 16:02:51
+ * @FilePath : \\tms-obc-web\\src\\app\\routes\\order-management\\modal\\vehicle\\view-track\\view-track.component.ts
+ * Copyright (C) 2022 huzhenhong. All rights reserved.
+ */
+import { Component, OnInit, ViewChild } from '@angular/core';
+import { STColumn } from '@delon/abc/st';
+import {
+ SFComponent,
+ SFCustomWidgetSchema,
+ SFNumberWidgetSchema,
+ SFRadioWidgetSchema,
+ SFSchema,
+ SFTextareaWidgetSchema,
+ SFUISchema
+} from '@delon/form';
+import format from 'date-fns/format';
+import { _HttpClient } from '@delon/theme';
+import { NzMessageService } from 'ng-zorro-antd/message';
+import { NzModalRef, NzModalService } from 'ng-zorro-antd/modal';
+import { OrderManagementService } from '../../../services/order-management.service';
+
+
+@Component({
+ selector: 'app-order-management-view-track',
+ styleUrls: ['./view-track.component.less'],
+ templateUrl: './view-track.component.html'
+})
+export class OneCarOrderViewtrackComponent implements OnInit {
+ i: any; // 单行数据
+ MapList:any[] = []; //地图点位数据组
+ trajectory = 'car';
+ addressItems: any[] = []; //打点地址数据组
+ logColumns: STColumn[] = [
+ { title: '时间', index: 'vinOutTime' },
+ { title: '地点', index: 'cityName' },
+ ];
+ constructor(
+ private modalRef: NzModalRef,
+ private modal: NzModalService,
+ private msgSrv: NzMessageService,
+ public service: OrderManagementService
+ ) {}
+
+ ngOnInit(): void {
+ console.log(this.i);
+ this.MapInit();
+
+ }
+ // 获取轨迹
+ MapInit() {
+ this.service.request(this.service.$api_get_getTrajectory, { id: this.i.id }).subscribe(res => {
+ if (res) {
+ const points = res.trackArray;
+ let list :any[] = [];
+ points?.forEach((item: any) => {
+ list.push({
+ name: item.hgt,
+ lnglat: [Number((Number(item.lon) / 600000).toFixed(6)), Number((Number(item.lat) / 600000).toFixed(6))]
+ });
+ });
+ this.MapList = list;
+ // this.addressItems = res.parkArray;
+ this.addressItems = res.cityArray;
+ if(this.addressItems && this.addressItems.length > 0){
+ this.addressItems.forEach(item => {
+ item.vinOutTime = this.getLocalTime(item.vinOutTime);
+ });
+ }
+ }
+ });
+ }
+ close(value: boolean): void {
+ this.modalRef.close(false);
+ }
+ getLocalTime(time: any) {
+ return format(new Date(parseInt(time)), 'yyyy-MM-dd HH:mm:ss');
+ }
+}
diff --git a/src/app/routes/order-management/order-management.module.ts b/src/app/routes/order-management/order-management.module.ts
index 8d59ea15..b71b0fda 100644
--- a/src/app/routes/order-management/order-management.module.ts
+++ b/src/app/routes/order-management/order-management.module.ts
@@ -36,6 +36,7 @@ import { VehicleModifyRateComponent } from './modal/vehicle/modify-rate/modify-r
import { VehicleSureArriveComponent } from './modal/vehicle/sure-arrive/sure-arrive.component';
import { VehicleSureDepartComponent } from './modal/vehicle/sure-depart/sure-depart.component';
import { VehicleUpdateFreightComponent } from './modal/vehicle/update-freight/update-freight.component';
+import { OneCarOrderViewtrackComponent } from './modal/vehicle/view-track/view-track.component';
import { OrderManagementRoutingModule } from './order-management-routing.module';
const COMPONENTS: Type[] = [
@@ -62,7 +63,8 @@ const COMPONENTS: Type[] = [
OrderManagementReceiptsAuditComponent,
orderManagementVoucherViewComponent,
OrderManagementComplianceAuditComponent,
- OneCarOrderCancelConfirmComponent
+ OneCarOrderCancelConfirmComponent,
+ OneCarOrderViewtrackComponent
];
@NgModule({
diff --git a/src/app/routes/order-management/services/order-management.service.ts b/src/app/routes/order-management/services/order-management.service.ts
index d142db1c..b426ad03 100644
--- a/src/app/routes/order-management/services/order-management.service.ts
+++ b/src/app/routes/order-management/services/order-management.service.ts
@@ -4,7 +4,7 @@
* @Author : Shiming
* @Date : 2021-12-03 15:31:52
* @LastEditors : Shiming
- * @LastEditTime : 2022-02-28 12:01:42
+ * @LastEditTime : 2022-03-01 19:21:53
* @FilePath : \\tms-obc-web\\src\\app\\routes\\order-management\\services\\order-management.service.ts
* Copyright (C) 2022 huzhenhong. All rights reserved.
*/
diff --git a/src/app/routes/supply-management/components/assigned-car/assigned-car.component.html b/src/app/routes/supply-management/components/assigned-car/assigned-car.component.html
index 65a2952a..22030b03 100644
--- a/src/app/routes/supply-management/components/assigned-car/assigned-car.component.html
+++ b/src/app/routes/supply-management/components/assigned-car/assigned-car.component.html
@@ -1,66 +1,49 @@
-
-
+ (change)="changeSt($event)">
-
+
-
- {{ car.carNo }} -
- {{ car.carLength }}米,{{ car.carLoad }}吨 -
- 空闲
- 已被指派
+
+ {{car.carNo}} -
+ {{car.carLength}}米,{{car.carLoad}}吨 -
+ 空闲
+ 在途
未认证
- {{ item.captainName }} {{ item.captainPhone }}
- 设置
+ {{item.captainName}} {{item.captainPhone}}
+ 设置
空闲
- 已被指派
+ 在途
未认证
diff --git a/src/app/routes/supply-management/components/assigned-car/assigned-car.component.ts b/src/app/routes/supply-management/components/assigned-car/assigned-car.component.ts
index 11a756c4..bcbd14e5 100644
--- a/src/app/routes/supply-management/components/assigned-car/assigned-car.component.ts
+++ b/src/app/routes/supply-management/components/assigned-car/assigned-car.component.ts
@@ -2,8 +2,9 @@ import { Component, OnInit, ViewChild } from '@angular/core';
import { STChange, STColumn, STColumnBadge, STComponent, STData } from '@delon/abc/st';
import { SFComponent, SFSchema, SFUISchema } from '@delon/form';
import { ModalHelper, _HttpClient } from '@delon/theme';
+import { EAEnvironmentService } from '@shared';
import { NzMessageService } from 'ng-zorro-antd/message';
-import { NzModalRef } from 'ng-zorro-antd/modal';
+import { NzModalRef, NzModalService } from 'ng-zorro-antd/modal';
import { SupplyManagementService } from '../../services/supply-management.service';
import { SupplyManagementAddDriversComponent } from '../add-drivers/add-drivers.component';
import { CarAddmodalComponent } from '../addmodal/addmodal.component';
@@ -29,7 +30,6 @@ export class SupplyManagementVehicleAssignedCarComponent implements OnInit {
@ViewChild('st') st!: STComponent;
@ViewChild('sf', { static: false }) sf!: SFComponent;
status: string = 'anew';
- type: any;
url = ''; // 请求的api地址
params: any = {}; // 传进来的参数
cardBADGE: STColumnBadge | any = {
@@ -43,6 +43,8 @@ export class SupplyManagementVehicleAssignedCarComponent implements OnInit {
private msgSrv: NzMessageService,
public service: SupplyManagementService,
private modalHelper: ModalHelper,
+ private envSrv: EAEnvironmentService,
+ private modalSrv: NzModalService
) {
this.initSF();
this.initSt();
@@ -54,10 +56,14 @@ export class SupplyManagementVehicleAssignedCarComponent implements OnInit {
get reqParams() {
return {
...this.sf?.value,
+ loadingTime: this.params?.loadingTime,
+ unloadingTime: this.params?.unloadingTime
};
}
+
+
/**
* 初始化查询表单
*/
@@ -67,14 +73,15 @@ export class SupplyManagementVehicleAssignedCarComponent implements OnInit {
_$expand: { type: 'boolean', ui: { hidden: true } },
nameOrPhone: {
type: 'string',
- title: '',
+ title: '承运司机',
ui: {
placeholder: '请输入司机姓名/手机号'
}
},
carNo: {
type: 'string',
- title: '',
+ title: '车牌号',
+ maxLength: 9,
ui: {
placeholder: '请输入车牌号'
}
@@ -100,13 +107,12 @@ export class SupplyManagementVehicleAssignedCarComponent implements OnInit {
}
ngOnInit(): void {
- console.log(this.type)
}
dataProcess(data: STData[]): STData[] {
return data.map((i, index) => {
i.carId = '';
- i.disabled = i.carStatus === '1';
+ i.disabled = (i?.certificationStatus === 1 && i.driverStatus === 1);
const defaultCar = i?.userCarLicenseDesensitizationVOList?.find((item: any) => item.isDefault);
if (defaultCar) {
i.carId = defaultCar?.carId;
@@ -116,16 +122,15 @@ export class SupplyManagementVehicleAssignedCarComponent implements OnInit {
}
save(): void {
- if (this.selectedRows) {
- const { carId, appUserId: driverId, captainAppUserId: carCaptainId } = this.selectedRows;
- const params: any = { carId, driverId, carCaptainId };
- this.service.request(this.url, { ...params, ...this.params }).subscribe((res: any) => {
- if (res) {
- this.modal.close(res);
- }
- })
+ const { carId, appUserId: driverId, captainAppUserId: carCaptainId } = this.selectedRows;
+ const params: any = { carId, driverId, carCaptainId };
+ this.service.request(this.url, { ...params, ...this.params }).subscribe((res: any) => {
+ if (res) {
+ this.service.msgSrv.success('指派成功!');
+ this.modal.close(res);
+ }
+ })
- }
}
changeSt(e: STChange): void {
@@ -143,10 +148,28 @@ export class SupplyManagementVehicleAssignedCarComponent implements OnInit {
});
}
+ /**
+ * 校验司机是否能设置车队长
+ * @param item 当前对象
+ */
+ verifyCanSetCarCaptain(item: any) {
+ this.service.request(this.service.$api_get_sys_config, [{ itemKey: 'sys.config.shipper.setCarCaptain', businessId: this.envSrv.env.enterpriseId }]).subscribe(res => {
+ if (res && res.length > 0) {
+ const { itemValue } = res[0];
+ if (itemValue !== '1') {
+ this.service.msgSrv.error('不可设置车队长!');
+ return;
+ }
+ this.setCarCaptain(item);
+ }
+ })
+ }
+
/**
* 设置车队长
*/
setCarCaptain(item: any) {
+
this.modalHelper.create(SupplyManagementAddDriversComponent, { dirvierInfo: item }, {
size: 900,
modalOptions: { nzMaskClosable: false, nzTitle: '设置' }
@@ -168,4 +191,57 @@ export class SupplyManagementVehicleAssignedCarComponent implements OnInit {
this.sf.reset();
this.st.load(1);
}
+
+ /**
+ * 验证车辆的状态
+ */
+ verifyVechicleStatus(params: any) {
+ if (this.selectedRows) {
+ const obj = this.status === 'anew' ? { resourceId: params.id } : { ...params };
+ const { carId, appUserId: driverId, captainAppUserId: carCaptainId } = this.selectedRows;
+ const carInfo: any = { carId, driverId, carCaptainId };
+ this.service.request(this.service.$api_verify_vehicle_status, { ...obj, ...carInfo }).subscribe(res => {
+ if (res) {
+ const { title, alert, subContent, content } = res;
+ switch (alert) {
+ case 'Error':
+ // if (code === '3' || code === '4' || code === '8') {
+ // this.error(title, subContent, '#CF3834');
+ // } else {
+ this.error(title, content, subContent);
+ break;
+ case 'Warn':
+ this.showConfirm(title, content, subContent);
+ break;
+ case 'Success':
+ this.save();
+ break;
+ }
+ }
+ })
+ }
+
+ }
+
+ error(title: string, content: string, subContent: string): void {
+ this.modalSrv.error({
+ nzTitle: title,
+ nzContent: `${content ? content : ''}${subContent ? subContent : ''}`,
+ nzOkText: '知道了'
+ });
+ }
+
+ showConfirm(title: string, content: string, subContent: string): void {
+ this.modalSrv.confirm({
+ nzTitle: title,
+ nzContent: `${content ? content : ''}${subContent ? subContent : ''}`,
+ nzOkText: '继续',
+ nzCancelText: '取消',
+ nzOnOk: () => {
+ this.save();
+ }
+ });
+ }
+
+
}
diff --git a/src/app/routes/supply-management/components/bulk-detail/bulk-detail.component.html b/src/app/routes/supply-management/components/bulk-detail/bulk-detail.component.html
index fb4c2eb6..5d118b1f 100644
--- a/src/app/routes/supply-management/components/bulk-detail/bulk-detail.component.html
+++ b/src/app/routes/supply-management/components/bulk-detail/bulk-detail.component.html
@@ -13,16 +13,17 @@
网络货运人:{{ i?.shipperAppUserName }}
-
-
-
+
+
+
- 总费用:{{ i?.totalAmount | currency: '¥' }}
+ 总费用:{{ i?.totalAmount | currency: '¥' }}
@@ -39,19 +40,14 @@
@@ -77,10 +73,8 @@
-
装货卸货信息
- (
+ 装货卸货信息
+ (
)
@@ -130,7 +124,8 @@
- {{ item?.freightPrice | currency: '¥' }} {{ freightType[item?.freightType] }}
+ {{ item?.freightPrice | currency: '¥' }} {{
+ freightType[item?.freightType] }}
@@ -139,8 +134,7 @@
- ( 0 }">{{ item?.count }})
+ ( 0 }">{{ item?.count }})
@@ -199,7 +200,7 @@
-
+
-
diff --git a/src/app/routes/supply-management/components/bulk-publish/bulk-publish.component.ts b/src/app/routes/supply-management/components/bulk-publish/bulk-publish.component.ts
index 9e5c484b..727e0e7c 100644
--- a/src/app/routes/supply-management/components/bulk-publish/bulk-publish.component.ts
+++ b/src/app/routes/supply-management/components/bulk-publish/bulk-publish.component.ts
@@ -46,6 +46,13 @@ export class SupplyManagementBulkPublishComponent implements OnInit {
startInfo: any = [];
endInfo: any = [];
PageStatus = '';
+ limitValues = {
+ maxMonth: 99,
+ maxWeight: 99999,
+ maxVolume: 99999,
+ maxTrainNumber: 99999,
+ maxFreight: 9999999
+ }
constructor(
private http: _HttpClient,
fb: FormBuilder,
@@ -96,6 +103,7 @@ export class SupplyManagementBulkPublishComponent implements OnInit {
this.initSF4();
this.initSF6();
this.initdata();
+ this.getLimitvalue();
}
initSF1() {
this.schema1 = {
@@ -110,9 +118,10 @@ export class SupplyManagementBulkPublishComponent implements OnInit {
searchDebounceTime: 300,
searchLoadingText: '搜索中...',
onSearch: (q: any) => {
- if (!!q) {
+ let str =q.replace(/^\s+|\s+$/g,"");
+ if (str) {
return this.service
- .request(this.service.$api_enterpriceList, { enterpriseName: q })
+ .request(this.service.$api_enterpriceList, { enterpriseName: str })
.pipe(map(res => (res as any[]).map(i => ({ label: i.enterpriseName, value: i.id } as SFSchemaEnum))))
.toPromise();
} else {
@@ -120,7 +129,10 @@ export class SupplyManagementBulkPublishComponent implements OnInit {
}
},
change: (q: any) => {
- this.getRegionCode(q);
+ let str =q.replace(/^\s+|\s+$/g,"");
+ if (str) {
+ this.getRegionCode(str);
+ }
},
} as SFSelectWidgetSchema
},
@@ -146,19 +158,19 @@ export class SupplyManagementBulkPublishComponent implements OnInit {
ui: {
placeholder: '请输入',
format: 'yyyy-MM-dd HH:mm:ss',
- disabledDate: (current: Date): boolean => {
+ validator: (val) => {
let d = new Date();
let year = d.getFullYear();
let month = d.getMonth();
let date = d.getDate();
- let mydate = new Date(year, month + 3, date);
- return differenceInCalendarDays(current, new Date()) < 0 || differenceInCalendarDays(current, mydate) > 0;
- },
- validator: (val) => {
- if( new Date(val)
mydate) {
+ return [{ keyword: 'validTime2', message: `有效期最长为${this.limitValues.maxMonth}个月` }];
+ }
+ return [];
},
}
},
@@ -412,6 +424,7 @@ export class SupplyManagementBulkPublishComponent implements OnInit {
grid: { lg: 8, md: 12, sm: 12, xs: 24 }
},
$carModel: {
+ spanLabelFixed: 120,
grid: { span: 8 }
},
$carLength: {
@@ -522,7 +535,7 @@ export class SupplyManagementBulkPublishComponent implements OnInit {
} as SFTextareaWidgetSchema
}
},
- required: ['stateReceipt', 'receiptType', 'receiptUserName','receiptUserPhone','receiptAddressArea','receiptAddress']
+ required: ['stateReceipt', 'receiptType', 'receiptUserName','receiptUserPhone','receiptAddressArea','receiptAddress','paymentDays']
};
this.ui7 = {
'*': {
@@ -644,7 +657,6 @@ export class SupplyManagementBulkPublishComponent implements OnInit {
}
// 提交前确认,委托运输协议弹窗
submitConfirm(submitType?: any) {
- // 校验规则
Object.keys(this.validateForm1.controls).forEach(key => {
this.validateForm1.controls[key].markAsDirty();
this.validateForm1.controls[key].updateValueAndValidity();
@@ -652,8 +664,18 @@ export class SupplyManagementBulkPublishComponent implements OnInit {
this.sf1.validator({ emitError: true });
this.sf3.validator({ emitError: true });
this.sf4.validator({ emitError: true });
- this.sf7.validator({ emitError: true });
- if (this.validateForm1.invalid || !this.sf3.valid || !this.sf1.valid || !this.sf4.valid || !this.sf7.valid) {
+ if (this.validateForm1.invalid || !this.sf1.valid || !this.sf3.valid || !this.sf4.valid ) {
+ this.service.msgSrv.warning('请完善必填项!');
+ return;
+ }
+ // 校验各个输入限定值
+ if (this.sf4.value.weight > this.limitValues.maxWeight || this.sf4.value.volume > this.limitValues.maxVolume || this.sf4.value.number > this.limitValues.maxTrainNumber) {
+ this.service.msgSrv.error(`当前货物核载信息已超出限定值【${this.limitValues.maxWeight}吨、${this.limitValues.maxVolume}方、${this.limitValues.maxTrainNumber}车】`);
+ return;
+ }
+
+ if (this.sf4.value.freightPrice > this.limitValues.maxFreight) {
+ this.service.msgSrv.error(`当前运费单价已超出限定值【${this.limitValues.maxFreight}元】`);
return;
}
@@ -671,16 +693,21 @@ export class SupplyManagementBulkPublishComponent implements OnInit {
}
// 确认提交
submit(submitType?: string): void {
- if (typeof this.validateForm1.value.modifyTime !== 'string') {
- var c = new Date(this.validateForm1.value.modifyTime);
- this.validateForm1.value.modifyTime =
- c.getFullYear() + '-' + (c.getMonth() + 1) + '-' + c.getDate() + ' ' + c.getHours() + ':' + c.getMinutes() + ':' + c.getSeconds();
- }
- if (typeof this.validateForm1.value.createTime !== 'string') {
- var c = new Date(this.validateForm1.value.createTime);
- this.validateForm1.value.createTime =
- c.getFullYear() + '-' + (c.getMonth() + 1) + '-' + c.getDate() + ' ' + c.getHours() + ':' + c.getMinutes() + ':' + c.getSeconds();
- }
+ // //装卸货信息
+ const LoadingList = this.startInfo.concat(this.endInfo);
+
+ // 货物信息
+ const sf3Values = { ...this.sf3.value };
+ if (sf3Values.goodsTypeName === '其它') {
+ sf3Values.goodsName = sf3Values.goodsName1;
+ delete sf3Values.goodsName1;
+ }
+ if (this.sf4.value.carModel.includes('999')) {
+ this.sf4.value.carModel = ['999']
+ }
+ if (this.sf4.value.carLength.includes('999')) {
+ this.sf4.value.carLength = ['999']
+ }
const params: any = {
...this.sf1.value,
@@ -1051,4 +1078,27 @@ export class SupplyManagementBulkPublishComponent implements OnInit {
});
}
}
+ getLimitvalue() {
+ const getlimitvaluesParms = [
+ this.service.limitKeys2.month,
+ this.service.limitKeys2.weight,
+ this.service.limitKeys2.volume,
+ this.service.limitKeys2.trainNumber,
+ this.service.limitKeys2.freight,
+ ];
+ this.service.request(this.service.$api_findItemValueByItemKeys, getlimitvaluesParms).subscribe((res) => {
+ const maxMonth = res.filter((item: any) => item.itemKey === this.service.limitKeys2.month)[0].itemValue;
+ const maxWeight = res.filter((item: any) => item.itemKey === this.service.limitKeys2.weight)[0].itemValue;
+ const maxVolume = res.filter((item: any) => item.itemKey === this.service.limitKeys2.volume)[0].itemValue;
+ const maxTrainNumber = res.filter((item: any) => item.itemKey === this.service.limitKeys2.trainNumber)[0].itemValue;
+ const maxFreight = res.filter((item: any) => item.itemKey === this.service.limitKeys2.freight)[0].itemValue;
+ this.limitValues = {
+ maxMonth: Number(maxMonth),
+ maxWeight: Number(maxWeight),
+ maxVolume: Number(maxVolume),
+ maxTrainNumber: Number(maxTrainNumber),
+ maxFreight: Number(maxFreight)
+ }
+ })
+ }
}
diff --git a/src/app/routes/supply-management/components/bulk-release-publish/bulk-release-publish.component.html b/src/app/routes/supply-management/components/bulk-release-publish/bulk-release-publish.component.html
index 88cd31bb..29a70721 100644
--- a/src/app/routes/supply-management/components/bulk-release-publish/bulk-release-publish.component.html
+++ b/src/app/routes/supply-management/components/bulk-release-publish/bulk-release-publish.component.html
@@ -17,7 +17,7 @@
- 装卸货信息预计公里数:{{ totalDistance }}km,预计行程耗时:{{ totalTime }}小时
@@ -26,7 +26,7 @@
- 装货地
+ 装货地
@@ -37,13 +37,14 @@
name="startDetailedAddress{{ idx }}"
placeholder="请输入装货地"
required
+ readonly="true"
/>
-
- 联系人
+
+ 联系人
- 卸货地
+ 卸货地
@@ -90,13 +91,14 @@
name="endDetailedAddress{{ idx }}"
placeholder="请输入卸货地"
required
+ readonly="true"
/>
- 联系人
+ 联系人
-
+
-
diff --git a/src/app/routes/supply-management/components/bulk-release-publish/bulk-release-publish.component.less b/src/app/routes/supply-management/components/bulk-release-publish/bulk-release-publish.component.less
index 193ba9aa..6abb9df7 100644
--- a/src/app/routes/supply-management/components/bulk-release-publish/bulk-release-publish.component.less
+++ b/src/app/routes/supply-management/components/bulk-release-publish/bulk-release-publish.component.less
@@ -4,7 +4,7 @@
width: 100%;
}
nz-date-picker {
- width: 100%;
+ width: 94.3%;
}
}
i {
@@ -37,10 +37,6 @@
:hover{color: #52acff;}
}
-#container {
- width: 300px;
- height: 180px;
-}
input[type='number'] {
-moz-appearance: textfield;
diff --git a/src/app/routes/supply-management/components/bulk-release-publish/bulk-release-publish.component.ts b/src/app/routes/supply-management/components/bulk-release-publish/bulk-release-publish.component.ts
index 94e45979..53858ad0 100644
--- a/src/app/routes/supply-management/components/bulk-release-publish/bulk-release-publish.component.ts
+++ b/src/app/routes/supply-management/components/bulk-release-publish/bulk-release-publish.component.ts
@@ -41,6 +41,13 @@ export class SupplyManagementBulkReleasePublishComponent implements OnInit {
totalFees: any; // 总数信息
id = '';
type = 'add';
+ limitValues = {
+ maxMonth: 99,
+ maxWeight: 99999,
+ maxVolume: 99999,
+ maxTrainNumber: 99999,
+ maxFreight: 9999999
+ }
// // 单位
startInfo: any[] = [];
endInfo: any[] = [];
@@ -80,6 +87,7 @@ export class SupplyManagementBulkReleasePublishComponent implements OnInit {
this.initSF3();
this.initSF4();
this.initSF6();
+ this.getLimitvalue();
this.startInfo = [
{
detailedAddress: '',
@@ -121,9 +129,10 @@ export class SupplyManagementBulkReleasePublishComponent implements OnInit {
searchLoadingText: '搜索中...',
allowClear: true,
onSearch: (q: any) => {
- if (!!q) {
+ let str =q.replace(/^\s+|\s+$/g,"");
+ if (str) {
return this.service
- .request(this.service.$api_enterpriceList, { enterpriseName: q })
+ .request(this.service.$api_enterpriceList, { enterpriseName: str })
.pipe(map((res: any[]) => (res as any[]).map(i => ({ label: i.enterpriseName, value: i.id } as SFSchemaEnum))))
.toPromise();
} else {
@@ -131,7 +140,10 @@ export class SupplyManagementBulkReleasePublishComponent implements OnInit {
}
},
change: (q: any) => {
- this.getRegionCode(q);
+ let str =q.replace(/^\s+|\s+$/g,"");
+ if (str) {
+ this.getRegionCode(str);
+ }
}
} as SFSelectWidgetSchema
},
@@ -169,19 +181,19 @@ export class SupplyManagementBulkReleasePublishComponent implements OnInit {
ui: {
placeholder: '请输入',
format: 'yyyy-MM-dd HH:mm:ss',
- disabledDate: (current: Date): boolean => {
+ validator: (val) => {
let d = new Date();
let year = d.getFullYear();
let month = d.getMonth();
let date = d.getDate();
- let mydate = new Date(year, month + 3, date);
- return differenceInCalendarDays(current, new Date()) < 0 || differenceInCalendarDays(current, mydate) > 0;
- },
- validator: (val) => {
- if( new Date(val)
mydate) {
+ return [{ keyword: 'validTime2', message: `有效期最长为${this.limitValues.maxMonth}个月` }];
+ }
+ return [];
},
}
},
@@ -435,6 +447,7 @@ export class SupplyManagementBulkReleasePublishComponent implements OnInit {
grid: { lg: 8, md: 12, sm: 12, xs: 24 }
},
$carModel: {
+ spanLabelFixed: 120,
grid: { span: 8 }
},
$carLength: {
@@ -532,7 +545,7 @@ export class SupplyManagementBulkReleasePublishComponent implements OnInit {
} as SFTextareaWidgetSchema
}
},
- required: ['stateReceipt', 'paymentDays', 'receiptType', 'receiptUserName','receiptUserPhone','receiptAddressArea','receiptAddress']
+ required: ['stateReceipt', 'paymentDays', 'receiptType', 'receiptUserName','receiptUserPhone','receiptAddressArea','receiptAddress','paymentDays']
};
this.ui6 = {
'*': {
@@ -580,9 +593,19 @@ export class SupplyManagementBulkReleasePublishComponent implements OnInit {
this.sf4.validator({ emitError: true });
this.sf6.validator({ emitError: true });
if (this.ngForm.form.invalid || !this.sf1.valid || !this.sf3.valid || !this.sf4.valid || !this.sf6.valid) {
+ this.service.msgSrv.warning('请完善必填项!');
return;
}
-
+ // 校验各个输入限定值
+ if (this.sf4.value.weight > this.limitValues.maxWeight || this.sf4.value.volume > this.limitValues.maxVolume || this.sf4.value.number > this.limitValues.maxTrainNumber) {
+ this.service.msgSrv.error(`当前货物核载信息已超出限定值【${this.limitValues.maxWeight}吨、${this.limitValues.maxVolume}方、${this.limitValues.maxTrainNumber}车】`);
+ return;
+ }
+
+ if (this.sf4.value.freightPrice > this.limitValues.maxFreight) {
+ this.service.msgSrv.error(`当前运费单价已超出限定值【${this.limitValues.maxFreight}元】`);
+ return;
+ }
const modalRef = this.modalService.create({
nzTitle: '运输协议',
nzContent: TranAgreementComponent,
@@ -599,12 +622,20 @@ export class SupplyManagementBulkReleasePublishComponent implements OnInit {
submit(submitType: string): void {
// //装卸货信息
const LoadingList = this.startInfo.concat(this.endInfo);
+
// 货物信息
const sf3Values = { ...this.sf3.value };
if (sf3Values.goodsTypeName === '其它') {
sf3Values.goodsName = sf3Values.goodsName1;
delete sf3Values.goodsName1;
}
+ if (this.sf4.value.carModel.includes('999')) {
+ this.sf4.value.carModel = ['999']
+ }
+ if (this.sf4.value.carLength.includes('999')) {
+ this.sf4.value.carLength = ['999']
+ }
+
const goodsInfoList = [
{
...sf3Values,
@@ -816,4 +847,27 @@ export class SupplyManagementBulkReleasePublishComponent implements OnInit {
});
}
}
+ getLimitvalue() {
+ const getlimitvaluesParms = [
+ this.service.limitKeys2.month,
+ this.service.limitKeys2.weight,
+ this.service.limitKeys2.volume,
+ this.service.limitKeys2.trainNumber,
+ this.service.limitKeys2.freight,
+ ];
+ this.service.request(this.service.$api_findItemValueByItemKeys, getlimitvaluesParms).subscribe((res) => {
+ const maxMonth = res.filter((item: any) => item.itemKey === this.service.limitKeys2.month)[0].itemValue;
+ const maxWeight = res.filter((item: any) => item.itemKey === this.service.limitKeys2.weight)[0].itemValue;
+ const maxVolume = res.filter((item: any) => item.itemKey === this.service.limitKeys2.volume)[0].itemValue;
+ const maxTrainNumber = res.filter((item: any) => item.itemKey === this.service.limitKeys2.trainNumber)[0].itemValue;
+ const maxFreight = res.filter((item: any) => item.itemKey === this.service.limitKeys2.freight)[0].itemValue;
+ this.limitValues = {
+ maxMonth: Number(maxMonth),
+ maxWeight: Number(maxWeight),
+ maxVolume: Number(maxVolume),
+ maxTrainNumber: Number(maxTrainNumber),
+ maxFreight: Number(maxFreight)
+ }
+ })
+ }
}
diff --git a/src/app/routes/supply-management/components/bulk/bulk.component.html b/src/app/routes/supply-management/components/bulk/bulk.component.html
index 6f5a8142..ad472530 100644
--- a/src/app/routes/supply-management/components/bulk/bulk.component.html
+++ b/src/app/routes/supply-management/components/bulk/bulk.component.html
@@ -4,7 +4,7 @@
* @Author : Shiming
* @Date : 2022-01-12 10:52:50
* @LastEditors : Shiming
- * @LastEditTime : 2022-02-25 15:22:19
+ * @LastEditTime : 2022-03-02 18:09:01
* @FilePath : \\tms-obc-web\\src\\app\\routes\\supply-management\\components\\bulk\\bulk.component.html
* Copyright (C) 2022 huzhenhong. All rights reserved.
-->
@@ -32,8 +32,8 @@
-
-
+
+