|
@@ -1,7 +1,7 @@
|
|
|
<template>
|
|
|
<view class="container">
|
|
|
<uni-forms
|
|
|
- ref="valiForm"
|
|
|
+ ref="valiFormRef"
|
|
|
label-align="right"
|
|
|
:label-width="80"
|
|
|
:rules="rules"
|
|
@@ -71,6 +71,7 @@ import {
|
|
|
import { checkPermission } from '@/utils'
|
|
|
import { warehouseScan } from '@/services/warehouseScan'
|
|
|
|
|
|
+const valiFormRef = ref()
|
|
|
const loading = ref(false)
|
|
|
const hidePage = ref(false)
|
|
|
const focusType = ref(true)
|
|
@@ -128,15 +129,23 @@ const setfocus = () => {
|
|
|
|
|
|
const onsubmit = async () => {
|
|
|
st && clearTimeout(st)
|
|
|
+
|
|
|
+ const valiRes: any = await valiFormRef.value.validate()
|
|
|
+ if (!valiRes) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
loading.value = true
|
|
|
|
|
|
const res = await warehouseScan({
|
|
|
order_code: valiFormData.value.order_code,
|
|
|
})
|
|
|
+ console.log('res---', res)
|
|
|
+
|
|
|
loading.value = false
|
|
|
- if (res.data.code == 1) {
|
|
|
+ if (res.code == 1) {
|
|
|
messageType.value = 'success'
|
|
|
- messageText.value = res.data.msg
|
|
|
+ messageText.value = res.msg
|
|
|
messageRef.value.open()
|
|
|
|
|
|
// const historyItem = {
|
|
@@ -150,7 +159,7 @@ const onsubmit = async () => {
|
|
|
// getHistory()
|
|
|
} else {
|
|
|
messageType.value = 'error'
|
|
|
- messageText.value = res.data.msg
|
|
|
+ messageText.value = res.msg
|
|
|
messageRef.value.open()
|
|
|
// const historyItem = {
|
|
|
// order_code: valiFormData.value.order_code,
|
|
@@ -172,7 +181,6 @@ const onsubmit = async () => {
|
|
|
// warehouseLogHistory.value = uni.getStorageSync('warehouseLogHistory') || []
|
|
|
// }
|
|
|
const keypress = (e: any) => {
|
|
|
- console.log(e, '按键码')
|
|
|
// 102 左侧 103 右侧 104 中间按键
|
|
|
if (e.keyCode === 102 || e.keyCode === 103 || e.keyCode === 104) {
|
|
|
//这里按键成功
|
|
@@ -255,7 +263,6 @@ onNavigationBarButtonTap((event) => {
|
|
|
height: 35px;
|
|
|
width: 50%;
|
|
|
margin-left: 10px;
|
|
|
- font-size: 16rpx;
|
|
|
}
|
|
|
|
|
|
.uni-icons {
|