提交 865eabf1 authored 作者: 王鹏飞's avatar 王鹏飞

增加学术报告路由

上级 e9b07f19
......@@ -90,3 +90,8 @@ export function getOrder(orderId) {
export function paySuccess(id) {
return httpRequest.get(`/api/lms/v2/lobby/update-status-api/${id}`)
}
// 获取学术活动报告列表
export function getAcitivityReportList(id) {
return httpRequest.get(`/api/lms/v2/education/symposium/${id}/report`)
}
......@@ -21,6 +21,16 @@ export default [
{ name: 'activityAdd', path: 'activity/add', component: ActivityEdit },
{ name: 'activityEdit', path: 'activity/edit/:id', component: ActivityEdit, props: { isEdit: true } },
{ name: 'activityView', path: 'activity/view/:id', component: ActivityEdit, props: { isView: true } },
{
name: 'activityReportView',
path: 'activity/report',
component: () => import(/* webpackChunkName: "offices" */ './src/activity/reportView.vue')
},
{
name: 'activityReportEdit',
path: 'activity/report/edit',
component: () => import(/* webpackChunkName: "offices" */ './src/activity/reportEdit.vue')
},
/**
* 乐分享
......
......@@ -24,29 +24,32 @@ export default {
label: '操作',
attrs: { width: '200' },
buttons: [
// {
// label: '查看报告',
// isShow(row) {
// return row.form.reportscount !== '0'
// },
// onClick: row => {
// this.$router.push({
// path: `/app/offices/view-report/${row.form.id}`
// })
// }
// },
// {
// label: '上传报告',
// isShow(row) {
// const isPass = [1, 2, 4].includes(row.status)
// return isPass && row.form.reportscount === '0'
// },
// onClick: row => {
// this.$router.push({
// path: `/app/offices/upload-report/${row.form.id}/-1`
// })
// }
// },
{
label: '查看报告',
isShow(row) {
return row.form.reportscount !== '0'
},
onClick: row => {
this.$router.push({
path: `/app/affairs-hall/view-report/${row.form.id}`
})
// this.$router.push({ name: 'activityReportView', query: { id: row.form.id } })
}
},
{
label: '上传报告',
isShow(row) {
const isPass = [1, 2, 4].includes(row.status)
return isPass && row.form.reportscount === '0'
},
onClick: row => {
this.$router.push({
path: `/app/affairs-hall/upload-report/${row.form.id}/-1`
})
// this.$router.push({ name: 'activityReportEdit', query: { id: row.form.id } })
}
},
{
label: '查看',
isShow(row) {
......
<template>
<div>
<div class="con-title">{{ $t('pages.affairsHall.uploadReport.title') }}</div>
<div class="con-box">
<el-button type="text" @click="goBack">{{ $t('pages.affairsHall.uploadReport.backText') }}</el-button>
<el-form label-width="120px" :model="ruleForm" :rules="rules" ref="ruleForm" class="main-form">
<el-form-item :label="$t('pages.affairsHall.uploadReport.name')" prop="name">
<el-input v-model="ruleForm.name" :placeholder="$t('pages.affairsHall.uploadReport.placename')" />
</el-form-item>
<el-form-item :label="$t('pages.affairsHall.uploadReport.labeltitle')" prop="title">
<el-input
type="textarea"
v-model="ruleForm.title"
:placeholder="$t('pages.affairsHall.uploadReport.placetitle')"
/>
</el-form-item>
<el-form-item :label="$t('pages.affairsHall.uploadReport.file')" prop="file">
<el-upload
action=""
:multiple="false"
:limit="1"
:show-file-list="false"
:on-change="handleChange"
:http-request="uploadFile"
:file-list="filesArr"
>
<el-button size="small" type="primary">{{
$t('pages.affairsHall.uploadReport.uploadButtonText')
}}</el-button>
<div slot="tip" class="el-upload__tip">
{{ $t('pages.affairsHall.uploadReport.uploadTips') }}
<a
href="http://zws-imgs-pub.oss-cn-beijing.aliyuncs.com/static/build/learn-mba/%E3%80%8AMBA%E5%AD%A6%E7%94%9F%E5%AD%A6%E6%9C%AF%E6%B4%BB%E5%8A%A8%E8%AE%B0%E5%BD%95%E6%8A%A5%E5%91%8A%E3%80%8B%E6%A8%A1%E6%9D%BFXXX%E5%AD%A6%E7%94%9F.docx"
target="_blank"
>{{ $t('pages.affairsHall.uploadReport.downloadTemplateText') }}</a
>
</div>
</el-upload>
<template v-if="successFileUrl">
<a :href="successFileUrl">{{ $t('pages.affairsHall.uploadReport.downloadButtonText') }}</a>
</template>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="handleSubmit">{{
$t('pages.affairsHall.uploadReport.savesubmit')
}}</el-button>
</el-form-item>
</el-form>
</div>
</div>
</template>
<script>
import * as api from '../../api'
export default {
data() {
return {
ruleForm: { name: '', title: '' },
rules: {
name: [{ required: true, message: '请输入报告主题', trigger: 'blur' }],
title: [{ required: true, message: '请输入报告摘要', trigger: 'blur' }]
},
submitLoading: false,
fileList: []
}
},
methods: {
handleChange(file, filelist) {
this.file.name = file.raw.name
this.file.type = file.raw.type
this.file.lastModifiedDate = file.raw.lastModifiedDate
this.file.size = file.raw.size
this.file.file = file.raw
},
uploadFile() {
api
.uploadFile(this.file)
.then(data => {
this.successFileUrl = data.url
this.filesArr.pop()
})
.catch(e => {
this.filesArr.pop()
this.$message.error(e.message)
})
},
goBack() {
this.$router.push({ path: '/app/offices' })
},
// 提交
handleSubmit(callback) {
this.$refs.ruleForm.validate().then(() => {
const params = Object.assign({}, this.ruleForm, { affair_id: this.affairId })
this.isEdit ? this.handleUpdate(params, callback) : this.handleAdd(params, callback)
})
},
// 新建
handleAdd(params, callback) {
this.submitLoading = true
api
.createAffair(params)
.then(response => {
response.success ? this.handleSuccess(response) : this.handleError(response)
})
.catch(this.handleError)
.finally(() => {
this.submitLoading = false
})
},
// 修改
handleUpdate(params, callback) {
this.submitLoading = true
api
.updateAffair(this.pid, params)
.then(response => {
response.success ? this.handleSuccess(response) : this.handleError(response)
})
.catch(this.handleError)
.finally(() => {
this.submitLoading = false
})
}
}
}
</script>
<style lang="scss" scoped>
.main-form {
max-width: 600px;
margin: 0 auto;
}
</style>
<template>
<div>
<div class="con-title">{{ $t('pages.affairsHall.uploadReport.title') }}</div>
<div class="con-box">
<el-button type="text" @click='gobackActiveList'>{{ $t('pages.affairsHall.uploadReport.backText') }}</el-button>
<el-row type="flex" justify="center">
<el-col :xs="24" :sm="24" :md="16" :lg="12" :xl="8">
<el-form ref="setSubmitForm" :label-width="labelWidth" :model="setSubmit" :rules="submitRules">
<el-form-item :label="$t('pages.affairsHall.uploadReport.name')" prop="name">
<el-input v-model="setSubmit.name" :placeholder="$t('pages.affairsHall.uploadReport.placename')" type="text" />
</el-form-item>
<el-form-item :label="$t('pages.affairsHall.uploadReport.labeltitle')" prop="title">
<el-input v-model="setSubmit.title" :placeholder="$t('pages.affairsHall.uploadReport.placetitle')" type="text" />
</el-form-item>
<el-form-item :label="$t('pages.affairsHall.uploadReport.file')" prop="file">
<el-upload
ref="upFile"
class="upload-demo"
action=""
:multiple="false"
:limit="1"
:show-file-list="false"
:on-change="handleChange"
:http-request="uploadFile"
:file-list="filesArr">
<el-button size="small" type="primary">{{ $t('pages.affairsHall.uploadReport.uploadButtonText') }}</el-button>
<div slot="tip" class="el-upload__tip">{{ $t('pages.affairsHall.uploadReport.uploadTips') }}<a href="http://zws-imgs-pub.oss-cn-beijing.aliyuncs.com/static/build/learn-mba/%E3%80%8AMBA%E5%AD%A6%E7%94%9F%E5%AD%A6%E6%9C%AF%E6%B4%BB%E5%8A%A8%E8%AE%B0%E5%BD%95%E6%8A%A5%E5%91%8A%E3%80%8B%E6%A8%A1%E6%9D%BFXXX%E5%AD%A6%E7%94%9F.docx">{{ $t('pages.affairsHall.uploadReport.downloadTemplateText') }}</a></div>
<template v-if="successFileUrl">
{{successFileUrl.replace(/.*\/([^\/]*\.[^.]+)$/gi, '$1')}}
</template>
</el-upload>
<template v-if="successFileUrl">
<a :href="successFileUrl">{{ $t('pages.affairsHall.uploadReport.downloadButtonText') }}</a>
</template>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="onSubmitFrom">{{ $t('pages.affairsHall.uploadReport.savesubmit') }}</el-button>
</el-form-item>
</el-form>
</el-col>
</el-row>
</div>
</div>
</template>
<script>
import cAction from '@action'
export default {
props: {
rid: { type: String, required: false },
reid: { type: String, required: false }
},
components: {},
data () {
return {
labelWidth: '110px',
setSubmit: {
name: '',
title: ''
},
submitRules: {
name: [
{ required: true, message: '报告主题不能为空', trigger: 'blur' }
],
title: []
},
successFileUrl: '',
filesArr: [],
file: {
id: 'WU_FILE_0',
name: '',
type: '',
lastModifiedDate: '',
size: '',
file: ''
}
}
},
mounted () {
if (this.reid !== '-1') {
const loading = this.$loading({ lock: true, text: '', spinner: '', background: 'rgba(255, 255, 255, 0.9)' })
cAction.Affairs.getSubmitReport(this.rid, this.reid).then(data => {
if (data.report_name) {
this.setSubmit.name = data.report_name
this.setSubmit.title = data.report_description
this.successFileUrl = data.file_url
}
}).catch(e => { this.$message.error(e.message) }).finally(() => { loading.close() })
}
window.addEventListener('resize', () => {
const width = document.documentElement.clientWidth
if (width < 790) {
this.labelWidth = 'auto'
} else {
this.labelWidth = '110px'
}
})
},
methods: {
handleChange (file, filelist) {
this.file.name = file.raw.name
this.file.type = file.raw.type
this.file.lastModifiedDate = file.raw.lastModifiedDate
this.file.size = file.raw.size
this.file.file = file.raw
},
uploadFile () {
const loading = this.$loading({ lock: true, text: '', spinner: '', background: 'rgba(255, 255, 255, 0.9)' })
cAction.Affairs.uploadFile(this.file).then(data => {
this.successFileUrl = data.url
this.filesArr.pop()
}).catch(e => { this.filesArr.pop(); this.$message.error(e.message) }).finally(() => { loading.close() })
},
gobackActiveList () {
this.$router.push({ path: '/app/affairs-hall/hall' })
},
onSubmitFrom () {
this.$refs.setSubmitForm.validate((valid) => {
if (valid) {
// if (!this.successFileUrl) {
// this.$message.error('请上传附件')
// return
// // this.$refs['setApplyForm'].resetFields()
// }
const loading = this.$loading({ lock: true, text: '', spinner: '', background: 'rgba(255, 255, 255, 0.9)' })
let report = null
if (this.reid !== '-1') {
/* 修改 */
report = cAction.Affairs.updateSubmitReport(this.rid, this.reid, {
report_name: this.setSubmit.name,
report_description: this.setSubmit.title,
file_url: JSON.stringify([{
name: this.file.name,
url: this.successFileUrl
}])
})
} else {
/* 新建 */
report = cAction.Report.submitReport(this.rid, {
report_name: this.setSubmit.name,
report_description: this.setSubmit.title,
file_url: JSON.stringify([{
name: this.file.name,
url: this.successFileUrl
}])
})
}
report.then(data => {
if (data.flag) {
this.$message({ type: 'success', message: '提交成功' })
setTimeout(() => {
this.$router.push({ path: `/app/affairs-hall/view-report/${this.rid}` })
}, 500)
}
}).catch(e => { this.filesArr.pop(); this.$message.error(e.message) }).finally(() => { loading.close() })
} else {
this.$message.error('请检查输入项,确认无误后,重新提交')
return false
}
})
}
}
}
</script>
<style lang="scss" scoped>
/* 申请 */
.el-date-editor.el-input {
width: 100%;
}
.el-upload__tip {
line-height: 1.5;
}
</style>
......@@ -2,116 +2,60 @@
<div>
<div class="con-title">{{ $t('pages.affairsHall.uploadReport.title') }}</div>
<div class="con-box">
<!-- <el-button type="primary" @click="goReportSubmit">申请报告</el-button> -->
<el-button type="text" @click="gobackReportActiveList">{{
$t('pages.affairsHall.uploadReport.backText')
}}</el-button>
<div style="width: 100%; height: 0.2rem"></div>
<m-page
:tableHead="tableHead"
:tableData="tableData"
:params="params"
:objFn="objFn"
:tableConfig="tableConfig"
/>
<table-list v-bind="tableOptions" ref="tableList"></table-list>
</div>
</div>
</template>
<script>
import cAction from '@action'
import mPage from '../../components/comTable/mPage.vue'
import TableList from '@/components/comTable/tableList'
import * as api from '../../api'
export default {
props: {
rid: { type: String, required: true }
},
components: { mPage },
components: { TableList },
data() {
return {
tableConfig: { border: '', size: '', selection: { has: false, sels: [], width: '50px', fix: 'left', align: '' } }, // 增加选择框,has设置为true
tableHead: [
{ prop: 'index', label: '序号', minWidth: '80', fix: false },
{ prop: 'report_name', label: '报告名称', minWidth: '150', fix: false },
{ prop: 'report_description', label: '报告摘要', minWidth: '120', fix: false },
{ prop: 'submit_time', label: '提交时间', minWidth: '120', fix: false },
// { prop: 'approve_status', label: '审批状态', minWidth: '120', fix: false },
{ prop: 'file_url', label: '附件下载', minWidth: '120', fix: false },
// { prop: '', label: '', minWidth: '', fix: false, goObj: { routerName: '', params: {} } }, // 点击跳转页面并传参数
tableOptions: {
remote: {
request: api.getAcitivityReportList,
beforeRequest: this.tableListbeforeRequest
},
columns: [
{ prop: 'index', label: '序号' },
{ prop: 'report_name', label: '报告名称' },
{ prop: 'report_description', label: '报告摘要' },
{ prop: 'submit_time', label: '提交时间' },
{ prop: 'file_url', label: '附件下载' },
{
prop: 'operate-x',
label: '操作',
width: '140px',
fix: false,
commandArr:
"[ { command: 'reportlist-', name: '' }, { command: 'reportlist-edit', name: '编辑' }, { command: 'reportlist-delete', name: '删除' } ]"
buttons: [
{
label: '编辑',
onClick: row => {
this.$router.push({
path: `/app/offices/view-report/${row.form.id}`
})
}
],
tableData: [],
params: { keywords: '', curPage: 1, pageSize: 100, total: '' },
objFn: {
paramsFn: _this => {
return { rid: this.rid }
},
nameAPI: 'getReportListAll',
actionClass: 'Report',
// nameExcel: 'getStatSummaryExcel',
nameExcel: 'getExportExcel3_4_14',
callback: (_this, data) => {
_this.params.total = 100
data.forEach((elem, i) => {
elem.approve_status = elem.is_checked === 1 ? '通过' : elem.is_checked === 0 ? '未通过' : '未审批'
elem.file_url = JSON.parse(elem.file_url)[0].url
elem.index = i + 1 + (_this.params.curPage - 1) * _this.params.pageSize
_this.tableData.push(elem)
{
label: '删除',
onClick: row => {
this.$router.push({
path: `/app/offices/view-report/${row.form.id}`
})
}
}
]
}
},
mounted() {
this.VueEvent.$off('command-tablelist-x').$on('command-tablelist-x', _obj => {
if (_obj.command.command === 'reportlist-edit') {
const reid = _obj.tableData[_obj.index - 1].id
this.$router.push({ path: `/app/learn/report-submit/${this.rid}/${reid}` })
]
}
if (_obj.command.command === 'reportlist-delete') {
const reid = _obj.tableData[_obj.index - 1].id
/* 删除 */
const loading = this.$loading({ lock: true, text: '', spinner: '', background: 'rgba(255, 255, 255, 0.9)' })
cAction.Affairs.deleteSubmitReport(this.rid, reid)
.then(data => {
if (data.flag) {
this.$message({ type: 'success', message: '删除成功' })
}
this.params.pageSize += 1
})
.catch(e => {
this.$message.error(e.message)
})
.finally(() => {
loading.close()
})
}
})
},
methods: {
goReportSubmit() {
this.$router.push({ path: `/app/learn/report-submit/${this.rid}/-1` })
},
gobackReportActiveList() {
this.$router.push({ path: '/app/affairs-hall/hall' })
}
}
}
</script>
<style lang="scss" scoped>
/* 申请 */
.el-date-editor.el-input {
width: 100%;
}
.el-upload__tip {
line-height: 1.5;
}
</style>
......@@ -113,7 +113,7 @@ export default {
}).catch(e => { this.filesArr.pop(); this.$message.error(e.message) }).finally(() => { loading.close() })
},
gobackActiveList () {
this.$router.push({ path: '/app/affairs-hall/hall' })
this.$router.push({ path: '/app/offices' })
},
onSubmitFrom () {
this.$refs.setSubmitForm.validate((valid) => {
......
......@@ -82,7 +82,7 @@ export default {
this.$router.push({ path: `/app/learn/report-submit/${this.rid}/-1` })
},
gobackReportActiveList () {
this.$router.push({ path: '/app/affairs-hall/hall' })
this.$router.push({ path: '/app/offices' })
}
}
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论