feat:样品库管理
This commit is contained in:
@@ -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 = ''
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user