⚡ 配载货物信息分列数量单位,并修复车辆尺寸 -1 展示

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-10-13 12:55:15 +08:00
parent 6955784e93
commit 6296c8f6f4
3 changed files with 49 additions and 26 deletions
+7 -23
View File
@@ -633,15 +633,12 @@
prop="packageType"
label="包装"
min-width="100" /><el-table-column
prop="weight"
label="重量(吨)"
min-width="110" /><el-table-column
prop="volume"
label="体积(方)"
min-width="110" /><el-table-column
prop="quantity"
label="数量"
min-width="90" /><el-table-column
prop="quantityUnit"
label="数量单位"
min-width="100" /><el-table-column
prop="materialCode"
label="物料编码"
min-width="120" /><el-table-column
@@ -1419,7 +1416,7 @@
<el-table-column prop="cargoType" label="货物类型" min-width="140" />
<el-table-column prop="packageType" label="包装" min-width="100" />
<el-table-column prop="quantity" label="数量" min-width="100" />
<el-table-column prop="quantityUnit" label="单位" min-width="100" />
<el-table-column prop="quantityUnit" label="数量单位" min-width="100" />
<el-table-column prop="materialCode" label="物料编码" min-width="130" />
<el-table-column prop="equipmentCode" label="设备编码" min-width="130" />
<el-table-column prop="brand" label="品牌" min-width="120" />
@@ -2852,7 +2849,6 @@ export default {
if (status === 'draft') {
return [
{ type: 'edit', label: '编辑' },
{ type: 'copy', label: '复制' },
{ type: 'delete', label: '删除' },
];
}
@@ -2864,36 +2860,24 @@ export default {
if (row.driverRejected) {
actions.push({ type: 'reassign', label: '重新派单' });
}
actions.push(
{ type: 'edit', label: '编辑' },
{ type: 'copy', label: '复制' },
{ type: 'cancel', label: '取消' }
);
actions.push({ type: 'edit', label: '编辑' }, { type: 'cancel', label: '取消' });
return actions;
}
if (status === 'running') {
return [
{ type: 'view', label: '详情' },
{ type: 'complete', label: '完成' },
{ type: 'copy', label: '复制' },
];
}
if (status === 'completed' || status === 'cancelled') {
return [
{ type: 'view', label: '详情' },
{ type: 'copy', label: '复制' },
];
return [{ type: 'view', label: '详情' }];
}
return [
{ type: 'view', label: '详情' },
{ type: 'copy', label: '复制' },
];
return [{ type: 'view', label: '详情' }];
},
handleRowAction(type, row) {
const actionMap = {
view: () => this.gotoLoadingDetail(row),
edit: () => this.openLoadingDialog('edit', row),
copy: () => this.gotoLoadingCopy(row),
reassign: () => this.gotoLoadingReassign(row),
delete: () => this.deleteLoading(row),
start: () => this.startLoading(row),
@@ -27,10 +27,10 @@
}}</el-descriptions-item>
<el-descriptions-item label="外廓尺寸(mm)">{{ dimensions }}</el-descriptions-item>
<el-descriptions-item label="核定载质量(KG)">{{
vehicleDetail.approvedLoadKg ?? '-'
optionalNumberText(vehicleDetail.approvedLoadKg)
}}</el-descriptions-item>
<el-descriptions-item label="准牵引总质量(KG)">{{
vehicleDetail.tractionMassKg ?? '-'
optionalNumberText(vehicleDetail.tractionMassKg)
}}</el-descriptions-item>
<el-descriptions-item label="行驶证档案编号">{{
vehicleDetail.drivingLicenseNo || '-'
@@ -302,10 +302,29 @@ export default {
const v = this.vehicleDetail;
return (
[v.outerLength, v.outerWidth, v.outerHeight]
.filter(item => item !== null && item !== undefined && item !== '')
.filter(
item =>
item !== null &&
item !== undefined &&
item !== '' &&
Number(item) !== -1 &&
String(item) !== '-1'
)
.join('×') || '-'
);
},
optionalNumberText(value) {
if (
value === null ||
value === undefined ||
value === '' ||
Number(value) === -1 ||
String(value) === '-1'
) {
return '-';
}
return value;
},
plateColorType() {
return (
{ 黄牌: 'warning', 蓝牌: 'primary', 绿牌: 'success' }[this.vehicleDetail.plateColor] ||
+20
View File
@@ -863,6 +863,7 @@ export default {
...emptyForm(),
...(res.data.data || {}),
};
this.normalizeOptionalNumberFields(this.vehicleForm);
if (!this.vehicleForm.useDepartment) {
this.vehicleForm.useDepartment = this.getCurrentOrganizationName();
}
@@ -1284,6 +1285,7 @@ export default {
}
this.submitLoading = true;
const payload = this.normalizeVehicleDateFields({ ...this.vehicleForm });
this.normalizeOptionalNumberFields(payload, null);
submit(payload)
.then(() => {
this.$message.success('操作成功');
@@ -1295,6 +1297,24 @@ export default {
});
});
},
/**
* 可选数字字段:空串 / -1(BladeX null 占位)归一为 emptyValue,避免查看时显示 -1
*/
normalizeOptionalNumberFields(form = {}, emptyValue = undefined) {
['outerLength', 'outerWidth', 'outerHeight', 'tractionMassKg'].forEach(key => {
const value = form[key];
if (
value === undefined ||
value === null ||
value === '' ||
Number(value) === -1 ||
String(value) === '-1'
) {
form[key] = emptyValue;
}
});
return form;
},
handleStatus(row) {
const status = row.status === 1 ? 2 : 1;
const text = status === 1 ? '启用' : '停用';