3 changed files with 331 additions and 0 deletions
@ -0,0 +1,128 @@ |
|||
<template> |
|||
<el-dialog :visible.sync="visible" :title="!dataForm.id ? $t('add') : $t('update')" :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"> |
|||
<el-select v-model="dataForm.actStatus" placeholder="审核操作"> |
|||
<el-option label="审核通过" value="1"> </el-option> |
|||
<el-option label="审核未通过" value="2"> </el-option> |
|||
</el-select> |
|||
</el-form-item> |
|||
<el-form-item label="不通过原因:" prop="noPassReason" v-if="dataForm.actStatus === '2'"> |
|||
<el-input v-model="dataForm.noPassReason" placeholder="不通过原因"></el-input> |
|||
</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: '', |
|||
actTitle: '', |
|||
actContent: '', |
|||
actAddress: '', |
|||
actStartTime: '', |
|||
actEndTime: '', |
|||
actPeopleNum: '', |
|||
actContacts: '', |
|||
actTel: '', |
|||
actStatus: '', |
|||
noPassReason: '' |
|||
} |
|||
} |
|||
}, |
|||
computed: { |
|||
dataRule () { |
|||
return { |
|||
actStatus: [ |
|||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
|||
], |
|||
noPassReason: [ |
|||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
|||
] |
|||
} |
|||
} |
|||
}, |
|||
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 = '' |
|||
} |
|||
}).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> |
@ -0,0 +1,121 @@ |
|||
<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> |
@ -0,0 +1,82 @@ |
|||
<template> |
|||
<el-card shadow="never" class="aui-card--fill"> |
|||
<div class="mod-news__actapplyinfo}"> |
|||
<el-table v-loading="dataListLoading" :data="dataList" border @selection-change="dataListSelectionChangeHandle" style="width: 100%;"> |
|||
<el-table-column label="序号" type="index" show-overflow-tooltip align="center" width="50"></el-table-column> |
|||
<el-table-column prop="actTitle" label="志愿服务标题" header-align="center" align="center" show-overflow-tooltip></el-table-column> |
|||
<el-table-column prop="actStatus" label="活动状态" header-align="center" align="center" :formatter="formatActStatus"></el-table-column> |
|||
<el-table-column prop="createdTime" label="申请时间" header-align="center" align="center"></el-table-column> |
|||
<el-table-column :label="$t('handle')" fixed="right" header-align="center" align="center" width="150"> |
|||
<template slot-scope="scope"> |
|||
<el-button type="text" size="small" @click="phraseDetailHandle(scope.row.id)">查看</el-button> |
|||
<el-button type="text" size="small" v-show="scope.row.actStatus === '0'" @click="addOrUpdateHandle(scope.row.id)">审核</el-button> |
|||
<el-button type="text" size="small" v-show="scope.row.actStatus !== '0'" :disabled="true" @click="addOrUpdateHandle(scope.row.id)">已审核</el-button> |
|||
</template> |
|||
</el-table-column> |
|||
</el-table> |
|||
<el-pagination |
|||
:current-page="page" |
|||
:page-sizes="[10, 20, 50, 100]" |
|||
:page-size="limit" |
|||
:total="total" |
|||
layout="total, sizes, prev, pager, next, jumper" |
|||
@size-change="pageSizeChangeHandle" |
|||
@current-change="pageCurrentChangeHandle"> |
|||
</el-pagination> |
|||
<!-- 弹窗, 新增 / 修改 --> |
|||
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update> |
|||
<!--查看--> |
|||
<actapplyinfo-detail v-if="actapplyinfoDetailVisible" |
|||
ref="actapplyinfoDetail" |
|||
@refreshDataList="getDataList"></actapplyinfo-detail> |
|||
</div> |
|||
</el-card> |
|||
</template> |
|||
|
|||
<script> |
|||
import mixinViewModule from '@/mixins/view-module' |
|||
import AddOrUpdate from './actapplyinfo-add-or-update' |
|||
import actapplyinfoDetail from './actapplyinfo-detail' |
|||
export default { |
|||
mixins: [mixinViewModule], |
|||
data () { |
|||
return { |
|||
mixinViewModuleOptions: { |
|||
getDataListURL: '/heart/actapplyinfo/page', |
|||
getDataListIsPage: true, |
|||
deleteURL: '/heart/actapplyinfo', |
|||
deleteIsBatch: true |
|||
}, |
|||
dataForm: { |
|||
id: '' |
|||
}, |
|||
actapplyinfoDetailVisible: false |
|||
} |
|||
}, |
|||
components: { |
|||
AddOrUpdate, |
|||
actapplyinfoDetail |
|||
}, |
|||
methods: { |
|||
formatActStatus (row) { |
|||
if (row.actStatus) { |
|||
if (row.actStatus === '0') { |
|||
return '待审核' |
|||
} else if (row.actStatus === '1') { |
|||
return '审核通过' |
|||
} else if (row.actStatus === '2') { |
|||
return '审核不通过' |
|||
} |
|||
} |
|||
return '' |
|||
}, |
|||
phraseDetailHandle (id) { |
|||
this.actapplyinfoDetailVisible = true |
|||
this.$nextTick(() => { |
|||
this.$refs.actapplyinfoDetail.dataForm.id = id |
|||
this.$refs.actapplyinfoDetail.init() |
|||
}) |
|||
} |
|||
} |
|||
} |
|||
</script> |
Loading…
Reference in new issue