3 changed files with 129 additions and 11 deletions
@ -0,0 +1,118 @@ |
|||
<template> |
|||
<el-dialog |
|||
:visible.sync="visible" |
|||
title="积分调整" |
|||
:close-on-click-modal="false" |
|||
:close-on-press-escape="false" |
|||
> |
|||
<el-form :label-width="$i18n.locale === 'en-US' ? '100px' : '80px'"> |
|||
<el-form-item label="主键:" v-if="false"> |
|||
<div>{{dataForm.id}}</div> |
|||
</el-form-item> |
|||
<el-form-item label="userId:" v-if="false"> |
|||
<div>{{dataForm.userId}}</div> |
|||
</el-form-item> |
|||
<el-form-item label="姓名:"> |
|||
<div>{{dataForm.fullName}}</div> |
|||
</el-form-item> |
|||
<el-form-item label="性别:"> |
|||
<div v-if="dataForm.sex === '1'">男</div> |
|||
<div v-if="dataForm.sex === '0'">女</div> |
|||
<div v-if="dataForm.sex !=='0' && dataForm.sex !=='1'">未知</div> |
|||
</el-form-item> |
|||
<el-form-item label="出生日期:"> |
|||
<el-date-picker v-model="dataForm.birthday" |
|||
type="date" |
|||
value-format="yyyy-MM-dd" |
|||
format="yyyy-MM-dd" readonly> |
|||
</el-date-picker> |
|||
</el-form-item> |
|||
<el-form-item label="手机号:"> |
|||
<div>{{dataForm.mobile}}</div> |
|||
</el-form-item> |
|||
<el-form-item label="积分:"> |
|||
<div>{{dataForm.points}}</div> |
|||
</el-form-item> |
|||
<el-form-item label="调整原因:" prop="adjustReason"> |
|||
<el-input v-model="dataForm.adjustReason" type="textarea" placeholder="不超过500字"></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="操作类型:"> |
|||
<el-radio-group v-model="dataForm.operationType"> |
|||
<el-radio :label="1">加积分</el-radio> |
|||
<el-radio :label="0">减积分</el-radio> |
|||
</el-radio-group> |
|||
</el-form-item> |
|||
<el-form-item label="积分调整:"> |
|||
<el-input-number v-model="dataForm.operatePoints" :min="0"></el-input-number> |
|||
</el-form-item> |
|||
</el-form> |
|||
<template slot="footer"> |
|||
<el-button @click="visible = false">{{ $t('cancel') }}</el-button> |
|||
<el-button type="primary" @click="dataFormSubmitHandle()">{{ $t('confirm') }}</el-button> |
|||
</template> |
|||
</el-dialog> |
|||
</template> |
|||
|
|||
<script> |
|||
import debounce from 'lodash/debounce' |
|||
export default { |
|||
data () { |
|||
return { |
|||
visible: false, |
|||
dataForm: { |
|||
id: '', |
|||
userId: '', |
|||
fullName: '', |
|||
sex: '', |
|||
birthday: '', |
|||
mobile: '', |
|||
points: '', |
|||
adjustReason: '', |
|||
operationType: '', |
|||
operatePoints: '' |
|||
} |
|||
} |
|||
}, |
|||
methods: { |
|||
init () { |
|||
this.visible = true |
|||
this.$nextTick(() => { |
|||
if (this.dataForm.id) { |
|||
this.getInfo() |
|||
this.dataForm.adjustReason = '' |
|||
this.dataForm.operationType = '' |
|||
this.dataForm.operatePoints = '' |
|||
} |
|||
}) |
|||
}, |
|||
getInfo () { |
|||
this.$http.get(`/app-user/volunteerinfo/queryById/${this.dataForm.id}`).then(({ data: res }) => { |
|||
if (res.code !== 0) { |
|||
return this.$message.error(res.msg) |
|||
} |
|||
this.dataForm = { |
|||
...this.dataForm, |
|||
...res.data |
|||
} |
|||
}).catch(() => {}) |
|||
}, |
|||
dataFormSubmitHandle: debounce(function () { |
|||
this.$http['post']( |
|||
'/points/pointslogs/confirmAdjustPoint', this.dataForm).then(({ data: res }) => { |
|||
if (res.code !== 0) { |
|||
return this.$message.error(res.msg) |
|||
} |
|||
this.$message({ |
|||
message: this.$t('prompt.success'), |
|||
type: 'success', |
|||
duration: 500, |
|||
onClose: () => { |
|||
this.visible = false |
|||
this.$emit('refreshDataList') |
|||
} |
|||
}) |
|||
}).catch(() => {}) |
|||
}, 1000, { 'leading': true, 'trailing': false }) |
|||
} |
|||
} |
|||
</script> |
|||
Loading…
Reference in new issue