优化
This commit is contained in:
@ -323,6 +323,9 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
||||
errors: { required: '请填写货物名称' },
|
||||
visibleIf: {
|
||||
goodsTypeName: (value: any) => value && value === '其它'
|
||||
},
|
||||
blur: (value: any) => {
|
||||
this.checkGoodsName();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -465,10 +468,10 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
||||
)
|
||||
},
|
||||
change: (tag: any, org: any) => {
|
||||
if(tag === '3'){
|
||||
if (tag === '3') {
|
||||
this.sf5.setValue('/insurancePremium', null);
|
||||
this.sf5.setValue('/insuranceRate', null);
|
||||
}else {
|
||||
} else {
|
||||
this.getInsurersPrice(tag);
|
||||
}
|
||||
}
|
||||
@ -481,7 +484,7 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
||||
ui: {
|
||||
widget: 'custom',
|
||||
visibleIf: { insuranceType: (value: string) => value === '0' }
|
||||
} ,
|
||||
},
|
||||
},
|
||||
type2: {
|
||||
type: 'string',
|
||||
@ -494,7 +497,7 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
||||
insurancePremium: {
|
||||
type: 'string',
|
||||
title: '服务包费用',
|
||||
readOnly:true,
|
||||
readOnly: true,
|
||||
ui: {
|
||||
visibleIf: { insuranceType: (value: string) => value !== '3' }
|
||||
}
|
||||
@ -523,7 +526,7 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
||||
}
|
||||
},
|
||||
},
|
||||
required: [ 'insurancePremium']
|
||||
required: ['insurancePremium']
|
||||
};
|
||||
this.ui5 = {
|
||||
'*': {
|
||||
@ -733,7 +736,7 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
||||
this.service
|
||||
.request(
|
||||
this.service.$api_getAdditionalRate +
|
||||
`?shipperId=${this?.sf1?.value?.shipperAppUserId || ''}&enterpriseInfoId=${items}&resourcetype='1'`
|
||||
`?shipperId=${this?.sf1?.value?.shipperAppUserId || ''}&enterpriseInfoId=${items}&resourcetype='1'`
|
||||
)
|
||||
.subscribe(res => {
|
||||
if (res) {
|
||||
@ -986,9 +989,9 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
||||
];
|
||||
// 运费信息
|
||||
const expenseList = [
|
||||
{ expenseCode: 'PRE', expenseName: '预付', price: this.sf7.value.prePay || 0, id: this.sf7data?.prePayId || '' ,resourceId: this.sf7data?.PREresourceId || '' },
|
||||
{ expenseCode: 'RECE', expenseName: '到付', price: this.sf7.value.toPay || 0, id: this.sf7data?.toPayId || '' ,resourceId: this.sf7data?.RECEresourceId || ''},
|
||||
{ expenseCode: 'BACK', expenseName: '回单付', price: this.sf7.value.receiptPay || 0, id: this.sf7data?.receiptPayId || '' ,resourceId: this.sf7data?.BACKresourceId || ''}
|
||||
{ expenseCode: 'PRE', expenseName: '预付', price: this.sf7.value.prePay || 0, id: this.sf7data?.prePayId || '', resourceId: this.sf7data?.PREresourceId || '' },
|
||||
{ expenseCode: 'RECE', expenseName: '到付', price: this.sf7.value.toPay || 0, id: this.sf7data?.toPayId || '', resourceId: this.sf7data?.RECEresourceId || '' },
|
||||
{ expenseCode: 'BACK', expenseName: '回单付', price: this.sf7.value.receiptPay || 0, id: this.sf7data?.receiptPayId || '', resourceId: this.sf7data?.BACKresourceId || '' }
|
||||
];
|
||||
// 从“再下一单”过来,将所有的子参数内的id都删除
|
||||
if (this.PageStatus === '整车下一单') {
|
||||
@ -1017,8 +1020,8 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
||||
paymentDays: this.sf7.value.paymentDays,
|
||||
estimatedKilometers: this.totalDistance,
|
||||
estimatedTravelTime: this.totalTime,
|
||||
subtotal :this.sf7.value.subtotal,
|
||||
total:this.sf7.value.total,
|
||||
subtotal: this.sf7.value.subtotal,
|
||||
total: this.sf7.value.total,
|
||||
insurancePackagedGoods: this.sf4.value.insurancePackagedGoods,
|
||||
goodsValue: this.sf4.value.goodsValue
|
||||
};
|
||||
@ -1081,7 +1084,7 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
||||
nzWidth: 900,
|
||||
nzOnOk: item => {
|
||||
console.log(item);
|
||||
if(item?.poi) {
|
||||
if (item?.poi) {
|
||||
const poi = item.poi;
|
||||
const locList = poi.pois;
|
||||
switch (type) {
|
||||
@ -1106,7 +1109,7 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
if (this.startInfo[0]?.area && this.endInfo[0]?.area) {
|
||||
this.amapService.drivingCompute([...this.startInfo], [...this.endInfo]).subscribe((res: any) => {
|
||||
this.totalDistance = res.distance;
|
||||
@ -1114,10 +1117,10 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
||||
this.getInsurersPrice(); // 计算保费金额
|
||||
});
|
||||
}
|
||||
return true
|
||||
return true
|
||||
} else {
|
||||
this.service.msgSrv.warning('请重新手动选择地址!')
|
||||
return false
|
||||
return false
|
||||
}
|
||||
}
|
||||
});
|
||||
@ -1155,7 +1158,7 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
||||
this.totalDistance = res?.estimatedKilometers;
|
||||
this.totalTime = res?.estimatedTravelTime;
|
||||
this.sf1data = {
|
||||
resourceCode:res?.resourceCode || '',
|
||||
resourceCode: res?.resourceCode || '',
|
||||
enterpriseInfoName: res?.enterpriseInfoName,
|
||||
enterpriseInfoId: res?.enterpriseInfoId,
|
||||
dispatchPhone: res?.dispatchPhone,
|
||||
@ -1423,7 +1426,7 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
||||
// 计算保价费金额
|
||||
getInsurersPrice(insuranceType = this.sf5.value.insuranceType) {
|
||||
console.log(this.totalDistance);
|
||||
if (insuranceType !== '3' && this.totalDistance > 0) {
|
||||
if (insuranceType !== '3' && this.totalDistance > 0) {
|
||||
const params = {
|
||||
insuranceType,
|
||||
goodsValue: this.sf4.value.goodsValue,
|
||||
@ -1440,14 +1443,27 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
||||
});
|
||||
}
|
||||
}
|
||||
// 运费信息价格变更
|
||||
priceChange(event:any, i:any){
|
||||
i.setValue(event);
|
||||
if(event>=99999){
|
||||
this.modalService.warning({
|
||||
nzTitle: '可输入的最大金额为99999元',
|
||||
// 运费信息价格变更
|
||||
priceChange(event: any, i: any) {
|
||||
i.setValue(event);
|
||||
if (event >= 99999) {
|
||||
this.modalService.warning({
|
||||
nzTitle: '可输入的最大金额为99999元',
|
||||
});
|
||||
}
|
||||
this.payChange()
|
||||
}
|
||||
|
||||
checkGoodsName() {
|
||||
this.service.request(this.service.$api_checkGoodsName, this.sf3.value.goodsName1).subscribe(res => {
|
||||
if (res === false) {
|
||||
const modalRef = this.modalService.error({
|
||||
nzTitle: '货物名称含有违禁词,请重新输入!',
|
||||
});
|
||||
modalRef.afterClose.subscribe(result => {
|
||||
// this.sf3.setValue('/goodsName1', null);
|
||||
});
|
||||
}
|
||||
this.payChange()
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user