diff --git a/manifest.json b/manifest.json
index 1c018a5..c61851d 100644
--- a/manifest.json
+++ b/manifest.json
@@ -2,8 +2,8 @@
"name" : "宁波富佳",
"appid" : "__UNI__F00F4C3",
"description" : "宁波富佳手持系统",
- "versionName" : "1.0.2",
- "versionCode" : 102,
+ "versionName" : "1.0.3",
+ "versionCode" : 103,
"transformPx" : false,
/* 5+App特有相关 */
"app-plus" : {
diff --git a/pages/manage/wlzp.vue b/pages/manage/wlzp.vue
index 2bedd6b..3110e26 100644
--- a/pages/manage/wlzp.vue
+++ b/pages/manage/wlzp.vue
@@ -41,7 +41,16 @@
- |
+
+
+ |
|
|
@@ -75,7 +84,8 @@
totalQty: null,
currentData: {},
disabled: false,
- dataList: []
+ dataList: [],
+ errorIndex: -1 // 新增:记录错误行的索引
};
},
watch: {
@@ -101,8 +111,14 @@
})
},
addmater () {
- this.validateMaterFrames()
- this.dataList.push({mater_frame: null, qty: 0.000})
+ if(this.validateMaterFrames()){
+ this.dataList.push({mater_frame: null, qty: 0.000})
+ }else {
+ uni.showToast({
+ title: '请先填写当前料框号',
+ icon: 'none'
+ })
+ }
},
delItem (i) {
this.dataList.splice(i, 1)
@@ -141,8 +157,8 @@
}
},
clearError(index) {
- if (this.dataList[index].mater_frame) {
- this.$refs.materFrameInputs[index].$el.style.borderColor = ''
+ if (this.dataList[index].mater_frame && this.errorIndex === index) {
+ this.errorIndex = -1
}
},
updateTotalQty() {
@@ -150,13 +166,12 @@
},
validateMaterFrames () {
let isValid = true
+ this.errorIndex = -1 // 重置错误索引
for (let i = 0; i < this.dataList.length; i++) {
if (!this.dataList[i].mater_frame) {
- this.$refs.materFrameInputs[i].$el.style.borderColor = 'red'
- this.scrollToView(this.$refs.materFrameInputs[i])
+ this.errorIndex = i // 设置第一个错误的索引
isValid = false
- } else {
- this.$refs.materFrameInputs[i].$el.style.borderColor = ''
+ break // 找到第一个错误就停止
}
}
return isValid