edit
This commit is contained in:
@ -1,5 +1,5 @@
|
|||||||
import { Component, OnInit, ViewChild } from '@angular/core';
|
import { Component, OnInit, ViewChild } from '@angular/core';
|
||||||
import { FormBuilder, FormGroup,Validators,FormControl } from '@angular/forms';
|
import { FormBuilder, FormGroup, Validators, FormControl } from '@angular/forms';
|
||||||
import { ActivatedRoute, Router } from '@angular/router';
|
import { ActivatedRoute, Router } from '@angular/router';
|
||||||
import {
|
import {
|
||||||
SFComponent,
|
SFComponent,
|
||||||
@ -11,7 +11,7 @@ import {
|
|||||||
SFUISchema
|
SFUISchema
|
||||||
} from '@delon/form';
|
} from '@delon/form';
|
||||||
import { _HttpClient } from '@delon/theme';
|
import { _HttpClient } from '@delon/theme';
|
||||||
import { AmapPoiPickerComponent,AmapService, ShipperBaseService } from '@shared';
|
import { AmapPoiPickerComponent, AmapService, ShipperBaseService } from '@shared';
|
||||||
import { NzModalService } from 'ng-zorro-antd/modal';
|
import { NzModalService } from 'ng-zorro-antd/modal';
|
||||||
import { PublishGoodsChooseFamifiarComponent } from '../choose-famifiar/choose-famifiar.component';
|
import { PublishGoodsChooseFamifiarComponent } from '../choose-famifiar/choose-famifiar.component';
|
||||||
import { SupplyManagementService } from '../../services/supply-management.service';
|
import { SupplyManagementService } from '../../services/supply-management.service';
|
||||||
@ -25,7 +25,7 @@ import { of } from 'rxjs';
|
|||||||
templateUrl: './onecar-publish.component.html',
|
templateUrl: './onecar-publish.component.html',
|
||||||
styleUrls: ['./onecar-publish.component.less']
|
styleUrls: ['./onecar-publish.component.less']
|
||||||
})
|
})
|
||||||
export class SupplyManagementOnecarPublishComponent implements OnInit {
|
export class SupplyManagementOnecarPublishComponent implements OnInit {
|
||||||
validateForm1: FormGroup;
|
validateForm1: FormGroup;
|
||||||
newTempchecked = false; //是否存入新模板
|
newTempchecked = false; //是否存入新模板
|
||||||
sf1data: any; // 货源单设置回显
|
sf1data: any; // 货源单设置回显
|
||||||
@ -40,9 +40,9 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
|||||||
totalFees: any; // 总数信息
|
totalFees: any; // 总数信息
|
||||||
totalDistance = 0.0; //总里程
|
totalDistance = 0.0; //总里程
|
||||||
totalTime = 0.0; //路程总时间
|
totalTime = 0.0; //路程总时间
|
||||||
currentRate = 0 //实时计算的费率
|
currentRate = 0; //实时计算的费率
|
||||||
|
|
||||||
npp =false
|
npp = false;
|
||||||
id = this.route.snapshot.params.id;
|
id = this.route.snapshot.params.id;
|
||||||
// // 单位
|
// // 单位
|
||||||
unit1 = '吨';
|
unit1 = '吨';
|
||||||
@ -61,10 +61,10 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
|||||||
public service: SupplyManagementService,
|
public service: SupplyManagementService,
|
||||||
private amapService: AmapService,
|
private amapService: AmapService,
|
||||||
public shipperSrv: ShipperBaseService
|
public shipperSrv: ShipperBaseService
|
||||||
) {
|
) {
|
||||||
this.validateForm1 = fb.group({
|
this.validateForm1 = fb.group({
|
||||||
loadingTime: [null, []],
|
loadingTime: [null, []],
|
||||||
unloadingTime: [null, []],
|
unloadingTime: [null, []]
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ViewChild('sf1', { static: false }) sf1!: SFComponent;
|
@ViewChild('sf1', { static: false }) sf1!: SFComponent;
|
||||||
@ -95,14 +95,14 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
|||||||
schema7: SFSchema = {};
|
schema7: SFSchema = {};
|
||||||
ui7!: SFUISchema;
|
ui7!: SFUISchema;
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
if(this.route.snapshot?.queryParams?.sta === '1') {
|
if (this.route.snapshot?.queryParams?.sta === '1') {
|
||||||
console.log('修改')
|
console.log('修改');
|
||||||
this.PageStatus = '整车修改';
|
this.PageStatus = '整车修改';
|
||||||
} else if(this.route.snapshot?.queryParams?.sta === '2') {
|
} else if (this.route.snapshot?.queryParams?.sta === '2') {
|
||||||
this.PageStatus = '整车下一单';
|
this.PageStatus = '整车下一单';
|
||||||
} else if(this.route.snapshot?.queryParams?.sta === '3') {
|
} else if (this.route.snapshot?.queryParams?.sta === '3') {
|
||||||
this.PageStatus = '大宗修改';
|
this.PageStatus = '大宗修改';
|
||||||
} else if(this.route.snapshot?.queryParams?.sta === '4') {
|
} else if (this.route.snapshot?.queryParams?.sta === '4') {
|
||||||
this.PageStatus = '大宗下一单';
|
this.PageStatus = '大宗下一单';
|
||||||
}
|
}
|
||||||
this.initSF1();
|
this.initSF1();
|
||||||
@ -130,20 +130,20 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
|||||||
onSearch: (q: any) => {
|
onSearch: (q: any) => {
|
||||||
if (!!q) {
|
if (!!q) {
|
||||||
return this.service
|
return this.service
|
||||||
.request(this.service.$api_enterpriceList, { enterpriseName: q})
|
.request(this.service.$api_enterpriceList, { enterpriseName: q })
|
||||||
.pipe(map((res) => (res as any[]).map((i) => ({ label: i.enterpriseName, value: i.id } as SFSchemaEnum))))
|
.pipe(map(res => (res as any[]).map(i => ({ label: i.enterpriseName, value: i.id } as SFSchemaEnum))))
|
||||||
.toPromise();
|
.toPromise();
|
||||||
} else {
|
} else {
|
||||||
return of([]);
|
return of([]);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
change: (q: any) => {
|
change: (q: any) => {
|
||||||
this.getRegionCode(q)
|
this.getRegionCode(q);
|
||||||
},
|
},
|
||||||
visibleIf: {
|
visibleIf: {
|
||||||
_$expand: (value: boolean) => value,
|
_$expand: (value: boolean) => value
|
||||||
},
|
}
|
||||||
} as SFSelectWidgetSchema,
|
} as SFSelectWidgetSchema
|
||||||
},
|
},
|
||||||
enterpriseProjectId: {
|
enterpriseProjectId: {
|
||||||
type: 'string',
|
type: 'string',
|
||||||
@ -151,7 +151,7 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
|||||||
ui: {
|
ui: {
|
||||||
widget: 'select',
|
widget: 'select',
|
||||||
placeholder: '请选择',
|
placeholder: '请选择',
|
||||||
allowClear: true,
|
allowClear: true
|
||||||
} as SFSelectWidgetSchema
|
} as SFSelectWidgetSchema
|
||||||
},
|
},
|
||||||
enterpriseInfoName: {
|
enterpriseInfoName: {
|
||||||
@ -159,7 +159,7 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
|||||||
title: '网络货运人',
|
title: '网络货运人',
|
||||||
ui: {
|
ui: {
|
||||||
widget: 'text'
|
widget: 'text'
|
||||||
},
|
}
|
||||||
},
|
},
|
||||||
externalResourceCode: {
|
externalResourceCode: {
|
||||||
type: 'string',
|
type: 'string',
|
||||||
@ -243,7 +243,7 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
required: ['goodsName', ]
|
required: ['goodsName']
|
||||||
};
|
};
|
||||||
this.ui3 = {
|
this.ui3 = {
|
||||||
'*': {
|
'*': {
|
||||||
@ -335,18 +335,18 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
// 获取城市列表
|
// 获取城市列表
|
||||||
getRegionCode(regionCode: any) {
|
getRegionCode(regionCode: any) {
|
||||||
console.log(regionCode)
|
console.log(regionCode);
|
||||||
return this.service
|
return this.service
|
||||||
.request(this.service.$api_get_enterprise_project, { id: regionCode })
|
.request(this.service.$api_get_enterprise_project, { id: regionCode })
|
||||||
.pipe(
|
.pipe(
|
||||||
map((res) =>
|
map(res =>
|
||||||
res.map((item: any) => ({
|
res.map((item: any) => ({
|
||||||
label: item.projectName,
|
label: item.projectName,
|
||||||
value: item.id,
|
value: item.id
|
||||||
})),
|
}))
|
||||||
),
|
)
|
||||||
)
|
)
|
||||||
.subscribe((res) => {
|
.subscribe(res => {
|
||||||
this.sf1.getProperty('/enterpriseProjectId')!.schema.enum = res;
|
this.sf1.getProperty('/enterpriseProjectId')!.schema.enum = res;
|
||||||
this.sf1.getProperty('/enterpriseProjectId')!.widget.reset(res);
|
this.sf1.getProperty('/enterpriseProjectId')!.widget.reset(res);
|
||||||
});
|
});
|
||||||
@ -393,7 +393,7 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
|||||||
ui: {
|
ui: {
|
||||||
widget: 'dict-select',
|
widget: 'dict-select',
|
||||||
params: { dictKey: 'receipt:type' },
|
params: { dictKey: 'receipt:type' },
|
||||||
containsAllLable:false,
|
containsAllLable: false,
|
||||||
placeholder: '请选择',
|
placeholder: '请选择',
|
||||||
errors: { required: '请选择' },
|
errors: { required: '请选择' },
|
||||||
visibleIf: {
|
visibleIf: {
|
||||||
@ -465,7 +465,7 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
|||||||
} as SFTextareaWidgetSchema
|
} as SFTextareaWidgetSchema
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
required: ['stateReceipt', 'receiptType','receiptAddressId']
|
required: ['stateReceipt', 'receiptType', 'receiptAddressId']
|
||||||
};
|
};
|
||||||
this.ui6 = {
|
this.ui6 = {
|
||||||
'*': {
|
'*': {
|
||||||
@ -475,8 +475,13 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
changeValue() {
|
changeValue() {
|
||||||
this.totalFees = Number(this.sf7?.value?.appendFee) + Number(this.sf7?.value?.oilCardPay) + Number(this.sf7?.value?.prePay) + Number(this.sf7?.value?.receiptPay) + Number(this.sf7?.value?.toPay)
|
this.totalFees =
|
||||||
console.log(this.totalFees)
|
Number(this.sf7?.value?.appendFee) +
|
||||||
|
Number(this.sf7?.value?.oilCardPay) +
|
||||||
|
Number(this.sf7?.value?.prePay) +
|
||||||
|
Number(this.sf7?.value?.receiptPay) +
|
||||||
|
Number(this.sf7?.value?.toPay);
|
||||||
|
console.log(this.totalFees);
|
||||||
}
|
}
|
||||||
initSF7() {
|
initSF7() {
|
||||||
this.schema7 = {
|
this.schema7 = {
|
||||||
@ -508,9 +513,9 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
|||||||
default: 0,
|
default: 0,
|
||||||
ui: { prefix: '¥', change: args => this.payChange() } as SFNumberWidgetSchema
|
ui: { prefix: '¥', change: args => this.payChange() } as SFNumberWidgetSchema
|
||||||
},
|
},
|
||||||
subtotal: { type: 'number', title: '小计',default: 0, ui: {widget: 'custom' } as SFNumberWidgetSchema },
|
subtotal: { type: 'number', title: '小计', default: 0, ui: { widget: 'custom' } as SFNumberWidgetSchema },
|
||||||
appendFee: { 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 },
|
total: { type: 'number', title: '总费用', default: 0, ui: { widget: 'custom' } as SFNumberWidgetSchema },
|
||||||
paymentDays: {
|
paymentDays: {
|
||||||
type: 'string',
|
type: 'string',
|
||||||
title: '到货后',
|
title: '到货后',
|
||||||
@ -531,28 +536,30 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
payChange() {
|
payChange() {
|
||||||
const subtotal = (this.sf7.value.prePay + this.sf7.value.toPay + this.sf7.value.oilCardPay + this.sf7.value.receiptPay) || 0;
|
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;
|
const oilCardPay = this.sf7.value.oilCardPay || 0;
|
||||||
this.service.request(this.service.$api_getCalculatedSurcharge+`?totalFreight=${subtotal}&fuelCardAmount=${oilCardPay}`).subscribe(res => {
|
this.service
|
||||||
if (res) {
|
.request(this.service.$api_getCalculatedSurcharge + `?totalFreight=${subtotal}&fuelCardAmount=${oilCardPay}`)
|
||||||
this.sf7.setValue('/appendFee', res.surcharge);
|
.subscribe(res => {
|
||||||
this.sf7.setValue('/subtotal', subtotal);
|
if (res) {
|
||||||
this.sf7.setValue('/total', subtotal+res.surcharge);
|
this.sf7.setValue('/appendFee', res.surcharge);
|
||||||
this.service.request(this.service.$api_getcalculatedServiceRate+`?invoiceAmount=${subtotal+res.surcharge}&totalFreight=${subtotal}`).subscribe(res => {
|
this.sf7.setValue('/subtotal', subtotal);
|
||||||
if (res) {
|
this.sf7.setValue('/total', subtotal + res.surcharge);
|
||||||
this.currentRate = res.rate;
|
this.service
|
||||||
} else {
|
.request(this.service.$api_getcalculatedServiceRate + `?invoiceAmount=${subtotal + res.surcharge}&totalFreight=${subtotal}`)
|
||||||
this.service.msgSrv.error(res.msg);
|
.subscribe(res => {
|
||||||
}
|
if (res) {
|
||||||
});
|
this.currentRate = res.rate;
|
||||||
} else {
|
} else {
|
||||||
this.service.msgSrv.error(res.msg);
|
this.service.msgSrv.error(res.msg);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
} else {
|
||||||
|
this.service.msgSrv.error(res.msg);
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
addStartInfo(event: any) {
|
addStartInfo(event: any) {
|
||||||
if (this.startInfo.length < 5) {
|
if (this.startInfo.length < 5) {
|
||||||
const controlId = this.startInfo.length;
|
const controlId = this.startInfo.length;
|
||||||
@ -572,12 +579,12 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
|||||||
this.validateForm1.addControl(`loadPhone${controlId}`, new FormControl(null, Validators.required));
|
this.validateForm1.addControl(`loadPhone${controlId}`, new FormControl(null, Validators.required));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
subStartInfo(event: any, index: number, id?:any) {
|
subStartInfo(event: any, index: number, id?: any) {
|
||||||
console.log(event, index, id)
|
console.log(event, index, id);
|
||||||
if(id) {
|
if (id) {
|
||||||
this.service.request(this.service.$api_delete_Wholedeletebatch, [id]).subscribe((res) => {
|
this.service.request(this.service.$api_delete_Wholedeletebatch, [id]).subscribe(res => {
|
||||||
console.log(res)
|
console.log(res);
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
this.startInfo.splice(index, 1);
|
this.startInfo.splice(index, 1);
|
||||||
this.validateForm1.removeControl(`loadAddress${index}`);
|
this.validateForm1.removeControl(`loadAddress${index}`);
|
||||||
@ -604,15 +611,15 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
|||||||
this.validateForm1.addControl(`unloadPhone${controlId}`, new FormControl(null, Validators.required));
|
this.validateForm1.addControl(`unloadPhone${controlId}`, new FormControl(null, Validators.required));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
subEndInfo(event: any, index: number, id?:any) {
|
subEndInfo(event: any, index: number, id?: any) {
|
||||||
if(id) {
|
if (id) {
|
||||||
this.service.request(this.service.$api_delete_Wholedeletebatch, [id]).subscribe((res) => {
|
this.service.request(this.service.$api_delete_Wholedeletebatch, [id]).subscribe(res => {
|
||||||
console.log(res)
|
console.log(res);
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
console.log(event, index, id)
|
console.log(event, index, id);
|
||||||
this.endInfo.splice(index, 1);
|
this.endInfo.splice(index, 1);
|
||||||
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}`);
|
||||||
}
|
}
|
||||||
@ -626,8 +633,8 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
submit(): void {
|
submit(): void {
|
||||||
console.log('进来了')
|
console.log('进来了');
|
||||||
console.log(this.startInfo)
|
console.log(this.startInfo);
|
||||||
// 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();
|
||||||
@ -639,14 +646,36 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
|||||||
// if (this.validateForm1.invalid || !this.sf1.valid || !this.sf3.valid || !this.sf4.valid || !this.sf6.valid) {
|
// if (this.validateForm1.invalid || !this.sf1.valid || !this.sf3.valid || !this.sf4.valid || !this.sf6.valid) {
|
||||||
// return;
|
// return;
|
||||||
// }
|
// }
|
||||||
console.log(this.validateForm1.value)
|
console.log(this.validateForm1.value);
|
||||||
if(typeof(this.validateForm1.value.unloadingTime) !== 'string' ) {
|
if (typeof this.validateForm1.value.unloadingTime !== 'string') {
|
||||||
var c = new Date(this.validateForm1.value.unloadingTime);
|
var c = new Date(this.validateForm1.value.unloadingTime);
|
||||||
this.validateForm1.value.unloadingTime = c.getFullYear() + '-' + this.addPreZero(c.getMonth() + 1) + '-' + this.addPreZero(c.getDate()) + ' ' + this.addPreZero(c.getHours()) + ':' + this.addPreZero(c.getMinutes()) + ':' + this.addPreZero(c.getSeconds())
|
this.validateForm1.value.unloadingTime =
|
||||||
|
c.getFullYear() +
|
||||||
|
'-' +
|
||||||
|
this.addPreZero(c.getMonth() + 1) +
|
||||||
|
'-' +
|
||||||
|
this.addPreZero(c.getDate()) +
|
||||||
|
' ' +
|
||||||
|
this.addPreZero(c.getHours()) +
|
||||||
|
':' +
|
||||||
|
this.addPreZero(c.getMinutes()) +
|
||||||
|
':' +
|
||||||
|
this.addPreZero(c.getSeconds());
|
||||||
}
|
}
|
||||||
if(typeof(this.validateForm1.value.loadingTime) !== 'string' ) {
|
if (typeof this.validateForm1.value.loadingTime !== 'string') {
|
||||||
var c = new Date(this.validateForm1.value.loadingTime);
|
var c = new Date(this.validateForm1.value.loadingTime);
|
||||||
this.validateForm1.value.loadingTime = c.getFullYear() + '-' + this.addPreZero(c.getMonth() + 1) + '-' + this.addPreZero(c.getDate()) + ' ' + this.addPreZero(c.getHours()) + ':' + this.addPreZero(c.getMinutes()) + ':' + this.addPreZero(c.getSeconds())
|
this.validateForm1.value.loadingTime =
|
||||||
|
c.getFullYear() +
|
||||||
|
'-' +
|
||||||
|
this.addPreZero(c.getMonth() + 1) +
|
||||||
|
'-' +
|
||||||
|
this.addPreZero(c.getDate()) +
|
||||||
|
' ' +
|
||||||
|
this.addPreZero(c.getHours()) +
|
||||||
|
':' +
|
||||||
|
this.addPreZero(c.getMinutes()) +
|
||||||
|
':' +
|
||||||
|
this.addPreZero(c.getSeconds());
|
||||||
}
|
}
|
||||||
// if (this.validateForm1.invalid) {
|
// if (this.validateForm1.invalid) {
|
||||||
// return;
|
// return;
|
||||||
@ -658,7 +687,7 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
|||||||
paymentDays: this.sf7.value.paymentDays,
|
paymentDays: this.sf7.value.paymentDays,
|
||||||
loadingTime: this.validateForm1?.value?.loadingTime,
|
loadingTime: this.validateForm1?.value?.loadingTime,
|
||||||
unloadingTime: this.validateForm1?.value?.unloadingTime,
|
unloadingTime: this.validateForm1?.value?.unloadingTime,
|
||||||
unLoadingPlaceDTOList: [...this.startInfo, ...this.endInfo,],
|
unLoadingPlaceDTOList: [...this.startInfo, ...this.endInfo],
|
||||||
goodsInfoDTOList: [
|
goodsInfoDTOList: [
|
||||||
{
|
{
|
||||||
...this.sf4.value,
|
...this.sf4.value,
|
||||||
@ -667,25 +696,25 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
|||||||
maxCube: this.sf4.value.maxCube.join(',')
|
maxCube: this.sf4.value.maxCube.join(',')
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
};
|
||||||
params.shippingInformationDTO = {
|
params.shippingInformationDTO = {
|
||||||
...this.sf7.value,
|
...this.sf7.value,
|
||||||
totalFees: this.totalFees
|
totalFees: this.totalFees
|
||||||
}
|
};
|
||||||
console.log(params)
|
console.log(params);
|
||||||
if(this.PageStatus === '整车修改') {
|
if (this.PageStatus === '整车修改') {
|
||||||
this.requests(this.service.$api_set_WholeModify, params);
|
this.requests(this.service.$api_set_WholeModify, params);
|
||||||
} else if(this.PageStatus === '整车下一单') {
|
} else if (this.PageStatus === '整车下一单') {
|
||||||
this.requests(this.service.$api_set_saveAnotherWholeOrder, params);
|
this.requests(this.service.$api_set_saveAnotherWholeOrder, params);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
addPreZero(num: any){
|
addPreZero(num: any) {
|
||||||
if(num<10){
|
if (num < 10) {
|
||||||
return '0'+num;
|
return '0' + num;
|
||||||
} else {
|
} else {
|
||||||
return num;
|
return num;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
requests(url: any, params: any) {
|
requests(url: any, params: any) {
|
||||||
this.service.request(url, params).subscribe((res: any) => {
|
this.service.request(url, params).subscribe((res: any) => {
|
||||||
if (res) {
|
if (res) {
|
||||||
@ -699,92 +728,92 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
|||||||
} else {
|
} else {
|
||||||
this.service.msgSrv.error(res.msg);
|
this.service.msgSrv.error(res.msg);
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
// 打开地图
|
// 打开地图
|
||||||
openMap(type: string, index: number) {
|
openMap(type: string, index: number) {
|
||||||
const modalRef = this.modalService.create({
|
const modalRef = this.modalService.create({
|
||||||
nzTitle: '',
|
nzTitle: '',
|
||||||
nzContent: AmapPoiPickerComponent,
|
nzContent: AmapPoiPickerComponent,
|
||||||
nzWidth: 900,
|
nzWidth: 900,
|
||||||
nzOnOk: item => {
|
nzOnOk: item => {
|
||||||
const poi = item.poi;
|
const poi = item.poi;
|
||||||
const locList = poi.pois;
|
const locList = poi.pois;
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case 'start':
|
case 'start':
|
||||||
this.startInfo[index].detailedAddress = poi.formattedAddress;
|
this.startInfo[index].detailedAddress = poi.formattedAddress;
|
||||||
this.startInfo[index].longitude = locList[0];
|
this.startInfo[index].longitude = locList[0];
|
||||||
this.startInfo[index].latitude = locList[1];
|
this.startInfo[index].latitude = locList[1];
|
||||||
this.startInfo[index].province = poi.addressComponent.province;
|
this.startInfo[index].province = poi.addressComponent.province;
|
||||||
this.startInfo[index].city = poi.addressComponent.city;
|
this.startInfo[index].city = poi.addressComponent.city;
|
||||||
this.startInfo[index].area = poi.addressComponent.district;
|
this.startInfo[index].area = poi.addressComponent.district;
|
||||||
this.startInfo[index].address = poi.formattedAddress;
|
this.startInfo[index].address = poi.formattedAddress;
|
||||||
break;
|
break;
|
||||||
case 'end':
|
case 'end':
|
||||||
this.endInfo[index].detailedAddress = poi.formattedAddress;
|
this.endInfo[index].detailedAddress = poi.formattedAddress;
|
||||||
this.endInfo[index].longitude = locList[0];
|
this.endInfo[index].longitude = locList[0];
|
||||||
this.endInfo[index].latitude = locList[1];
|
this.endInfo[index].latitude = locList[1];
|
||||||
this.endInfo[index].province = poi.addressComponent.province;
|
this.endInfo[index].province = poi.addressComponent.province;
|
||||||
this.endInfo[index].city = poi.addressComponent.city;
|
this.endInfo[index].city = poi.addressComponent.city;
|
||||||
this.endInfo[index].area = poi.addressComponent.district;
|
this.endInfo[index].area = poi.addressComponent.district;
|
||||||
this.endInfo[index].address = poi.formattedAddress;
|
this.endInfo[index].address = poi.formattedAddress;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
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: any) => {
|
this.amapService.drivingCompute([...this.startInfo], [...this.endInfo]).subscribe((res: any) => {
|
||||||
this.totalDistance = res.distance;
|
this.totalDistance = res.distance;
|
||||||
this.totalTime = res.time;
|
this.totalTime = res.time;
|
||||||
});
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
});
|
}
|
||||||
}
|
|
||||||
goBack() {
|
goBack() {
|
||||||
window.history.go(-1);
|
window.history.go(-1);
|
||||||
}
|
}
|
||||||
// 初始化信息
|
// 初始化信息
|
||||||
initdata() {
|
initdata() {
|
||||||
this.service.request(`${this.service.$api_get_getCompleteVehicleDetail}`, {id:this.id}).subscribe((res) => {
|
this.service.request(`${this.service.$api_get_getCompleteVehicleDetail}`, { id: this.id }).subscribe(res => {
|
||||||
this.dataR(res);
|
this.dataR(res);
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
asds(i: any) {
|
asds(i: any) {
|
||||||
console.log(i)
|
console.log(i);
|
||||||
}
|
}
|
||||||
// 初始化信息
|
// 初始化信息
|
||||||
dataR (res: any) {
|
dataR(res: any) {
|
||||||
// this.dataList = res;
|
// this.dataList = res;
|
||||||
if(res?.shipperAppUserName) {
|
if (res?.shipperAppUserName) {
|
||||||
const List: any = []
|
const List: any = [];
|
||||||
this.service.request(this.service.$api_enterpriceList, { enterpriseName: res?.shipperAppUserName}).subscribe((res) => {
|
this.service.request(this.service.$api_enterpriceList, { enterpriseName: res?.shipperAppUserName }).subscribe(rs => {
|
||||||
console.log(res)
|
rs?.forEach((element: any) => {
|
||||||
res?.forEach((element: any) => {
|
List.push({ label: element.enterpriseName, value: element.id });
|
||||||
List.push({ label: element.enterpriseName, value: element.id } )
|
});
|
||||||
});
|
|
||||||
console.log(List)
|
|
||||||
this.sf1.getProperty('/shipperAppUserId')!.schema.enum = List;
|
this.sf1.getProperty('/shipperAppUserId')!.schema.enum = List;
|
||||||
this.sf1.getProperty('/shipperAppUserId')!.widget.reset(List);
|
this.sf1.getProperty('/shipperAppUserId')!.widget.reset(List);
|
||||||
})
|
if (res?.shipperAppUserId) {
|
||||||
}
|
this.sf1.setValue('/shipperAppUserId', res?.shipperAppUserId);
|
||||||
if(res?.shipperAppUserId) {
|
this.getRegionCode(res?.shipperAppUserId);
|
||||||
this.getRegionCode(res?.shipperAppUserId)
|
}
|
||||||
}
|
});
|
||||||
|
}
|
||||||
|
|
||||||
this.sf1data = {
|
this.sf1data = {
|
||||||
// enterpriseProjectId: res?.enterpriseProjectId,
|
// enterpriseProjectId: res?.enterpriseProjectId,
|
||||||
enterpriseInfoName: res?.enterpriseInfoName,
|
enterpriseInfoName: res?.enterpriseInfoName,
|
||||||
externalResourceCode: res?.externalResourceCode,
|
externalResourceCode: res?.externalResourceCode,
|
||||||
dispatchId: res?.dispatchId ,
|
dispatchId: res?.dispatchId
|
||||||
}
|
};
|
||||||
if(this.PageStatus === '整车修改') {
|
if (this.PageStatus === '整车修改') {
|
||||||
this.sf1data.id = res?.id;
|
this.sf1data.id = res?.id;
|
||||||
}
|
}
|
||||||
res?.unLoadingPlaceVOList.forEach((element: any) => {
|
res?.unLoadingPlaceVOList.forEach((element: any) => {
|
||||||
if(element.type === 1 || element.type === '1') {
|
if (element.type === 1 || element.type === '1') {
|
||||||
const controlId = this.startInfo.length;
|
const controlId = this.startInfo.length;
|
||||||
if(this.PageStatus === '整车修改') {
|
if (this.PageStatus === '整车修改') {
|
||||||
this.startInfo.push({
|
this.startInfo.push({
|
||||||
detailedAddress: element.detailedAddress,
|
detailedAddress: element.detailedAddress,
|
||||||
appUserName: element.appUserName,
|
appUserName: element.appUserName,
|
||||||
@ -796,7 +825,7 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
|||||||
area: element.area,
|
area: element.area,
|
||||||
type: element.type,
|
type: element.type,
|
||||||
id: element.id
|
id: element.id
|
||||||
})
|
});
|
||||||
} else {
|
} else {
|
||||||
this.startInfo.push({
|
this.startInfo.push({
|
||||||
detailedAddress: element.detailedAddress,
|
detailedAddress: element.detailedAddress,
|
||||||
@ -807,16 +836,16 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
|||||||
province: element.province,
|
province: element.province,
|
||||||
city: element.city,
|
city: element.city,
|
||||||
area: element.area,
|
area: element.area,
|
||||||
type: element.type,
|
type: element.type
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
this.validateForm1.addControl(`loadAddress${controlId}`, new FormControl(null, Validators.required));
|
this.validateForm1.addControl(`loadAddress${controlId}`, new FormControl(null, Validators.required));
|
||||||
this.validateForm1.addControl(`loadName${controlId}`, new FormControl(null, Validators.required));
|
this.validateForm1.addControl(`loadName${controlId}`, new FormControl(null, Validators.required));
|
||||||
this.validateForm1.addControl(`loadPhone${controlId}`, new FormControl(null, Validators.required));
|
this.validateForm1.addControl(`loadPhone${controlId}`, new FormControl(null, Validators.required));
|
||||||
} else if(element.type === 2 || element.type === '2') {
|
} else if (element.type === 2 || element.type === '2') {
|
||||||
const controlId = this.endInfo.length;
|
const controlId = this.endInfo.length;
|
||||||
if(this.PageStatus === '整车修改') {
|
if (this.PageStatus === '整车修改') {
|
||||||
this.endInfo.push({
|
this.endInfo.push({
|
||||||
detailedAddress: element?.detailedAddress,
|
detailedAddress: element?.detailedAddress,
|
||||||
appUserName: element?.appUserName,
|
appUserName: element?.appUserName,
|
||||||
@ -828,7 +857,7 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
|||||||
area: element.area,
|
area: element.area,
|
||||||
type: element.type,
|
type: element.type,
|
||||||
id: element.id
|
id: element.id
|
||||||
})
|
});
|
||||||
} else {
|
} else {
|
||||||
this.endInfo.push({
|
this.endInfo.push({
|
||||||
detailedAddress: element?.detailedAddress,
|
detailedAddress: element?.detailedAddress,
|
||||||
@ -840,7 +869,7 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
|||||||
city: element.city,
|
city: element.city,
|
||||||
area: element.area,
|
area: element.area,
|
||||||
type: element.type
|
type: element.type
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
this.validateForm1.addControl(`unloadAddress${controlId}`, new FormControl(null, Validators.required));
|
this.validateForm1.addControl(`unloadAddress${controlId}`, new FormControl(null, Validators.required));
|
||||||
this.validateForm1.addControl(`unloadName${controlId}`, new FormControl(null, Validators.required));
|
this.validateForm1.addControl(`unloadName${controlId}`, new FormControl(null, Validators.required));
|
||||||
@ -849,50 +878,50 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
|||||||
});
|
});
|
||||||
|
|
||||||
this.sf3data = {
|
this.sf3data = {
|
||||||
goodsName: res?.goodsInfoVOList[0]?.goodsName ,
|
goodsName: res?.goodsInfoVOList[0]?.goodsName
|
||||||
}
|
};
|
||||||
this.sf4data = {
|
this.sf4data = {
|
||||||
weight: res?.goodsInfoVOList[0]?.weight ,
|
weight: res?.goodsInfoVOList[0]?.weight,
|
||||||
volume: res?.goodsInfoVOList[0]?.volume ,
|
volume: res?.goodsInfoVOList[0]?.volume,
|
||||||
vehicleDemand: res?.goodsInfoVOList[0]?.vehicleDemand ,
|
vehicleDemand: res?.goodsInfoVOList[0]?.vehicleDemand,
|
||||||
maxCube: res?.goodsInfoVOList[0]?.maxCube?.split(',') ,
|
maxCube: res?.goodsInfoVOList[0]?.maxCube?.split(','),
|
||||||
maxWeight: res?.goodsInfoVOList[0]?.maxWeight?.split(',') || '',
|
maxWeight: res?.goodsInfoVOList[0]?.maxWeight?.split(',') || '',
|
||||||
number: res?.goodsInfoVOList[0]?.number ,
|
number: res?.goodsInfoVOList[0]?.number,
|
||||||
goodsTypeName: res?.goodsInfoVOList[0]?.goodsTypeName ,
|
goodsTypeName: res?.goodsInfoVOList[0]?.goodsTypeName,
|
||||||
modifyUserId: res?.goodsInfoVOList[0]?.modifyUserId ,
|
modifyUserId: res?.goodsInfoVOList[0]?.modifyUserId,
|
||||||
resourceId: res?.goodsInfoVOList[0]?.resourceId ,
|
resourceId: res?.goodsInfoVOList[0]?.resourceId,
|
||||||
rule: res?.goodsInfoVOList[0]?.rule ,
|
rule: res?.goodsInfoVOList[0]?.rule,
|
||||||
settlementBasis: res?.goodsInfoVOList[0]?.settlementBasis ,
|
settlementBasis: res?.goodsInfoVOList[0]?.settlementBasis
|
||||||
}
|
};
|
||||||
if(res?.loadingTime) {
|
if (res?.loadingTime) {
|
||||||
this.loadingTime = res?.loadingTime;
|
this.loadingTime = res?.loadingTime;
|
||||||
}
|
}
|
||||||
if(res?.unloadingTime) {
|
if (res?.unloadingTime) {
|
||||||
this.unloadingTime = res?.unloadingTime;
|
this.unloadingTime = res?.unloadingTime;
|
||||||
}
|
}
|
||||||
if(this.PageStatus === '整车修改' ) {
|
if (this.PageStatus === '整车修改') {
|
||||||
this.sf4data.id = res?.goodsInfoVOList[0]?.id;
|
this.sf4data.id = res?.goodsInfoVOList[0]?.id;
|
||||||
}
|
}
|
||||||
this.totalFees = res?.shippingInformationVO?.totalFee || '0';
|
this.totalFees = res?.shippingInformationVO?.totalFee || '0';
|
||||||
this.sf5data = {
|
this.sf5data = {
|
||||||
goodsValue: res?.goodsValue ,
|
goodsValue: res?.goodsValue
|
||||||
}
|
};
|
||||||
console.log(res?.stateReceipt)
|
console.log(res?.stateReceipt);
|
||||||
this.sf6data = {
|
this.sf6data = {
|
||||||
stateReceipt: res?.stateReceipt,
|
stateReceipt: res?.stateReceipt,
|
||||||
receiptType: res?.receiptType ,
|
receiptType: res?.receiptType,
|
||||||
receiptUserId: res?.receiptUserId ,
|
receiptUserId: res?.receiptUserId,
|
||||||
remarks: res?.remarks
|
remarks: res?.remarks
|
||||||
}
|
};
|
||||||
this.sf7data = {
|
this.sf7data = {
|
||||||
prePay: res?.shippingInformationVO?.prePay ,
|
prePay: res?.shippingInformationVO?.prePay,
|
||||||
toPay: res?.shippingInformationVO?.toPay ,
|
toPay: res?.shippingInformationVO?.toPay,
|
||||||
oilCardPay: res?.shippingInformationVO?.oilCardPay ,
|
oilCardPay: res?.shippingInformationVO?.oilCardPay,
|
||||||
receiptPay: res?.shippingInformationVO?.receiptPay ,
|
receiptPay: res?.shippingInformationVO?.receiptPay,
|
||||||
// subtotal: res?.shippingInformationVO?.oilCardPay ,
|
// subtotal: res?.shippingInformationVO?.oilCardPay ,
|
||||||
appendFee: res?.shippingInformationVO?.appendFee ,
|
appendFee: res?.shippingInformationVO?.appendFee,
|
||||||
paymentDays: res?.paymentDays ,
|
paymentDays: res?.paymentDays
|
||||||
}
|
};
|
||||||
}
|
}
|
||||||
backBillChange() {
|
backBillChange() {
|
||||||
const modalRef = this.modalService.create({
|
const modalRef = this.modalService.create({
|
||||||
|
|||||||
Reference in New Issue
Block a user