Browse Source

志愿者管理和积分排名中的积分调整页面,确认按钮增加 防连击

feature/syp_points
zhangyongzhangyong 5 years ago
parent
commit
e47ca7616e
  1. 15
      src/views/modules/points/userinfo-points-adjust.vue
  2. 15
      src/views/modules/points/volunteerinfo-points-adjust.vue

15
src/views/modules/points/userinfo-points-adjust.vue

@ -53,12 +53,12 @@
<el-form-item label="积分调整 :" <el-form-item label="积分调整 :"
prop="operatePoints"> prop="operatePoints">
<el-input-number v-model="dataForm.operatePoints" <el-input-number v-model="dataForm.operatePoints"
:min="0" :max="1000"></el-input-number> :min="1" :max="1000"></el-input-number>
</el-form-item> </el-form-item>
</el-form> </el-form>
<template slot="footer"> <template slot="footer">
<el-button @click="visible = false">{{ $t('cancel') }}</el-button> <el-button @click="visible = false">{{ $t('cancel') }}</el-button>
<el-button type="primary" <el-button type="primary" :disabled = "isDisabled" :loading="isLoading"
@click="dataFormSubmitHandle()">{{ $t('confirm') }}</el-button> @click="dataFormSubmitHandle()">{{ $t('confirm') }}</el-button>
</template> </template>
</el-dialog> </el-dialog>
@ -83,7 +83,9 @@ export default {
adjustReason: '', adjustReason: '',
operationType: '', operationType: '',
operatePoints: '' operatePoints: ''
} },
isDisabled: false,
isLoading: false
} }
}, },
computed: { computed: {
@ -125,6 +127,9 @@ export default {
this.dataForm.adjustReason = '' this.dataForm.adjustReason = ''
this.dataForm.operationType = '' this.dataForm.operationType = ''
this.dataForm.operatePoints = '' this.dataForm.operatePoints = ''
//
this.isDisabled = false
this.isLoading = false
} }
}) })
}, },
@ -144,9 +149,13 @@ export default {
if (!valid) { if (!valid) {
return false return false
} }
this.isLoading = true
this.isDisabled = true
this.$http['post']( this.$http['post'](
'/points/pointslogs/confirmUserAdjustPoint', this.dataForm).then(({ data: res }) => { '/points/pointslogs/confirmUserAdjustPoint', this.dataForm).then(({ data: res }) => {
if (res.code !== 0) { if (res.code !== 0) {
this.isDisabled = false
this.isLoading = false
return this.$message.error(res.msg) return this.$message.error(res.msg)
} }
this.$message({ this.$message({

15
src/views/modules/points/volunteerinfo-points-adjust.vue

@ -65,12 +65,12 @@
<el-form-item label="积分调整 :" <el-form-item label="积分调整 :"
prop="operatePoints"> prop="operatePoints">
<el-input-number v-model="dataForm.operatePoints" <el-input-number v-model="dataForm.operatePoints"
:min="0" :max="1000"></el-input-number> :min="1" :max="1000"></el-input-number>
</el-form-item> </el-form-item>
</el-form> </el-form>
<template slot="footer"> <template slot="footer">
<el-button @click="visible = false">{{ $t('cancel') }}</el-button> <el-button @click="visible = false">{{ $t('cancel') }}</el-button>
<el-button type="primary" <el-button type="primary" :disabled = "isDisabled" :loading="isLoading"
@click="dataFormSubmitHandle()">{{ $t('confirm') }}</el-button> @click="dataFormSubmitHandle()">{{ $t('confirm') }}</el-button>
</template> </template>
</el-dialog> </el-dialog>
@ -97,7 +97,9 @@ export default {
operatePoints: '', operatePoints: '',
behaviorCode: '' behaviorCode: ''
}, },
behaviorTypeList: [] behaviorTypeList: [],
isDisabled: false,
isLoading: false
} }
}, },
computed: { computed: {
@ -148,6 +150,9 @@ export default {
this.dataForm.operationType = '' this.dataForm.operationType = ''
this.dataForm.operatePoints = '' this.dataForm.operatePoints = ''
this.dataForm.behaviorCode = '' this.dataForm.behaviorCode = ''
//
this.isDisabled = false
this.isLoading = false
} }
}) })
}, },
@ -167,9 +172,13 @@ export default {
if (!valid) { if (!valid) {
return false return false
} }
this.isLoading = true
this.isDisabled = true
this.$http['post']( this.$http['post'](
'/points/pointslogs/confirmAdjustPoint', this.dataForm).then(({ data: res }) => { '/points/pointslogs/confirmAdjustPoint', this.dataForm).then(({ data: res }) => {
if (res.code !== 0) { if (res.code !== 0) {
this.isDisabled = false
this.isLoading = false
return this.$message.error(res.msg) return this.$message.error(res.msg)
} }
this.$message({ this.$message({

Loading…
Cancel
Save