🐛 修复车务非必填-1展示,并完善总单调度与运单表单体验
调度页限制上一段到达后才可调度;司机候选项点击展开;车务多模块-1显示为空;同步配载/总单编辑与导入相关优化。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -332,15 +332,34 @@ export default {
|
||||
? values.vehicleNo.trim()
|
||||
: values.vehicleNo.trim().toUpperCase();
|
||||
}
|
||||
// 非必填金额未填写时不要提交 -1 占位值
|
||||
values.directEconomicLoss = this.normalizeOptionalAmount(values.directEconomicLoss);
|
||||
values.insuranceClaimAmount = this.normalizeOptionalAmount(values.insuranceClaimAmount);
|
||||
values.accidentLocation = this.normalizeOptionalText(values.accidentLocation);
|
||||
values.accidentReasonDamage = this.normalizeOptionalText(values.accidentReasonDamage);
|
||||
values.remark = this.normalizeOptionalText(values.remark);
|
||||
values.attachments = this.stringifyAttachments(values.attachments);
|
||||
return values;
|
||||
},
|
||||
normalizeOptionalAmount(value) {
|
||||
if (value === undefined || value === null || value === '' || Number(value) === -1) {
|
||||
return null;
|
||||
}
|
||||
return value;
|
||||
},
|
||||
normalizeOptionalText(value) {
|
||||
if (value === undefined || value === null) return null;
|
||||
const text = String(value).trim();
|
||||
return !text || text === '-1' ? null : text;
|
||||
},
|
||||
validateRow(row) {
|
||||
if (Number(row.directEconomicLoss) < 0) {
|
||||
const directEconomicLoss = this.normalizeOptionalAmount(row.directEconomicLoss);
|
||||
const insuranceClaimAmount = this.normalizeOptionalAmount(row.insuranceClaimAmount);
|
||||
if (directEconomicLoss !== null && Number(directEconomicLoss) < 0) {
|
||||
this.$message.warning('直接经济损失不能小于 0');
|
||||
return false;
|
||||
}
|
||||
if (Number(row.insuranceClaimAmount) < 0) {
|
||||
if (insuranceClaimAmount !== null && Number(insuranceClaimAmount) < 0) {
|
||||
this.$message.warning('保险理赔金额不能小于 0');
|
||||
return false;
|
||||
}
|
||||
@@ -353,13 +372,9 @@ export default {
|
||||
return false;
|
||||
}
|
||||
if (
|
||||
row.directEconomicLoss !== undefined &&
|
||||
row.directEconomicLoss !== null &&
|
||||
row.directEconomicLoss !== '' &&
|
||||
row.insuranceClaimAmount !== undefined &&
|
||||
row.insuranceClaimAmount !== null &&
|
||||
row.insuranceClaimAmount !== '' &&
|
||||
Number(row.insuranceClaimAmount) > Number(row.directEconomicLoss)
|
||||
directEconomicLoss !== null &&
|
||||
insuranceClaimAmount !== null &&
|
||||
Number(insuranceClaimAmount) > Number(directEconomicLoss)
|
||||
) {
|
||||
this.$message.warning('保险理赔金额不能超过直接经济损失金额');
|
||||
return false;
|
||||
@@ -448,6 +463,11 @@ export default {
|
||||
const detail = res.data.data;
|
||||
detail.attachments = this.parseAttachments(detail.attachments);
|
||||
detail.vehicleType = detail.vehicleType || '车辆';
|
||||
detail.directEconomicLoss = this.normalizeOptionalAmount(detail.directEconomicLoss);
|
||||
detail.insuranceClaimAmount = this.normalizeOptionalAmount(detail.insuranceClaimAmount);
|
||||
detail.accidentLocation = this.normalizeOptionalText(detail.accidentLocation) || '';
|
||||
detail.accidentReasonDamage = this.normalizeOptionalText(detail.accidentReasonDamage) || '';
|
||||
detail.remark = this.normalizeOptionalText(detail.remark) || '';
|
||||
this.form = detail;
|
||||
this.updateVehicleTypeDisplays(detail.vehicleType);
|
||||
this.vehicleOptions = [];
|
||||
|
||||
Reference in New Issue
Block a user