🐛 修复车务非必填-1展示,并完善总单调度与运单表单体验
调度页限制上一段到达后才可调度;司机候选项点击展开;车务多模块-1显示为空;同步配载/总单编辑与导入相关优化。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -448,9 +448,25 @@ export default {
|
||||
} else {
|
||||
values.violationItem = undefined;
|
||||
}
|
||||
// 非必填项未填写时不要提交 -1 占位值
|
||||
values.fineAmount = this.normalizeOptionalAmount(values.fineAmount);
|
||||
values.deductPoints = this.normalizeOptionalAmount(values.deductPoints);
|
||||
values.penaltyUnit = this.normalizeOptionalText(values.penaltyUnit);
|
||||
values.processResult = this.normalizeOptionalText(values.processResult);
|
||||
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 (row.vehicleType === '船舶' && !row.violationItem) {
|
||||
this.$message.warning('请输入事项');
|
||||
@@ -467,17 +483,17 @@ export default {
|
||||
this.$message.warning('日期不能超过当前时间');
|
||||
return false;
|
||||
}
|
||||
if (Number(row.fineAmount) < 0) {
|
||||
const fineAmount = this.normalizeOptionalAmount(row.fineAmount);
|
||||
const deductPoints = this.normalizeOptionalAmount(row.deductPoints);
|
||||
if (fineAmount !== null && Number(fineAmount) < 0) {
|
||||
this.$message.warning('被罚金额不能小于 0');
|
||||
return false;
|
||||
}
|
||||
if (
|
||||
row.deductPoints !== undefined &&
|
||||
row.deductPoints !== null &&
|
||||
row.deductPoints !== '' &&
|
||||
(!Number.isInteger(Number(row.deductPoints)) ||
|
||||
Number(row.deductPoints) < 0 ||
|
||||
Number(row.deductPoints) > 15)
|
||||
deductPoints !== null &&
|
||||
(!Number.isInteger(Number(deductPoints)) ||
|
||||
Number(deductPoints) < 0 ||
|
||||
Number(deductPoints) > 15)
|
||||
) {
|
||||
this.$message.warning('被扣分数范围为 0-15 分');
|
||||
return false;
|
||||
@@ -570,6 +586,10 @@ export default {
|
||||
detail.attachments = this.parseAttachments(detail.attachments);
|
||||
detail.vehicleType = detail.vehicleType || '车辆';
|
||||
detail.processStatus = detail.processStatus || '未处理';
|
||||
detail.fineAmount = this.normalizeOptionalAmount(detail.fineAmount);
|
||||
detail.deductPoints = this.normalizeOptionalAmount(detail.deductPoints);
|
||||
detail.penaltyUnit = this.normalizeOptionalText(detail.penaltyUnit) || '';
|
||||
detail.processResult = this.normalizeOptionalText(detail.processResult) || '';
|
||||
this.form = detail;
|
||||
this.updateVehicleTypeDisplays(detail.vehicleType);
|
||||
this.vehicleOptions = [];
|
||||
|
||||
Reference in New Issue
Block a user