You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
186 lines
5.4 KiB
186 lines
5.4 KiB
<template>
|
|
<el-dialog :visible.sync="visible"
|
|
title="志愿者审核"
|
|
:close-on-click-modal="false"
|
|
:close-on-press-escape="false">
|
|
<el-form :model="dataForm"
|
|
:rules="dataRule"
|
|
ref="dataForm"
|
|
v-if="clickStatus === 1"
|
|
@keyup.enter.native="dataFormSubmitHandle()"
|
|
:label-width="$i18n.locale === 'en-US' ? '120px' : '80px'">
|
|
<el-form-item label="审核 :"
|
|
prop="auditStatus">
|
|
<template>
|
|
<el-radio v-model="dataForm.auditStatus"
|
|
label="1">通过</el-radio>
|
|
<el-radio v-model="dataForm.auditStatus"
|
|
label="2">不通过</el-radio>
|
|
</template>
|
|
</el-form-item>
|
|
<el-form-item label="填写原因 :" label-width="90px"
|
|
prop="failureReason">
|
|
<el-input v-model="dataForm.failureReason"
|
|
maxlength="50"
|
|
show-word-limit
|
|
placeholder="请您填写取消原因,50字以内"></el-input>
|
|
</el-form-item>
|
|
</el-form>
|
|
<el-form :model="dataForm"
|
|
:rules="dataRule"
|
|
ref="dataForm"
|
|
v-if="clickStatus === 2"
|
|
@keyup.enter.native="dataFormSubmitHandle()"
|
|
:label-width="$i18n.locale === 'en-US' ? '120px' : '90px'">
|
|
<el-form-item label="填写原因"
|
|
prop="failureReason">
|
|
<el-input v-model="dataForm.failureReason"
|
|
maxlength="50"
|
|
show-word-limit
|
|
placeholder="请您填写拉入黑名单原因,50字以内"></el-input>
|
|
</el-form-item>
|
|
</el-form>
|
|
<template slot="footer"
|
|
v-if="clickStatus === 1">
|
|
<el-button @click="visible = false">{{ $t('cancel') }}</el-button>
|
|
<el-button type="primary"
|
|
@click="dataFormSubmitHandle()">{{ $t('confirm') }}</el-button>
|
|
</template>
|
|
<template slot="footer"
|
|
v-if="clickStatus === 2">
|
|
<el-button @click="visible = false">{{ $t('cancel') }}</el-button>
|
|
<el-button type="primary"
|
|
@click="blackListSubmitHandle()">{{ $t('confirm') }}</el-button>
|
|
</template>
|
|
</el-dialog>
|
|
</template>
|
|
|
|
<script>
|
|
import debounce from 'lodash/debounce'
|
|
export default {
|
|
data () {
|
|
return {
|
|
visible: false,
|
|
dataForm: {
|
|
id: '', // 志愿者表id
|
|
auditStatus: '',
|
|
failureReason: '',
|
|
tagIds: []
|
|
},
|
|
clickStatus: '',
|
|
tagOptions: [],
|
|
userGridList: []
|
|
}
|
|
},
|
|
computed: {
|
|
dataRule () {
|
|
return {
|
|
auditStatus: [
|
|
{
|
|
required: true,
|
|
message: this.$t('validate.required'),
|
|
trigger: 'blur'
|
|
}
|
|
],
|
|
failureReason: [
|
|
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
|
|
]
|
|
}
|
|
}
|
|
},
|
|
methods: {
|
|
init () {
|
|
this.visible = true
|
|
this.$nextTick(() => {
|
|
this.$refs['dataForm'].resetFields()
|
|
if (this.dataForm.id) {
|
|
// data.dataForm.id = this.dataForm.id
|
|
// this.getInfo()
|
|
}
|
|
})
|
|
},
|
|
// 审核
|
|
dataFormSubmitHandle: debounce(
|
|
function () {
|
|
this.$refs['dataForm'].validate(valid => {
|
|
if (!valid) {
|
|
return false
|
|
}
|
|
let postData = {
|
|
id: this.dataForm.id,
|
|
auditStatus: this.dataForm.auditStatus,
|
|
failureReason: this.dataForm.failureReason
|
|
}
|
|
this.$http['post'](
|
|
'/app-user/volunteerinfo/volunteerInfoCheck',
|
|
postData
|
|
)
|
|
.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 }
|
|
),
|
|
// 拉黑
|
|
blackListSubmitHandle: debounce(
|
|
function () {
|
|
this.$refs['dataForm'].validate(valid => {
|
|
if (!valid) {
|
|
return false
|
|
}
|
|
let postData = {
|
|
id: this.dataForm.id,
|
|
auditStatus: '3',
|
|
failureReason: this.dataForm.failureReason
|
|
}
|
|
this.$http['post'](
|
|
'/app-user/volunteerinfo/volunteerInfoCheck',
|
|
postData
|
|
)
|
|
.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 }
|
|
),
|
|
showLeaderFlagFormatter (row, column, cellValue, index) {
|
|
if (cellValue === '1') {
|
|
return '是'
|
|
} else {
|
|
return '否'
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
<style scoped>
|
|
|
|
</style>
|
|
|