From eacbdcd01264a746080141acd105ffddfd80c849 Mon Sep 17 00:00:00 2001 From: "97694732@qq.com" Date: Thu, 4 Jun 2026 14:50:49 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8D=B0=E5=88=B7=E6=97=B6=E9=97=B4:=E7=A9=BA?= =?UTF-8?q?=E6=97=B6=E9=BB=98=E8=AE=A4=E4=BB=8A=E5=B9=B4/01=E6=9C=88,?= =?UTF-8?q?=E6=9C=89=E5=80=BC=E6=97=B6=E5=AE=9A=E4=BD=8D=E5=AF=B9=E5=BA=94?= =?UTF-8?q?=E5=B9=B4/=E6=9C=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/upload/upload.vue | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/pages/upload/upload.vue b/pages/upload/upload.vue index 4a5ee7d..e203bf7 100644 --- a/pages/upload/upload.vue +++ b/pages/upload/upload.vue @@ -935,6 +935,8 @@ export default { this.loadPriceConfig() // 预加载图书分类 this.loadNoIsbnCategory() + // 初始化印刷时间选择器默认值 + this.syncNoIsbnPrintTimeIndexes() // 恢复选择的仓库货位 const savedWhData = uni.getStorageSync('selectedWarehouseData') if (savedWhData) { @@ -1110,6 +1112,9 @@ export default { if (this.productList.length > 0 && this.isbn && this.isLoggedIn) { this.searchISBN() } + }, + noIsbnPrintTime() { + this.syncNoIsbnPrintTimeIndexes() } }, @@ -1658,6 +1663,22 @@ export default { } }, + // 同步印刷时间选择器索引(空→今年,有值→对应年/月) + syncNoIsbnPrintTimeIndexes() { + if (this.noIsbnPrintTime) { + const parts = this.noIsbnPrintTime.split('/') + const yearIdx = this.noIsbnYearOptions.indexOf(parts[0]) + const monthIdx = parts[1] ? this.noIsbnMonthOptions.indexOf(parts[1].padStart(2, '0')) : -1 + if (yearIdx >= 0) this.noIsbnPrintTimeIndexes[0] = yearIdx + if (monthIdx >= 0) this.noIsbnPrintTimeIndexes[1] = monthIdx + } else { + const curYear = String(new Date().getFullYear()) + const curYearIdx = this.noIsbnYearOptions.indexOf(curYear) + if (curYearIdx >= 0) this.noIsbnPrintTimeIndexes[0] = curYearIdx + this.noIsbnPrintTimeIndexes[1] = 0 + } + }, + // 商品预览 previewProductImage(index) { const urls = this.productList.map(item => item.image).filter(Boolean)