From 205d48984b2c0ba0a3759d6e5c97fa253fa0d2c7 Mon Sep 17 00:00:00 2001
From: zm2000 <18386612143@163.com>
Date: Sun, 9 Aug 2026 18:05:45 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=95=86=E5=93=81=E6=9F=A5?=
=?UTF-8?q?=E8=AF=A2=E3=80=81=E5=88=86=E6=8B=A3=E7=BC=BA=E8=B4=A7=E8=A1=A5?=
=?UTF-8?q?=E8=B4=A7=E9=A1=B5=E9=9D=A2?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
env.js | 4 +-
pages/replenishment/replenishShorts.vue | 2 +
pages/work/product/detail.vue | 158 ++++++++++++++++++++++--
pages/work/product/edit.vue | 152 +++++++++++++++++++++++
4 files changed, 307 insertions(+), 9 deletions(-)
diff --git a/env.js b/env.js
index b87b72a..c33f58a 100644
--- a/env.js
+++ b/env.js
@@ -1,4 +1,4 @@
-export const BASE_URL = 'http://qimen.wms.gztbyc.com' //生产环境接口地址
-// export const BASE_URL = 'http://192.168.11.56:6060' //开发环境接口地址
+// export const BASE_URL = 'http://qimen.wms.gztbyc.com' //生产环境接口地址
+export const BASE_URL = 'http://192.168.11.56:6060' //开发环境接口地址
export const API_URL = `${BASE_URL}/system` //后台接口域名
export const IMG_URL = 'https://ye4s.file.gzxunren.com' //全局网络图片地址变量,css背景图片地址变量在uni.scss
diff --git a/pages/replenishment/replenishShorts.vue b/pages/replenishment/replenishShorts.vue
index ff2c60f..45513a6 100644
--- a/pages/replenishment/replenishShorts.vue
+++ b/pages/replenishment/replenishShorts.vue
@@ -446,6 +446,7 @@
}
.loading-state {
+ flex: 1;
display: flex;
flex-direction: column;
align-items: center;
@@ -460,6 +461,7 @@
}
.empty-card {
+ flex: 1;
display: flex;
flex-direction: column;
align-items: center;
diff --git a/pages/work/product/detail.vue b/pages/work/product/detail.vue
index c440103..dc40852 100644
--- a/pages/work/product/detail.vue
+++ b/pages/work/product/detail.vue
@@ -145,6 +145,79 @@
净重(g):
{{ item.net_weight || '--' }}
+
+ 管理标识
+
+ 序列号管理:
+ {{ getFlagValue(item, ['is_sn_mgmt', 'is_serial_management', 'serial_management', 'is_serial', 'manage_serial']) }}
+
+
+ 保质期管理:
+ {{ getFlagValue(item, ['is_shelf_life_mgmt', 'is_expiry_management', 'expiry_management', 'is_expiry', 'manage_expiry']) }}
+
+
+ 批次管理:
+ {{ getFlagValue(item, ['is_batch_mgmt', 'is_batch_management', 'batch_management', 'is_batch', 'manage_batch']) }}
+
+
+ 尺寸信息
+
+ 长度(cm):
+ {{ getValue(item, ['length', 'item_length', 'box_length']) }}
+
+
+ 宽度(cm):
+ {{ getValue(item, ['width', 'item_width', 'box_width']) }}
+
+
+ 高度(cm):
+ {{ getValue(item, ['height', 'item_height', 'box_height']) }}
+
+
+ 体积(cm³):
+ {{ getValue(item, ['volume', 'item_volume', 'box_volume']) }}
+
+
+ 箱规信息
+
+ 启用箱规:
+ {{ getFlagValue(item, ['enable_box_spec', 'enable_box_rule', 'is_box_rule', 'box_rule_enabled', 'use_box_rule', 'enabled_box_rule']) }}
+
+
+
+ 每箱数量:
+ {{ getValue(item, ['quantity_per_box']) }}
+
+
+ 箱毛重(g):
+ {{ getValue(item, ['box_gross_weight']) }}
+
+
+ 箱净重(g):
+ {{ getValue(item, ['box_net_weight']) }}
+
+
+ 箱长(cm):
+ {{ getValue(item, ['box_length']) }}
+
+
+ 箱宽(cm):
+ {{ getValue(item, ['box_width']) }}
+
+
+ 箱高(cm):
+ {{ getValue(item, ['box_height']) }}
+
+
+ 箱体积(m³):
+ {{ getValue(item, ['box_volume']) }}
+
+
+
+
+ 打包要求:
+ {{ getValue(item, ['packing_requirements', 'package_requirement', 'packing_requirement', 'package_requirements']) }}
+
创建时间:
{{ item.create_at_display || '--' }}
@@ -244,6 +317,51 @@ export default {
getValueOrDash(value) {
return value === null || value === undefined || value === '' ? '--' : value;
},
+ isBoxSpecEnabled(item) {
+ if (!item || typeof item !== 'object') {
+ return false;
+ }
+
+ const val = item.enable_box_spec ?? item.enable_box_rule ?? item.is_box_rule ?? item.box_rule_enabled ?? item.use_box_rule ?? item.enabled_box_rule;
+ if (val === true || val === 1 || val === '1' || val === 'Y' || val === 'y' || val === '是' || String(val).toLowerCase() === 'true') {
+ return true;
+ }
+ return false;
+ },
+ getValue(item, fieldKeys) {
+ if (!item || typeof item !== 'object' || !Array.isArray(fieldKeys)) {
+ return '--';
+ }
+
+ for (const key of fieldKeys) {
+ const val = item[key];
+ if (val !== null && val !== undefined && val !== '') {
+ return val;
+ }
+ }
+
+ return '--';
+ },
+ getFlagValue(item, fieldKeys) {
+ const val = this.getValue(item, fieldKeys);
+ if (val === '--') {
+ return '--';
+ }
+
+ return this.toYesNoText(val);
+ },
+ toYesNoText(val) {
+ const str = String(val).trim().toLowerCase();
+ if (val === true || val === 1 || str === 'true' || str === 'yes' || str === 'y' || str === '是' || str === '启用' || str === '开启') {
+ return '是';
+ }
+
+ if (val === false || val === 0 || str === 'false' || str === 'no' || str === 'n' || str === '否' || str === '禁用' || str === '关闭') {
+ return '否';
+ }
+
+ return String(val);
+ },
getBarcodeText(item) {
if (!item || typeof item !== 'object') {
return '--';
@@ -588,6 +706,13 @@ export default {
word-break: break-all;
}
+.detail-section-title {
+ padding: 24rpx 0 12rpx;
+ font-size: 30rpx;
+ font-weight: bold;
+ color: #303133;
+}
+
.info-row {
display: flex;
align-items: center;
@@ -607,13 +732,32 @@ export default {
flex-shrink: 0;
}
-.value {
- flex: 1;
- font-size: 35rpx;
- color: #000;
- white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
+.info-row--multiline {
+ align-items: flex-start;
+ }
+
+ .value {
+ flex: 1;
+ font-size: 35rpx;
+ color: #000;
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ }
+
+ .value--multiline {
+ white-space: pre-wrap;
+ overflow: visible;
+ text-overflow: clip;
+ word-break: break-all;
+ line-height: 1.6;
+}
+
+/* 底部安全区:适配真机底部 home 指示条,避免最后一行被遮挡 */
+.safe-area-bottom {
+ height: 20rpx;
+ padding-bottom: constant(safe-area-inset-bottom);
+ padding-bottom: env(safe-area-inset-bottom);
}
.empty-state {
diff --git a/pages/work/product/edit.vue b/pages/work/product/edit.vue
index f07d4a3..0fb82c0 100644
--- a/pages/work/product/edit.vue
+++ b/pages/work/product/edit.vue
@@ -49,6 +49,61 @@
+
+ 管理标识
+
+
+
+
+
+
+
+
+
+
+ 尺寸信息
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 箱规信息
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
0 ? cachedQuantityPerBox : '1';
+ this.formData.box_gross_weight = this.normalizeInputValue(cached.box_gross_weight);
+ this.formData.box_net_weight = this.normalizeInputValue(cached.box_net_weight);
+ this.formData.box_length = this.normalizeInputValue(cached.box_length);
+ this.formData.box_width = this.normalizeInputValue(cached.box_width);
+ this.formData.box_height = this.normalizeInputValue(cached.box_height);
+ this.formData.box_volume = this.normalizeInputValue(cached.box_volume);
+ this.formData.packing_requirements = String(cached.packing_requirements || '');
this.formData.images = this.normalizeImageListForUpload(cached);
this.formData.stock_unit = String(cached.stock_unit || '');
this.formData.stock_unit_value = String(cached.stock_unit || '');
@@ -891,6 +979,15 @@ export default {
}
return String(value);
},
+ toBooleanFlag(value) {
+ if (value === true || value === 1 || value === '1' || value === 'true' || value === 'Y' || value === 'y' || value === '是' || value === '启用') {
+ return true;
+ }
+ return false;
+ },
+ toApiFlag(value) {
+ return value ? 1 : 0;
+ },
normalizeImageListForUpload(item) {
if (!item || typeof item !== 'object') {
return [];
@@ -1134,6 +1231,22 @@ export default {
return;
}
+ // 箱规校验:启用箱规时,每箱数量为必填项且必须大于0
+ const enableBoxSpec = this.toBooleanFlag(this.formData.enable_box_spec);
+ let normalizedQuantityPerBox = 0;
+ if (enableBoxSpec) {
+ const quantityText = String(this.formData.quantity_per_box || '').trim();
+ if (!quantityText) {
+ this.showToastMessage('每箱数量为必填项');
+ return;
+ }
+ normalizedQuantityPerBox = Number(quantityText);
+ if (!Number.isFinite(normalizedQuantityPerBox) || normalizedQuantityPerBox <= 0) {
+ this.showToastMessage('每箱数量必须大于0');
+ return;
+ }
+ }
+
this.saving = true;
try {
const storeId = this.resolveStoreId(this.rawItem || {});
@@ -1167,6 +1280,22 @@ export default {
prohibited_type_name: String(this.formData.prohibited_type_name || '').trim(),
gross_weight: grossWeight,
net_weight: String(this.formData.net_weight || '').trim(),
+ is_sn_mgmt: this.toApiFlag(this.formData.is_sn_mgmt),
+ is_shelf_life_mgmt: this.toApiFlag(this.formData.is_shelf_life_mgmt),
+ is_batch_mgmt: this.toApiFlag(this.formData.is_batch_mgmt),
+ length: String(this.formData.length || ''),
+ width: String(this.formData.width || ''),
+ height: String(this.formData.height || ''),
+ volume: String(this.formData.volume || ''),
+ enable_box_spec: this.toApiFlag(this.formData.enable_box_spec),
+ quantity_per_box: enableBoxSpec ? normalizedQuantityPerBox : 0,
+ box_gross_weight: String(this.formData.box_gross_weight || ''),
+ box_net_weight: String(this.formData.box_net_weight || ''),
+ box_length: String(this.formData.box_length || ''),
+ box_width: String(this.formData.box_width || ''),
+ box_height: String(this.formData.box_height || ''),
+ box_volume: String(this.formData.box_volume || ''),
+ packing_requirements: String(this.formData.packing_requirements || '').trim(),
images: this.extractImageUrls(this.formData.images),
stock_unit: stockUnit,
tag_price: String(normalizedTagPrice),
@@ -1233,6 +1362,22 @@ export default {
},
gross_weight: grossWeight,
net_weight: String(this.formData.net_weight || '').trim(),
+ is_sn_mgmt: this.toApiFlag(this.formData.is_sn_mgmt),
+ is_shelf_life_mgmt: this.toApiFlag(this.formData.is_shelf_life_mgmt),
+ is_batch_mgmt: this.toApiFlag(this.formData.is_batch_mgmt),
+ length: String(this.formData.length || ''),
+ width: String(this.formData.width || ''),
+ height: String(this.formData.height || ''),
+ volume: String(this.formData.volume || ''),
+ enable_box_spec: this.toApiFlag(this.formData.enable_box_spec),
+ quantity_per_box: enableBoxSpec ? normalizedQuantityPerBox : 0,
+ box_gross_weight: String(this.formData.box_gross_weight || ''),
+ box_net_weight: String(this.formData.box_net_weight || ''),
+ box_length: String(this.formData.box_length || ''),
+ box_width: String(this.formData.box_width || ''),
+ box_height: String(this.formData.box_height || ''),
+ box_volume: String(this.formData.box_volume || ''),
+ packing_requirements: String(this.formData.packing_requirements || '').trim(),
images: normalizedImages,
image: normalizedImageUrls[0] || '',
stock_unit: stockUnit,
@@ -1302,6 +1447,13 @@ export default {
background: #fff;
}
+.form-section-title {
+ padding: 24rpx 0 8rpx;
+ font-size: 30rpx;
+ font-weight: bold;
+ color: #303133;
+}
+
.picker-display {
min-height: 72rpx;
padding: 0 6rpx;