印刷时间:空时默认今年/01月,有值时定位对应年/月
This commit is contained in:
parent
12d35ec642
commit
eacbdcd012
@ -935,6 +935,8 @@ export default {
|
|||||||
this.loadPriceConfig()
|
this.loadPriceConfig()
|
||||||
// 预加载图书分类
|
// 预加载图书分类
|
||||||
this.loadNoIsbnCategory()
|
this.loadNoIsbnCategory()
|
||||||
|
// 初始化印刷时间选择器默认值
|
||||||
|
this.syncNoIsbnPrintTimeIndexes()
|
||||||
// 恢复选择的仓库货位
|
// 恢复选择的仓库货位
|
||||||
const savedWhData = uni.getStorageSync('selectedWarehouseData')
|
const savedWhData = uni.getStorageSync('selectedWarehouseData')
|
||||||
if (savedWhData) {
|
if (savedWhData) {
|
||||||
@ -1110,6 +1112,9 @@ export default {
|
|||||||
if (this.productList.length > 0 && this.isbn && this.isLoggedIn) {
|
if (this.productList.length > 0 && this.isbn && this.isLoggedIn) {
|
||||||
this.searchISBN()
|
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) {
|
previewProductImage(index) {
|
||||||
const urls = this.productList.map(item => item.image).filter(Boolean)
|
const urls = this.productList.map(item => item.image).filter(Boolean)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user