Compare commits
3 Commits
| Author | SHA1 | Date |
|---|---|---|
|
|
1215eb19b4 | |
|
|
536c5c27de | |
|
|
c8f62074a3 |
|
|
@ -36,15 +36,14 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div class="card" style="margin-top: 10px;">
|
<div class="card" style="margin-top: 20px;">
|
||||||
<!-- <div>扫码识别</div>
|
<div>扫码识别</div>
|
||||||
<div style="width: 94%;height: 120px;margin: 10px;border: 1px solid #ccc;">
|
<div style="width: 94%;height: 120px;margin: 10px;border: 1px solid #ccc;">
|
||||||
|
|
||||||
</div> -->
|
</div> -->
|
||||||
|
|
||||||
|
|
||||||
<uni-row :gutter="24" style="display: flex; align-items: center;margin-bottom: 10px;">
|
<uni-row :gutter="24" style="display: flex; align-items: center;margin-bottom: 10px;">
|
||||||
<uni-col :span="6">设备编码:</uni-col>
|
|
||||||
<uni-col :span="12">
|
<uni-col :span="12">
|
||||||
<uni-easyinput placeholder="请输入内容" v-model="maCode"/>
|
<uni-easyinput placeholder="请输入内容" v-model="maCode"/>
|
||||||
</uni-col>
|
</uni-col>
|
||||||
|
|
@ -238,6 +237,67 @@ const uploadImg = () => {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const toBase64 = (path) => {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
// #ifdef APP-PLUS
|
||||||
|
plus.io.resolveLocalFileSystemURL(path, (entry) => {
|
||||||
|
entry.file((file) => {
|
||||||
|
let fileReader = new plus.io.FileReader()
|
||||||
|
fileReader.readAsDataURL(file)
|
||||||
|
fileReader.onloadend = (evt) => {
|
||||||
|
let base64 = evt.target.result.split(",")[1]
|
||||||
|
resolve(base64)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 编码识别按钮
|
||||||
|
const onCodeIdentify1 = () => {
|
||||||
|
console.log('编码识别--')
|
||||||
|
|
||||||
|
// 只允许通过相机扫码
|
||||||
|
uni.chooseImage({
|
||||||
|
count: 1, // 选择一张图片
|
||||||
|
sourceType: ['camera'], // 只允许从相机拍照
|
||||||
|
success: (res) => {
|
||||||
|
const tempFilePath = res.tempFilePaths[0];
|
||||||
|
toBase64(tempFilePath)
|
||||||
|
},
|
||||||
|
fail: (err) => {
|
||||||
|
console.error("选择图片失败", err);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// 引入百度 OCR API 需要的请求函数
|
||||||
|
const recognizeCode =((imagePath)=>{
|
||||||
|
// 将图片转换为 Base64 格式
|
||||||
|
toBase64(imagePath).then(res=>{
|
||||||
|
callBaiduOcrApi(res);
|
||||||
|
}
|
||||||
|
)
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
const onCodeIdentify2 = () => {
|
||||||
|
console.log('二维码识别--')
|
||||||
|
|
||||||
|
// 只允许通过相机扫码
|
||||||
|
uni.scanCode({
|
||||||
|
onlyFromCamera: true,
|
||||||
|
scanType: ['qrCode', 'pdf417'],
|
||||||
|
success: function (res) {
|
||||||
|
console.log('条码类型:' + res.scanType)
|
||||||
|
console.log('条码内容:' + res)
|
||||||
|
maCode.value = res.result;
|
||||||
|
getMaInfo();
|
||||||
|
},
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
onLoad((options)=>{
|
onLoad((options)=>{
|
||||||
console.log(options)
|
console.log(options)
|
||||||
taskInfo.value = JSON.parse(options.taskInfo)
|
taskInfo.value = JSON.parse(options.taskInfo)
|
||||||
|
|
|
||||||
|
|
@ -42,6 +42,9 @@
|
||||||
<uni-col :span="6">
|
<uni-col :span="6">
|
||||||
<view class="coding-btn" @tap="boxScan">标准箱出库</view>
|
<view class="coding-btn" @tap="boxScan">标准箱出库</view>
|
||||||
</uni-col>
|
</uni-col>
|
||||||
|
<uni-col :span="6">
|
||||||
|
<view class="coding-btn" @tap="boxScan">标准箱识别</view>
|
||||||
|
</uni-col>
|
||||||
</uni-row>
|
</uni-row>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
|
@ -276,7 +279,7 @@ const getCodeDeviceListData = async () => {
|
||||||
}
|
}
|
||||||
|
|
||||||
// 编码识别按钮
|
// 编码识别按钮
|
||||||
const onCodeIdentify = () => {
|
const onCodeIdentify1 = () => {
|
||||||
console.log('编码识别--')
|
console.log('编码识别--')
|
||||||
// uni.navigateTo({
|
// uni.navigateTo({
|
||||||
// url: `/pages/picking/outbound/code-outScan?queryParams=${JSON.stringify(
|
// url: `/pages/picking/outbound/code-outScan?queryParams=${JSON.stringify(
|
||||||
|
|
|
||||||
|
|
@ -153,6 +153,34 @@ const boxList = ref([
|
||||||
},
|
},
|
||||||
])
|
])
|
||||||
|
|
||||||
|
// 退料
|
||||||
|
const backList = ref([
|
||||||
|
{
|
||||||
|
title: '退料',
|
||||||
|
url: '/pages/back/index',
|
||||||
|
iconSrc: '../../static/workbench/fix.png',
|
||||||
|
},
|
||||||
|
])
|
||||||
|
|
||||||
|
// 标准箱
|
||||||
|
const boxList = ref([
|
||||||
|
{
|
||||||
|
title: '标准箱管理',
|
||||||
|
url: '/pages/standardBox/index',
|
||||||
|
iconSrc: '../../static/workbench/fetchMaterialOutStore.png',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '标准箱移交',
|
||||||
|
url: '/pages/standardBox/transferBox',
|
||||||
|
iconSrc: '../../static/workbench/fetchMaterialOutStore.png',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '标准箱接收',
|
||||||
|
url: '/pages/standardBox/acceptBox',
|
||||||
|
iconSrc: '../../static/workbench/fetchMaterialOutStore.png',
|
||||||
|
},
|
||||||
|
])
|
||||||
|
|
||||||
const onNavigateTo = (url) => {
|
const onNavigateTo = (url) => {
|
||||||
uni.navigateTo({ url })
|
uni.navigateTo({ url })
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue