锦水项目前端
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.
 
 
 
 

121 lines
3.6 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" @keyup.enter.native="dataFormSubmitHandle()" :label-width="$i18n.locale === 'en-US' ? '120px' : '120px'">
<el-form-item label="志愿服务标题:" prop="actTitle">
{{dataForm.actTitle}}
</el-form-item>
<el-form-item label="志愿服务内容:" prop="actContent">
{{dataForm.actContent}}
</el-form-item>
<el-form-item label="地点:" prop="actAddress">
{{dataForm.actAddress}}
</el-form-item>
<el-form-item label="活动时间:">
{{dataForm.actStartTime}}-{{dataForm.actEndTime}}
</el-form-item>
<el-form-item label="需要人数:" prop="actPeopleNum">
{{dataForm.actPeopleNum}}
</el-form-item>
<el-form-item label="联系人:" prop="actContacts">
{{dataForm.actContacts}}
</el-form-item>
<el-form-item label="联系电话:" prop="actTel">
{{dataForm.actTel}}
</el-form-item>
<el-form-item label="审核操作:" prop="actStatus">
{{dataForm.actStatus}}
</el-form-item>
<el-form-item label="不通过原因:" prop="noPassReason" v-if="dataForm.actStatus === '审核不通过'">
{{dataForm.noPassReason}}
</el-form-item>
</el-form>
</el-dialog>
</template>
<script>
import debounce from 'lodash/debounce'
export default {
data () {
return {
visible: false,
dataForm: {
id: '',
actTitle: '',
actContent: '',
actAddress: '',
actStartTime: '',
actEndTime: '',
actPeopleNum: '',
actContacts: '',
actTel: '',
actStatus: '',
noPassReason: ''
}
}
},
computed: {
dataRule () {
return {
}
}
},
methods: {
init () {
this.visible = true
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
if (this.dataForm.id) {
this.getInfo()
}
})
},
// 获取信息
getInfo () {
this.$http.get(`/heart/actapplyinfo/${this.dataForm.id}`).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.dataForm = {
...this.dataForm,
...res.data
}
if (res.data.actStatus === '0') {
this.dataForm.actStatus = '待审核'
}
if (res.data.actStatus === '1') {
this.dataForm.actStatus = '审核通过'
}
if (res.data.actStatus === '2') {
this.dataForm.actStatus = '审核不通过'
}
}).catch(() => {})
},
// 表单提交
dataFormSubmitHandle: debounce(function () {
this.$refs['dataForm'].validate((valid) => {
if (!valid) {
return false
}
if (this.dataForm.actStatus === '0') {
return this.$message.error('请选择审核结果!')
}
this.$http.post('/heart/actapplyinfo/review', 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>