新购编码确认时增加按钮loading 防止重复调用接口导致编码重复

This commit is contained in:
BianLzhaoMin 2024-07-22 14:51:09 +08:00
parent b7a7bf1930
commit 25cdb4b077
1 changed files with 23 additions and 13 deletions

View File

@ -297,7 +297,11 @@
</el-table> </el-table>
<div slot="footer" class="dialog-footer" style="text-align: center"> <div slot="footer" class="dialog-footer" style="text-align: center">
<el-button type="primary" @click="submitForm" v-if="!isDetail" <el-button
type="primary"
@click="submitForm"
v-if="!isDetail"
:loading="codingLoading"
> </el-button > </el-button
> >
<el-button @click="cancel"> </el-button> <el-button @click="cancel"> </el-button>
@ -431,6 +435,7 @@ export default {
isDetail: false, isDetail: false,
surplusNoBindNum: 0, surplusNoBindNum: 0,
codingLoading: false,
} }
}, },
mounted() { mounted() {
@ -723,7 +728,9 @@ export default {
) )
return // return //
} }
editPurchaseMacode(this.codeList).then((response) => { this.codingLoading = true
editPurchaseMacode(this.codeList)
.then((response) => {
if (response.data && response.data.length > 0) { if (response.data && response.data.length > 0) {
this.codeList = response.data this.codeList = response.data
this.$modal.msgError( this.$modal.msgError(
@ -735,6 +742,9 @@ export default {
this.getList() this.getList()
} }
}) })
.finally(() => {
this.codingLoading = false
})
} }
}, },
hasDuplicateField(array, field) { hasDuplicateField(array, field) {