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