|
@@ -61,7 +61,7 @@
|
|
<template #footer>
|
|
<template #footer>
|
|
<div class="flex center dialog-footer">
|
|
<div class="flex center dialog-footer">
|
|
<el-button @click="onCloseBtnClick">取消</el-button>
|
|
<el-button @click="onCloseBtnClick">取消</el-button>
|
|
- <el-button type="primary" @click="onSavePurchaseBtnClick">确定</el-button>
|
|
|
|
|
|
+ <el-button :disabled="!visible || isSave" type="primary" @click="onSavePurchaseBtnClick">确定</el-button>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
</el-dialog>
|
|
</el-dialog>
|
|
@@ -84,6 +84,9 @@ export default {
|
|
type: Object
|
|
type: Object
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+ data: () => ({
|
|
|
|
+ isSave: false
|
|
|
|
+ }),
|
|
methods: {
|
|
methods: {
|
|
tagNumberValidator (rule, value, callback) {
|
|
tagNumberValidator (rule, value, callback) {
|
|
value = parseFloat(value)
|
|
value = parseFloat(value)
|
|
@@ -97,6 +100,9 @@ export default {
|
|
return callback()
|
|
return callback()
|
|
},
|
|
},
|
|
onSavePurchaseBtnClick () {
|
|
onSavePurchaseBtnClick () {
|
|
|
|
+ if (this.isSave) {
|
|
|
|
+ return
|
|
|
|
+ }
|
|
const saveData = {
|
|
const saveData = {
|
|
receiveDate: new Date(this.data.dataTime).format('YYYY/MM/DD HH:mm:ss'),
|
|
receiveDate: new Date(this.data.dataTime).format('YYYY/MM/DD HH:mm:ss'),
|
|
providerId: this.data.providerId,
|
|
providerId: this.data.providerId,
|
|
@@ -110,10 +116,11 @@ export default {
|
|
})
|
|
})
|
|
return
|
|
return
|
|
}
|
|
}
|
|
|
|
+ this.isSave = true
|
|
this.$$request(this.api, saveData).then(() => {
|
|
this.$$request(this.api, saveData).then(() => {
|
|
this.close()
|
|
this.close()
|
|
this.$emit('saved')
|
|
this.$emit('saved')
|
|
- }).catch(console.error).finally(() => {})
|
|
|
|
|
|
+ }).catch(console.error).finally(() => { this.isSave = false })
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|