diff --git a/src/views/modules/points/volunteer-points-log.vue b/src/views/modules/points/volunteer-points-log.vue new file mode 100644 index 00000000..5687e09d --- /dev/null +++ b/src/views/modules/points/volunteer-points-log.vue @@ -0,0 +1,122 @@ + + + diff --git a/src/views/modules/points/volunteerinfo-points-adjust.vue b/src/views/modules/points/volunteerinfo-points-adjust.vue index 790f3df8..f04dbf17 100644 --- a/src/views/modules/points/volunteerinfo-points-adjust.vue +++ b/src/views/modules/points/volunteerinfo-points-adjust.vue @@ -5,7 +5,10 @@ :close-on-click-modal="false" :close-on-press-escape="false" > - +
{{dataForm.id}}
@@ -33,16 +36,26 @@
{{dataForm.points}}
+ + + + + + - + 加积分 减积分 - +
@@ -69,19 +82,60 @@ export default { points: '', adjustReason: '', operationType: '', - operatePoints: '' + operatePoints: '', + behaviorCode: '' + }, + behaviorTypeList: [] + } + }, + computed: { + dataRule () { + return { + behaviorCode: [ + { + required: true, + message: this.$t('validate.required'), + trigger: 'blur' + } + ], + adjustReason: [ + { + required: true, + message: this.$t('validate.required'), + trigger: 'blur' + } + ], + operationType: [ + { + required: true, + message: this.$t('validate.required'), + trigger: 'blur' + } + ], + operatePoints: [ + { + required: true, + message: this.$t('validate.required'), + trigger: 'blur' + } + ] } } }, + created () { + this.getBehaviorTypeList() + }, methods: { init () { this.visible = true this.$nextTick(() => { + this.$refs['dataForm'].resetFields() if (this.dataForm.id) { this.getInfo() this.dataForm.adjustReason = '' this.dataForm.operationType = '' this.dataForm.operatePoints = '' + this.dataForm.behaviorCode = '' } }) }, @@ -97,22 +151,38 @@ export default { }).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.$refs['dataForm'].validate(valid => { + if (!valid) { + return false } - this.$message({ - message: this.$t('prompt.success'), - type: 'success', - duration: 500, - onClose: () => { - this.visible = false - this.$emit('refreshDataList') + 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 }) + }), + getBehaviorTypeList () { + this.$http + .get(`/sys/dict/listSimple/pointsrule_behavior`) + .then(({ data: res }) => { + if (res.code !== 0) { + return this.$message.error(res.msg) + } + this.behaviorTypeList = res.data }) - }).catch(() => {}) - }, 1000, { 'leading': true, 'trailing': false }) + .catch(() => {}) + } } } diff --git a/src/views/modules/user/volunteerinfo.vue b/src/views/modules/user/volunteerinfo.vue index 1260e044..67da373e 100644 --- a/src/views/modules/user/volunteerinfo.vue +++ b/src/views/modules/user/volunteerinfo.vue @@ -77,7 +77,7 @@ @click="checkHandle(scope.row.id, 2)" >拉入黑名单 积分调整 - + 积分记录 @@ -109,7 +109,13 @@ v-if="volunteerinfoPointsAdjustVisible" ref="volunteerinfoPointsAdjust" @refreshDataList="getDataList" - > + > + + @@ -119,7 +125,8 @@ import mixinViewModule from '@/mixins/view-module' import AddOrUpdate from './volunteerinfo-add-or-update' // import debounce from 'lodash/debounce' import volunteerinfoDetail from './volunteerinfo-detail' -import volunteerinfoPointsAdjust from '../points/volunteerinfo-points-adjust.vue' +import volunteerinfoPointsAdjust from '../points/volunteerinfo-points-adjust' +import volunteerPointsLog from '../points/volunteer-points-log' import volunteerinfoCheck from './volunteerinfo-check' // import func from '../../../../vue-temp/vue-editor-bridge' export default { @@ -158,6 +165,7 @@ export default { options: [], volunteerinfoDetailVisible: false, volunteerinfoPointsAdjustVisible: false, + volunteerPointsLogVisible: false, volunteerinfoCheckVisible: false } }, @@ -222,6 +230,14 @@ export default { this.$refs.volunteerinfoPointsAdjust.init() }) }, + // 积分记录 + pointsLogs (id) { + this.volunteerPointsLogVisible = true + this.$nextTick(() => { + this.$refs.volunteerPointsLog.dataForm.volunteerId = id + this.$refs.volunteerPointsLog.init() + }) + }, // 性别状态转换 sexState: function (row, column) { let state = row.sex @@ -249,7 +265,8 @@ export default { AddOrUpdate, volunteerinfoDetail, volunteerinfoPointsAdjust, - volunteerinfoCheck + volunteerinfoCheck, + volunteerPointsLog } }