From e8f631147707951cfdc2add2d9815011fdbf724e Mon Sep 17 00:00:00 2001
From: weicw <594098497@qq.com>
Date: Sat, 24 Oct 2026 21:29:21 +0800
Subject: [PATCH] =?UTF-8?q?:sparkles:=20=E7=BC=96=E8=BE=91=E6=89=93?=
=?UTF-8?q?=E5=8D=A1=E8=AE=B0=E5=BD=95=E6=94=AF=E6=8C=81=E9=87=8C=E7=A8=8B?=
=?UTF-8?q?=E9=87=87=E9=9B=86=E4=B8=8E=E7=BB=93=E7=AE=97=E5=90=8E=E5=86=BB?=
=?UTF-8?q?=E7=BB=93?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../components/waybill-manage-page.vue | 46 +++++++++++++++++++
1 file changed, 46 insertions(+)
diff --git a/src/views/business/components/waybill-manage-page.vue b/src/views/business/components/waybill-manage-page.vue
index 4715c05..569ba3a 100644
--- a/src/views/business/components/waybill-manage-page.vue
+++ b/src/views/business/components/waybill-manage-page.vue
@@ -2271,6 +2271,13 @@
体积 {{ record.volume }}方
数量 {{ record.quantity }}
+
+
+ 里程 {{ record.mileage }} 公里
+
+
+
+
+
+ 公里
+
+
+
0 ? String(record.mileage) : '',
remark: record.remark || '',
photos: (record.photos || [])
.filter(photo => photo?.url)
@@ -6037,10 +6069,22 @@ export default {
photos.splice(index, 1);
this.waybillPunchEditForm.photos = photos;
},
+ // 里程只收整数:非数字直接丢掉,长度与「维护里程」一致(≤10 位)
+ handleWaybillPunchMileageInput(value) {
+ this.waybillPunchEditForm.mileage = String(value || '')
+ .replace(/\D/g, '')
+ .slice(0, 10);
+ },
async submitWaybillPunchRecordEdit() {
await this.$refs.waybillPunchRecordEditFormRef.validate();
const record = this.waybillPunchEditRecord;
const form = this.waybillPunchEditForm;
+ // 管理端里程选填:留空表示不改动运单里程,所以只校验填了值的情况
+ const mileageText = String(form.mileage || '').trim();
+ if (this.waybillPunchEditMileageVisible && mileageText && !/^[1-9]\d{0,9}$/.test(mileageText)) {
+ this.$message.warning('里程必须为不超过10位的正整数');
+ return;
+ }
const submit =
typeof this.api?.savePunchRecord === 'function' ? this.api.savePunchRecord : savePunchRecord;
this.waybillPunchRecordEditDialog.submitting = true;
@@ -6059,6 +6103,8 @@ export default {
weight: form.weight,
volume: form.volume,
quantity: form.quantity,
+ // 不传代表不改;后端按 null 处理
+ mileage: mileageText ? Number(mileageText) : undefined,
remark: form.remark,
photos: form.photos.map(photo => ({ url: photo.url, type: photo.type })),
});