Commit 49f647b7 by LJM

修复重复提交问题

parent 2049d46c
Showing with 13 additions and 1 deletions
...@@ -190,7 +190,7 @@ ...@@ -190,7 +190,7 @@
</template> </template>
<!-- 提交 --> <!-- 提交 -->
<template v-else> <template v-else>
<view class="btn row rowCenter verCenter" @click="submitTallyDetail(index)">提 交</view> <view class="btn row rowCenter verCenter" @click="submitTallyDetail(index)" :class="{ disabled: isSubmitting }">提 交</view>
</template> </template>
</view> </view>
</view> </view>
...@@ -330,6 +330,7 @@ ...@@ -330,6 +330,7 @@
export default { export default {
data() { data() {
return { return {
isSubmitting: false, // 防重复点击标志
email: uni.getStorageSync('email') || '', //操作人邮箱 email: uni.getStorageSync('email') || '', //操作人邮箱
is_focus_1: true, //获取焦点动态化 is_focus_1: true, //获取焦点动态化
is_focus_2: false, is_focus_2: false,
...@@ -1002,6 +1003,9 @@ ...@@ -1002,6 +1003,9 @@
* 理货明细提交 * 理货明细提交
*/ */
submitTallyDetail(index) { submitTallyDetail(index) {
if (this.isSubmitting) return; // 如果正在提交,则直接返回
this.isSubmitting = true; // 设置为提交中
var tally_num = parseInt(this.form[index].tally_num); var tally_num = parseInt(this.form[index].tally_num);
var netWeight = parseFloat(this.form[index].net_weight); var netWeight = parseFloat(this.form[index].net_weight);
...@@ -1010,6 +1014,7 @@ ...@@ -1010,6 +1014,7 @@
title: '请填写入库数量', title: '请填写入库数量',
icon: 'error' icon: 'error'
}); });
this.isSubmitting = false; // 解锁
return false; return false;
} }
if (!this.form[index].origin) { if (!this.form[index].origin) {
...@@ -1017,6 +1022,7 @@ ...@@ -1017,6 +1022,7 @@
title: '请填写原产地', title: '请填写原产地',
icon: 'error' icon: 'error'
}); });
this.isSubmitting = false; // 解锁
return false; return false;
} }
if (!netWeight) { if (!netWeight) {
...@@ -1024,6 +1030,7 @@ ...@@ -1024,6 +1030,7 @@
title: '请填写净重', title: '请填写净重',
icon: 'error' icon: 'error'
}); });
this.isSubmitting = false; // 解锁
return false; return false;
} }
if (this.form[index].is_goods_check) { if (this.form[index].is_goods_check) {
...@@ -1032,6 +1039,7 @@ ...@@ -1032,6 +1039,7 @@
title: '该物料为商检,必须要上传图片', title: '该物料为商检,必须要上传图片',
icon: 'none' icon: 'none'
}); });
this.isSubmitting = false; // 解锁
return false; return false;
} }
} }
...@@ -1041,6 +1049,7 @@ ...@@ -1041,6 +1049,7 @@
this.tally_info = this.form[index] this.tally_info = this.form[index]
this.tally_info.tally_num_temp = ''; this.tally_info.tally_num_temp = '';
this.$refs.popupTallyNum.open('center'); this.$refs.popupTallyNum.open('center');
this.isSubmitting = false; // 解锁
return false; return false;
} }
...@@ -1056,6 +1065,7 @@ ...@@ -1056,6 +1065,7 @@
//理货提交成功后自动清空型号查询框 //理货提交成功后自动清空型号查询框
this.getTallyData(); this.getTallyData();
this.clearInput(3); this.clearInput(3);
this.isSubmitting = false; // 解锁按钮
}, 2000); }, 2000);
} else if (res.err_code === 10000) { } else if (res.err_code === 10000) {
uni.showModal({ uni.showModal({
...@@ -1067,6 +1077,7 @@ ...@@ -1067,6 +1077,7 @@
// 用户点击确定按钮后的操作 // 用户点击确定按钮后的操作
this.getTallyData(); this.getTallyData();
this.clearInput(3); this.clearInput(3);
this.isSubmitting = false; // 解锁按钮
} }
} }
}); });
...@@ -1075,6 +1086,7 @@ ...@@ -1075,6 +1086,7 @@
title: res.err_msg, title: res.err_msg,
icon: 'none' icon: 'none'
}); });
this.isSubmitting = false; // 解锁按钮
} }
}); });
}, },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment