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

@ -214,7 +214,7 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
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() {
@ -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: {
@ -429,7 +429,7 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
} }
} }
} }
}, }
}, },
required: ['weight', 'carModel', 'carLength'] required: ['weight', 'carModel', 'carLength']
}; };
@ -454,7 +454,7 @@ 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') {
@ -519,9 +519,7 @@ 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']
}; };
@ -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;
}); });
@ -1004,7 +1014,7 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
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: '运输协议',
@ -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;
@ -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,
@ -1384,7 +1394,7 @@ 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,

View File

@ -211,7 +211,7 @@ export class SupplyManagementReleasePublishComponent implements OnInit {
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: {
@ -411,7 +411,7 @@ export class SupplyManagementReleasePublishComponent implements OnInit {
} }
} }
} }
}, }
}, },
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);
} }
} }
@ -502,9 +502,7 @@ 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']
}; };
@ -528,7 +526,6 @@ export class SupplyManagementReleasePublishComponent implements OnInit {
}; };
} }
initSF6() { initSF6() {
this.schema6 = { this.schema6 = {
properties: { properties: {
@ -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;
@ -956,7 +965,7 @@ export class SupplyManagementReleasePublishComponent implements OnInit {
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({
@ -968,7 +977,7 @@ export class SupplyManagementReleasePublishComponent implements OnInit {
}); });
modalRef.afterClose.subscribe(result => { modalRef.afterClose.subscribe(result => {
if (result) { if (result) {
this.submit(submitType, params, ); this.submit(submitType, params);
} }
}); });
} }
@ -1181,8 +1190,8 @@ export class SupplyManagementReleasePublishComponent implements OnInit {
} }
// 计算保价费金额 // 计算保价费金额
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,

View File

@ -183,12 +183,12 @@ export class SupplyManagementVehicleComponent implements OnInit {
if (res) { if (res) {
console.log(res); console.log(res);
} }
}) });
console.log(111); console.log(111);
} }
}, }
] ]
}) });
} }
}); });
} }
@ -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'] }
}, },
// { // {
@ -640,8 +640,8 @@ 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('导出成功,请去下载中心下载!');
} }
}) });
} }
} }