Browse Source

防止重复点击

master_hella_20240701
wangyufei 5 months ago
parent
commit
29d7297bc2
  1. 13
      src/components/XButton/src/ButtonBase.vue
  2. 13
      src/views/wms/productionManage/productreceiptAssemble/productreceiptAssembleRequestMain/index.vue

13
src/components/XButton/src/ButtonBase.vue

@ -74,8 +74,6 @@ const emit = defineEmits(['buttonBaseClick', 'updataTableColumns'])
let timer = ref(null) let timer = ref(null)
const buttonBaseClick = (val, item, $event) => { const buttonBaseClick = (val, item, $event) => {
if(!timer.value){ if(!timer.value){
clearButtonBlurHandle($event) //el-button
emit('buttonBaseClick', val, item, $event)
timer.value = setTimeout(()=>{ timer.value = setTimeout(()=>{
if(timer.value){ if(timer.value){
console.log('清空timer',timer.value) console.log('清空timer',timer.value)
@ -83,8 +81,19 @@ const buttonBaseClick = (val, item, $event) => {
timer.value = null timer.value = null
} }
},2000) },2000)
clearButtonBlurHandle($event) //el-button
emit('buttonBaseClick', val, item, $event)
}
} }
onUnmounted(() => {
if(timer.value){
console.log('清空timer',timer.value)
clearTimeout(timer.value)
timer.value = null
} }
})
const popoverVisible = ref(false) const popoverVisible = ref(false)
// //
const closeRowDrop = () => { const closeRowDrop = () => {

13
src/views/wms/productionManage/productreceiptAssemble/productreceiptAssembleRequestMain/index.vue

@ -441,20 +441,21 @@ const buttonTableClick = async (val, row) => {
}) })
} else if (val == 'mainHandle') { // } else if (val == 'mainHandle') { //
tableObject.loading = true
// //
let isCreateLabel = false let isCreateLabel = false
await PackageApi.getPackagePage({ let res = await PackageApi.getPackagePage({
requestNumber: row.number requestNumber: row.number
}).then(res => {
if (res) {
if (res.list.length > 0) isCreateLabel = true
}
}) })
if (res&&res.list.length > 0) {
isCreateLabel = true
}
if (!isCreateLabel) { if (!isCreateLabel) {
message.warning('请先创建标签') message.warning('请先创建标签')
tableObject.loading = false
return return
} }
tableObject.loading = true
ProductreceiptRequestMainApi.handle(row.masterId).then(() => { ProductreceiptRequestMainApi.handle(row.masterId).then(() => {
message.success(t('common.updateSuccess')) message.success(t('common.updateSuccess'))
tableObject.loading = false tableObject.loading = false

Loading…
Cancel
Save