From 8318b3a6880dd6da5bcc925e772587ea2945e01d Mon Sep 17 00:00:00 2001 From: zm2000 <18386612143@163.com> Date: Fri, 2 Oct 2026 17:59:25 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=96=B0=E5=A2=9E=E5=95=86=E5=93=81?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=E7=BB=B4=E6=8A=A4=E9=A1=B5=E5=8F=8A=E4=BD=9C?= =?UTF-8?q?=E4=B8=9A=E8=A6=81=E6=B1=82(=E6=89=93=E5=8C=85/=E6=8B=A3?= =?UTF-8?q?=E8=B4=A7/=E5=A4=8D=E6=A0=B8)=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 新增 pages/work/product/itemMaint 维护页并在 pages.json 注册 - 商品查询页新增「维护信息」入口,扫码带出商品后跳转 - edit/detail 页新增拣货、复核要求字段,支持要求合并/拆分切换 - 首页与快捷操作拦截「商品信息维护」,仅限商品查询页使用 --- pages.json | 7 + pages/home/edit-quick-actions.vue | 9 + pages/index/index.vue | 9 + pages/work/product/detail.vue | 11 +- pages/work/product/edit.vue | 76 ++- pages/work/product/itemMaint.vue | 792 ++++++++++++++++++++++++++++++ pages/work/product/query.vue | 69 +++ 7 files changed, 969 insertions(+), 4 deletions(-) create mode 100644 pages/work/product/itemMaint.vue diff --git a/pages.json b/pages.json index ae49017..b141439 100644 --- a/pages.json +++ b/pages.json @@ -194,6 +194,13 @@ "titleNView": false } }, + { + "path" : "pages/work/product/itemMaint", + "style" : + { + "titleNView": false + } + }, { "path" : "pages/work/order/picking", "style" : diff --git a/pages/home/edit-quick-actions.vue b/pages/home/edit-quick-actions.vue index 8345e15..967684a 100644 --- a/pages/home/edit-quick-actions.vue +++ b/pages/home/edit-quick-actions.vue @@ -327,6 +327,7 @@ const normalizedPath = rawPath ? (rawPath.startsWith('/') ? rawPath : `/${rawPath}`) : ''; const isRandomStorage = menuName === '随机入库' || (menuName.includes('随机') && menuName.includes('入库')); const isRelocation = menuName === '移库作业' || normalizedPath === '/pages/work/storage/relocation'; + const isItemMaint = menuName === '商品信息维护' || normalizedPath === '/pages/work/product/itemMaint'; if (isRelocation) { uni.showToast({ title: '该功能只支持在商品查询页面使用!', @@ -335,6 +336,14 @@ }); return; } + if (isItemMaint) { + uni.showToast({ + title: '该功能只支持在商品查询页面使用!', + icon: 'none', + duration: 2500 + }); + return; + } if (isRandomStorage) { this.$tools.routerTo('/pages/work/storage/random-storage'); return; diff --git a/pages/index/index.vue b/pages/index/index.vue index 510a034..a04a0b0 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -1367,6 +1367,7 @@ const normalizedPath = rawPath ? (rawPath.startsWith('/') ? rawPath : `/${rawPath}`) : ''; const isRandomStorage = menuName === '随机入库' || (menuName.includes('随机') && menuName.includes('入库')); const isRelocation = menuName === '移库作业' || normalizedPath === '/pages/work/storage/relocation'; + const isItemMaint = menuName === '商品信息维护' || normalizedPath === '/pages/work/product/itemMaint'; if (isRelocation) { uni.showToast({ title: '该功能只支持在商品查询页面使用!', @@ -1375,6 +1376,14 @@ }); return; } + if (isItemMaint) { + uni.showToast({ + title: '该功能只支持在商品查询页面使用!', + icon: 'none', + duration: 2500 + }); + return; + } if (isRandomStorage) { this.$tools.routerTo('/pages/work/storage/random-storage'); return; diff --git a/pages/work/product/detail.vue b/pages/work/product/detail.vue index 8feb614..86b6f2e 100644 --- a/pages/work/product/detail.vue +++ b/pages/work/product/detail.vue @@ -235,11 +235,20 @@ - + + 作业要求 打包要求: {{ getValue(item, ['packing_requirements', 'package_requirement', 'packing_requirement', 'package_requirements']) }} + + 拣货要求: + {{ getValue(item, ['pick_requirements', 'pick_requirement']) }} + + + 复核要求: + {{ getValue(item, ['recheck_requirements', 'recheck_requirement']) }} + 创建时间: {{ item.create_at_display || '--' }} diff --git a/pages/work/product/edit.vue b/pages/work/product/edit.vue index c4e4c0e..8284bbc 100644 --- a/pages/work/product/edit.vue +++ b/pages/work/product/edit.vue @@ -116,9 +116,25 @@ - - - + + + 作业要求 + + 要求合并 + + + + + + + + + + + + + + @@ -190,6 +206,7 @@ export default { latestImagesLoadPromise: null, showProhibitedPicker: false, showStockUnitPicker: false, + mergeRequirements: true, prohibitedTypeList: [], stockUnitList: [], formData: { @@ -222,6 +239,8 @@ export default { box_width: '', box_height: '', box_volume: '', + pick_requirements: '', + recheck_requirements: '', packing_requirements: '', images: [], stock_unit_value: '', @@ -288,7 +307,10 @@ export default { 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.pick_requirements = String(cached.pick_requirements || cached.pick_requirement || ''); + this.formData.recheck_requirements = String(cached.recheck_requirements || cached.recheck_requirement || ''); this.formData.packing_requirements = String(cached.packing_requirements || ''); + this.mergeRequirements = this.loadMergeRequirementsPreference(); this.formData.images = this.normalizeImageListForUpload(cached); this.formData.stock_unit = String(cached.stock_unit || ''); this.formData.stock_unit_value = String(cached.stock_unit || ''); @@ -525,6 +547,27 @@ export default { this.speakProductEditMessage(options.speakText || message, options.voiceOptions || {}); } }, + loadMergeRequirementsPreference() { + try { + const saved = uni.getStorageSync('product_edit_merge_requirements'); + if (saved === '' || saved === null || saved === undefined) { + return true; + } + if (typeof saved === 'boolean') { + return saved; + } + return String(saved) === 'true' || String(saved) === '1'; + } catch (error) { + return true; + } + }, + handleMergeRequirementsChange(value) { + try { + uni.setStorageSync('product_edit_merge_requirements', !!value); + } catch (error) { + console.warn('[ProductEdit] 保存要求合并偏好失败:', error); + } + }, resolveStoreId(item) { if (!item || typeof item !== 'object') { return null; @@ -1338,6 +1381,8 @@ export default { sku_property: String(this.formData.sku_property || '').trim(), stock_unit: stockUnit, packing_requirements: String(this.formData.packing_requirements || '').trim(), + pick_requirements: String(this.formData.pick_requirements || '').trim(), + recheck_requirements: String(this.formData.recheck_requirements || '').trim(), length: Number(this.formData.length) || 0, width: Number(this.formData.width) || 0, height: Number(this.formData.height) || 0, @@ -1446,6 +1491,8 @@ export default { box_height: String(this.formData.box_height || ''), box_volume: String(this.formData.box_volume || ''), packing_requirements: String(this.formData.packing_requirements || '').trim(), + pick_requirements: String(this.formData.pick_requirements || '').trim(), + recheck_requirements: String(this.formData.recheck_requirements || '').trim(), images: normalizedImages, image: normalizedImageUrls[0] || '', stock_unit: stockUnit, @@ -1522,6 +1569,29 @@ export default { color: #303133; } +.form-section-title--row { + display: flex; + align-items: center; + justify-content: space-between; +} + +.merge-toggle { + display: flex; + align-items: center; +} + +.merge-toggle__text { + margin-right: 12rpx; + font-size: 26rpx; + font-weight: normal; + color: #606266; +} + +/* 作业要求(打包/拣货/复核)文本域内容颜色改为黑色 */ +::v-deep .u-textarea__field { + color: #000000; +} + .shelf-life-block { margin: 12rpx 0 16rpx; padding: 8rpx 20rpx 20rpx; diff --git a/pages/work/product/itemMaint.vue b/pages/work/product/itemMaint.vue new file mode 100644 index 0000000..d378afb --- /dev/null +++ b/pages/work/product/itemMaint.vue @@ -0,0 +1,792 @@ + + + + + diff --git a/pages/work/product/query.vue b/pages/work/product/query.vue index 1cb78f7..a537265 100644 --- a/pages/work/product/query.vue +++ b/pages/work/product/query.vue @@ -236,6 +236,14 @@ + + + 维护信息 + + + 移库记录 + + @@ -2225,6 +2233,28 @@ url: `/pages/warehouse/inventoryTransfer${query}` }); }, + goItemMaint(item) { + if (!item || typeof item !== 'object') { + return; + } + + // 优先条码,其次编码,跳转到商品信息维护页并自动带出商品 + const barcodeList = Array.isArray(item.barcodes) ? item.barcodes.filter(code => code) : []; + const keyword = String( + barcodeList[0] + || item.barcode + || item.bar_code + || item.item_barcode + || item.code + || item.item_code + || item.goods_code + || '' + ).trim(); + const query = keyword ? `?barcode=${encodeURIComponent(keyword)}` : ''; + uni.navigateTo({ + url: `/pages/work/product/itemMaint${query}` + }); + }, async goProductDetail(item) { if (!item || typeof item !== 'object') { return; @@ -3322,6 +3352,45 @@ padding-bottom: 4rpx; } + .storage-action-bar { + display: flex; + align-items: center; + margin-top: 20rpx; + } + + .storage-action-btn { + flex: 1; + height: 72rpx; + display: flex; + align-items: center; + justify-content: center; + border: 1rpx solid #d9e4f5; + border-radius: 10rpx; + background: #f5f8ff; + font-size: 32rpx; + color: #606266; + + // 老机型 WebView 不支持 flex gap,改用外边距实现按钮间隔 + & + & { + margin-left: 20rpx; + } + + &:active { + opacity: 0.7; + } + } + + .storage-action-btn--primary { + background: #2979ff; + border-color: #2979ff; + color: #ffffff; + font-weight: 600; + } + + .storage-action-btn__text { + line-height: 1; + } + .label { width: auto; margin-right: 6rpx;