Commit 5cad3eee authored by 何远江's avatar 何远江

添加长宽高扫码功能

parent 3fda39f7
...@@ -41,7 +41,7 @@ export default { ...@@ -41,7 +41,7 @@ export default {
}, },
{ {
src: require('@/static/images/cgrk.png'), src: require('@/static/images/cgrk.png'),
text: '质量异常', text: '质量异常下架',
url: '/pages/abnormal/abnormalRemove' url: '/pages/abnormal/abnormalRemove'
}, },
{ {
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
长(cm): 长(cm):
</u-col> </u-col>
<u-col span="6"> <u-col span="6">
<uni-easyinput v-model="form.long"></uni-easyinput> <uni-easyinput v-model="form.long" @input="updateWeight"></uni-easyinput>
</u-col> </u-col>
</u-row> </u-row>
<u-row gutter="16" class="itemRow"> <u-row gutter="16" class="itemRow">
...@@ -98,6 +98,20 @@ export default { ...@@ -98,6 +98,20 @@ export default {
} }
}, },
methods: { methods: {
updateWeight(e) {
const reg = /^\d+\*\d+\*\d+\-\d+$/
// 验证格式,判断是否是扫码
if (reg.test(e)) {
const arr = e.split('*')
this.$nextTick(() => {
this.form.long = arr[0]
this.form.wide = arr[1]
const data = arr[2].split('-')
this.form.high = data[0]
this.form.zxntgew = data[1]
})
}
}
} }
}; };
</script> </script>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment