车辆对接
This commit is contained in:
@ -40,6 +40,8 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
||||
totalFees: any; // 总数信息
|
||||
totalDistance = 0.0; //总里程
|
||||
totalTime = 0.0; //路程总时间
|
||||
currentRate = 0 //实时计算的费率
|
||||
|
||||
npp =false
|
||||
id = this.route.snapshot.params.id;
|
||||
// // 单位
|
||||
@ -369,7 +371,6 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
initSF6() {
|
||||
this.schema6 = {
|
||||
properties: {
|
||||
@ -392,6 +393,7 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
||||
ui: {
|
||||
widget: 'dict-select',
|
||||
params: { dictKey: 'receipt:type' },
|
||||
containsAllLable:false,
|
||||
placeholder: '请选择',
|
||||
errors: { required: '请选择' },
|
||||
visibleIf: {
|
||||
@ -399,56 +401,55 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
||||
}
|
||||
}
|
||||
},
|
||||
receiptUserId: {
|
||||
receiptAddressId: {
|
||||
type: 'string',
|
||||
title: '选择地址',
|
||||
ui: {
|
||||
widget: 'custom',
|
||||
placeholder: '请点击选择收回单地址',
|
||||
validator: val => (this.sf6?.value?.receiptType === '2' ? [{ keyword: 'required', message: '请点击选择收回单地址' }] : []),
|
||||
// validator: val => (this.sf6?.value?.receiptType === '2' ? [{ keyword: 'required', message: '请点击选择收回单地址' }] : []),
|
||||
visibleIf: {
|
||||
receiptType: value => value === 2
|
||||
receiptType: value => value === '2'
|
||||
}
|
||||
},
|
||||
default: '1212'
|
||||
default: ''
|
||||
},
|
||||
name4: {
|
||||
receiptUserName: {
|
||||
type: 'string',
|
||||
title: '联系人',
|
||||
ui: {
|
||||
visibleIf: {
|
||||
receiptType: value => value === 2
|
||||
receiptType: value => value === '2'
|
||||
}
|
||||
},
|
||||
readOnly: true
|
||||
},
|
||||
name5: {
|
||||
phon: {
|
||||
type: 'string',
|
||||
title: '联系电话',
|
||||
ui: {
|
||||
visibleIf: {
|
||||
receiptType: value => value === 2
|
||||
receiptType: value => value === '2'
|
||||
}
|
||||
},
|
||||
readOnly: true
|
||||
},
|
||||
name6: {
|
||||
area: {
|
||||
type: 'string',
|
||||
title: '所在地区',
|
||||
ui: {
|
||||
visibleIf: {
|
||||
receiptType: value => value === 2
|
||||
receiptType: value => value === '2'
|
||||
}
|
||||
},
|
||||
readOnly: true
|
||||
},
|
||||
receiptAddress: {
|
||||
address: {
|
||||
type: 'string',
|
||||
title: '详细地址',
|
||||
maxLength: 20,
|
||||
ui: {
|
||||
visibleIf: {
|
||||
receiptType: value => value === 2
|
||||
receiptType: value => value === '2'
|
||||
}
|
||||
},
|
||||
readOnly: true
|
||||
@ -464,7 +465,7 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
||||
} as SFTextareaWidgetSchema
|
||||
}
|
||||
},
|
||||
required: ['stateReceipt', 'receiptType']
|
||||
required: ['stateReceipt', 'receiptType','receiptAddressId']
|
||||
};
|
||||
this.ui6 = {
|
||||
'*': {
|
||||
@ -480,50 +481,43 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
||||
initSF7() {
|
||||
this.schema7 = {
|
||||
properties: {
|
||||
prePay: { type: 'number', title: '预付', default: 0, ui: { prefix: '¥', change: ()=> {
|
||||
this.changeValue();
|
||||
},
|
||||
} as SFNumberWidgetSchema },
|
||||
toPay: { type: 'number', title: '到付', default: 0, ui: { prefix: '¥',change: ()=> {
|
||||
this.changeValue();
|
||||
},
|
||||
} as SFNumberWidgetSchema },
|
||||
oilCardPay: { type: 'number', title: '油卡', default: 0, ui: { prefix: '¥',change: ()=> {this.changeValue();} ,
|
||||
} as SFNumberWidgetSchema },
|
||||
receiptPay: { type: 'number', title: '回单付', default: 0, ui: { prefix: '¥',change: ()=> {
|
||||
this.changeValue();},
|
||||
} as SFNumberWidgetSchema },
|
||||
subtotal: {
|
||||
type: 'string',
|
||||
title: '小计',
|
||||
prePay: {
|
||||
type: 'number',
|
||||
title: '预付',
|
||||
default: 0,
|
||||
ui: {
|
||||
widget: 'custom',
|
||||
placeholder: '请输入',
|
||||
},
|
||||
prefix: '¥',
|
||||
change: args => this.payChange()
|
||||
} as SFNumberWidgetSchema
|
||||
},
|
||||
appendFee: {
|
||||
type: 'string',
|
||||
title: '附加费',
|
||||
ui: {
|
||||
widget: 'custom',
|
||||
placeholder: '请输入',
|
||||
},
|
||||
|
||||
toPay: {
|
||||
type: 'number',
|
||||
title: '到付',
|
||||
default: 0,
|
||||
ui: { prefix: '¥', change: args => this.payChange() } as SFNumberWidgetSchema
|
||||
},
|
||||
totalFee: {
|
||||
type: 'string',
|
||||
title: '总费用',
|
||||
ui: {
|
||||
widget: 'custom',
|
||||
placeholder: '请输入'
|
||||
}
|
||||
oilCardPay: {
|
||||
type: 'number',
|
||||
title: '油卡',
|
||||
default: 0,
|
||||
ui: { prefix: '¥', change: args => this.payChange() } as SFNumberWidgetSchema
|
||||
},
|
||||
receiptPay: {
|
||||
type: 'number',
|
||||
title: '回单付',
|
||||
default: 0,
|
||||
ui: { prefix: '¥', change: args => this.payChange() } as SFNumberWidgetSchema
|
||||
},
|
||||
subtotal: { 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 },
|
||||
paymentDays: {
|
||||
type: 'string',
|
||||
title: '到货后',
|
||||
ui: {
|
||||
widget: 'custom',
|
||||
placeholder: '请输入',
|
||||
errors: { required: '请输入付款承诺天数' }
|
||||
}
|
||||
}
|
||||
},
|
||||
@ -536,6 +530,28 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
||||
}
|
||||
};
|
||||
}
|
||||
payChange() {
|
||||
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;
|
||||
this.service.request(this.service.$api_getCalculatedSurcharge+`?totalFreight=${subtotal}&fuelCardAmount=${oilCardPay}`).subscribe(res => {
|
||||
if (res) {
|
||||
this.sf7.setValue('/appendFee', res.surcharge);
|
||||
this.sf7.setValue('/subtotal', subtotal);
|
||||
this.sf7.setValue('/total', subtotal+res.surcharge);
|
||||
this.service.request(this.service.$api_getcalculatedServiceRate+`?invoiceAmount=${subtotal+res.surcharge}&totalFreight=${subtotal}`).subscribe(res => {
|
||||
if (res) {
|
||||
this.currentRate = res.rate;
|
||||
} else {
|
||||
this.service.msgSrv.error(res.msg);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.service.msgSrv.error(res.msg);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
addStartInfo(event: any) {
|
||||
if (this.startInfo.length < 5) {
|
||||
|
||||
Reference in New Issue
Block a user