This commit is contained in:
wangshiming
2022-03-10 14:31:12 +08:00
parent a6c357e77a
commit c3afc62cb1
5 changed files with 133 additions and 106 deletions

View File

@ -648,6 +648,10 @@ export class SupplyManagementBulkPublishComponent implements OnInit {
this.service.msgSrv.warning('请完善必填项!'); this.service.msgSrv.warning('请完善必填项!');
return; return;
} }
if (this.totalDistance <= 0) {
this.service.msgSrv.warning('起终点相同,请重新选择装卸货地址!');
return;
}
// 校验各个输入限定值 // 校验各个输入限定值
if ( if (
this.sf4.value?.weight > this.limitValues?.maxWeight || this.sf4.value?.weight > this.limitValues?.maxWeight ||

View File

@ -580,6 +580,10 @@ export class SupplyManagementBulkReleasePublishComponent implements OnInit {
this.service.msgSrv.warning('请完善必填项!'); this.service.msgSrv.warning('请完善必填项!');
return; return;
} }
if (this.totalDistance <= 0) {
this.service.msgSrv.warning('起终点相同,请重新选择装卸货地址!');
return;
}
// 校验各个输入限定值 // 校验各个输入限定值
if (this.sf4.value.weight > this.limitValues.maxWeight || this.sf4.value.volume > this.limitValues.maxVolume || this.sf4.value.number > this.limitValues.maxTrainNumber) { 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}车】`); this.service.msgSrv.error(`当前货物核载信息已超出限定值【${this.limitValues.maxWeight}吨、${this.limitValues.maxVolume}方、${this.limitValues.maxTrainNumber}车】`);

View File

@ -189,7 +189,7 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
widget: 'text' widget: 'text'
} }
}, },
externalResourceCode: { externalResourceCode: {
type: 'string', type: 'string',
title: '外部货源号', title: '外部货源号',
@ -211,10 +211,10 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
type: 'string', type: 'string',
title: '调度员手机号', title: '调度员手机号',
maxLength: 30, maxLength: 30,
ui: { ui: {
placeholder: '请输入' placeholder: '请输入'
} }
}, }
// dispatchId: { // dispatchId: {
// type: 'string', // type: 'string',
// title: '调度员', // title: '调度员',
@ -249,7 +249,7 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
}, },
$enterpriseProjectId: { $enterpriseProjectId: {
grid: { span: 12 } grid: { span: 12 }
}, }
}; };
} }
initSF3() { initSF3() {
@ -320,7 +320,7 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
} }
} }
}, },
required: ['goodsTypeId', 'goodsName', 'goodsNameId','goodsName1'] required: ['goodsTypeId', 'goodsName', 'goodsNameId', 'goodsName1']
}; };
this.ui3 = { this.ui3 = {
'*': { '*': {
@ -347,7 +347,7 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
title: '', title: '',
ui: { ui: {
widget: 'custom', widget: 'custom',
placeholder: '请输入', placeholder: '请输入'
} }
}, },
number: { number: {
@ -355,7 +355,7 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
title: '', title: '',
ui: { ui: {
widget: 'custom', widget: 'custom',
placeholder: '请输入', placeholder: '请输入'
} }
}, },
carModel: { carModel: {
@ -408,7 +408,7 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
params: { dictKey: 'insure:packaged:goods' }, params: { dictKey: 'insure:packaged:goods' },
containsAllLabel: false, containsAllLabel: false,
validator: val => { validator: val => {
if (this.sf5?.value?.insuranceType && this.sf5?.value?.insuranceType !=='3' && this.isEmpty(val)) { if (this.sf5?.value?.insuranceType && this.sf5?.value?.insuranceType !== '3' && this.isEmpty(val)) {
return [{ keyword: 'required', message: '必填项' }]; return [{ keyword: 'required', message: '必填项' }];
} else { } else {
return []; return [];
@ -422,14 +422,14 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
ui: { ui: {
widget: 'custom', widget: 'custom',
validator: val => { validator: val => {
if (this.sf5?.value?.insuranceType && this.sf5?.value?.insuranceType !=='3' && this.isEmpty(val)) { if (this.sf5?.value?.insuranceType && this.sf5?.value?.insuranceType !== '3' && this.isEmpty(val)) {
return [{ keyword: 'required', message: '必填项' }]; return [{ keyword: 'required', message: '必填项' }];
} else { } else {
return []; return [];
} }
} }
} }
}, }
}, },
required: ['weight', 'carModel', 'carLength'] required: ['weight', 'carModel', 'carLength']
}; };
@ -454,13 +454,13 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
map((res: any) => { map((res: any) => {
return [...res]; return [...res];
}) })
) );
}, },
change: (tag: any, org: any) => { change: (tag: any, org: any) => {
if(tag === '3'){ if (tag === '3') {
this.sf5.setValue('/insurancePremium', null); this.sf5.setValue('/insurancePremium', null);
this.sf5.setValue('/insuranceRate', null); this.sf5.setValue('/insuranceRate', null);
}else { } else {
this.getInsurersPrice(tag); this.getInsurersPrice(tag);
} }
} }
@ -492,7 +492,7 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
insurancePremium: { insurancePremium: {
type: 'string', type: 'string',
title: '服务包费用', title: '服务包费用',
readOnly:true, readOnly: true,
ui: { ui: {
visibleIf: { insuranceType: (value: string) => value !== '3' } visibleIf: { insuranceType: (value: string) => value !== '3' }
} }
@ -519,11 +519,9 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
widget: 'custom', widget: 'custom',
visibleIf: { insuranceType: (value: string) => value === '1' } visibleIf: { insuranceType: (value: string) => value === '1' }
} }
}, }
}, },
required: [ 'insurancePremium'] required: ['insurancePremium']
}; };
this.ui5 = { this.ui5 = {
'*': { '*': {
@ -864,7 +862,7 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
nzComponentParams: { nzComponentParams: {
status: 'new', status: 'new',
url: this.service.$api_save_assign_whole, url: this.service.$api_save_assign_whole,
params: item, params: item
}, },
nzFooter: null nzFooter: null
}); });
@ -895,10 +893,22 @@ 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 });
if (this.validateForm1.invalid || !this.sf3.valid || !this.sf1.valid || !this.sf4.valid || !this.sf5.valid || !this.sf6.valid || !this.sf7.valid) { if (
this.validateForm1.invalid ||
!this.sf3.valid ||
!this.sf1.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.totalDistance <= 0) {
this.service.msgSrv.warning('起终点相同,请重新选择装卸货地址!');
return;
}
if (this.validateForm1.value.loadingTime < new Date()) { if (this.validateForm1.value.loadingTime < new Date()) {
this.service.msgSrv.warning('装货时间必须大于当前时间!'); this.service.msgSrv.warning('装货时间必须大于当前时间!');
return; return;
@ -979,7 +989,7 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
{ expenseCode: 'BACK', expenseName: '回单付', price: this.sf7.value.receiptPay || 0, id: this.sf7data?.receiptPayId || '' } { expenseCode: 'BACK', expenseName: '回单付', price: this.sf7.value.receiptPay || 0, id: this.sf7data?.receiptPayId || '' }
]; ];
// 从“再下一单”过来将所有的子参数内的id都删除 // 从“再下一单”过来将所有的子参数内的id都删除
if ((this.PageStatus === '整车下一单')) { if (this.PageStatus === '整车下一单') {
LoadingList.forEach((ele: any) => { LoadingList.forEach((ele: any) => {
delete ele.id; delete ele.id;
}); });
@ -1003,15 +1013,15 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
paymentDays: this.sf7.value.paymentDays, paymentDays: this.sf7.value.paymentDays,
estimatedKilometers: this.totalDistance, estimatedKilometers: this.totalDistance,
estimatedTravelTime: this.totalTime, estimatedTravelTime: this.totalTime,
insurancePackagedGoods:this.sf4.value.insurancePackagedGoods, insurancePackagedGoods: this.sf4.value.insurancePackagedGoods,
goodsValue:this.sf4.value.goodsValue, goodsValue: this.sf4.value.goodsValue
}; };
const modalRef = this.modalService.create({ const modalRef = this.modalService.create({
nzTitle: '运输协议', nzTitle: '运输协议',
nzContent: TranAgreementComponent, nzContent: TranAgreementComponent,
nzWidth: 900, nzWidth: 900,
nzFooter: null, nzFooter: null,
nzComponentParams: { object: params, shipperName: this.shipperName,type:'onecar' } nzComponentParams: { object: params, shipperName: this.shipperName, type: 'onecar' }
}); });
modalRef.afterClose.subscribe(result => { modalRef.afterClose.subscribe(result => {
if (result) { if (result) {
@ -1136,7 +1146,7 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
enterpriseInfoId: res?.enterpriseInfoId, enterpriseInfoId: res?.enterpriseInfoId,
dispatchPhone: res?.dispatchPhone, dispatchPhone: res?.dispatchPhone,
dispatchName: res?.dispatchName, dispatchName: res?.dispatchName,
externalResourceCode: res?.externalResourceCode, externalResourceCode: res?.externalResourceCode
}; };
if (this.PageStatus === '整车修改') { if (this.PageStatus === '整车修改') {
this.sf1data.id = res?.id; this.sf1data.id = res?.id;
@ -1207,14 +1217,14 @@ 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));
} }
// 计算里程,时间 // 计算里程,时间
if (this.startInfo[0]?.detailedAddress && this.endInfo[0]?.detailedAddress) { if (this.startInfo[0]?.detailedAddress && this.endInfo[0]?.detailedAddress) {
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(); //计算保费金额 this.getInsurersPrice(); //计算保费金额
}); });
} }
}); });
this.sf3data = { this.sf3data = {
@ -1248,7 +1258,7 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
carModel: res?.goodsInfoVOList[0]?.carModel?.split(',') || [], carModel: res?.goodsInfoVOList[0]?.carModel?.split(',') || [],
carLength: res?.goodsInfoVOList[0]?.carLength?.split(',') || [], carLength: res?.goodsInfoVOList[0]?.carLength?.split(',') || [],
goodsValue: res?.goodsValue || '', goodsValue: res?.goodsValue || '',
insurancePackagedGoods: res?.insurancePackagedGoods || '', insurancePackagedGoods: res?.insurancePackagedGoods || ''
}; };
if (this.PageStatus === '整车修改') { if (this.PageStatus === '整车修改') {
this.sf4data.id = res?.goodsInfoVOList[0]?.id; this.sf4data.id = res?.goodsInfoVOList[0]?.id;
@ -1257,7 +1267,7 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
this.sf5data = { this.sf5data = {
insuranceType: res?.insuranceType || '', insuranceType: res?.insuranceType || '',
insurancePremium: res?.insurancePremium || '', insurancePremium: res?.insurancePremium || '',
insuranceRate: res?.insuranceRate || '', insuranceRate: res?.insuranceRate || ''
}; };
this.sf6data = { this.sf6data = {
stateReceipt: res?.stateReceipt, stateReceipt: res?.stateReceipt,
@ -1323,14 +1333,14 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
default: default:
break; break;
} }
// 计算里程,时间 // 计算里程,时间
if (this.startInfo[0]?.detailedAddress && this.endInfo[0]?.detailedAddress) { if (this.startInfo[0]?.detailedAddress && this.endInfo[0]?.detailedAddress) {
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(); //计算保费金额 this.getInsurersPrice(); //计算保费金额
}); });
} }
} }
}); });
} }
@ -1384,8 +1394,8 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
} }
// 计算保价费金额 // 计算保价费金额
getInsurersPrice(insuranceType = this.sf5.value.insuranceType) { getInsurersPrice(insuranceType = this.sf5.value.insuranceType) {
console.log(this.totalDistance) console.log(this.totalDistance);
if ( insuranceType !=='3' && this.sf4.value?.goodsValue >= 50000 && this.totalDistance > 0 ) { if (insuranceType !== '3' && this.sf4.value?.goodsValue >= 50000 && this.totalDistance > 0) {
const params = { const params = {
insuranceType, insuranceType,
goodsValue: this.sf4.value.goodsValue, goodsValue: this.sf4.value.goodsValue,
@ -1395,7 +1405,7 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
if (res) { if (res) {
this.sf5.setValue('/insurancePremium', res.insurancePremium); this.sf5.setValue('/insurancePremium', res.insurancePremium);
this.sf5.setValue('/insuranceRate', res.insuranceRate); this.sf5.setValue('/insuranceRate', res.insuranceRate);
}else{ } else {
this.sf5.setValue('/insurancePremium', null); this.sf5.setValue('/insurancePremium', null);
this.sf5.setValue('/insuranceRate', null); this.sf5.setValue('/insuranceRate', null);
} }

View File

@ -208,10 +208,10 @@ export class SupplyManagementReleasePublishComponent implements OnInit {
type: 'string', type: 'string',
title: '调度员手机号', title: '调度员手机号',
maxLength: 30, maxLength: 30,
ui: { ui: {
placeholder: '请输入' placeholder: '请输入'
} }
}, }
}, },
required: ['shipperAppUserId', 'enterpriseProjectId', 'enterpriseInfoName'] required: ['shipperAppUserId', 'enterpriseProjectId', 'enterpriseInfoName']
}; };
@ -329,7 +329,7 @@ export class SupplyManagementReleasePublishComponent implements OnInit {
title: '', title: '',
ui: { ui: {
widget: 'custom', widget: 'custom',
placeholder: '请输入', placeholder: '请输入'
} }
}, },
number: { number: {
@ -337,7 +337,7 @@ export class SupplyManagementReleasePublishComponent implements OnInit {
title: '', title: '',
ui: { ui: {
widget: 'custom', widget: 'custom',
placeholder: '请输入', placeholder: '请输入'
} }
}, },
carModel: { carModel: {
@ -390,7 +390,7 @@ export class SupplyManagementReleasePublishComponent implements OnInit {
params: { dictKey: 'insure:packaged:goods' }, params: { dictKey: 'insure:packaged:goods' },
containsAllLabel: false, containsAllLabel: false,
validator: val => { validator: val => {
if (this.sf5?.value?.insuranceType && this.sf5?.value?.insuranceType !=='3' && this.isEmpty(val)) { if (this.sf5?.value?.insuranceType && this.sf5?.value?.insuranceType !== '3' && this.isEmpty(val)) {
return [{ keyword: 'required', message: '必填项' }]; return [{ keyword: 'required', message: '必填项' }];
} else { } else {
return []; return [];
@ -404,14 +404,14 @@ export class SupplyManagementReleasePublishComponent implements OnInit {
ui: { ui: {
widget: 'custom', widget: 'custom',
validator: val => { validator: val => {
if (this.sf5?.value?.insuranceType && this.sf5?.value?.insuranceType !=='3' && this.isEmpty(val)) { if (this.sf5?.value?.insuranceType && this.sf5?.value?.insuranceType !== '3' && this.isEmpty(val)) {
return [{ keyword: 'required', message: '必填项' }]; return [{ keyword: 'required', message: '必填项' }];
} else { } else {
return []; return [];
} }
} }
} }
}, }
}, },
required: ['weight', 'carModel', 'carLength'] required: ['weight', 'carModel', 'carLength']
}; };
@ -436,14 +436,14 @@ export class SupplyManagementReleasePublishComponent implements OnInit {
map((res: any) => { map((res: any) => {
return [...res]; return [...res];
}) })
) );
}, },
change: (tag: any, org: any) => { change: (tag: any, org: any) => {
if(tag === '3'){ if (tag === '3') {
this.sf5.setValue('/insurancePremium', null); this.sf5.setValue('/insurancePremium', null);
this.sf5.setValue('/insuranceRate', null); this.sf5.setValue('/insuranceRate', null);
}else { } else {
console.log(tag) console.log(tag);
this.getInsurersPrice(tag); this.getInsurersPrice(tag);
} }
} }
@ -475,7 +475,7 @@ export class SupplyManagementReleasePublishComponent implements OnInit {
insurancePremium: { insurancePremium: {
type: 'string', type: 'string',
title: '服务包费用', title: '服务包费用',
readOnly:true, readOnly: true,
ui: { ui: {
visibleIf: { insuranceType: (value: string) => value !== '3' } visibleIf: { insuranceType: (value: string) => value !== '3' }
} }
@ -502,11 +502,9 @@ export class SupplyManagementReleasePublishComponent implements OnInit {
widget: 'custom', widget: 'custom',
visibleIf: { insuranceType: (value: string) => value === '1' } visibleIf: { insuranceType: (value: string) => value === '1' }
} }
}, }
}, },
required: [ 'insurancePremium'] required: ['insurancePremium']
}; };
this.ui5 = { this.ui5 = {
'*': { '*': {
@ -528,7 +526,6 @@ export class SupplyManagementReleasePublishComponent implements OnInit {
}; };
} }
initSF6() { initSF6() {
this.schema6 = { this.schema6 = {
properties: { properties: {
@ -769,8 +766,8 @@ export class SupplyManagementReleasePublishComponent implements OnInit {
addStartInfo() { addStartInfo() {
console.log(this.startInfo.length); console.log(this.startInfo.length);
console.log(this.limitValues.maxTimes); console.log(this.limitValues.maxTimes);
if (this.startInfo.length < this.limitValues.maxTimes) { if (this.startInfo.length < this.limitValues.maxTimes) {
const controlId = this.startInfo.length; const controlId = this.startInfo.length;
this.startInfo.push({ this.startInfo.push({
detailedAddress: '', detailedAddress: '',
@ -857,12 +854,24 @@ export class SupplyManagementReleasePublishComponent 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.sf1.valid) console.log(!this.sf1.valid);
console.log(this.sf1.value) console.log(this.sf1.value);
if (this.validateForm1.invalid || !this.sf3.valid || !this.sf1.valid || !this.sf4.valid || !this.sf5.valid || !this.sf6.valid || !this.sf7.valid) { if (
this.validateForm1.invalid ||
!this.sf3.valid ||
!this.sf1.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.totalDistance <= 0) {
this.service.msgSrv.warning('起终点相同,请重新选择装卸货地址!');
return;
}
if (this.validateForm1.value.loadingTime < new Date()) { if (this.validateForm1.value.loadingTime < new Date()) {
this.service.msgSrv.warning('装货时间必须大于当前时间!'); this.service.msgSrv.warning('装货时间必须大于当前时间!');
return; return;
@ -955,8 +964,8 @@ export class SupplyManagementReleasePublishComponent implements OnInit {
paymentDays: this.sf7.value.paymentDays, paymentDays: this.sf7.value.paymentDays,
estimatedKilometers: this.totalDistance, estimatedKilometers: this.totalDistance,
estimatedTravelTime: this.totalTime, estimatedTravelTime: this.totalTime,
insurancePackagedGoods:this.sf4.value.insurancePackagedGoods, insurancePackagedGoods: this.sf4.value.insurancePackagedGoods,
goodsValue:this.sf4.value.goodsValue, goodsValue: this.sf4.value.goodsValue
}; };
console.log(params); console.log(params);
const modalRef = this.modalService.create({ const modalRef = this.modalService.create({
@ -964,11 +973,11 @@ export class SupplyManagementReleasePublishComponent implements OnInit {
nzContent: TranAgreementComponent, nzContent: TranAgreementComponent,
nzWidth: 900, nzWidth: 900,
nzFooter: null, nzFooter: null,
nzComponentParams: { object: params ,shipperName: this.shipperName,type:'onecar'} nzComponentParams: { object: params, shipperName: this.shipperName, type: 'onecar' }
}); });
modalRef.afterClose.subscribe(result => { modalRef.afterClose.subscribe(result => {
if (result) { if (result) {
this.submit(submitType, params, ); this.submit(submitType, params);
} }
}); });
} }
@ -1088,14 +1097,14 @@ export class SupplyManagementReleasePublishComponent implements OnInit {
default: default:
break; break;
} }
// 计算里程,时间 // 计算里程,时间
if (this.startInfo[0]?.detailedAddress && this.endInfo[0]?.detailedAddress) { if (this.startInfo[0]?.detailedAddress && this.endInfo[0]?.detailedAddress) {
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(); //计算保费金额 this.getInsurersPrice(); //计算保费金额
}); });
} }
} }
}); });
} }
@ -1170,20 +1179,20 @@ export class SupplyManagementReleasePublishComponent implements OnInit {
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]?.detailedAddress && this.endInfo[0]?.detailedAddress) { if (this.startInfo[0]?.detailedAddress && this.endInfo[0]?.detailedAddress) {
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(); //计算保费金额 this.getInsurersPrice(); //计算保费金额
}); });
} }
} }
// 计算保价费金额 // 计算保价费金额
getInsurersPrice(insuranceType = this.sf5.value?.insuranceType) { getInsurersPrice(insuranceType = this.sf5.value?.insuranceType) {
console.log(insuranceType) console.log(insuranceType);
console.log(this.totalDistance) console.log(this.totalDistance);
if ( insuranceType !=='3' && this.sf4.value?.goodsValue >= 50000 && this.totalDistance > 0 ) { if (insuranceType !== '3' && this.sf4.value?.goodsValue >= 50000 && this.totalDistance > 0) {
const params = { const params = {
insuranceType, insuranceType,
goodsValue: this.sf4.value.goodsValue, goodsValue: this.sf4.value.goodsValue,
@ -1193,7 +1202,7 @@ export class SupplyManagementReleasePublishComponent implements OnInit {
if (res) { if (res) {
this.sf5.setValue('/insurancePremium', res.insurancePremium); this.sf5.setValue('/insurancePremium', res.insurancePremium);
this.sf5.setValue('/insuranceRate', res.insuranceRate); this.sf5.setValue('/insuranceRate', res.insuranceRate);
}else{ } else {
this.sf5.setValue('/insurancePremium', null); this.sf5.setValue('/insurancePremium', null);
this.sf5.setValue('/insuranceRate', null); this.sf5.setValue('/insuranceRate', null);
} }

View File

@ -180,15 +180,15 @@ export class SupplyManagementVehicleComponent implements OnInit {
type: 'primary', type: 'primary',
onClick: () => { onClick: () => {
this.service.request(this.service.$api_getFailUploadGoodsOperateResource, result.ids).subscribe((res: any) => { this.service.request(this.service.$api_getFailUploadGoodsOperateResource, result.ids).subscribe((res: any) => {
if(res) { if (res) {
console.log(res); console.log(res);
} }
}) });
console.log(111); console.log(111);
} }
}, }
] ]
}) });
} }
}); });
} }
@ -252,7 +252,7 @@ export class SupplyManagementVehicleComponent implements OnInit {
* 审核通过按钮 * 审核通过按钮
*/ */
handleOK(value: any) { handleOK(value: any) {
if (this.auditMany === false) { if (this.auditMany === false) {
const params: any = { const params: any = {
id: this.auditID, id: this.auditID,
remarks: this.sfFre.value.remarks remarks: this.sfFre.value.remarks
@ -508,7 +508,7 @@ export class SupplyManagementVehicleComponent implements OnInit {
width: '180px', width: '180px',
className: 'text-left' className: 'text-left'
}, },
{ {
title: '项目名称', title: '项目名称',
index: 'enterpriseProjectName', index: 'enterpriseProjectName',
@ -576,7 +576,7 @@ export class SupplyManagementVehicleComponent implements OnInit {
title: '创建时间', title: '创建时间',
width: '200px', width: '200px',
index: 'createTime', index: 'createTime',
className: 'text-left', className: 'text-left'
}, },
{ {
title: '审核状态', title: '审核状态',
@ -606,7 +606,7 @@ export class SupplyManagementVehicleComponent implements OnInit {
{ {
text: '修改货源', text: '修改货源',
click: _record => this.amend(_record), click: _record => this.amend(_record),
iif: item => item.resourceStatus === '1' , iif: item => item.resourceStatus === '1' && item.insurancePayment !== 'Y',
acl: { ability: ['SUPPLY-INDEX-vehicleModificationSupply'] } acl: { ability: ['SUPPLY-INDEX-vehicleModificationSupply'] }
}, },
// { // {
@ -636,12 +636,12 @@ export class SupplyManagementVehicleComponent implements OnInit {
} }
]; ];
} }
// 导出 // 导出
exportFire() { exportFire() {
this.service.request(this.service.$api_asyncExportWholeList, this.reqParams ).subscribe((res: any) => { this.service.request(this.service.$api_asyncExportWholeList, this.reqParams).subscribe((res: any) => {
if(res) { if (res) {
this.service.msgSrv.success('导出成功,请去下载中心下载!') this.service.msgSrv.success('导出成功,请去下载中心下载!');
} }
}) });
} }
} }