diff --git a/core/request/apis.js b/core/request/apis.js index ada7701..6905e24 100644 --- a/core/request/apis.js +++ b/core/request/apis.js @@ -275,6 +275,18 @@ export default { method: "POST", isSystemApi: true }, + listByStockId: { + path: "storage.inventory.listByStockId", + auth: true, + method: "POST", + isSystemApi: true + }, + updateExpiry: { + path: "storage.inventory.updateExpiry", + auth: true, + method: "POST", + isSystemApi: true + }, transferByProduct: { path: "storage.inventory.transferByProduct", auth: true, diff --git a/pages/work/product/query.vue b/pages/work/product/query.vue index d1e4242..35e9b89 100644 --- a/pages/work/product/query.vue +++ b/pages/work/product/query.vue @@ -3,6 +3,24 @@ + @@ -160,7 +186,6 @@ :style="getStorageHeadStyle(getStorageSectionKey(item, index, 'batch'))" > - 批次号 库位 库存 可移库存 @@ -179,12 +204,23 @@ - {{ getBatchNumberBySource(storageItem, item) }} - {{ getStorageSpaceText(storageItem) }} - {{ getStorageQuantityText(storageItem) }} - {{ getStorageAvailableText(storageItem) }} + + {{ getStorageSpaceText(storageItem) }} + {{ getStorageQuantityText(storageItem) }} + {{ getStorageAvailableText(storageItem) }} + + + + 生产: + {{ getProductionDateText(storageItem) }} + + + 到期: + {{ getExpiryDateText(storageItem) }} + + @@ -203,6 +239,49 @@ + + + + 维护生产/到期日期 + + + + 生产日期 + + {{ expiryEditProductDate || '请选择' }} + + + + + 到期日期 + + {{ expiryEditExpiryDate || '请选择' }} + + + + + + + 取消 + + + 保存 + + + + + + + @@ -214,6 +293,8 @@ title: '商品查询', keyword: '', queryMode: 'nonBatch', + // 库存展示粒度:space=按库位(默认,group_by_batch=false),detail=按明细(group_by_batch=true) + inventoryViewMode: 'space', loading: false, list: [], rawList: [], @@ -236,7 +317,24 @@ // 商品图片/条码缓存(按商品 id),避免重复搜索重复请求;TTL 5 分钟 productImageCache: {}, productBarcodeCache: {}, - CACHE_TTL: 5 * 60 * 1000 + CACHE_TTL: 5 * 60 * 1000, + // 明细/库位切换时复用:避免重新搜索导致整页 loading 闪烁 + searchListCache: [], + warehouseListCache: [], + stockIdListCache: [], + expiryEditVisible: false, + expiryEditItem: null, + expiryEditProductItem: null, + expiryEditProductDate: '', + expiryEditExpiryDate: '', + expiryEditOriginalProductDate: '', + expiryEditOriginalExpiryDate: '', + expiryDatePickerVisible: false, + expiryDatePickerType: 'production', + expiryDatePickerValue: '', + expiryDateMinDate: 0, + expiryDateMaxDate: 0, + expirySaving: false } }, computed: { @@ -1056,7 +1154,17 @@ ); }, extractListFromResponse(response) { - const responseData = response && response.data; + if (!response || typeof response !== 'object') { + return []; + } + // 兼容两种返回结构:{ data: { list: [...] } } 与 { list: [...] } + if (Array.isArray(response.list)) { + return response.list; + } + if (Array.isArray(response.rows)) { + return response.rows; + } + const responseData = response.data; if (Array.isArray(responseData)) { return responseData; } @@ -1157,7 +1265,15 @@ return list; } - return list.filter(item => !this.hasBatchNumber(item)); + // 非批次模式:按「是否开启批次管理」过滤,而不是按 batch_no 判断 + // (非批次商品也可能有入库批次号 batch_no) + return list.filter(item => { + if (!item || typeof item !== 'object') { + return false; + } + const flag = item.is_batch_mgmt_enabled ?? item.stock?.is_batch_mgmt_enabled; + return !(flag === true || flag === 1 || flag === '1' || flag === 'true'); + }); }, updateDisplayListByMode(sourceList, keyword, isBarcodeKeyword) { // 无论是条码还是名称,都支持模糊匹配 @@ -1300,7 +1416,7 @@ sortField: 'created_at', sortOrder: 'DESC' }, - group_by_batch: this.queryMode === 'batch' + group_by_batch: this.inventoryViewMode === 'detail' }; }, setQueryMode(nextMode) { @@ -1318,6 +1434,34 @@ this.handleSearch(); }, + setInventoryViewMode(nextMode) { + if (!nextMode || nextMode === this.inventoryViewMode) { + return; + } + + this.inventoryViewMode = nextMode; + const keyword = this.normalizeKeyword(this.keyword); + if (!keyword) { + this.scheduleRefreshStorageSectionMetas(); + return; + } + + // 已有缓存时只重拉库存明细,不重新搜索,避免整页 loading 闪烁 + if (Array.isArray(this.stockIdListCache) && this.stockIdListCache.length) { + this.refreshInventoryByMode(); + } else { + this.handleSearch(); + } + }, + async refreshInventoryByMode() { + const searchSeq = ++this.searchSeq; + await this.fetchInventoryDetails( + this.searchListCache, + this.warehouseListCache, + this.stockIdListCache, + searchSeq + ); + }, filterByNameContains(list, keyword) { const target = String(keyword || '').trim().toLowerCase(); if (!target) { @@ -1467,19 +1611,14 @@ return Math.max(Array.isArray(list) ? list.length : 0, 1); }, shouldEnableStorageVerticalScroll(item, mode = 'nonBatch') { - return this.getStorageRowCount(item, mode) > 4; + // 内层 scroll-view 同时开启 scroll-x 与 scroll-y 时,纵向滚动会失效; + // 这里不再开启内层纵向滚动,纵向上由外层页面 scroll-view 负责 + return false; }, getStorageBodyStyle(item, mode = 'nonBatch') { - const minRows = 1; - const maxRows = 4; - // 与 CSS .storage-table__row 的 min-height:72rpx + padding:8rpx 0 保持一致 - const rowHeight = 88; - const rowCount = this.getStorageRowCount(item, mode); - const visibleRows = Math.min(Math.max(rowCount, minRows), maxRows); + // 不限制高度,让表格按实际行数完整展开,避免底部行被裁剪 return { - minHeight: `${minRows * rowHeight}rpx`, - maxHeight: `${maxRows * rowHeight}rpx`, - height: `${visibleRows * rowHeight}rpx` + minHeight: '140rpx' }; }, getStorageItemKey(item, index) { @@ -1487,14 +1626,15 @@ return index; } - return item.id || item.space_id || item.storage_id || item.space_barcode || item.space_name || index; + return item.storage_id || item.id || item.space_id || item.space_barcode || item.space_name || index; }, getBatchStorageItemKey(sourceItem, storageItem, index) { if (!storageItem || typeof storageItem !== 'object') { return this.getStorageItemKey(sourceItem, index); } - return storageItem.id + return storageItem.storage_id + || storageItem.id || storageItem.batch_id || storageItem.space_id || `${this.getBatchNumberBySource(storageItem, sourceItem)}_${this.getStorageSpaceText(storageItem)}_${index}`; @@ -1552,6 +1692,249 @@ ?? item.usable_quantity ); }, + formatStorageDate(value) { + if (value === null || value === undefined || value === '') { + return '--'; + } + + const text = String(value).trim(); + if (!text) { + return '--'; + } + + const datePart = text.split(' ')[0].split('T')[0]; + if (/^\d{4}[-/]\d{1,2}[-/]\d{1,2}$/.test(datePart)) { + return datePart.replace(/\//g, '-'); + } + + const date = new Date(text); + if (!Number.isNaN(date.getTime())) { + const year = date.getFullYear(); + const month = String(date.getMonth() + 1).padStart(2, '0'); + const day = String(date.getDate()).padStart(2, '0'); + return `${year}-${month}-${day}`; + } + + return text; + }, + getProductionDateText(item) { + if (!item || typeof item !== 'object') { + return '--'; + } + + return this.formatStorageDate(item.production_date ?? item.produce_date ?? item.manufacture_date); + }, + getExpiryDateText(item) { + if (!item || typeof item !== 'object') { + return '--'; + } + + return this.formatStorageDate(item.expiry_date ?? item.expire_date ?? item.expiration_date); + }, + parseDateToTimestamp(value) { + const text = String(value || '').trim(); + if (!text) { + return NaN; + } + + const normalized = text.replace(/-/g, '/'); + const date = new Date(normalized); + if (Number.isNaN(date.getTime())) { + return NaN; + } + + date.setHours(0, 0, 0, 0); + return date.getTime(); + }, + getRawStorageDate(item, type) { + if (!item || typeof item !== 'object') { + return ''; + } + + const value = type === 'production' + ? (item.production_date ?? item.produce_date ?? item.manufacture_date) + : (item.expiry_date ?? item.expire_date ?? item.expiration_date); + if (value === null || value === undefined || value === '') { + return ''; + } + + return this.formatStorageDate(value); + }, + openExpiryEdit(productItem, storageItem) { + if (!storageItem || typeof storageItem !== 'object') { + return; + } + + this.expiryEditItem = storageItem; + this.expiryEditProductItem = productItem || null; + this.expiryEditProductDate = this.getRawStorageDate(storageItem, 'production'); + this.expiryEditExpiryDate = this.getRawStorageDate(storageItem, 'expiry'); + this.expiryEditOriginalProductDate = this.expiryEditProductDate; + this.expiryEditOriginalExpiryDate = this.expiryEditExpiryDate; + this.expiryEditVisible = true; + }, + closeExpiryEdit() { + this.expiryEditVisible = false; + this.expiryEditItem = null; + this.expiryEditProductItem = null; + }, + showExpiryDatePicker(type) { + this.expiryDatePickerType = type; + const currentText = type === 'production' ? this.expiryEditProductDate : this.expiryEditExpiryDate; + const currentTimestamp = this.parseDateToTimestamp(currentText); + const now = new Date(); + this.expiryDatePickerValue = Number.isFinite(currentTimestamp) ? currentTimestamp : now.getTime(); + + // 彻底放开边界:允许任意日期 + this.expiryDateMinDate = new Date(1900, 0, 1).getTime(); + this.expiryDateMaxDate = new Date(2100, 11, 31).getTime(); + + this.expiryDatePickerVisible = true; + }, + handleExpiryDateConfirm(e) { + const dateStr = this.$u.timeFormat(e.value, 'yyyy-mm-dd'); + if (this.expiryDatePickerType === 'production') { + this.expiryEditProductDate = dateStr; + } else { + this.expiryEditExpiryDate = dateStr; + } + this.expiryDatePickerVisible = false; + }, + async resolveStorageIdForNonBatch(storageItem, productItem) { + const stockId = this.getRelocationProductStockId(productItem) || this.getRelocationProductStockId(storageItem); + const spaceId = this.normalizePositiveId( + storageItem.space_id + || storageItem.space?.id + || productItem?.space_id + || productItem?.space?.id + ); + if (!stockId || !spaceId) { + return null; + } + + try { + const res = await this.$http('storage.inventory.listByStockId', { stock_id: stockId }); + const listOk = res && (res.flag === 'success' || Number(res.code) === 1 || Number(res.code) === 200); + if (!listOk) { + return null; + } + const list = this.extractListFromResponse(res); + const matched = (list || []).find(record => { + if (!record || typeof record !== 'object') { + return false; + } + const recordSpaceId = this.normalizePositiveId(record.space_id ?? record.space?.id); + return recordSpaceId === spaceId; + }); + if (matched) { + return this.normalizePositiveId(matched.storage_id ?? matched.id); + } + console.log('[ProductQuery] listByStockId 未匹配到库位', { + stockId, + spaceId, + listLength: list.length, + firstItem: list[0] || null + }); + } catch (error) { + console.warn('[ProductQuery] 查询库存记录ID失败:', error); + } + return null; + }, + async saveExpiry() { + if (this.expirySaving) { + return; + } + + const storageItem = this.expiryEditItem; + if (!storageItem || typeof storageItem !== 'object') { + return; + } + + const productionDate = this.expiryEditProductDate; + const expiryDate = this.expiryEditExpiryDate; + const productionChanged = productionDate !== this.expiryEditOriginalProductDate; + const expiryChanged = expiryDate !== this.expiryEditOriginalExpiryDate; + + if (!productionChanged && !expiryChanged) { + uni.showToast({ + title: '日期未发生变化', + icon: 'none' + }); + return; + } + + // 未传字段取库内原值参与比较(生产日期不得晚于到期日期) + const mergedProductionDate = productionChanged ? productionDate : this.expiryEditOriginalProductDate; + const mergedExpiryDate = expiryChanged ? expiryDate : this.expiryEditOriginalExpiryDate; + const productionTimestamp = this.parseDateToTimestamp(mergedProductionDate); + const expiryTimestamp = this.parseDateToTimestamp(mergedExpiryDate); + if (Number.isFinite(productionTimestamp) && Number.isFinite(expiryTimestamp) && expiryTimestamp < productionTimestamp) { + uni.showToast({ + title: '到期日期不能早于生产日期', + icon: 'none' + }); + return; + } + + this.expirySaving = true; + uni.showLoading({ + title: '保存中...' + }); + try { + let storageId = this.getRelocationStorageId(storageItem); + if (!storageId && this.queryMode === 'nonBatch') { + storageId = await this.resolveStorageIdForNonBatch(storageItem, this.expiryEditProductItem); + } + if (!storageId) { + uni.hideLoading(); + uni.showToast({ + title: '未获取到库存记录ID', + icon: 'none' + }); + return; + } + + const payload = { + storage_id: storageId + }; + if (productionChanged) { + payload.production_date = productionDate; + } + if (expiryChanged) { + payload.expiry_date = expiryDate; + } + + const res = await this.$http('storage.inventory.updateExpiry', payload); + uni.hideLoading(); + if (res && Number(res.code) === 200) { + uni.showToast({ + title: (res && res.message) || '保存成功', + icon: 'success' + }); + if (productionChanged) { + this.$set(storageItem, 'production_date', productionDate); + } + if (expiryChanged) { + this.$set(storageItem, 'expiry_date', expiryDate); + } + this.closeExpiryEdit(); + } else { + uni.showToast({ + title: (res && res.message) || '保存失败', + icon: 'none' + }); + } + } catch (error) { + uni.hideLoading(); + console.warn('[ProductQuery] 更新到期日期失败:', error); + uni.showToast({ + title: '保存失败,请重试', + icon: 'none' + }); + } finally { + this.expirySaving = false; + } + }, getStorageSpaceCode(item) { if (!item || typeof item !== 'object') { return ''; @@ -1825,6 +2208,10 @@ stockIdList = stockIdList.slice(0, MAX_INVENTORY_STOCK_IDS); } console.log('[ProductQuery] stockIdList 数量:', stockIdList.length); + // 缓存阶段1的列表与商品 id,明细/库位切换时复用,避免重新搜索 + this.searchListCache = nextList; + this.warehouseListCache = warehouseList; + this.stockIdListCache = stockIdList; let mergedList = this.mergeProductResultLists(nextList, warehouseList, []); mergedList = this.applySearchStorageOverride(mergedList, nextList); mergedList = this.applyRouteStockFilter(mergedList); @@ -1887,25 +2274,77 @@ } const listStartTime = Date.now(); - const listRes = await this.$http('storage.inventory.list', this.buildListQueryParams(stockIdList)).catch(error => { - console.warn('[ProductQuery] storage.inventory.list 调用失败:', error); - return null; - }); - console.log('[ProductQuery] 阶段2 inventory.list 耗时:', Date.now() - listStartTime, 'ms'); + const groupBySpace = this.inventoryViewMode === 'space'; + // 按 stock_id 逐商品请求 listByStockId,并发上限 4;按库位时传 group_by_space=true + const results = await this.runMapWithConcurrency( + stockIdList, + 4, + async (stockId) => { + const params = { stock_id: stockId }; + if (groupBySpace) { + params.group_by_space = true; + } + return this.$http('storage.inventory.listByStockId', params).catch(error => { + console.warn('[ProductQuery] storage.inventory.listByStockId 调用失败:', error); + return null; + }); + } + ); + console.log('[ProductQuery] 阶段2 listByStockId 耗时:', Date.now() - listStartTime, 'ms'); // 竞态保护:请求期间可能已发起新的搜索 if (searchSeq !== this.searchSeq) { return; } - const listOk = listRes && listRes.code === 200; - if (!listOk) { + const detailList = []; + results.forEach(result => { + if (!result || result.status !== 'fulfilled') { + return; + } + const res = result.value; + const listOk = res && (res.flag === 'success' || Number(res.code) === 1 || Number(res.code) === 200); + if (!listOk) { + return; + } + const list = this.extractListFromResponse(res); + if (Array.isArray(list) && list.length) { + detailList.push(...list); + } + }); + + if (!detailList.length) { return; } - const detailList = this.extractListFromResponse(listRes); - let mergedList = this.mergeProductResultLists(nextList, warehouseList, detailList); + const firstDetail = detailList[0] || {}; + console.log('[ProductQuery] listByStockId 首条明细字段:', JSON.stringify({ + keys: Object.keys(firstDetail), + storage_id: firstDetail.storage_id, + id: firstDetail.id, + stock_id: firstDetail.stock_id, + space_id: firstDetail.space_id, + production_date: firstDetail.production_date, + expiry_date: firstDetail.expiry_date + })); + + // 明细行 id 是 wms_storage.id,统一转为 storage_id,避免污染商品项的 id + const normalizedDetailList = detailList.map(detail => { + if (!detail || typeof detail !== 'object') { + return detail; + } + const next = { ...detail }; + if (next.storage_id === undefined && next.id !== undefined) { + next.storage_id = next.id; + } + delete next.id; + return next; + }); + + let mergedList = this.mergeProductResultLists(nextList, warehouseList, normalizedDetailList); mergedList = this.applySearchStorageOverride(mergedList, nextList); + mergedList = this.applyInventoryStorageOverride(mergedList, normalizedDetailList); + mergedList = this.applyInventoryDatesToStorage(mergedList, normalizedDetailList); mergedList = this.applyRouteStockFilter(mergedList); if (searchSeq !== this.searchSeq) { @@ -1947,6 +2386,145 @@ return item; }); }, + /** + * 以 storage.inventory.list 明细作为库存表主数据源: + * 按 stock_id 分组,把明细覆盖到 item.storage(有明细才覆盖,否则保留 search 的 storage 兜底)。 + * 明细自带 库位/库存/可移库存/生产/到期日期。 + */ + applyInventoryStorageOverride(mergedList, detailList) { + if (!Array.isArray(detailList) || !detailList.length) { + return mergedList; + } + + const detailByStockId = new Map(); + detailList.forEach(detail => { + if (!detail || typeof detail !== 'object') { + return; + } + const stockId = this.normalizePositiveId(detail.stock_id ?? detail.stock?.id); + if (!stockId) { + return; + } + if (!detailByStockId.has(stockId)) { + detailByStockId.set(stockId, []); + } + detailByStockId.get(stockId).push(detail); + }); + + if (!detailByStockId.size) { + return mergedList; + } + + return (mergedList || []).map(item => { + if (!item || typeof item !== 'object') { + return item; + } + const stockId = this.getRelocationProductStockId(item); + const records = stockId ? detailByStockId.get(stockId) : null; + if (!records || !records.length) { + return item; + } + // 明细需含库位信息才覆盖,否则是商品级聚合,保留 search 的库位明细兜底 + const hasSpaceInfo = records.some(record => this.hasStorageSpaceInfo(record)); + if (!hasSpaceInfo) { + return item; + } + return { ...item, storage: records }; + }); + }, + /** + * 非批次模式:storage.inventory.list 是商品级聚合(无库位), + * 把明细里的生产/到期日期按 stock_id 回填到 search 的库位明细上。 + */ + applyInventoryDatesToStorage(mergedList, detailList) { + // 按明细模式 inventory.list 明细自带日期,无需回填;仅按库位模式回填 + if (this.inventoryViewMode === 'detail') { + return mergedList; + } + if (!Array.isArray(detailList) || !detailList.length) { + return mergedList; + } + + const dateMapByStockId = new Map(); + detailList.forEach(detail => { + if (!detail || typeof detail !== 'object') { + return; + } + const stockId = this.normalizePositiveId(detail.stock_id ?? detail.stock?.id); + if (!stockId) { + return; + } + const productionDate = detail.production_date ?? detail.produce_date ?? detail.manufacture_date; + const expiryDate = detail.expiry_date ?? detail.expire_date ?? detail.expiration_date; + const entry = {}; + if (productionDate !== null && productionDate !== undefined && String(productionDate).trim() !== '') { + entry.production_date = productionDate; + } + if (expiryDate !== null && expiryDate !== undefined && String(expiryDate).trim() !== '') { + entry.expiry_date = expiryDate; + } + if (Object.keys(entry).length && !dateMapByStockId.has(stockId)) { + dateMapByStockId.set(stockId, entry); + } + }); + + if (!dateMapByStockId.size) { + return mergedList; + } + + return (mergedList || []).map(item => { + if (!item || typeof item !== 'object') { + return item; + } + const stockId = this.getRelocationProductStockId(item); + const dateEntry = stockId ? dateMapByStockId.get(stockId) : null; + if (!dateEntry) { + return item; + } + + const next = { ...item }; + const applyDates = (entry) => { + if (!entry || typeof entry !== 'object') { + return entry; + } + // 只补缺失日期,不覆盖已有日期 + const updated = { ...entry }; + if (dateEntry.production_date !== undefined && this.getRawStorageDate(entry, 'production') === '') { + updated.production_date = dateEntry.production_date; + } + if (dateEntry.expiry_date !== undefined && this.getRawStorageDate(entry, 'expiry') === '') { + updated.expiry_date = dateEntry.expiry_date; + } + return updated; + }; + if (Array.isArray(next.storage)) { + next.storage = next.storage.map(applyDates); + } + if (Array.isArray(next.wms_storage)) { + next.wms_storage = next.wms_storage.map(applyDates); + } + return next; + }); + }, + hasStorageSpaceInfo(record) { + if (!record || typeof record !== 'object') { + return false; + } + return [ + record.space_id, + record.space?.id, + record.custom_name, + record.space?.custom_name, + record.space_code, + record.space?.code, + record.space?.space_code, + record.space?.name, + record.space_name, + record.space_barcode, + record.location_name, + record.position_name + ].some(value => value !== null && value !== undefined && value !== ''); + }, /** * 从分拣缺货补货进入时,根据 stock_id 精确匹配 */ @@ -1974,6 +2552,12 @@ overflow: hidden; } + /* u-popup 根节点自带 flex:1(uView 组件内置),放在纵向 flex 容器里会与 normar_container 平分高度,这里中和掉 */ + .goods-query-page > .u-popup { + flex: none; + flex-shrink: 0; + } + .normar_container { flex: 1; display: flex; @@ -2030,7 +2614,7 @@ transition: all 0.2s ease; &__text { - font-size: 20rpx; + font-size: 26rpx; font-weight: 600; color: #5f6b7a; line-height: 1; @@ -2050,6 +2634,48 @@ } } + .nav-view-switch-group { + height: 44rpx; + padding: 3rpx; + border-radius: 26rpx; + background: #edf2ff; + display: inline-flex; + align-items: center; + box-sizing: border-box; + border: 1rpx solid #dbe7ff; + } + + .nav-view-switch-btn { + min-width: 68rpx; + height: 40rpx; + padding: 0 10rpx; + border-radius: 21rpx; + display: inline-flex; + align-items: center; + justify-content: center; + transition: all 0.2s ease; + + &__text { + font-size: 26rpx; + font-weight: 600; + color: #5f6b7a; + line-height: 1; + } + + &:active { + opacity: 0.88; + } + } + + .nav-view-switch-btn--active { + background: #07c160; + box-shadow: 0 3rpx 8rpx rgba(7, 193, 96, 0.25); + + .nav-view-switch-btn__text { + color: #fff; + } + } + .search-input-wrap { position: relative; @@ -2364,18 +2990,6 @@ min-width: 680rpx; } - .storage-table--batch .storage-col { - font-size: 32rpx; - } - - .storage-table--batch .storage-col--batch { - flex: 0.62; - } - - .storage-table--batch .storage-col--space { - flex: 0.95; - } - .storage-table__row { display: grid; align-items: center; @@ -2390,7 +3004,47 @@ } .storage-table--batch .storage-table__row { - grid-template-columns: minmax(0, 0.65fr) minmax(0, 0.85fr) minmax(0, 0.4fr) minmax(0, 0.4fr); + grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.72fr) minmax(0, 0.72fr); + } + + .storage-table__row--two-line { + display: block; + padding: 0; + } + + .storage-row-main { + display: grid; + grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.72fr) minmax(0, 0.72fr); + align-items: center; + min-height: 72rpx; + } + + .storage-row-dates { + display: flex; + align-items: center; + gap: 24rpx; + min-height: 72rpx; + padding: 8rpx 14rpx; + border-top: 1rpx dashed #e8eef7; + background: #fbfdff; + box-sizing: border-box; + } + + .storage-date-item { + flex: 1; + font-size: 35rpx; + line-height: 1.4; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + } + + .storage-date-label { + color: #909399; + } + + .storage-date-value { + color: #000000; } .storage-table__row:last-child { @@ -2484,11 +3138,6 @@ text-decoration: none; } - .storage-table--batch .storage-col--qty { - padding-left: 1rpx; - padding-right: 1rpx; - } - .storage-col--highlight { color: #2979ff; font-weight: 600; @@ -2549,4 +3198,82 @@ .safe-area-bottom { height: calc(30rpx + env(safe-area-inset-bottom)); } + + .expiry-edit-popup { + padding-bottom: calc(24rpx + env(safe-area-inset-bottom)); + background: #fff; + } + + .popup-header { + display: flex; + align-items: center; + justify-content: center; + padding: 32rpx 24rpx 20rpx; + } + + .popup-title { + font-size: 34rpx; + font-weight: 600; + color: #303133; + } + + .popup-body { + padding: 0 24rpx; + } + + .expiry-form-item { + display: flex; + align-items: center; + justify-content: space-between; + min-height: 96rpx; + padding: 0 8rpx; + border-bottom: 1rpx solid #f2f2f2; + } + + .expiry-form-label { + font-size: 30rpx; + color: #303133; + } + + .expiry-form-value { + display: flex; + align-items: center; + gap: 8rpx; + } + + .expiry-form-text { + font-size: 30rpx; + color: #606266; + } + + .popup-footer { + display: flex; + gap: 20rpx; + padding: 32rpx 24rpx 0; + } + + .popup-btn { + flex: 1; + height: 88rpx; + display: flex; + align-items: center; + justify-content: center; + border-radius: 44rpx; + font-size: 30rpx; + font-weight: 600; + + &:active { + opacity: 0.8; + } + } + + .popup-btn--cancel { + background: #f2f3f5; + color: #606266; + } + + .popup-btn--confirm { + background: #2979ff; + color: #fff; + }