⚡ 配载货物信息分列数量单位,并修复车辆尺寸 -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" prop="packageType"
label="包装" label="包装"
min-width="100" /><el-table-column 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" prop="quantity"
label="数量" label="数量"
min-width="90" /><el-table-column min-width="90" /><el-table-column
prop="quantityUnit"
label="数量单位"
min-width="100" /><el-table-column
prop="materialCode" prop="materialCode"
label="物料编码" label="物料编码"
min-width="120" /><el-table-column min-width="120" /><el-table-column
@@ -1419,7 +1416,7 @@
<el-table-column prop="cargoType" label="货物类型" min-width="140" /> <el-table-column prop="cargoType" label="货物类型" min-width="140" />
<el-table-column prop="packageType" label="包装" min-width="100" /> <el-table-column prop="packageType" label="包装" min-width="100" />
<el-table-column prop="quantity" 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="materialCode" label="物料编码" min-width="130" />
<el-table-column prop="equipmentCode" label="设备编码" min-width="130" /> <el-table-column prop="equipmentCode" label="设备编码" min-width="130" />
<el-table-column prop="brand" label="品牌" min-width="120" /> <el-table-column prop="brand" label="品牌" min-width="120" />
@@ -2852,7 +2849,6 @@ export default {
if (status === 'draft') { if (status === 'draft') {
return [ return [
{ type: 'edit', label: '编辑' }, { type: 'edit', label: '编辑' },
{ type: 'copy', label: '复制' },
{ type: 'delete', label: '删除' }, { type: 'delete', label: '删除' },
]; ];
} }
@@ -2864,36 +2860,24 @@ export default {
if (row.driverRejected) { if (row.driverRejected) {
actions.push({ type: 'reassign', label: '重新派单' }); actions.push({ type: 'reassign', label: '重新派单' });
} }
actions.push( actions.push({ type: 'edit', label: '编辑' }, { type: 'cancel', label: '取消' });
{ type: 'edit', label: '编辑' },
{ type: 'copy', label: '复制' },
{ type: 'cancel', label: '取消' }
);
return actions; return actions;
} }
if (status === 'running') { if (status === 'running') {
return [ return [
{ type: 'view', label: '详情' }, { type: 'view', label: '详情' },
{ type: 'complete', label: '完成' }, { type: 'complete', label: '完成' },
{ type: 'copy', label: '复制' },
]; ];
} }
if (status === 'completed' || status === 'cancelled') { if (status === 'completed' || status === 'cancelled') {
return [ return [{ type: 'view', label: '详情' }];
{ type: 'view', label: '详情' },
{ type: 'copy', label: '复制' },
];
} }
return [ return [{ type: 'view', label: '详情' }];
{ type: 'view', label: '详情' },
{ type: 'copy', label: '复制' },
];
}, },
handleRowAction(type, row) { handleRowAction(type, row) {
const actionMap = { const actionMap = {
view: () => this.gotoLoadingDetail(row), view: () => this.gotoLoadingDetail(row),
edit: () => this.openLoadingDialog('edit', row), edit: () => this.openLoadingDialog('edit', row),
copy: () => this.gotoLoadingCopy(row),
reassign: () => this.gotoLoadingReassign(row), reassign: () => this.gotoLoadingReassign(row),
delete: () => this.deleteLoading(row), delete: () => this.deleteLoading(row),
start: () => this.startLoading(row), start: () => this.startLoading(row),
@@ -27,10 +27,10 @@
}}</el-descriptions-item> }}</el-descriptions-item>
<el-descriptions-item label="外廓尺寸(mm)">{{ dimensions }}</el-descriptions-item> <el-descriptions-item label="外廓尺寸(mm)">{{ dimensions }}</el-descriptions-item>
<el-descriptions-item label="核定载质量(KG)">{{ <el-descriptions-item label="核定载质量(KG)">{{
vehicleDetail.approvedLoadKg ?? '-' optionalNumberText(vehicleDetail.approvedLoadKg)
}}</el-descriptions-item> }}</el-descriptions-item>
<el-descriptions-item label="准牵引总质量(KG)">{{ <el-descriptions-item label="准牵引总质量(KG)">{{
vehicleDetail.tractionMassKg ?? '-' optionalNumberText(vehicleDetail.tractionMassKg)
}}</el-descriptions-item> }}</el-descriptions-item>
<el-descriptions-item label="行驶证档案编号">{{ <el-descriptions-item label="行驶证档案编号">{{
vehicleDetail.drivingLicenseNo || '-' vehicleDetail.drivingLicenseNo || '-'
@@ -302,10 +302,29 @@ export default {
const v = this.vehicleDetail; const v = this.vehicleDetail;
return ( return (
[v.outerLength, v.outerWidth, v.outerHeight] [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('×') || '-' .join('×') || '-'
); );
}, },
optionalNumberText(value) {
if (
value === null ||
value === undefined ||
value === '' ||
Number(value) === -1 ||
String(value) === '-1'
) {
return '-';
}
return value;
},
plateColorType() { plateColorType() {
return ( return (
{ 黄牌: 'warning', 蓝牌: 'primary', 绿牌: 'success' }[this.vehicleDetail.plateColor] || { 黄牌: 'warning', 蓝牌: 'primary', 绿牌: 'success' }[this.vehicleDetail.plateColor] ||
+20
View File
@@ -863,6 +863,7 @@ export default {
...emptyForm(), ...emptyForm(),
...(res.data.data || {}), ...(res.data.data || {}),
}; };
this.normalizeOptionalNumberFields(this.vehicleForm);
if (!this.vehicleForm.useDepartment) { if (!this.vehicleForm.useDepartment) {
this.vehicleForm.useDepartment = this.getCurrentOrganizationName(); this.vehicleForm.useDepartment = this.getCurrentOrganizationName();
} }
@@ -1284,6 +1285,7 @@ export default {
} }
this.submitLoading = true; this.submitLoading = true;
const payload = this.normalizeVehicleDateFields({ ...this.vehicleForm }); const payload = this.normalizeVehicleDateFields({ ...this.vehicleForm });
this.normalizeOptionalNumberFields(payload, null);
submit(payload) submit(payload)
.then(() => { .then(() => {
this.$message.success('操作成功'); 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) { handleStatus(row) {
const status = row.status === 1 ? 2 : 1; const status = row.status === 1 ? 2 : 1;
const text = status === 1 ? '启用' : '停用'; const text = status === 1 ? '启用' : '停用';