🐛 修复车务非必填-1展示,并完善总单调度与运单表单体验
调度页限制上一段到达后才可调度;司机候选项点击展开;车务多模块-1显示为空;同步配载/总单编辑与导入相关优化。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -345,7 +345,7 @@ export default {
|
||||
return JSON.stringify(value);
|
||||
},
|
||||
isEmpty(value) {
|
||||
return value === undefined || value === null || value === '';
|
||||
return value === undefined || value === null || value === '' || Number(value) === -1;
|
||||
},
|
||||
toNumber(value) {
|
||||
return this.isEmpty(value) ? null : Number(value);
|
||||
@@ -356,6 +356,15 @@ export default {
|
||||
normalizeIntegerInput(prop, value) {
|
||||
this.form[prop] = String(value ?? '').replace(/\D/g, '');
|
||||
},
|
||||
normalizeOptionalAmount(value) {
|
||||
if (this.isEmpty(value)) return null;
|
||||
return value;
|
||||
},
|
||||
normalizeOptionalText(value) {
|
||||
if (value === undefined || value === null) return null;
|
||||
const text = String(value).trim();
|
||||
return !text || text === '-1' ? null : text;
|
||||
},
|
||||
normalizeRow(row) {
|
||||
const values = { ...row };
|
||||
values.vehicleType = '车辆';
|
||||
@@ -363,6 +372,12 @@ export default {
|
||||
if (values.vehicleNo) {
|
||||
values.vehicleNo = values.vehicleNo.trim().toUpperCase();
|
||||
}
|
||||
// 非必填里程未填写时不要提交 -1 占位值
|
||||
values.previousMonthMileage = this.normalizeOptionalAmount(values.previousMonthMileage);
|
||||
values.currentMonthMileage = this.normalizeOptionalAmount(values.currentMonthMileage);
|
||||
values.monthlyMileage = this.normalizeOptionalAmount(values.monthlyMileage);
|
||||
values.totalMileage = this.normalizeOptionalAmount(values.totalMileage);
|
||||
values.remark = this.normalizeOptionalText(values.remark);
|
||||
const previousMonthMileage = this.toNumber(values.previousMonthMileage);
|
||||
const currentMonthMileage = this.toNumber(values.currentMonthMileage);
|
||||
if (
|
||||
@@ -503,6 +518,11 @@ export default {
|
||||
detail.attachments = this.parseAttachments(detail.attachments);
|
||||
detail.vehicleType = '车辆';
|
||||
detail.mileageUnit = '公里';
|
||||
detail.previousMonthMileage = this.normalizeOptionalAmount(detail.previousMonthMileage);
|
||||
detail.currentMonthMileage = this.normalizeOptionalAmount(detail.currentMonthMileage);
|
||||
detail.monthlyMileage = this.normalizeOptionalAmount(detail.monthlyMileage);
|
||||
detail.totalMileage = this.normalizeOptionalAmount(detail.totalMileage);
|
||||
detail.remark = this.normalizeOptionalText(detail.remark) || '';
|
||||
this.form = detail;
|
||||
this.vehicleOptions = [];
|
||||
this.loadVehicleOptions(this.form.vehicleNo || '');
|
||||
|
||||
Reference in New Issue
Block a user