From a800448ad02ef121503c7b26ac7884d84cecd60f Mon Sep 17 00:00:00 2001
From: whycq <913841844@qq.com>
Date: 星期日, 14 五月 2023 22:20:44 +0800
Subject: [PATCH] #
---
pages/order/orderPakin.vue | 65 +++++++++++++++++++-------------
1 files changed, 38 insertions(+), 27 deletions(-)
diff --git a/pages/order/orderPakin.vue b/pages/order/orderPakin.vue
index 249cbb5..54522dd 100644
--- a/pages/order/orderPakin.vue
+++ b/pages/order/orderPakin.vue
@@ -1,11 +1,6 @@
<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"
@@ -148,9 +143,7 @@
baseUrl: '',
token: '',
order: '',
- orderFocus: true,
barcode: '',
- barcodeFocus: '',
dataList: [],
count: 0,
rowNum: '',
@@ -162,9 +155,10 @@
messageText: '',
title: '',
content: '',
- barcodeFocus: false,
+ barcodeFocus: true,
matFocus: false,
- matData: ''
+ matData: '',
+ removeNum: 0
}
},
onShow() {
@@ -196,6 +190,9 @@
that.matData = result.data
that.matnr = ''
that.matData['batch'] = ''
+ // if (matnr[2] === null) {
+ // matnr[2] = ''
+ // }
result.data.batch = matnr[2]
uni.navigateTo({
url: "../mat/matSelected",
@@ -240,28 +237,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)
@@ -335,6 +338,7 @@
this.dataList = []
this.order = ''
this.barcode = ''
+ this.matnr = ''
this.messageText = "閲嶇疆瀹屾垚"
this.messageToggle('success')
},
@@ -356,6 +360,7 @@
},
// 鍒楄〃绉婚櫎鎸夐挳
remove(item, i, type) {
+ this.removeNum = i
this.msgType = type
this.title = '璀﹀憡'
this.content = '鏄惁绉婚櫎褰撳墠鍟嗗搧!'
@@ -365,7 +370,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 +386,12 @@
changeValue(value) {
this.count = value
},
+ // 娓呯┖
+ resst() {
+ this.dataList = []
+ this.barcode = ''
+ this.barcodeFocuss()
+ },
}
}
</script>
--
Gitblit v1.9.1