OCR入库
This commit is contained in:
parent
3dbf5081d7
commit
34a39391b3
|
|
@ -89,6 +89,7 @@ export default {
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('关闭相机出错:', error)
|
console.error('关闭相机出错:', error)
|
||||||
} finally {
|
} finally {
|
||||||
|
this.$emit('ocrClose', false)
|
||||||
this.showCamera = false
|
this.showCamera = false
|
||||||
this.cameraStarted = false
|
this.cameraStarted = false
|
||||||
this.resetFocusState()
|
this.resetFocusState()
|
||||||
|
|
@ -238,6 +239,7 @@ export default {
|
||||||
content: '相机插件未准备好,请确保应用已正确安装相机插件,或尝试重启应用',
|
content: '相机插件未准备好,请确保应用已正确安装相机插件,或尝试重启应用',
|
||||||
showCancel: false,
|
showCancel: false,
|
||||||
})
|
})
|
||||||
|
this.$emit('ocrClose', false)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -256,6 +258,7 @@ export default {
|
||||||
icon: 'none',
|
icon: 'none',
|
||||||
duration: 2000,
|
duration: 2000,
|
||||||
})
|
})
|
||||||
|
this.$emit('ocrClose', false)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -327,6 +330,7 @@ export default {
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('关闭相机出错:', error)
|
console.error('关闭相机出错:', error)
|
||||||
} finally {
|
} finally {
|
||||||
|
this.$emit('ocrClose', false)
|
||||||
this.showCamera = false
|
this.showCamera = false
|
||||||
this.cameraStarted = false
|
this.cameraStarted = false
|
||||||
this.resetFocusState()
|
this.resetFocusState()
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="card">
|
<div class="card" v-show="!showOCR">
|
||||||
<uni-forms :model="formData" label-width="180rpx" :border="true">
|
<uni-forms :model="formData" label-width="180rpx" :border="true">
|
||||||
<uni-forms-item label="设备编码:" name="maCode" required>
|
<uni-forms-item label="设备编码:" name="maCode" required>
|
||||||
<uni-easyinput v-model="formData.maCode" placeholder="请输入内容" />
|
<uni-easyinput v-model="formData.maCode" placeholder="请输入内容" />
|
||||||
|
|
@ -46,7 +46,7 @@
|
||||||
<button type="primary" style="width: 45%" @click="submit">入 库</button>
|
<button type="primary" style="width: 45%" @click="submit">入 库</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<OcrSearch ref="ocrSearch" @getMaCode="getMaCode" :jiJuType="formData.jiJuType" />
|
<OcrSearch ref="ocrSearch" @getMaCode="getMaCode" @ocrClose="handleOCRClose" :jiJuType="formData.jiJuType" />
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
|
|
@ -57,6 +57,7 @@ import OcrSearch from '@/components/OcrSearch/index.vue'
|
||||||
import { getDeviceTypeTreeApi, getTypeListApi, addMaMachineApi } from '@/services/inStorage'
|
import { getDeviceTypeTreeApi, getTypeListApi, addMaMachineApi } from '@/services/inStorage'
|
||||||
import { getSupplierList } from '@/services/information'
|
import { getSupplierList } from '@/services/information'
|
||||||
|
|
||||||
|
const showOCR = ref(false)
|
||||||
const ocrSearch = ref(null)
|
const ocrSearch = ref(null)
|
||||||
const opts = ref({})
|
const opts = ref({})
|
||||||
const formData = reactive({
|
const formData = reactive({
|
||||||
|
|
@ -101,6 +102,7 @@ const handleOpenOcr = () => {
|
||||||
})
|
})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
showOCR.value = true
|
||||||
ocrSearch.value.openCamera()
|
ocrSearch.value.openCamera()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -108,6 +110,10 @@ const getMaCode = (code) => {
|
||||||
console.log('🚀 ~ getMaCode ~ code:', code)
|
console.log('🚀 ~ getMaCode ~ code:', code)
|
||||||
formData.maCode = code
|
formData.maCode = code
|
||||||
}
|
}
|
||||||
|
const handleOCRClose = (val) => {
|
||||||
|
console.log('🚀 ~ handleOCRClose ~ val:', val)
|
||||||
|
showOCR.value = false
|
||||||
|
}
|
||||||
|
|
||||||
const getTypeModelList = async () => {
|
const getTypeModelList = async () => {
|
||||||
try {
|
try {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue