This commit is contained in:
parent
4455f9cc36
commit
63bfa4d48c
|
|
@ -50,8 +50,8 @@ const origin = window.location.href
|
|||
|
||||
// 登录参数
|
||||
const loginForm = reactive({
|
||||
username: uni.getStorageSync('username'),
|
||||
password: uni.getStorageSync('password'),
|
||||
username: '342601199506086818',
|
||||
password: 'Iws2022#',
|
||||
loginType: 'USERNAME_PASSWORD',
|
||||
code: '',
|
||||
phoneUuid: '',
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
status-bar
|
||||
left-icon="left"
|
||||
left-text="返回"
|
||||
title="OCR出库"
|
||||
title="编码出库"
|
||||
@clickLeft="back"
|
||||
/>
|
||||
<view class="page-container">
|
||||
|
|
@ -27,13 +27,28 @@
|
|||
<uni-forms-item label="领料工程:" name="projectName" class="flex">
|
||||
<span class="form-view">{{ queryParams.projectName }}</span>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="物资类型:" name="maTypeName" class="flex" v-if="!queryParams.isAddCode">
|
||||
<uni-forms-item
|
||||
label="物资类型:"
|
||||
name="maTypeName"
|
||||
class="flex"
|
||||
v-if="!queryParams.isAddCode"
|
||||
>
|
||||
<span class="form-view">{{ queryParams.maTypeName }}</span>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="规格型号:" name="typeName" class="flex" v-if="!queryParams.isAddCode">
|
||||
<uni-forms-item
|
||||
label="规格型号:"
|
||||
name="typeName"
|
||||
class="flex"
|
||||
v-if="!queryParams.isAddCode"
|
||||
>
|
||||
<span class="form-view">{{ queryParams.typeName }}</span>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="待出库数量:" name="outNum" class="flex" v-if="!queryParams.isAddCode">
|
||||
<uni-forms-item
|
||||
label="待出库数量:"
|
||||
name="outNum"
|
||||
class="flex"
|
||||
v-if="!queryParams.isAddCode"
|
||||
>
|
||||
<span class="form-view">{{ queryParams.outNum }}</span>
|
||||
</uni-forms-item>
|
||||
</uni-forms>
|
||||
|
|
@ -49,19 +64,13 @@
|
|||
</uni-col>
|
||||
-->
|
||||
<uni-col :span="6">
|
||||
<button style="width: 100px" type="primary" @click="scanStart">
|
||||
二维码出库
|
||||
</button>
|
||||
<button style="width: 100px" type="primary" @click="scanStart">二维码出库</button>
|
||||
</uni-col>
|
||||
<uni-col :span="6">
|
||||
<button style="width: 100px" type="primary" @click="">
|
||||
RFID识别
|
||||
</button>
|
||||
<button style="width: 100px" type="primary" @click="">RFID识别</button>
|
||||
</uni-col>
|
||||
<uni-col :span="6">
|
||||
<button style="width: 100px" type="primary" @click="ocrClick">
|
||||
OCR识别
|
||||
</button>
|
||||
<button style="width: 100px" type="primary" @click="ocrClick">OCR识别</button>
|
||||
</uni-col>
|
||||
</uni-row>
|
||||
</view>
|
||||
|
|
@ -132,7 +141,7 @@
|
|||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, computed, onUnmounted,reactive } from 'vue'
|
||||
import { ref, computed, onUnmounted, reactive } from 'vue'
|
||||
import { onLoad, onShow } from '@dcloudio/uni-app'
|
||||
import {
|
||||
getCodeDetailAPI,
|
||||
|
|
@ -141,7 +150,7 @@ import {
|
|||
getCodeScanAPI,
|
||||
} from '@/services/picking/outbound.js'
|
||||
import { getBoxBindByCode } from '@/services/standard.js'
|
||||
import { getInfoByQrcode,getOutNum } from '@/services/back.js'
|
||||
import { getInfoByQrcode, getOutNum } from '@/services/back.js'
|
||||
import { debounce } from 'lodash-es'
|
||||
import ScanQrCode from '@/pages/devicesSearch/ScanQrCode.vue'
|
||||
// const query = defineProps() // 获取上级页面传递的路由参数
|
||||
|
|
@ -187,7 +196,7 @@ const back = () => {
|
|||
onLoad((opt) => {
|
||||
queryParamsTemp.value = opt.params ? JSON.parse(opt.params) : {}
|
||||
queryParamsTemp.value.id = queryParamsTemp.value.parentId
|
||||
console.log("xxxxxxxx",queryParamsTemp.value)
|
||||
console.log('xxxxxxxx', queryParamsTemp.value)
|
||||
queryParams.value.isAddCode = queryParamsTemp.value.isAddCode
|
||||
getDetailsById()
|
||||
// getDetailsById()
|
||||
|
|
@ -195,7 +204,7 @@ onLoad((opt) => {
|
|||
})
|
||||
|
||||
onShow(() => {
|
||||
getDetailsById()
|
||||
getDetailsById()
|
||||
// getCodeDetailData(queryParams.value.id, queryParams.value.publishTask, queryParams.value.typeId) //获取详情
|
||||
})
|
||||
|
||||
|
|
@ -203,12 +212,14 @@ onShow(() => {
|
|||
const getDetailsById = async () => {
|
||||
try {
|
||||
console.log('🚀 ~ getDetailsById ~ queryParams.value:', queryParamsTemp.value)
|
||||
const res = await getOutNum({id: queryParamsTemp.value.id,typeId: queryParamsTemp.value.typeId})
|
||||
const res = await getOutNum({
|
||||
id: queryParamsTemp.value.id,
|
||||
typeId: queryParamsTemp.value.typeId,
|
||||
})
|
||||
console.log('🚀 ~ getDetailsById ~ queryParams.value:', res.data)
|
||||
queryParams.value = res.data[0]
|
||||
queryParams.value.projectName = queryParamsTemp.value.projectName
|
||||
queryParams.value.teamName = queryParamsTemp.value.teamName
|
||||
|
||||
} catch (error) {
|
||||
console.log('🚀 ~ getDetailsById ~ error:', error)
|
||||
}
|
||||
|
|
@ -217,7 +228,7 @@ const getDetailsById = async () => {
|
|||
const delMaterial = (item, index) => {
|
||||
codeDeviceList.value.splice(index, 1)
|
||||
// 提示
|
||||
uni.showToast({
|
||||
uni.showToast({
|
||||
title: `${item.maCode} 移除成功`,
|
||||
icon: 'none',
|
||||
})
|
||||
|
|
@ -467,13 +478,17 @@ const scanStart = () => {
|
|||
// }
|
||||
uni.scanCode({
|
||||
success: async (res) => {
|
||||
console.log('🚀 ~ scanStart ~ res:', res.result)
|
||||
const qrCode = res.result
|
||||
console.log('🚀 ~ scanStart ~ res:', res)
|
||||
let qrCode = res.result
|
||||
qrCode = qrCode.includes('qrcode=') ? qrCode.split('qrcode=')[1] : qrCode
|
||||
console.log('🚀 ~ success: ~ qrCode:', qrCode)
|
||||
if (!qrCode) {
|
||||
uni.showToast({ title: '扫码识别失败', icon: 'none' })
|
||||
} else {
|
||||
const params = { qrCode, typeId: queryParams.value.typeId }
|
||||
console.log('🚀 ~ success: ~ params:', params)
|
||||
try {
|
||||
const res = await getInfoByQrcode({ qrCode })
|
||||
const res = await getInfoByQrcode(params)
|
||||
console.log('🚀 ~ success: ~ res:', res)
|
||||
if (res.code === 200) {
|
||||
if (res.data && res.data.recordList.length > 0) {
|
||||
|
|
@ -489,13 +504,13 @@ const scanStart = () => {
|
|||
return true
|
||||
})
|
||||
//materialModel
|
||||
codeDeviceList.value.forEach(item => {
|
||||
codeDeviceList.value.forEach((item) => {
|
||||
item.materialName = item.typeName
|
||||
item.materialModel = item.typeModelName
|
||||
})
|
||||
}
|
||||
} else {
|
||||
uni.showToast({ title: '暂无数据', icon: 'none' })
|
||||
uni.showToast({ title: res.data.msg, icon: 'none' })
|
||||
}
|
||||
} else {
|
||||
uni.showToast({ title: '扫码识别失败', icon: 'none' })
|
||||
|
|
@ -590,18 +605,17 @@ const confirmCodeOutBound = async () => {
|
|||
|
||||
// 编码识别按钮
|
||||
const ocrClick = () => {
|
||||
console.log('编码识别--')
|
||||
// if(maxNum.value==0){
|
||||
// uni.showToast({
|
||||
// title: '待出库数量已为0!',
|
||||
// icon: 'none',
|
||||
// })
|
||||
// }else{
|
||||
uni.navigateTo({
|
||||
url: `/pages/toolsLease/ocrScan/ocrOutScan?queryParams=${JSON.stringify(queryParams.value)}`,
|
||||
})
|
||||
// }
|
||||
|
||||
console.log('编码识别--')
|
||||
// if(maxNum.value==0){
|
||||
// uni.showToast({
|
||||
// title: '待出库数量已为0!',
|
||||
// icon: 'none',
|
||||
// })
|
||||
// }else{
|
||||
uni.navigateTo({
|
||||
url: `/pages/toolsLease/ocrScan/ocrOutScan?queryParams=${JSON.stringify(queryParams.value)}`,
|
||||
})
|
||||
// }
|
||||
}
|
||||
</script>
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue