车辆对接
This commit is contained in:
@ -222,21 +222,20 @@
|
||||
</div>
|
||||
</div>
|
||||
</nz-card>
|
||||
|
||||
<nz-card>
|
||||
<div class="card-title">运费信息</div>
|
||||
<div nz-row>
|
||||
<div nz-col nzSpan="12">
|
||||
<sf #sf7 [schema]="schema7" [formData]="sf7data" [button]="'none'" [ui]="ui7">
|
||||
<ng-template sf-template="totalFee" let-i let-ui="ui" >
|
||||
<div>{{totalFees | currency: '¥'}}</div>
|
||||
</ng-template>
|
||||
<sf #sf7 [schema]="schema7" [button]="'none'" [ui]="ui7" [formData]="sf7data">
|
||||
<ng-template sf-template="subtotal" let-i let-ui="ui">¥{{i.value}}</ng-template>
|
||||
<ng-template sf-template="appendFee" let-i let-ui="ui">¥{{i.value}}(费率:{{currentRate | number: '0.2-4' }}%)</ng-template>
|
||||
<ng-template sf-template="total" let-i let-ui="ui">¥{{i.value}}</ng-template>
|
||||
<ng-template sf-template="paymentDays" let-i let-ui="ui">
|
||||
<div nz-row>
|
||||
<div class="align-center">
|
||||
<div nz-col nzSpan="16">
|
||||
<!-- <input nz-input [ngModel]="i.value" (ngModelChange)="i.setValue($event)" /> -->
|
||||
<nz-input-number [(ngModel)]="i.value" (ngModelChange)="i.setValue($event)" [nzMin]="1" [nzMax]="30" [nzStep]="1"></nz-input-number>
|
||||
<nz-input-number [ngModel]="i.value" [nzMin]="1" [nzMax]="30" [nzStep]="1"
|
||||
(ngModelChange)="i.setValue($event)" nzPlaceHolder="请输入1-30"></nz-input-number>
|
||||
</div>
|
||||
<div nz-col nzSpan="8">
|
||||
<span>天内支付运费</span>
|
||||
@ -250,7 +249,7 @@
|
||||
</nz-card>
|
||||
<nz-card>
|
||||
<div class="align-center">
|
||||
<button nz-button nzType="primary" (click)="chooseFamifiar()">指派熟车</button>
|
||||
<button nz-button nzType="primary" style="margin-left: 48px" (click)="submit()">司机抢单</button>
|
||||
<button nz-button nzType="primary" (click)="chooseFamifiar()">取消</button>
|
||||
<button nz-button nzType="primary" style="margin-left: 48px" (click)="submit()">提交修改</button>
|
||||
</div>
|
||||
</nz-card>
|
||||
|
||||
@ -40,6 +40,8 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
||||
totalFees: any; // 总数信息
|
||||
totalDistance = 0.0; //总里程
|
||||
totalTime = 0.0; //路程总时间
|
||||
currentRate = 0 //实时计算的费率
|
||||
|
||||
npp =false
|
||||
id = this.route.snapshot.params.id;
|
||||
// // 单位
|
||||
@ -369,7 +371,6 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
initSF6() {
|
||||
this.schema6 = {
|
||||
properties: {
|
||||
@ -392,6 +393,7 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
||||
ui: {
|
||||
widget: 'dict-select',
|
||||
params: { dictKey: 'receipt:type' },
|
||||
containsAllLable:false,
|
||||
placeholder: '请选择',
|
||||
errors: { required: '请选择' },
|
||||
visibleIf: {
|
||||
@ -399,56 +401,55 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
||||
}
|
||||
}
|
||||
},
|
||||
receiptUserId: {
|
||||
receiptAddressId: {
|
||||
type: 'string',
|
||||
title: '选择地址',
|
||||
ui: {
|
||||
widget: 'custom',
|
||||
placeholder: '请点击选择收回单地址',
|
||||
validator: val => (this.sf6?.value?.receiptType === '2' ? [{ keyword: 'required', message: '请点击选择收回单地址' }] : []),
|
||||
// validator: val => (this.sf6?.value?.receiptType === '2' ? [{ keyword: 'required', message: '请点击选择收回单地址' }] : []),
|
||||
visibleIf: {
|
||||
receiptType: value => value === 2
|
||||
receiptType: value => value === '2'
|
||||
}
|
||||
},
|
||||
default: '1212'
|
||||
default: ''
|
||||
},
|
||||
name4: {
|
||||
receiptUserName: {
|
||||
type: 'string',
|
||||
title: '联系人',
|
||||
ui: {
|
||||
visibleIf: {
|
||||
receiptType: value => value === 2
|
||||
receiptType: value => value === '2'
|
||||
}
|
||||
},
|
||||
readOnly: true
|
||||
},
|
||||
name5: {
|
||||
phon: {
|
||||
type: 'string',
|
||||
title: '联系电话',
|
||||
ui: {
|
||||
visibleIf: {
|
||||
receiptType: value => value === 2
|
||||
receiptType: value => value === '2'
|
||||
}
|
||||
},
|
||||
readOnly: true
|
||||
},
|
||||
name6: {
|
||||
area: {
|
||||
type: 'string',
|
||||
title: '所在地区',
|
||||
ui: {
|
||||
visibleIf: {
|
||||
receiptType: value => value === 2
|
||||
receiptType: value => value === '2'
|
||||
}
|
||||
},
|
||||
readOnly: true
|
||||
},
|
||||
receiptAddress: {
|
||||
address: {
|
||||
type: 'string',
|
||||
title: '详细地址',
|
||||
maxLength: 20,
|
||||
ui: {
|
||||
visibleIf: {
|
||||
receiptType: value => value === 2
|
||||
receiptType: value => value === '2'
|
||||
}
|
||||
},
|
||||
readOnly: true
|
||||
@ -464,7 +465,7 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
||||
} as SFTextareaWidgetSchema
|
||||
}
|
||||
},
|
||||
required: ['stateReceipt', 'receiptType']
|
||||
required: ['stateReceipt', 'receiptType','receiptAddressId']
|
||||
};
|
||||
this.ui6 = {
|
||||
'*': {
|
||||
@ -480,50 +481,43 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
||||
initSF7() {
|
||||
this.schema7 = {
|
||||
properties: {
|
||||
prePay: { type: 'number', title: '预付', default: 0, ui: { prefix: '¥', change: ()=> {
|
||||
this.changeValue();
|
||||
},
|
||||
} as SFNumberWidgetSchema },
|
||||
toPay: { type: 'number', title: '到付', default: 0, ui: { prefix: '¥',change: ()=> {
|
||||
this.changeValue();
|
||||
},
|
||||
} as SFNumberWidgetSchema },
|
||||
oilCardPay: { type: 'number', title: '油卡', default: 0, ui: { prefix: '¥',change: ()=> {this.changeValue();} ,
|
||||
} as SFNumberWidgetSchema },
|
||||
receiptPay: { type: 'number', title: '回单付', default: 0, ui: { prefix: '¥',change: ()=> {
|
||||
this.changeValue();},
|
||||
} as SFNumberWidgetSchema },
|
||||
subtotal: {
|
||||
type: 'string',
|
||||
title: '小计',
|
||||
prePay: {
|
||||
type: 'number',
|
||||
title: '预付',
|
||||
default: 0,
|
||||
ui: {
|
||||
widget: 'custom',
|
||||
placeholder: '请输入',
|
||||
},
|
||||
prefix: '¥',
|
||||
change: args => this.payChange()
|
||||
} as SFNumberWidgetSchema
|
||||
},
|
||||
appendFee: {
|
||||
type: 'string',
|
||||
title: '附加费',
|
||||
ui: {
|
||||
widget: 'custom',
|
||||
placeholder: '请输入',
|
||||
},
|
||||
|
||||
toPay: {
|
||||
type: 'number',
|
||||
title: '到付',
|
||||
default: 0,
|
||||
ui: { prefix: '¥', change: args => this.payChange() } as SFNumberWidgetSchema
|
||||
},
|
||||
totalFee: {
|
||||
type: 'string',
|
||||
title: '总费用',
|
||||
ui: {
|
||||
widget: 'custom',
|
||||
placeholder: '请输入'
|
||||
}
|
||||
oilCardPay: {
|
||||
type: 'number',
|
||||
title: '油卡',
|
||||
default: 0,
|
||||
ui: { prefix: '¥', change: args => this.payChange() } as SFNumberWidgetSchema
|
||||
},
|
||||
receiptPay: {
|
||||
type: 'number',
|
||||
title: '回单付',
|
||||
default: 0,
|
||||
ui: { prefix: '¥', change: args => this.payChange() } as SFNumberWidgetSchema
|
||||
},
|
||||
subtotal: { type: 'number', title: '小计',default: 0, ui: {widget: 'custom' } as SFNumberWidgetSchema },
|
||||
appendFee: { type: 'number', title: '附加费', default: 0, ui: {widget: 'custom' } as SFNumberWidgetSchema },
|
||||
total: { type: 'number', title: '总费用', default: 0, ui: { widget: 'custom' } as SFNumberWidgetSchema },
|
||||
paymentDays: {
|
||||
type: 'string',
|
||||
title: '到货后',
|
||||
ui: {
|
||||
widget: 'custom',
|
||||
placeholder: '请输入',
|
||||
errors: { required: '请输入付款承诺天数' }
|
||||
}
|
||||
}
|
||||
},
|
||||
@ -536,6 +530,28 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
||||
}
|
||||
};
|
||||
}
|
||||
payChange() {
|
||||
const subtotal = (this.sf7.value.prePay + this.sf7.value.toPay + this.sf7.value.oilCardPay + this.sf7.value.receiptPay) || 0;
|
||||
const oilCardPay = this.sf7.value.oilCardPay || 0;
|
||||
this.service.request(this.service.$api_getCalculatedSurcharge+`?totalFreight=${subtotal}&fuelCardAmount=${oilCardPay}`).subscribe(res => {
|
||||
if (res) {
|
||||
this.sf7.setValue('/appendFee', res.surcharge);
|
||||
this.sf7.setValue('/subtotal', subtotal);
|
||||
this.sf7.setValue('/total', subtotal+res.surcharge);
|
||||
this.service.request(this.service.$api_getcalculatedServiceRate+`?invoiceAmount=${subtotal+res.surcharge}&totalFreight=${subtotal}`).subscribe(res => {
|
||||
if (res) {
|
||||
this.currentRate = res.rate;
|
||||
} else {
|
||||
this.service.msgSrv.error(res.msg);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.service.msgSrv.error(res.msg);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
addStartInfo(event: any) {
|
||||
if (this.startInfo.length < 5) {
|
||||
|
||||
@ -1,3 +1,11 @@
|
||||
<!--
|
||||
* @Author: your name
|
||||
* @Date: 2021-12-14 20:39:34
|
||||
* @LastEditTime: 2021-12-28 20:49:04
|
||||
* @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\onecar-publish\publish-success\publish-success.component.html
|
||||
-->
|
||||
<div style="margin-top: 64px">
|
||||
<nz-result nzStatus="success" nzTitle="下单成功!">
|
||||
<div nz-result-extra>
|
||||
|
||||
@ -1,11 +1,3 @@
|
||||
/*
|
||||
* @Author: your name
|
||||
* @Date: 2021-12-14 20:39:34
|
||||
* @LastEditTime: 2021-12-14 20:43:18
|
||||
* @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\onecar-publish\publish-success\publish-success.component.ts
|
||||
*/
|
||||
import { Component } from '@angular/core';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { NzMessageService } from 'ng-zorro-antd/message';
|
||||
@ -17,6 +9,7 @@ import { NzMessageService } from 'ng-zorro-antd/message';
|
||||
})
|
||||
export class PublishSuccessComponent {
|
||||
type = 'onecar';
|
||||
resourceObj: any = null;
|
||||
constructor(private route: ActivatedRoute, private router: Router, public msg: NzMessageService) {
|
||||
this.type = route.snapshot.queryParams.type || 'onecar';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user