bug修复和添加防抖

This commit is contained in:
xiaofajia 2024-11-21 15:30:42 +08:00
parent 27375030c1
commit b00333d103
2 changed files with 88 additions and 76 deletions

View File

@ -199,6 +199,7 @@ export default {
}, },
// //
canClick:true, canClick:true,
subLoading: false
}; };
}, },
onLoad(data) { onLoad(data) {
@ -356,11 +357,14 @@ export default {
}) })
}, },
confirmOpe(type) { confirmOpe(type) {
if (!this.subLoading){
this.subLoading = true
if(this.selectWares.length==0){ if(this.selectWares.length==0){
uni.showToast({ uni.showToast({
title: '请选中要审核的配件!', title: '请选中要审核的配件!',
icon: 'none' icon: 'none'
}) })
this.subLoading = false
return return
} }
if (this.canClick) { if (this.canClick) {
@ -401,11 +405,14 @@ export default {
uni.navigateBack() uni.navigateBack()
}, 700) }, 700)
} }
this.subLoading = false
}) })
} catch (e) { } catch (e) {
this.subLoading = false
this.canClick = true this.canClick = true
} }
} }
}
}, },
} }
} }

View File

@ -96,7 +96,7 @@
<text class="label"></text> <text class="label"></text>
<text class="repairNum"></text> <text class="repairNum"></text>
<view class="submit" @click="submit" v-if="!isInput">保存</view> <view class="submit" @click="submit" v-if="!isInput">保存</view>
<view class="submit" @click="inWare" v-else>入库</view> <view class="submit" @click="inWare" v-else :disabled="subLoading">入库</view>
</view> </view>
</view> </view>
</template> </template>
@ -143,6 +143,7 @@ export default {
unitList: [], unitList: [],
query: null, query: null,
selectRows: [], selectRows: [],
subLoading: false
}; };
}, },
onLoad(data) { onLoad(data) {
@ -424,6 +425,8 @@ export default {
* 入库 * 入库
*/ */
inWare() { inWare() {
if (!this.subLoading){
this.subLoading = true
const data = { const data = {
id: this.soId, id: this.soId,
soNo: createUniqueCodeByHead("RK") soNo: createUniqueCodeByHead("RK")
@ -452,7 +455,9 @@ export default {
uni.navigateBack() uni.navigateBack()
}, 700) }, 700)
} }
this.subLoading = false
}) })
}
// this.partList.forEach(item => { // this.partList.forEach(item => {
// item.inCount = item.count // item.inCount = item.count
// item.goodsId = item.id // item.goodsId = item.id