From 1dc754ea30cd53e02b3c590a892863e3e2e416a4 Mon Sep 17 00:00:00 2001 From: zm2000 <18386612143@163.com> Date: Wed, 16 Sep 2026 13:46:55 +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=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/work/product/query.vue | 156 +++++++++++++++++++++++++++++++---- 2 files changed, 142 insertions(+), 18 deletions(-) diff --git a/env.js b/env.js index c33f58a..b87b72a 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/work/product/query.vue b/pages/work/product/query.vue index 35e9b89..86e38f8 100644 --- a/pages/work/product/query.vue +++ b/pages/work/product/query.vue @@ -122,7 +122,10 @@ - + - {{ getStorageSpaceText(storageItem) }} - {{ getStorageQuantityText(storageItem) }} + {{ getStorageSpaceText(storageItem) }} + {{ getStorageQuantityText(storageItem) }} + - {{ getStorageSpaceText(storageItem) }} - {{ getStorageQuantityText(storageItem) }} + {{ getStorageSpaceText(storageItem) }} + {{ getStorageQuantityText(storageItem) }} {{ getStorageAvailableText(storageItem) }} @@ -249,14 +255,27 @@ 生产日期 {{ expiryEditProductDate || '请选择' }} - + 到期日期 {{ expiryEditExpiryDate || '请选择' }} - + + + + + 保质期快捷定位到期日期 + + + {{ option.label }} + @@ -334,7 +353,16 @@ expiryDatePickerValue: '', expiryDateMinDate: 0, expiryDateMaxDate: 0, - expirySaving: false + expirySaving: false, + expiryQuickOptions: [ + { label: '1个月', months: 1 }, + { label: '3个月', months: 3 }, + { label: '6个月', months: 6 }, + { label: '1年', months: 12 }, + { label: '2年', months: 24 }, + { label: '3年', months: 36 }, + { label: '5年', months: 60 } + ] } }, computed: { @@ -1760,6 +1788,13 @@ return this.formatStorageDate(value); }, + handleStorageMainClick(item, storageItem) { + if (this.inventoryViewMode !== 'detail') { + return; + } + + this.openExpiryEdit(item, storageItem); + }, openExpiryEdit(productItem, storageItem) { if (!storageItem || typeof storageItem !== 'object') { return; @@ -1800,6 +1835,34 @@ } this.expiryDatePickerVisible = false; }, + quickSetExpiry(months) { + const baseDate = this.expiryEditProductDate; + if (!baseDate) { + uni.showToast({ + title: '请先选择生产日期', + icon: 'none' + }); + return; + } + + const baseTimestamp = this.parseDateToTimestamp(baseDate); + if (!Number.isFinite(baseTimestamp)) { + uni.showToast({ + title: '生产日期无效', + icon: 'none' + }); + return; + } + + const date = new Date(baseTimestamp); + const day = date.getDate(); + date.setDate(1); + date.setMonth(date.getMonth() + Number(months || 0)); + const lastDayOfMonth = new Date(date.getFullYear(), date.getMonth() + 1, 0).getDate(); + date.setDate(Math.min(day, lastDayOfMonth)); + + this.expiryEditExpiryDate = this.$u.timeFormat(date.getTime(), 'yyyy-mm-dd'); + }, async resolveStorageIdForNonBatch(storageItem, productItem) { const stockId = this.getRelocationProductStockId(productItem) || this.getRelocationProductStockId(storageItem); const spaceId = this.normalizePositiveId( @@ -1908,7 +1971,7 @@ uni.hideLoading(); if (res && Number(res.code) === 200) { uni.showToast({ - title: (res && res.message) || '保存成功', + title: '保存成功', icon: 'success' }); if (productionChanged) { @@ -1917,20 +1980,24 @@ if (expiryChanged) { this.$set(storageItem, 'expiry_date', expiryDate); } + this.speakQueryMessage('保存成功'); this.closeExpiryEdit(); } else { + const failMessage = (res && res.message) || '保存失败'; uni.showToast({ - title: (res && res.message) || '保存失败', + title: failMessage, icon: 'none' }); + this.speakQueryMessage(failMessage); } } catch (error) { uni.hideLoading(); console.warn('[ProductQuery] 更新到期日期失败:', error); uni.showToast({ - title: '保存失败,请重试', + title: '保存失败', icon: 'none' }); + this.speakQueryMessage('保存失败'); } finally { this.expirySaving = false; } @@ -2928,6 +2995,28 @@ position: relative; } + // 库位模式下库存信息行斑马纹(白底 + 浅蓝底交替,对比更明显) + .storage-section--zebra .storage-scroll--body .storage-table__row:nth-child(even) { + background: #dde9fb; + } + + .storage-section--zebra .storage-scroll--body .storage-table__row:nth-child(odd) { + background: #ffffff; + } + + // 明细模式下库存记录组(库存值行 + 生产到期日期行)整体斑马纹,方便区分相邻记录 + .storage-section--detail .storage-scroll--body .storage-table__row--two-line:nth-child(even) { + background: #dde9fb; + } + + .storage-section--detail .storage-scroll--body .storage-table__row--two-line:nth-child(odd) { + background: #ffffff; + } + + .storage-section--detail .storage-row-dates { + background: transparent; + } + .storage-head-fixed { position: relative; left: 0; @@ -3039,6 +3128,10 @@ text-overflow: ellipsis; } + .storage-date-item:last-child { + text-align: right; + } + .storage-date-label { color: #909399; } @@ -3212,7 +3305,7 @@ } .popup-title { - font-size: 34rpx; + font-size: 40rpx; font-weight: 600; color: #303133; } @@ -3231,7 +3324,7 @@ } .expiry-form-label { - font-size: 30rpx; + font-size: 36rpx; color: #303133; } @@ -3242,10 +3335,41 @@ } .expiry-form-text { - font-size: 30rpx; + font-size: 36rpx; color: #606266; } + .expiry-quick-section { + margin-top: 20rpx; + padding-top: 16rpx; + border-top: 1rpx solid #f2f2f2; + } + + .expiry-quick-title { + font-size: 30rpx; + color: #909399; + } + + .expiry-quick-list { + display: flex; + flex-wrap: wrap; + gap: 30rpx; + margin-top: 16rpx; + } + + .expiry-quick-btn { + padding: 14rpx 32rpx; + border: 1rpx solid #d9e4f5; + border-radius: 10rpx; + background: #f5f8ff; + font-size: 32rpx; + color: #2979ff; + + &:active { + opacity: 0.7; + } + } + .popup-footer { display: flex; gap: 20rpx; @@ -3259,7 +3383,7 @@ align-items: center; justify-content: center; border-radius: 44rpx; - font-size: 30rpx; + font-size: 36rpx; font-weight: 600; &:active {