From 1cf0d6313e14caa618fc6dfbbe44a01fad25df3e Mon Sep 17 00:00:00 2001
From: whycq <913841844@qq.com>
Date: 星期四, 18 五月 2023 15:12:59 +0800
Subject: [PATCH] #
---
pages/order/orderPutOn.vue | 103 +++++++++++++++++++++++++++++++++------------------
1 files changed, 67 insertions(+), 36 deletions(-)
diff --git a/pages/order/orderPutOn.vue b/pages/order/orderPutOn.vue
index 3a17edd..ad4a1a2 100644
--- a/pages/order/orderPutOn.vue
+++ b/pages/order/orderPutOn.vue
@@ -1,23 +1,16 @@
<template>
<view>
<view class="code">
- <!-- <view class="item">
- <view class="code-decs">璁㈠崟鍙�:</view>
- <input type="text" placeholder=" 鎵爜 / 杈撳叆" v-model="order" :focus="orderFocus"
- @input="orderInput()" disabled>
- </view> -->
- <view class="item">
- <view class="code-decs">鎵樼洏鐮�:</view>
- <input type="text" placeholder=" 鎵爜 / 杈撳叆" v-model="barcode" :focus="barcodeFocus"
- @confirm="barcodeInput()">
- </view>
<view class="item">
<view class="code-decs">搴撲綅鍙�:</view>
+ <input type="text" placeholder=" 鎵爜 / 杈撳叆" v-model="barcode" :focus="barcodeFocus"
+ @input="barcodeInput()">
+ </view>
+ <view class="item">
+ <view class="code-decs">鐗╂枡鍙�:</view>
<input type="text" placeholder=" 鎵爜 / 杈撳叆" v-model="matnr" :focus="matFocus" @input="findMat()">
<view class="item-right">
<button></button>
- <!-- <text style="text-align: right;color: #409EFF;" @click="selectMat()">鎻愬彇+</text> -->
- <!-- <uni-icons type="right" color="#c1c1c1"></uni-icons> -->
</view>
</view>
</view>
@@ -71,7 +64,7 @@
<!-- 搴曢儴鎿嶄綔鎸夐挳 -->
<view class="buttom">
<button size="mini" @click="reset('warn')">閲嶇疆</button>
- <button size="mini" type="primary" @click="combConfirm('warn')">缁勬墭</button>
+ <button size="mini" type="primary" @click="combConfirm('warn')">涓婃灦</button>
</view>
<!-- 寮圭獥 -->
<!-- 淇敼鏁伴噺 -->
@@ -148,7 +141,6 @@
baseUrl: '',
token: '',
order: '',
- orderFocus: true,
barcode: '',
barcodeFocus: '',
dataList: [],
@@ -162,9 +154,10 @@
messageText: '',
title: '',
content: '',
- barcodeFocus: false,
+ barcodeFocus: true,
matFocus: false,
- matData: ''
+ matData: '',
+ removeNum: 0
}
},
onShow() {
@@ -175,6 +168,30 @@
messageToggle(type) {
this.msgType1 = type
this.$refs.message.open()
+ },
+ // barcode input 浜嬩欢
+ barcodeInput() {
+ // 涓嶈缃畾鏃跺櫒 浼氬嚭鐜版壂鍏ョ殑瀛楃涓蹭笉鍏�
+ setTimeout(() => {
+ var len = this.barcode.length
+ this.focuss()
+ }, 200)
+ },
+ // 鎵樼洏鐮佹湁璇噸缃�
+ barcodeFocuss() {
+ let that = this;
+ that.barcodeFocus = false;
+ setTimeout(() => {
+ that.barcode = '';
+ that.barcodeFocus = true;
+ }, 100);
+ },
+ // 鍟嗗搧鍏夋爣娓呯┖閲嶇疆
+ focuss() {
+ setTimeout(() => {
+ this.matnr = '';
+ this.matFocus = true;
+ }, 100);
},
// 鎼滅储鐗╂枡
findMat() {
@@ -209,6 +226,7 @@
events: {
matList: function(data) {
that.checkMat(data.data)
+ that.focuss()
},
},
});
@@ -240,28 +258,34 @@
var len = this.dataList.length
var add = true ,sameItem = false
for (var i = 0; i < len; i++) {
- if (mat.matnr == this.dataList[i].matnr) {
- for (var j = 0; j < len; j++) {
- if (mat.batch == this.dataList[j].batch) {
- sameItem = true
+ if (mat.orderNo != this.dataList[i].orderNo) {
+ add = true
+ break;
+ } else {
+ if (mat.matnr == this.dataList[i].matnr) {
+ for (var j = 0; j < len; j++) {
+ if (mat.batch == this.dataList[j].batch) {
+ sameItem = true
+ }
}
- }
- // 鐩稿悓鐗╂枡 涓嶅悓鎵瑰彿 鏂板姞鍒楄〃
- if (mat.batch != this.dataList[i].batch) {
- this.$forceUpdate() // 寮哄埗鍒锋柊
- if (sameItem) {
- add = false
+ // 鐩稿悓鐗╂枡 涓嶅悓鎵瑰彿 鏂板姞鍒楄〃
+ if (mat.batch != this.dataList[i].batch) {
+ this.$forceUpdate() // 寮哄埗鍒锋柊
+ if (sameItem) {
+ add = false
+ } else {
+ add = true
+ }
+
} else {
- add = true
+ // 鐩稿悓鐗╂枡鐩稿悓鎵瑰彿 鏁伴噺绱姞
+ this.dataList[i].anfme += mat.anfme
+ this.$forceUpdate() // 寮哄埗鍒锋柊
+ add = false
}
-
- } else {
- // 鐩稿悓鐗╂枡鐩稿悓鎵瑰彿 鏁伴噺绱姞
- this.dataList[i].anfme += mat.anfme
- this.$forceUpdate() // 寮哄埗鍒锋柊
- add = false
}
}
+
}
if (add) {
this.dataList.unshift(mat)
@@ -294,9 +318,9 @@
}
}
uni.request({
- url: that.baseUrl + '/mobile/comb/auth',
+ url: that.baseUrl + '/mobile/manDetl/in',
data: JSON.stringify({
- locno: that.barcode,
+ locNo: that.barcode,
combMats: that.dataList
}),
method: 'POST',
@@ -356,6 +380,7 @@
},
// 鍒楄〃绉婚櫎鎸夐挳
remove(item, i, type) {
+ this.removeNum = i
this.msgType = type
this.title = '璀﹀憡'
this.content = '鏄惁绉婚櫎褰撳墠鍟嗗搧!'
@@ -365,7 +390,7 @@
removeConfirm(i) {
this.messageText = "绉婚櫎鎴愬姛"
this.messageToggle('success')
- this.dataList.splice(i, 1)
+ this.dataList.splice(this.removeNum, 1)
},
reviseConfirm() {
this.dataList[this.rowNum].anfme = this.count
@@ -381,6 +406,12 @@
changeValue(value) {
this.count = value
},
+ // 娓呯┖
+ resst() {
+ this.dataList = []
+ this.barcode = ''
+ this.barcodeFocuss()
+ },
}
}
</script>
--
Gitblit v1.9.1