Commit 49f647b7 by LJM

修复重复提交问题

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