feat:样品库管理

This commit is contained in:
houjunxiang
2025-11-21 17:56:33 +08:00
parent 7ee3df9ab9
commit 753766893b
24 changed files with 818 additions and 218 deletions

View File

@@ -58,15 +58,19 @@
<script setup>
import { ref, computed, onMounted, toRefs, watch } from 'vue'
import { onShow } from '@dcloudio/uni-app'
import { debounce } from 'lodash'
import nx from '@/nx'
const { scanQRInfo } = toRefs(nx.$store('biz'))
watch(scanQRInfo, newVal => {
if (!newVal) return
debouncedHandleScan(newVal)
})
const debouncedHandleScan = debounce(val => {
if (!val) return
scanQRInfo.value = ''
if (nx.$router.getCurrentPage().route !== 'pages/sampleWarehouse/sampleSearch/index') return
try {
sampleCode.value = newVal
sampleCode.value = val
handleSearch()
} catch (error) {
uni.showToast({
@@ -74,7 +78,7 @@ watch(scanQRInfo, newVal => {
icon: 'none'
})
}
})
}, 300)
onShow(() => {
scanQRInfo.value = ''
})