From 3392ed3df455314c501dd6b54f204060273f7a9b Mon Sep 17 00:00:00 2001
From: whycq <10027870+whycq@user.noreply.gitee.com>
Date: 星期五, 15 三月 2024 15:02:48 +0800
Subject: [PATCH] #
---
pages/order/orderPakin.vue | 61 ++++++++++++++++++++++++++++--
1 files changed, 56 insertions(+), 5 deletions(-)
diff --git a/pages/order/orderPakin.vue b/pages/order/orderPakin.vue
index 24be376..3f4d2e2 100644
--- a/pages/order/orderPakin.vue
+++ b/pages/order/orderPakin.vue
@@ -4,7 +4,7 @@
<view class="item">
<view class="code-decs">鎵樼洏鐮�:</view>
<input type="text" placeholder=" 鎵爜 / 杈撳叆" v-model="barcode" :focus="barcodeFocus"
- @confirm="barcodeInput()">
+ @input="barcodeInput()">
</view>
<view class="item">
<view class="code-decs">鐗╂枡鐮�:</view>
@@ -159,6 +159,7 @@
rowNum: '',
matnr: '',
matnr1: '',
+ anfme: '',
batch: '',
weight: '',
msgType1: 'success',
@@ -181,12 +182,50 @@
this.msgType1 = type
this.$refs.message.open()
},
+ barcodeInput() {
+ // 涓嶈缃畾鏃跺櫒 浼氬嚭鐜版壂鍏ョ殑瀛楃涓蹭笉鍏�
+ setTimeout(() => {
+ var len = this.barcode.length
+ if (len != 8) {
+ uni.showToast({
+ title: '鎵樼洏鐮佹湁璇閲嶈瘯',
+ icon: "none",
+ position: 'top'
+ });
+ this.barcodeFocuss()
+ return;
+ }
+ this.focuss()
+ }, 200)
+ },
+ // 鎵樼洏鐮佹湁璇噸缃�
+ barcodeFocuss() {
+ let that = this;
+ that.barcodeFocus = false;
+ setTimeout(() => {
+ that.barcode = '';
+ that.barcodeFocus = true;
+ }, 100);
+ },
+ // 鍟嗗搧鍏夋爣娓呯┖閲嶇疆
+ focuss() {
+ this.matFocus = false;
+ setTimeout(() => {
+ this.matnr = '';
+ this.matFocus = true;
+ }, 100);
+ },
// 鎼滅储鐗╂枡
findMat() {
let that = this
var matnr = that.matnr.split(";")
- that.order = matnr[0]
- that.matnr = matnr[1]
+ if (matnr[1]) {
+ that.order = matnr[0]
+ that.matnr = matnr[1]
+ that.batch = matnr[2] ? matnr[2] : ''
+ that.anfme = matnr[3]
+
+ }
uni.request({
url: that.baseUrl + '/mat/auth',
data: {
@@ -197,14 +236,26 @@
},
success(result) {
result = result.data
- if (result.code === 200 && result.data) {
+ if (result.code === 200) {
+ if (result.data === null) {
+ uni.showToast({
+ title: '鏃犵墿鏂�',
+ icon: "error",
+ position: 'top'
+ })
+ that.focuss()
+ return
+ }
that.matData = result.data
that.matnr = ''
+
that.matData['batch'] = ''
+ that.matData['anfme'] = ''
// if (matnr[2] === null) {
// matnr[2] = ''
// }
- result.data.batch = matnr[2]
+ result.data.batch = matnr[2] ? matnr[2] : ''
+ result.data.anfme = matnr[3]
uni.navigateTo({
url: "../mat/matSelected",
// 閫氳繃eventChannel鍚戣鎵撳紑椤甸潰浼犻�佹暟鎹�
--
Gitblit v1.9.1