Merge branch 'develop' of https://gitlab.eascs.com/tms-ui/tms-obc-web into develop
This commit is contained in:
@ -126,7 +126,6 @@
|
|||||||
<sf #sf4 [schema]="schema4" [formData]="sf4data" [button]="'none'" [ui]="ui4">
|
<sf #sf4 [schema]="schema4" [formData]="sf4data" [button]="'none'" [ui]="ui4">
|
||||||
<ng-template sf-template="freightPrice" let-i let-ui="ui">
|
<ng-template sf-template="freightPrice" let-i let-ui="ui">
|
||||||
<nz-input-group [nzAddOnAfter]="addOnAfterTemplate">
|
<nz-input-group [nzAddOnAfter]="addOnAfterTemplate">
|
||||||
<!-- <input nz-input [ngModel]="i.value" (ngModelChange)="i.setValue($event)" placeholder="请输入" /> -->
|
|
||||||
<nz-input-number [ngModel]="i.value" (ngModelChange)="i.setValue($event)" [nzMin]="1" style="width: 100%"></nz-input-number>
|
<nz-input-number [ngModel]="i.value" (ngModelChange)="i.setValue($event)" [nzMin]="1" style="width: 100%"></nz-input-number>
|
||||||
</nz-input-group>
|
</nz-input-group>
|
||||||
<ng-template #addOnAfterTemplate>
|
<ng-template #addOnAfterTemplate>
|
||||||
|
|||||||
@ -46,6 +46,13 @@ export class SupplyManagementBulkPublishComponent implements OnInit {
|
|||||||
startInfo: any = [];
|
startInfo: any = [];
|
||||||
endInfo: any = [];
|
endInfo: any = [];
|
||||||
PageStatus = '';
|
PageStatus = '';
|
||||||
|
limitValues = {
|
||||||
|
maxMonth: 99,
|
||||||
|
maxWeight: 99999,
|
||||||
|
maxVolume: 99999,
|
||||||
|
maxTrainNumber: 99999,
|
||||||
|
maxFreight: 9999999
|
||||||
|
}
|
||||||
constructor(
|
constructor(
|
||||||
private http: _HttpClient,
|
private http: _HttpClient,
|
||||||
fb: FormBuilder,
|
fb: FormBuilder,
|
||||||
@ -96,6 +103,7 @@ export class SupplyManagementBulkPublishComponent implements OnInit {
|
|||||||
this.initSF4();
|
this.initSF4();
|
||||||
this.initSF6();
|
this.initSF6();
|
||||||
this.initdata();
|
this.initdata();
|
||||||
|
this.getLimitvalue();
|
||||||
}
|
}
|
||||||
initSF1() {
|
initSF1() {
|
||||||
this.schema1 = {
|
this.schema1 = {
|
||||||
@ -150,19 +158,19 @@ export class SupplyManagementBulkPublishComponent implements OnInit {
|
|||||||
ui: {
|
ui: {
|
||||||
placeholder: '请输入',
|
placeholder: '请输入',
|
||||||
format: 'yyyy-MM-dd HH:mm:ss',
|
format: 'yyyy-MM-dd HH:mm:ss',
|
||||||
disabledDate: (current: Date): boolean => {
|
validator: (val) => {
|
||||||
let d = new Date();
|
let d = new Date();
|
||||||
let year = d.getFullYear();
|
let year = d.getFullYear();
|
||||||
let month = d.getMonth();
|
let month = d.getMonth();
|
||||||
let date = d.getDate();
|
let date = d.getDate();
|
||||||
let mydate = new Date(year, month + 3, date);
|
let mydate = new Date(year, month + this.limitValues.maxMonth, date);
|
||||||
return differenceInCalendarDays(current, new Date()) < 0 || differenceInCalendarDays(current, mydate) > 0;
|
if (new Date(val) < new Date()) {
|
||||||
},
|
return [{ keyword: 'validTime', message: '有效期时间需大于当前时间' }];
|
||||||
validator: (val) => {
|
}
|
||||||
if( new Date(val) <new Date()){
|
if (new Date(val) > mydate) {
|
||||||
return [{ keyword: 'validTime', message: '有效期时间需大于当前时间' }];
|
return [{ keyword: 'validTime2', message: `有效期最长为${this.limitValues.maxMonth}个月` }];
|
||||||
}
|
}
|
||||||
return [];
|
return [];
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -649,7 +657,6 @@ export class SupplyManagementBulkPublishComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
// 提交前确认,委托运输协议弹窗
|
// 提交前确认,委托运输协议弹窗
|
||||||
submitConfirm(submitType?: any) {
|
submitConfirm(submitType?: any) {
|
||||||
// 校验规则
|
|
||||||
Object.keys(this.validateForm1.controls).forEach(key => {
|
Object.keys(this.validateForm1.controls).forEach(key => {
|
||||||
this.validateForm1.controls[key].markAsDirty();
|
this.validateForm1.controls[key].markAsDirty();
|
||||||
this.validateForm1.controls[key].updateValueAndValidity();
|
this.validateForm1.controls[key].updateValueAndValidity();
|
||||||
@ -657,11 +664,20 @@ export class SupplyManagementBulkPublishComponent implements OnInit {
|
|||||||
this.sf1.validator({ emitError: true });
|
this.sf1.validator({ emitError: true });
|
||||||
this.sf3.validator({ emitError: true });
|
this.sf3.validator({ emitError: true });
|
||||||
this.sf4.validator({ emitError: true });
|
this.sf4.validator({ emitError: true });
|
||||||
this.sf7.validator({ emitError: true });
|
if (this.validateForm1.invalid || !this.sf1.valid || !this.sf3.valid || !this.sf4.valid ) {
|
||||||
if (this.validateForm1.invalid || !this.sf3.valid || !this.sf1.valid || !this.sf4.valid || !this.sf7.valid) {
|
|
||||||
this.service.msgSrv.warning('请完善必填项!');
|
this.service.msgSrv.warning('请完善必填项!');
|
||||||
return;
|
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({
|
const modalRef = this.modalService.create({
|
||||||
nzTitle: '运输协议',
|
nzTitle: '运输协议',
|
||||||
@ -677,16 +693,21 @@ export class SupplyManagementBulkPublishComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
// 确认提交
|
// 确认提交
|
||||||
submit(submitType?: string): void {
|
submit(submitType?: string): void {
|
||||||
if (typeof this.validateForm1.value.modifyTime !== 'string') {
|
// //装卸货信息
|
||||||
var c = new Date(this.validateForm1.value.modifyTime);
|
const LoadingList = this.startInfo.concat(this.endInfo);
|
||||||
this.validateForm1.value.modifyTime =
|
|
||||||
c.getFullYear() + '-' + (c.getMonth() + 1) + '-' + c.getDate() + ' ' + c.getHours() + ':' + c.getMinutes() + ':' + c.getSeconds();
|
// 货物信息
|
||||||
}
|
const sf3Values = { ...this.sf3.value };
|
||||||
if (typeof this.validateForm1.value.createTime !== 'string') {
|
if (sf3Values.goodsTypeName === '其它') {
|
||||||
var c = new Date(this.validateForm1.value.createTime);
|
sf3Values.goodsName = sf3Values.goodsName1;
|
||||||
this.validateForm1.value.createTime =
|
delete sf3Values.goodsName1;
|
||||||
c.getFullYear() + '-' + (c.getMonth() + 1) + '-' + c.getDate() + ' ' + c.getHours() + ':' + c.getMinutes() + ':' + c.getSeconds();
|
}
|
||||||
}
|
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 = {
|
const params: any = {
|
||||||
...this.sf1.value,
|
...this.sf1.value,
|
||||||
@ -1057,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)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -41,6 +41,13 @@ export class SupplyManagementBulkReleasePublishComponent implements OnInit {
|
|||||||
totalFees: any; // 总数信息
|
totalFees: any; // 总数信息
|
||||||
id = '';
|
id = '';
|
||||||
type = 'add';
|
type = 'add';
|
||||||
|
limitValues = {
|
||||||
|
maxMonth: 99,
|
||||||
|
maxWeight: 99999,
|
||||||
|
maxVolume: 99999,
|
||||||
|
maxTrainNumber: 99999,
|
||||||
|
maxFreight: 9999999
|
||||||
|
}
|
||||||
// // 单位
|
// // 单位
|
||||||
startInfo: any[] = [];
|
startInfo: any[] = [];
|
||||||
endInfo: any[] = [];
|
endInfo: any[] = [];
|
||||||
@ -80,6 +87,7 @@ export class SupplyManagementBulkReleasePublishComponent implements OnInit {
|
|||||||
this.initSF3();
|
this.initSF3();
|
||||||
this.initSF4();
|
this.initSF4();
|
||||||
this.initSF6();
|
this.initSF6();
|
||||||
|
this.getLimitvalue();
|
||||||
this.startInfo = [
|
this.startInfo = [
|
||||||
{
|
{
|
||||||
detailedAddress: '',
|
detailedAddress: '',
|
||||||
@ -173,19 +181,19 @@ export class SupplyManagementBulkReleasePublishComponent implements OnInit {
|
|||||||
ui: {
|
ui: {
|
||||||
placeholder: '请输入',
|
placeholder: '请输入',
|
||||||
format: 'yyyy-MM-dd HH:mm:ss',
|
format: 'yyyy-MM-dd HH:mm:ss',
|
||||||
disabledDate: (current: Date): boolean => {
|
validator: (val) => {
|
||||||
let d = new Date();
|
let d = new Date();
|
||||||
let year = d.getFullYear();
|
let year = d.getFullYear();
|
||||||
let month = d.getMonth();
|
let month = d.getMonth();
|
||||||
let date = d.getDate();
|
let date = d.getDate();
|
||||||
let mydate = new Date(year, month + 3, date);
|
let mydate = new Date(year, month + this.limitValues.maxMonth, date);
|
||||||
return differenceInCalendarDays(current, new Date()) < 0 || differenceInCalendarDays(current, mydate) > 0;
|
if (new Date(val) < new Date()) {
|
||||||
},
|
return [{ keyword: 'validTime', message: '有效期时间需大于当前时间' }];
|
||||||
validator: (val) => {
|
}
|
||||||
if( new Date(val) <new Date()){
|
if (new Date(val) > mydate) {
|
||||||
return [{ keyword: 'validTime', message: '有效期时间需大于当前时间' }];
|
return [{ keyword: 'validTime2', message: `有效期最长为${this.limitValues.maxMonth}个月` }];
|
||||||
}
|
}
|
||||||
return [];
|
return [];
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -588,7 +596,16 @@ export class SupplyManagementBulkReleasePublishComponent implements OnInit {
|
|||||||
this.service.msgSrv.warning('请完善必填项!');
|
this.service.msgSrv.warning('请完善必填项!');
|
||||||
return;
|
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({
|
const modalRef = this.modalService.create({
|
||||||
nzTitle: '运输协议',
|
nzTitle: '运输协议',
|
||||||
nzContent: TranAgreementComponent,
|
nzContent: TranAgreementComponent,
|
||||||
@ -605,12 +622,20 @@ export class SupplyManagementBulkReleasePublishComponent implements OnInit {
|
|||||||
submit(submitType: string): void {
|
submit(submitType: string): void {
|
||||||
// //装卸货信息
|
// //装卸货信息
|
||||||
const LoadingList = this.startInfo.concat(this.endInfo);
|
const LoadingList = this.startInfo.concat(this.endInfo);
|
||||||
|
|
||||||
// 货物信息
|
// 货物信息
|
||||||
const sf3Values = { ...this.sf3.value };
|
const sf3Values = { ...this.sf3.value };
|
||||||
if (sf3Values.goodsTypeName === '其它') {
|
if (sf3Values.goodsTypeName === '其它') {
|
||||||
sf3Values.goodsName = sf3Values.goodsName1;
|
sf3Values.goodsName = sf3Values.goodsName1;
|
||||||
delete 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 = [
|
const goodsInfoList = [
|
||||||
{
|
{
|
||||||
...sf3Values,
|
...sf3Values,
|
||||||
@ -822,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)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -897,11 +897,6 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
|||||||
this.sf5.validator({ emitError: true });
|
this.sf5.validator({ emitError: true });
|
||||||
this.sf6.validator({ emitError: true });
|
this.sf6.validator({ emitError: true });
|
||||||
this.sf7.validator({ emitError: true });
|
this.sf7.validator({ emitError: true });
|
||||||
console.log(this.validateForm1.invalid)
|
|
||||||
console.log(this.sf4.valid)
|
|
||||||
console.log(this.sf5.valid)
|
|
||||||
console.log(this.sf6.valid)
|
|
||||||
console.log(this.sf7.valid)
|
|
||||||
if (this.validateForm1.invalid || !this.sf3.valid || !this.sf4.valid || !this.sf5.valid || !this.sf6.valid || !this.sf7.valid) {
|
if (this.validateForm1.invalid || !this.sf3.valid || !this.sf4.valid || !this.sf5.valid || !this.sf6.valid || !this.sf7.valid) {
|
||||||
this.service.msgSrv.warning('请完善必填项!');
|
this.service.msgSrv.warning('请完善必填项!');
|
||||||
return;
|
return;
|
||||||
|
|||||||
@ -851,65 +851,137 @@ export class SupplyManagementReleasePublishComponent implements OnInit {
|
|||||||
this.validateForm1.controls[key].markAsDirty();
|
this.validateForm1.controls[key].markAsDirty();
|
||||||
this.validateForm1.controls[key].updateValueAndValidity();
|
this.validateForm1.controls[key].updateValueAndValidity();
|
||||||
});
|
});
|
||||||
this.sf1.validator({ emitError: true });
|
|
||||||
this.sf3.validator({ emitError: true });
|
this.sf3.validator({ emitError: true });
|
||||||
this.sf4.validator({ emitError: true });
|
this.sf4.validator({ emitError: true });
|
||||||
|
this.sf5.validator({ emitError: true });
|
||||||
this.sf6.validator({ emitError: true });
|
this.sf6.validator({ emitError: true });
|
||||||
this.sf7.validator({ emitError: true });
|
this.sf7.validator({ emitError: true });
|
||||||
if (this.validateForm1.invalid || !this.sf1.valid || !this.sf3.valid || !this.sf4.valid || !this.sf6.valid || !this.sf7.valid) {
|
if (this.validateForm1.invalid || !this.sf3.valid || !this.sf4.valid || !this.sf5.valid || !this.sf6.valid || !this.sf7.valid) {
|
||||||
this.service.msgSrv.warning('请完善必填项!');
|
this.service.msgSrv.warning('请完善必填项!');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (this.validateForm1.value.loadingTime < new Date()) {
|
||||||
|
this.service.msgSrv.warning('装货时间必须大于当前时间!');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (this.validateForm1.value.loadingTime > this.validateForm1.value.unloadingTime) {
|
||||||
|
this.service.msgSrv.warning('装货时间不能大于卸货时间!');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (this.sf7.value.total <= 0) {
|
||||||
|
this.service.msgSrv.warning('总费用不能为0!');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const num = (Number(this.validateForm1.value.unloadingTime) - Number(this.validateForm1.value.loadingTime))/(24*60*60*1000);
|
||||||
|
if (num > this.limitValues.maxDays) {
|
||||||
|
this.service.msgSrv.error(`当前计划装卸货时间间隔已超出限定值【${this.limitValues.maxDays}天】`);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (
|
||||||
|
this.sf4.value.weight > this.limitValues.maxWeight ||
|
||||||
|
this.sf4.value.volume > this.limitValues.maxVolume ||
|
||||||
|
this.sf4.value.number > this.limitValues.maxPiece
|
||||||
|
) {
|
||||||
|
this.service.msgSrv.error(
|
||||||
|
`当前货物核载信息已超出限定值【${this.limitValues.maxWeight}吨、${this.limitValues.maxVolume}方、${this.limitValues.maxPiece}件】`
|
||||||
|
);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const modalRef = this.modalService.create({
|
const getFreightParms = { carLengthKeys: this.sf4.value.carLength, km: this.totalDistance };
|
||||||
nzTitle: '运输协议',
|
this.service.request(this.service.$api_getFreight, getFreightParms).subscribe(res => {
|
||||||
nzContent: TranAgreementComponent,
|
if (this.sf7.value.subtotal > res.maxPrice) {
|
||||||
nzWidth: 900,
|
this.service.msgSrv.error(`运费过高,请调整录入`);
|
||||||
nzFooter: null
|
return;
|
||||||
});
|
} else if (this.sf7.value.subtotal > res.ewPrice) {
|
||||||
modalRef.afterClose.subscribe(result => {
|
this.modalService.confirm({
|
||||||
if (result) {
|
nzTitle: '',
|
||||||
this.submit(submitType);
|
nzContent: `您的录入的运费过高,可能会影响支付,请仔细确认`,
|
||||||
|
nzOkText: '继续',
|
||||||
|
nzCancelText: '取消',
|
||||||
|
nzOnOk: () => {
|
||||||
|
this.agreementConfirm(submitType);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
this.agreementConfirm(submitType);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
// 提交
|
// 提交前协议弹窗
|
||||||
submit(submitType: string): void {
|
agreementConfirm(submitType?: string) {
|
||||||
//装卸货信息
|
//装卸货信息
|
||||||
const LoadingList = this.startInfo.concat(this.endInfo);
|
const LoadingList = this.startInfo.concat(this.endInfo);
|
||||||
// 货物信息
|
|
||||||
const goodsInfoList = [
|
// 货物信息
|
||||||
{
|
const sf3Values = { ...this.sf3.value };
|
||||||
...this.sf4.value,
|
if (sf3Values.goodsTypeName === '其它') {
|
||||||
...this.sf3.value,
|
sf3Values.goodsName = sf3Values.goodsName1;
|
||||||
carModel: this.sf4.value.carModel.join(','),
|
delete sf3Values.goodsName1;
|
||||||
carLength: this.sf4.value.carLength.join(',')
|
}
|
||||||
}
|
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 goodsInfoVOList = [
|
||||||
|
{
|
||||||
|
...sf3Values,
|
||||||
|
...this.sf4.value,
|
||||||
|
carModel: this.sf4.value.carModel.join(','),
|
||||||
|
carLength: this.sf4.value.carLength.join(',')
|
||||||
|
}
|
||||||
|
];
|
||||||
// 运费信息
|
// 运费信息
|
||||||
const expenseList = [
|
const expenseList = [
|
||||||
{ expenseCode: 'PRE', expenseName: '预付', price: this.sf7.value.prePay, id: this.sf7data?.prePayId ? this.sf7data?.prePayId : '' },
|
{ expenseCode: 'PRE', expenseName: '预付', price: this.sf7.value.prePay || 0, id: this.sf7data?.prePayId || '' },
|
||||||
{ expenseCode: 'RECE', expenseName: '到付', price: this.sf7.value.toPay, id: this.sf7data?.toPayId ? this.sf7data?.toPayId : '' },
|
{ expenseCode: 'RECE', expenseName: '到付', price: this.sf7.value.toPay || 0, id: this.sf7data?.toPayId || '' },
|
||||||
{
|
{ expenseCode: 'BACK', expenseName: '回单付', price: this.sf7.value.receiptPay || 0, id: this.sf7data?.receiptPayId || '' }
|
||||||
expenseCode: 'BACK',
|
|
||||||
expenseName: '回单付',
|
|
||||||
price: this.sf7.value.receiptPay,
|
|
||||||
id: this.sf7data?.receiptPayId ? this.sf7data?.receiptPayId : ''
|
|
||||||
}
|
|
||||||
];
|
];
|
||||||
const params = {
|
console.log(this.sf55?.value)
|
||||||
id: '',
|
// const params = {
|
||||||
...this.sf1.value,
|
// id: '',
|
||||||
unLoadingPlaceDTOList: LoadingList,
|
// ...this.sf1.value,
|
||||||
unloadingTime: format(this.validateForm1.value.unloadingTime, 'yyyy-MM-dd HH:mm:ss'),
|
// unLoadingPlaceDTOList: LoadingList,
|
||||||
loadingTime: format(this.validateForm1.value.loadingTime, 'yyyy-MM-dd HH:mm:ss'),
|
// unloadingTime: format(this.validateForm1.value?.unloadingTime, 'yyyy-MM-dd HH:mm:ss'),
|
||||||
goodsInfoDTOList: goodsInfoList,
|
// loadingTime: format(this.validateForm1.value?.loadingTime, 'yyyy-MM-dd HH:mm:ss'),
|
||||||
...this.sf5.value,
|
// goodsInfoDTOList: goodsInfoList,
|
||||||
...this.sf6.value,
|
// ...this.sf5.value,
|
||||||
expenseDTOList: expenseList,
|
// ...this.sf6.value,
|
||||||
paymentDays: this.sf7.value.paymentDays,
|
// expenseDTOList: expenseList,
|
||||||
insuranceType:this.sf55.value.insuranceType,
|
// paymentDays: this.sf7.value?.paymentDays,
|
||||||
};
|
// insuranceType:this.sf55?.value?.insuranceType,
|
||||||
|
// };
|
||||||
|
const params = {
|
||||||
|
id: '',
|
||||||
|
...this.sf1.value,
|
||||||
|
unLoadingPlaceDTOList: LoadingList,
|
||||||
|
unloadingTime: format(this.validateForm1.value.unloadingTime, 'yyyy-MM-dd HH:mm:ss'),
|
||||||
|
loadingTime: format(this.validateForm1.value.loadingTime, 'yyyy-MM-dd HH:mm:ss'),
|
||||||
|
goodsInfoDTOList: goodsInfoVOList,
|
||||||
|
...this.sf5.value,
|
||||||
|
...this.sf6.value,
|
||||||
|
expenseDTOList: expenseList,
|
||||||
|
paymentDays: this.sf7.value.paymentDays
|
||||||
|
};
|
||||||
|
console.log(params)
|
||||||
|
const modalRef = this.modalService.create({
|
||||||
|
nzTitle: '运输协议',
|
||||||
|
nzContent: TranAgreementComponent,
|
||||||
|
nzWidth: 900,
|
||||||
|
nzFooter: null,
|
||||||
|
nzComponentParams: {Object: params,}
|
||||||
|
});
|
||||||
|
modalRef.afterClose.subscribe(result => {
|
||||||
|
if (result) {
|
||||||
|
this.submit(submitType, params);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
// 提交
|
||||||
|
submit(submitType?: string,params?: any): void {
|
||||||
|
|
||||||
|
|
||||||
let reqUrl = this.service.$api_consignWhole;
|
let reqUrl = this.service.$api_consignWhole;
|
||||||
if (submitType) {
|
if (submitType) {
|
||||||
@ -1069,65 +1141,44 @@ export class SupplyManagementReleasePublishComponent implements OnInit {
|
|||||||
goBack() {
|
goBack() {
|
||||||
window.history.go(-1);
|
window.history.go(-1);
|
||||||
}
|
}
|
||||||
// 装卸货地址互换
|
// 装卸货地址互换
|
||||||
swapAddress(){
|
swapAddress() {
|
||||||
this.startInfo.forEach((element:any, index:any) => {
|
this.startInfo.forEach((element: any, index: any) => {
|
||||||
this.validateForm1.removeControl(`loadAddress${index}`);
|
this.validateForm1.removeControl(`loadAddress${index}`);
|
||||||
this.validateForm1.removeControl(`loadName${index}`);
|
this.validateForm1.removeControl(`loadName${index}`);
|
||||||
this.validateForm1.removeControl(`loadPhone${index}`);
|
this.validateForm1.removeControl(`loadPhone${index}`);
|
||||||
});
|
});
|
||||||
this.endInfo.forEach((element:any, index:any) => {
|
this.endInfo.forEach((element: any, index: any) => {
|
||||||
this.validateForm1.removeControl(`unloadAddress${index}`);
|
this.validateForm1.removeControl(`unloadAddress${index}`);
|
||||||
this.validateForm1.removeControl(`unloadName${index}`);
|
this.validateForm1.removeControl(`unloadName${index}`);
|
||||||
this.validateForm1.removeControl(`unloadPhone${index}`);
|
this.validateForm1.removeControl(`unloadPhone${index}`);
|
||||||
});
|
});
|
||||||
|
|
||||||
let item = this.startInfo;
|
let item = this.startInfo;
|
||||||
this.startInfo = this.endInfo;
|
this.startInfo = this.endInfo;
|
||||||
this.endInfo = item;
|
this.endInfo = item;
|
||||||
|
|
||||||
this.startInfo.forEach((element:any,index:any) => {
|
this.startInfo.forEach((element: any, index: any) => {
|
||||||
element.type = '1';
|
element.type = '1';
|
||||||
this.validateForm1.addControl(`loadAddress${index}`, new FormControl(null, Validators.required));
|
this.validateForm1.addControl(`loadAddress${index}`, new FormControl(null, Validators.required));
|
||||||
this.validateForm1.addControl(`loadName${index}`, new FormControl(null, Validators.required));
|
this.validateForm1.addControl(`loadName${index}`, new FormControl(null, Validators.required));
|
||||||
this.validateForm1.addControl(`loadPhone${index}`, new FormControl(null, [Validators.required, Validators.pattern('^[0-9]*$')]));
|
this.validateForm1.addControl(`loadPhone${index}`, new FormControl(null, [Validators.required, Validators.pattern('^[0-9]*$')]));
|
||||||
});
|
});
|
||||||
this.endInfo.forEach((element:any,index:any) => {
|
this.endInfo.forEach((element: any, index: any) => {
|
||||||
element.type = '2';
|
element.type = '2';
|
||||||
this.validateForm1.addControl(`unloadAddress${index}`, new FormControl(null, Validators.required));
|
this.validateForm1.addControl(`unloadAddress${index}`, new FormControl(null, Validators.required));
|
||||||
this.validateForm1.addControl(`unloadName${index}`, new FormControl(null, Validators.required));
|
this.validateForm1.addControl(`unloadName${index}`, new FormControl(null, Validators.required));
|
||||||
this.validateForm1.addControl(`unloadPhone${index}`, new FormControl(null, [Validators.required, Validators.pattern('^[0-9]*$')]));
|
this.validateForm1.addControl(`unloadPhone${index}`, new FormControl(null, [Validators.required, Validators.pattern('^[0-9]*$')]));
|
||||||
});
|
});
|
||||||
|
// 计算里程,时间
|
||||||
// 计算里程,时间
|
if (this.startInfo[0]?.area && this.endInfo[0]?.area) {
|
||||||
if (this.startInfo[0]?.area && this.endInfo[0]?.area) {
|
|
||||||
this.amapService.drivingCompute([...this.startInfo], [...this.endInfo]).subscribe(res => {
|
this.amapService.drivingCompute([...this.startInfo], [...this.endInfo]).subscribe(res => {
|
||||||
this.totalDistance = res.distance;
|
this.totalDistance = res.distance;
|
||||||
this.totalTime = res.time;
|
this.totalTime = res.time;
|
||||||
|
this.getInsurersPrice(); //计算保费金额
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
goodsValuesChange(value: any) {
|
|
||||||
console.log(value);
|
|
||||||
console.log(this.totalDistance);
|
|
||||||
|
|
||||||
if(value >= 50000 && this.totalDistance > 0){
|
|
||||||
const params = {
|
|
||||||
goodsValue: value,
|
|
||||||
insuranceType: this.sf55.value.insuranceType,
|
|
||||||
km: this.totalDistance
|
|
||||||
};
|
|
||||||
this.service
|
|
||||||
.request(this.service.$api_getWholeInsuranceInfo, params)
|
|
||||||
.subscribe(res => {
|
|
||||||
if (res) {
|
|
||||||
this.sf5.setValue('/insurancePremium',res.insurancePremium);
|
|
||||||
}else{
|
|
||||||
this.sf5.setValue('/insurancePremium',null);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// 计算保价费金额
|
// 计算保价费金额
|
||||||
getInsurersPrice(insuranceType = this.sf5.value.insuranceType) {
|
getInsurersPrice(insuranceType = this.sf5.value.insuranceType) {
|
||||||
if (this.sf5.value.goodsValue >= 50000 && this.totalDistance > 0) {
|
if (this.sf5.value.goodsValue >= 50000 && this.totalDistance > 0) {
|
||||||
|
|||||||
@ -146,7 +146,13 @@ export class SupplyManagementService extends BaseService {
|
|||||||
intervalDays:'sys.config.goods.wholeUnloadingIntervalDays', //计划装、卸货时间间隔
|
intervalDays:'sys.config.goods.wholeUnloadingIntervalDays', //计划装、卸货时间间隔
|
||||||
maxTimes:'sys.config.goods.wholeLoadingMaxTimes', //整车-多装多卸地点上限
|
maxTimes:'sys.config.goods.wholeLoadingMaxTimes', //整车-多装多卸地点上限
|
||||||
}
|
}
|
||||||
|
public limitKeys2 = {
|
||||||
|
month:'sys.config.goods.bulkEndMaxMonth', //大宗-截止时间上限
|
||||||
|
weight:'sys.config.goods.bulkMaxWeight', //大宗-重量上限
|
||||||
|
volume:'sys.config.goods.bulkMaxVolume', //大宗-体积上限
|
||||||
|
trainNumber:'sys.config.goods.bulkMaxTrainNumber', //大宗-车次上限
|
||||||
|
freight:'sys.config.goods.bulkMaxUnitFreight', //大宗-运费单价上限
|
||||||
|
}
|
||||||
// 根据ItemKey获取项值
|
// 根据ItemKey获取项值
|
||||||
public $api_findItemValueByItemKeys = '/api/mdc/pbc/sysConfigItem/findItemValueByItemKeys';
|
public $api_findItemValueByItemKeys = '/api/mdc/pbc/sysConfigItem/findItemValueByItemKeys';
|
||||||
// 获取保价费信息
|
// 获取保价费信息
|
||||||
|
|||||||
Reference in New Issue
Block a user