车辆对接

This commit is contained in:
wangshiming
2021-12-21 15:03:59 +08:00
parent c9906c0588
commit c79ea5261f
14 changed files with 450 additions and 403 deletions

View File

@ -1,8 +1,8 @@
<!--
* @Author: your name
* @Date: 2021-12-15 13:17:42
* @LastEditTime: 2021-12-20 20:56:54
* @LastEditors: your name
* @LastEditTime: 2021-12-21 14:34:16
* @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\modal\vehicle\confir-receipt\confir-receipt.component.html
-->
@ -15,13 +15,13 @@
<sv-container col="1">
<sv label="费用明细">
<st #st [widthMode]="{ type: 'strict' }" [data]="dataInfo" [columns]="columns" bordered="true" [page]="{ show: false }"></st>
<st #st [widthMode]="{ type: 'strict' }" [data]="costDetail" [columns]="columns" bordered="true" [page]="{ show: false }"></st>
</sv>
<sv label="司机车辆">
<div>{{ i.driverName }} / {{ i.driverTelephone }} / {{ i.carNo }}</div>
<div>{{driverList?.nickName}} / {{driverList?.telephone}}/ {{carList?.carNo}}</div>
</sv>
<sv label="收款人">
<div>{{ i.payeeName }} / {{ i.payeePhone }}</div>
<div>{{payeeList?.nickName}} / {{payeeList?.telephone}}</div>
</sv>
<sv label="回单凭证">
<nz-upload

View File

@ -1,7 +1,7 @@
/*
* @Author: your name
* @Date: 2021-12-15 13:17:42
* @LastEditTime: 2021-12-21 09:34:52
* @LastEditTime: 2021-12-21 14:50:54
* @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\modal\vehicle\confir-receipt\confir-receipt.component.ts
@ -42,6 +42,7 @@ export class VehicleConfirReceiptComponent implements OnInit {
record: any = {};
i:any;
Status: any
costDetail: any // 费用明细
columns!: STColumn[];
previewVisible1 = false;
dataInfo: any;
@ -49,9 +50,13 @@ export class VehicleConfirReceiptComponent implements OnInit {
data: any = {};
previewImage1 = '';
listImagUrls: any[] = [];
payeeList: any;
driverList: any;
carList: any;
constructor(private modal: NzModalRef, private msgSrv: NzMessageService, public http: _HttpClient,public service: OrderManagementService) {}
ngOnInit(): void {
this.initST()
this.initData()
}
@ -96,14 +101,6 @@ export class VehicleConfirReceiptComponent implements OnInit {
});
};
initData() {
// this.dataInfo = [
// {
// prePay: this.i?.mybidDetailInfo?.filter((data: any) => data.expenseCode === 'PRE')[0]?.price || 0,
// toPay: this.i?.mybidDetailInfo?.filter((data: any) => data.expenseCode === 'RECE')[0]?.price || 0,
// receiptPay: this.i?.mybidDetailInfo?.filter((data: any) => data.expenseCode === 'OIL')[0]?.price || 0,
// traiPrice: this.i?.mybidDetailInfo?.filter((data: any) => data.expenseName === '运输费')[0]?.price || 0
// }
// ];
// if (this.i?.receiptCertificate?.length > 0) {
// this.i?.receiptCertificate.forEach((element: any) => {
// const image = {
@ -118,6 +115,34 @@ export class VehicleConfirReceiptComponent implements OnInit {
this.service.request(this.service.$api_get_getWholeSignForDetail, {id: this.i?.id}).subscribe((res: any) => {
console.log(res)
this.dataInfo = res;
const cost: any = {}
res.mybidDetailInfo.forEach((element: any) => {
if(element.expenseName === "预付" || element.expenseCode === 'PRE') {
cost.PRE = element.price
} else if(element.expenseName === "到付" || element.expenseCode === 'RECE') {
cost.RECE = element.price
} else if(element.expenseName === "回单付" || element.expenseCode === 'BACK') {
cost.BACK = element.price
} else if(element.expenseName === "油卡" || element.expenseCode === 'OIL') {
cost.OIL = element.price
} else if(element.expenseName === "总费用") {
cost.traiPrice = element.price
}
});
this.service.request(this.service.$api_getUserDetailByAppUserId, {id: this.dataInfo?.payeeId}).subscribe((res: any) => {
console.log(res)
this.payeeList = res;
})
this.service.request(this.service.$api_getUserDetailByAppUserId, {id: this.dataInfo?.driverId}).subscribe((res: any) => {
console.log(res)
this.driverList = res;
})
this.service.request(this.service.$api_getCarLicenseByIds, {id: this.dataInfo?.carId}).subscribe((res: any) => {
console.log(res)
this.carList = res;
})
console.log(cost)
this.costDetail = [cost];
})
}
@ -125,19 +150,19 @@ export class VehicleConfirReceiptComponent implements OnInit {
this.columns = [
{
title: '预付',
index: 'prePay'
index: 'PRE'
},
{
title: '到付',
index: 'toPay'
index: 'RECE'
},
{
title: '油卡',
index: 'OIL'
},
// {
// title: '油卡',
// index: 'name3'
// },
{
title: '回单付',
index: 'receiptPay'
index: 'BACK'
},
{
title: '总运费',

View File

@ -1,20 +1,11 @@
<!--
* @Author: your name
* @Date: 2021-12-15 13:17:42
* @LastEditTime: 2021-12-20 15:55:51
* @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\modal\vehicle\update-freight\update-freight.component.html
-->
<nz-spin *ngIf="!i" class="modal-spin"></nz-spin>
<sf #sf mode="edit" [schema]="schema" [ui]="ui" [formData]="i" button="none"></sf>
<sf #sf mode="edit" [schema]="schema" [ui]="ui" button="none"></sf>
<nz-divider></nz-divider>
<div>
<p>
<span style="font-weight: bolder"
>总运费:<span style="color: #dc112a">¥{{ totalPrice }}</span></span
>总运费:<span style="color: #dc112a">¥{{ data.totalFreight }}</span></span
>
(运输费:¥{{ tranPrice }},附加费:¥{{ otherPrice }}
(运输费:¥{{ data.freight }},附加费:¥{{ data.surcharge }}
</p>
<p>
<label nz-checkbox [(ngModel)]="aggreechecked">确认已阅读并知晓<a>《变更协议》</a></label>

View File

@ -2,12 +2,12 @@ import { preloaderFinished } from '@delon/theme';
/*
* @Author: your name
* @Date: 2021-12-14 14:03:07
* @LastEditTime: 2021-12-20 17:57:19
* @LastEditTime: 2021-12-21 14:56:26
* @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\modal\bulk\update-freight\update-freight.component.ts
*/
import { Component, OnInit, ViewChild } from '@angular/core';
import { Component, Input, OnInit, ViewChild } from '@angular/core';
import {
SFComponent,
SFCustomWidgetSchema,
@ -29,53 +29,33 @@ import { OrderManagementService } from '../../../services/order-management.servi
styleUrls: ['./update-freight.component.less']
})
export class VehicleUpdateFreightComponent implements OnInit {
record: any;
i: any;
@ViewChild('sf', { static: false }) sf!: SFComponent;
schema: SFSchema = {};
ui: SFUISchema = {};
totalPrice = 0;
tranPrice = 0;
otherPrice = 0;
aggreechecked = false;
@Input()
data: any;
constructor(private modal: NzModalRef, private msgSrv: NzMessageService, public service: OrderManagementService) {}
ngOnInit(): void {
console.log(this.record)
this.i = {
prePay: this.record?.mybidDetailInfo?.filter((data: any) => data.expenseCode === 'PRE')[0]?.price || 0,
toPay: this.record?.mybidDetailInfo?.filter((data: any) => data.expenseCode === 'RECE')[0]?.price || 0,
oilCardPay: this.record?.mybidDetailInfo?.filter((data: any) => data.expenseCode === 'OIL')[0]?.price || 0,
receiptPay: this.record?.mybidDetailInfo?.filter((data: any) => data.expenseCode === 'BACK')[0]?.price || 0,
prePayStatus: this.record?.mybidDetailInfo?.filter((data: any) => data.expenseCode === 'PRE')[0]?.paymentStatus,
toPayStatus: this.record?.mybidDetailInfo?.filter((data: any) => data.expenseCode === 'RECE')[0]?.paymentStatus,
oilCardPayStatus: this.record?.mybidDetailInfo?.filter((data: any) => data.expenseCode === 'OIL')[0]?.paymentStatus,
receiptPayStatus: this.record?.mybidDetailInfo?.filter((data: any) => data.expenseCode === 'BACK')[0]?.paymentStatus
};
this.record.list.forEach((element: any) => {
if(element.costCode === 'PRE') {
}
});
this.tranPrice = this.i.prePay + this.i.toPay + this.i.oilCardPay + this.i.receiptPay;
this.totalPrice = this.i.prePay + this.i.toPay + this.i.oilCardPay + this.i.receiptPay + this.otherPrice;
this.initSF();
this.service.request(this.service.$api_get_getFreightChangeWholeDetail, { id: this.record.id}).subscribe((res) => {
console.log(res)
console.log(this.i)
console.log(this.tranPrice)
})
this.initSF(this.data);
}
initSF() {
initSF(data: any) {
const info = {
prePay: data.list?.filter((item: any) => item.costCode === 'PRE')[0],
toPay: data.list?.filter((item: any) => item.costCode === 'RECE')[0],
receiptPay: data.list?.filter((item: any) => item.costCode === 'BACK')[0]
};
this.schema = {
properties: {
prePay: {
type: 'number',
title: '预付',
default: 0.0,
readOnly: this.i.prePayStatus === '2',
default: info.prePay?.price || 0,
readOnly: info.prePay?.paymentStatus === '2' || info.prePay?.paymentStatus === '4',
ui: {
prefix: '¥',
widgetWidth: 200,
@ -86,20 +66,8 @@ export class VehicleUpdateFreightComponent implements OnInit {
toPay: {
type: 'number',
title: '到付',
default: 0.0,
readOnly: this.i.toPayStatus === '2',
ui: {
prefix: '¥',
widgetWidth: 200,
precision: 2,
change: (val: any) => this.changeNumVal()
} as SFNumberWidgetSchema
},
oilCardPay: {
type: 'number',
title: '油卡',
default: 0.0,
readOnly: this.i.oilCardPayStatus === '1' || this.i.oilCardPayStatus === '3',
default: info.toPay?.price || 0,
readOnly: info.toPay?.paymentStatus === '2' || info.toPay?.paymentStatus === '4',
ui: {
prefix: '¥',
widgetWidth: 200,
@ -107,11 +75,23 @@ export class VehicleUpdateFreightComponent implements OnInit {
change: (val: any) => this.changeNumVal()
} as SFNumberWidgetSchema
},
// oilCardPay: {
// type: 'number',
// title: '油卡',
// default: 0.0,
// readOnly: this.i.oilCardPayStatus === '1' || this.i.oilCardPayStatus === '3',
// ui: {
// prefix: '¥',
// widgetWidth: 200,
// precision: 2,
// change: (val: any) => this.changeNumVal()
// } as SFNumberWidgetSchema
// },
receiptPay: {
type: 'number',
title: '回单付',
default: 0.0,
readOnly: this.i.receiptPayStatus === '2',
default: info.receiptPay?.price || 0,
readOnly: info.receiptPay?.paymentStatus === '2' || info.receiptPay?.paymentStatus === '4',
ui: {
prefix: '¥',
widgetWidth: 200,
@ -138,12 +118,11 @@ export class VehicleUpdateFreightComponent implements OnInit {
}
};
}
save(value: any): void {
console.log(this.record?.mybidDetailInfo)
console.log(this.sf.value)
const editItems = this.record?.mybidDetailInfo.filter((data: any) => data.receiptPayStatus !== '2');
const editItems = this.data.list?.filter((info: any) => info.toPay?.paymentStatus !== '2' && info.toPay?.paymentStatus !== '4');
editItems.forEach((item: any) => {
switch (item.expenseName) {
switch (item.costName) {
case '预付':
item.price = this.sf.value.prePay;
break;
@ -159,16 +138,15 @@ export class VehicleUpdateFreightComponent implements OnInit {
});
const params = {
id: this.record?.id,
billId: this.data.id,
dtos: editItems,
changeCause: this.sf.value.changeCause
};
console.log(params)
this.service.request(this.service.$api_get_insertFreightChangeWhole, params).subscribe((res: any) => {
if (res) {
this.modal.destroy();
} else {
this.service.msgSrv.error(res.msg);
this.service.msgSrv.success('变更运费成功');
}
});
}
@ -181,7 +159,7 @@ export class VehicleUpdateFreightComponent implements OnInit {
*
*/
changeNumVal() {
this.tranPrice = this.sf.value.prePay + this.sf.value.toPay + this.sf.value.oilCardPay + this.sf.value.receiptPay;
this.totalPrice = this.sf.value.prePay + this.sf.value.toPay + this.sf.value.oilCardPay + this.sf.value.receiptPay + this.otherPrice;
// this.tranPrice = this.sf.value.prePay + this.sf.value.toPay + this.sf.value.oilCardPay + this.sf.value.receiptPay;
// this.totalPrice = this.sf.value.prePay + this.sf.value.toPay + this.sf.value.oilCardPay + this.sf.value.receiptPay + this.otherPrice;
}
}