Browse Source

Merge remote-tracking branch 'origin/feature/syp_actApply' into feature/syp_actApply

feature/syp_points
liuchuang 5 years ago
parent
commit
9d91d17411
  1. 121
      src/views/modules/heart/actapplyinfo-detail.vue
  2. 24
      src/views/modules/heart/actapplyinfo.vue

121
src/views/modules/heart/actapplyinfo-detail.vue

@ -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>

24
src/views/modules/heart/actapplyinfo.vue

@ -5,10 +5,12 @@
<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"></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 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" :disabled="scope.row.actStatus !== '0'" @click="addOrUpdateHandle(scope.row.id)">审核</el-button>
<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>
@ -23,6 +25,10 @@
</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>
@ -30,6 +36,7 @@
<script>
import mixinViewModule from '@/mixins/view-module'
import AddOrUpdate from './actapplyinfo-add-or-update'
import actapplyinfoDetail from './actapplyinfo-detail'
export default {
mixins: [mixinViewModule],
data () {
@ -42,11 +49,13 @@ export default {
},
dataForm: {
id: ''
}
},
actapplyinfoDetailVisible: false
}
},
components: {
AddOrUpdate
AddOrUpdate,
actapplyinfoDetail
},
methods: {
formatActStatus (row) {
@ -60,6 +69,13 @@ export default {
}
}
return ''
},
phraseDetailHandle (id) {
this.actapplyinfoDetailVisible = true
this.$nextTick(() => {
this.$refs.actapplyinfoDetail.dataForm.id = id
this.$refs.actapplyinfoDetail.init()
})
}
}
}

Loading…
Cancel
Save