Files
shanghaiganxiangtuzhuangwor…/pages/scan/scan.vue
赵正易 a48ea6f110 feat: 新增物料图标和优化UI组件
fix(入库页面): 修复重复箱检测和批次检查逻辑

refactor(请求模块): 优化错误处理和防抖机制

style(全局字体): 更改默认字体为数黑体

perf(扫码组件): 添加防抖处理避免重复提交

feat(卡片组件): 增加删除功能并优化样式

docs(工具函数): 添加入库工具函数文档

chore: 更新依赖和配置文件
2025-08-22 18:28:25 +08:00

97 lines
2.4 KiB
Vue

<template>
<!-- 扫码查看信息 -->
<view class="common-nav-container">
<view style="padding: 10px;">
<u-input placeholder="请扫箱标签"
border="surround" v-model.trim="formData.query" @change="queryChange" clearable></u-input>
</view>
<u-list height="500px">
<u-list-item v-for="(item, index) in packageData" :key="index">
<u-cell :title="packageTitle[index]">
<u--text slot="value" type="info" :text="item" bold size="36"></u--text>
</u-cell>
</u-list-item>
</u-list>
</view>
</template>
<script>
import * as WarehoseApi from '@/api/warehouse/warehose.js';
export default {
data() {
return {
formData: {
query: ""
},
// 扫码类型
type: 0,
packageTitle: {
"workoderID": "工单号:",
"patchCode": "批次号:",
"partNumner": "零件号:",
"productionDescribe": "描述:",
"productionTime": "生产日期:",
"quantity": "数量:",
"team": "组:",
"remark": "备注:",
"originalCode": "扫码结果:",
},
packageData: {
"workoderID": "",
"patchCode": "",
"partNumner": "",
"productionDescribe": "",
"productionTime": "",
"quantity": null,
"team": "",
"remark": "",
"originalCode": "",
}
}
},
methods: {
// 扫标签码时,自动进行翻译
async queryChange(value) {
if (value === null || value === "") {
return;
}
if (value.length < 40) {
return;
}
let package_code = value;
let resolutionData = {
code: package_code
};
const emitRes = await WarehoseApi.resolutionPackage(resolutionData);
if (emitRes.code !== 200 || emitRes.data === null) {
uni.showModal({
title: '提示',
content: '该箱号数据解析异常!',
showCancel: false,
confirmText: '确定'
});
this.formData.query = "";
return;
}
setTimeout(() => {
this.formData.query = "";
this.packageData = {
"workoderID": emitRes.data.workoderID,
"patchCode": emitRes.data.patchCode,
"partNumner": emitRes.data.partNumner,
"productionDescribe": emitRes.data.productionDescribe,
"productionTime": emitRes.data.productionTime,
"quantity": emitRes.data.quantity,
"team": emitRes.data.team,
"remark": emitRes.data.remark,
"originalCode": emitRes.data.originalCode,
}
}, 100)
}
}
}
</script>
<style>
</style>