first commit
This commit is contained in:
@@ -0,0 +1,154 @@
|
||||
const basicForm = {
|
||||
template: /*language=HTML*/ `
|
||||
<div>
|
||||
<el-form :model="formData" ref="formRef" :rules="formRules" label-width="120px" label-position="left">
|
||||
<el-form-item prop="planType" label="计划类型">
|
||||
<el-select v-model="formData.planType" placeholder="请选择计划类型" filterable clearable
|
||||
style="width: 100%">
|
||||
<el-option v-if="$auth.hasRole('SYSADMIN') || $auth.hasRole('SCHOOL_UNION_ADMIN')" label="校工会" value="40001"></el-option>
|
||||
<el-option v-if="$auth.hasRole('SYSADMIN') || $auth.hasRole('BRANCH_UNION_CHAIRMAN')" label="分工会" value="40002"></el-option>
|
||||
<el-option v-if="$auth.hasRole('SYSADMIN') || $auth.hasRole('CLUB_PRESIDENT')" label="协会/社团" value="40003"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item v-if="formData.planType === '40002'" prop="tissueId" label="所属工会">
|
||||
<el-select v-model="formData.tissueId" placeholder="请选择所属工会" filterable clearable
|
||||
@change="(val) => {formData.tissueName = unionList.find(o => o.id === formData.tissueId).name}"
|
||||
style="width: 100%">
|
||||
<el-option
|
||||
v-for="item in unionList"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item v-if="formData.planType === '40003'" prop="tissueId" label="所属协会/社团">
|
||||
<el-select v-model="formData.tissueId" placeholder="请选择所属协会/社团" filterable clearable
|
||||
@change="(val) => {formData.tissueName = clubList.find(o => o.id === formData.tissueId).clubName}"
|
||||
style="width: 100%">
|
||||
<el-option
|
||||
v-for="item in clubList"
|
||||
:key="item.id"
|
||||
:label="item.clubName"
|
||||
:value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item prop="planName" label="计划名称">
|
||||
<el-input maxlength="50" placeholder="请填写计划名称" v-model="formData.planName"
|
||||
type="text"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="planTime" label="预计时间">
|
||||
<el-date-picker
|
||||
v-model="formData.planTime"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
placeholder="请选择预计时间"
|
||||
style="width: 100%">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item prop="activityType" label="活动类型">
|
||||
<el-select v-model="formData.activityType" placeholder="请选择活动类型" filterable clearable
|
||||
style="width: 100%">
|
||||
<el-option
|
||||
v-for="item in activityTypeList"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item prop="money" label="预算费用" class="is-required">
|
||||
<el-input maxlength="50" placeholder="请填写整数或者小数" v-model="formData.money"
|
||||
type="number"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="content" label="计划内容" class="is-required">
|
||||
<text-editor v-model="formData.content"></text-editor>
|
||||
</el-form-item>
|
||||
<el-form-item prop="content" label="附件上传">
|
||||
<file-upload :upload_number="5" :value.sync="formData.files"
|
||||
upload_result_type="url"
|
||||
complete_result upload_mode="drag"
|
||||
upload_result_category="array"></file-upload>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-row class="mt10" justify="end" type="flex">
|
||||
<el-button @click="$emit('refresh')">取消</el-button>
|
||||
<el-button @click="onSubmit" type="primary">提交</el-button>
|
||||
</el-row>
|
||||
</div>
|
||||
`,
|
||||
props: {
|
||||
unionList: {
|
||||
type: Array,
|
||||
required: true
|
||||
},
|
||||
clubList: {
|
||||
type: Array,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
activityTypeList: [],
|
||||
formData: {},
|
||||
formRules: {
|
||||
type: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
planName: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
planTime: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
money: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
activityType: [{required: true, message: '必填', trigger: ['blur']}],
|
||||
planType: [{required: true, message: '必填', trigger: ['blur']}],
|
||||
tissueId: [{required: true, message: '必填', trigger: ['blur']}],
|
||||
},
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onOpen(row) {
|
||||
if(row && row.id) {
|
||||
this.fetchOne(row.id)
|
||||
}
|
||||
},
|
||||
fetchOne(id) {
|
||||
this.$axios.post('/platform/yearPlan/manage/fetchOne', { id: id })
|
||||
.then((resp) => {
|
||||
this.formData = clone(resp.data)
|
||||
})
|
||||
},
|
||||
onSubmit() {
|
||||
this.$refs.formRef.validate((valid) => {
|
||||
if (valid) {
|
||||
this.$confirm("您确定要提交吗?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(async () => {
|
||||
this.formData.files = JSON.stringify(this.formData.files)
|
||||
const resp = await this.$axios.post("/platform/yearPlan/manage/onSubmit", this.formData)
|
||||
if (resp.code === 0) {
|
||||
this.$message.success(resp.msg)
|
||||
this.$emit('refresh')
|
||||
} else {
|
||||
this.$message.warning(resp.msg)
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
queryActivityType() {
|
||||
this.$axios.post('/platform/yearPlan/manage/queryActivityType')
|
||||
.then((resp) => {
|
||||
this.activityTypeList = resp.data
|
||||
})
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.queryActivityType()
|
||||
},
|
||||
style: /*language=CSS*/ `
|
||||
|
||||
`
|
||||
}
|
||||
@@ -0,0 +1,208 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
|
||||
<style>
|
||||
|
||||
</style>
|
||||
|
||||
<div id="app" v-cloak>
|
||||
<guava ref="guava">
|
||||
<template>
|
||||
<el-card shadow="never">
|
||||
<search @search="doSearch">
|
||||
<search-item label="年度">
|
||||
<el-date-picker
|
||||
placeholder="请选择年度"
|
||||
type="year"
|
||||
@change="doSearch"
|
||||
style="width: 100%"
|
||||
v-model="pageForm.year"
|
||||
value-format="yyyy"
|
||||
></el-date-picker>
|
||||
</search-item>
|
||||
<search-item label="计划名称">
|
||||
<el-input
|
||||
@keyup.enter.native="doSearch"
|
||||
clearable
|
||||
placeholder="请输入计划名称"
|
||||
style="width: 100%"
|
||||
v-model="pageForm.planName"
|
||||
></el-input>
|
||||
</search-item>
|
||||
<search-item v-if="$auth.hasRole('SYSADMIN') || $auth.hasRole('BRANCH_UNION_CHAIRMAN')" label="所属工会">
|
||||
<el-select v-model="pageForm.tissueIdByUnion" placeholder="请选择所属工会" filterable clearable
|
||||
@change="doSearch" style="width: 100%">
|
||||
<el-option
|
||||
v-for="item in unionList"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
<search-item v-if="$auth.hasRole('SYSADMIN') || $auth.hasRole('CLUB_PRESIDENT')" label="协会/社团:">
|
||||
<el-select v-model="pageForm.tissueIdByClub" placeholder="请选择所属协会/社团" filterable clearable
|
||||
@change="doSearch" style="width: 100%">
|
||||
<el-option
|
||||
v-for="item in clubList"
|
||||
:key="item.id"
|
||||
:label="item.clubName"
|
||||
:value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
</search>
|
||||
</el-card>
|
||||
|
||||
<el-card shadow="never" class="mt20">
|
||||
<table-tool label="年度计划">
|
||||
<el-button type="primary" size="small" @click="onDownLoad">
|
||||
<i class="el-icon-download"></i>
|
||||
下载全部附件
|
||||
</el-button>
|
||||
<el-button type="primary" size="small" @click="onAdd">
|
||||
<i class="ti-plus"></i>
|
||||
新增计划
|
||||
</el-button>
|
||||
</table-tool>
|
||||
<el-table :data="tableData" @sort-change="pageOrder" :size="tableSize">
|
||||
<el-table-column label="序号" type="index" :index="indexMethod" width="60"></el-table-column>
|
||||
<el-table-column
|
||||
:label="column.label"
|
||||
:prop="column.prop"
|
||||
:key="column.prop"
|
||||
:width="column.width"
|
||||
:sortable="column.sortable"
|
||||
align="center"
|
||||
header-align="center"
|
||||
show-overflow-tooltip
|
||||
v-for="column in tableColumns"
|
||||
>
|
||||
<template v-slot="{ row }" v-if="column.prop === 'planType'">
|
||||
<span v-if="row.planType === '40001'">校工会</span>
|
||||
<span v-if="row.planType === '40002'">分工会</span>
|
||||
<span v-if="row.planType === '40003'">协会/社团</span>
|
||||
</template>
|
||||
<template v-slot="{ row }" v-else-if="column.prop === 'tissueName'">
|
||||
{{ row.tissueName || '校工会' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="230">
|
||||
<template v-slot="{ row }">
|
||||
<el-button @click="onView(row)" size="mini" type="primary">查看</el-button>
|
||||
<el-button @click="onEdit(row)" size="mini" type="primary">编辑</el-button>
|
||||
<el-button @click="onDelete(row)" size="mini" type="danger">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--#include("/layouts/pagination.html"){}#-->
|
||||
</el-card>
|
||||
</template>
|
||||
|
||||
<template #edit>
|
||||
<basic-form ref="basicFormRef" @refresh="refresh" :union-list="unionList" :club-list="clubList"></basic-form>
|
||||
</template>
|
||||
|
||||
<template #view>
|
||||
<info ref="infoRef"></info>
|
||||
</template>
|
||||
|
||||
</guava>
|
||||
|
||||
</div>
|
||||
<script nonce="${cspNonce!}">
|
||||
<!--#include('basicForm.js'){}#-->
|
||||
<!--#include('info.js'){}#-->
|
||||
const vue = new Vue({
|
||||
el: "#app",
|
||||
mixins: [initTableMixins],
|
||||
components: {
|
||||
"basic-form": basicForm,
|
||||
"info": info,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
tableColumns: [
|
||||
{label: '年度', prop: 'year'},
|
||||
{label: '计划名称', prop: 'planName'},
|
||||
{label: '计划类型', prop: 'planType'},
|
||||
{label: '所属组织', prop: 'tissueName'},
|
||||
{label: '活动类型', prop: 'activityTypeName'},
|
||||
{label: '预计时间', prop: 'planTime'},
|
||||
{label: '预算费用', prop: 'money'},
|
||||
],
|
||||
unionList: [],
|
||||
clubList: [],
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onDownLoad() {
|
||||
this.$downLoad(loc() + '/downloadFiles', this.pageForm)
|
||||
},
|
||||
refresh() {
|
||||
this.doSearch()
|
||||
this.$refs.guava.index()
|
||||
},
|
||||
onView(row) {
|
||||
this.$refs.guava.view(() => {
|
||||
this.$refs.infoRef.onOpen(row)
|
||||
})
|
||||
},
|
||||
onAdd() {
|
||||
this.$refs.guava.edit(() => {
|
||||
this.$refs.basicFormRef.onOpen()
|
||||
})
|
||||
},
|
||||
onEdit(row) {
|
||||
this.$refs.guava.edit(() => {
|
||||
this.$refs.basicFormRef.onOpen(row)
|
||||
})
|
||||
},
|
||||
onDelete(row) {
|
||||
this.$confirm("您确定要删除吗, 是否继续?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
})
|
||||
.then(() => {
|
||||
this.$axios.post("/platform/yearPlan/manage/onDelete", { id: row.id }).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.$message.success(res.msg)
|
||||
this.pageData()
|
||||
}
|
||||
})
|
||||
})
|
||||
.catch(() => {})
|
||||
},
|
||||
pageData() {
|
||||
this.$axios.post(loc() + "/pageData", this.pageForm).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.tableData = res.data.list
|
||||
this.pageForm.totalCount = res.data.totalCount
|
||||
}
|
||||
})
|
||||
},
|
||||
queryUnion() {
|
||||
this.$axios.post('/platform/yearPlan/manage/queryUnion')
|
||||
.then((resp) => {
|
||||
this.unionList = resp.data
|
||||
})
|
||||
},
|
||||
queryClub() {
|
||||
this.$axios.post('/platform/yearPlan/manage/queryClub')
|
||||
.then((resp) => {
|
||||
this.clubList = resp.data
|
||||
})
|
||||
},
|
||||
},
|
||||
async created() {
|
||||
this.queryUnion()
|
||||
this.queryClub()
|
||||
this.pageData()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,45 @@
|
||||
const info = {
|
||||
template: /*language=HTML*/ `
|
||||
<div>
|
||||
<el-descriptions :column="2" border class="table_fixed">
|
||||
<el-descriptions-item label="计划类型">
|
||||
{{ viewData.type == 40001 ? '校工会计划' : viewData.type == 40002 ? '分工会计划' : '协会/社团计划' }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="计划名称">
|
||||
{{ viewData.planName }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="预计时间">
|
||||
{{ viewData.planTime }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="所属组织">
|
||||
{{ viewData.tissueName || '校工会' }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="活动类型">
|
||||
{{ viewData.activityTypeName }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="预算费用">
|
||||
{{ viewData.money }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="计划内容" :span="2">
|
||||
<div v-html="viewData.content"></div>
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</div>
|
||||
`,
|
||||
data() {
|
||||
return {
|
||||
viewData: {},
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onOpen(row) {
|
||||
this.$axios.post('/platform/yearPlan/manage/fetchOne', { id: row.id })
|
||||
.then((resp) => {
|
||||
this.viewData = resp.data
|
||||
})
|
||||
},
|
||||
},
|
||||
style: /*language=CSS*/ `
|
||||
|
||||
`
|
||||
}
|
||||
@@ -0,0 +1,118 @@
|
||||
const basicForm = {
|
||||
template: /*language=HTML*/ `
|
||||
<div>
|
||||
<el-form :model="formData" ref="formRef" :rules="formRules" label-width="120px" label-position="left">
|
||||
<el-form-item label="上传人" prop="userName">
|
||||
<el-input maxlength="50" placeholder="请填写上传人" :value="$store.state.user.username"
|
||||
type="text"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="summaryFrom" label="上传类型">
|
||||
<el-select v-model="formData.summaryFrom" placeholder="请选择上传类型" filterable clearable
|
||||
style="width: 100%">
|
||||
<el-option v-if="$auth.hasRole('SYSADMIN') || $auth.hasRole('SCHOOL_UNION_ADMIN')" label="校工会" value="40001"></el-option>
|
||||
<el-option v-if="$auth.hasRole('SYSADMIN') || $auth.hasRole('BRANCH_UNION_CHAIRMAN')" label="分工会" value="40002"></el-option>
|
||||
<el-option v-if="$auth.hasRole('SYSADMIN') || $auth.hasRole('CLUB_PRESIDENT')" label="协会/社团" value="40003"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="formData.summaryFrom === '40002'" prop="tissueId" label="所属工会">
|
||||
<el-select v-model="formData.tissueId" placeholder="请选择所属工会" filterable clearable
|
||||
@change="(val) => {formData.tissueName = unionList.find(o => o.id === formData.tissueId).name}"
|
||||
style="width: 100%">
|
||||
<el-option
|
||||
v-for="item in unionList"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="formData.summaryFrom === '40003'" prop="tissueId" label="所属协会/社团">
|
||||
<el-select v-model="formData.tissueId" placeholder="请选择所属协会/社团" filterable clearable
|
||||
@change="(val) => {formData.tissueName = clubList.find(o => o.id === formData.tissueId).clubName}"
|
||||
style="width: 100%">
|
||||
<el-option
|
||||
v-for="item in clubList"
|
||||
:key="item.id"
|
||||
:label="item.clubName"
|
||||
:value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item prop="summaryType" label="总结类型">
|
||||
<el-select v-model="formData.summaryType" placeholder="请选择总结类型"
|
||||
clearable style="width: 100%;">
|
||||
<el-option v-for="item in dict.type.SUMMARY_TYPE" :label="item.name" :value="item.code" :key="item.code"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item prop="files" label="附件">
|
||||
<file-upload :upload_number="5" :value.sync="formData.files"
|
||||
upload_result_type="url"
|
||||
complete_result upload_mode="drag"
|
||||
upload_result_category="array"></file-upload>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-row class="mt10" justify="end" type="flex">
|
||||
<el-button @click="$emit('refresh')">取消</el-button>
|
||||
<el-button @click="onSubmit" type="primary">提交</el-button>
|
||||
</el-row>
|
||||
</div>
|
||||
`,
|
||||
store,
|
||||
dicts: ["SUMMARY_TYPE"],
|
||||
props: {
|
||||
unionList: {
|
||||
type: Array,
|
||||
required: true
|
||||
},
|
||||
clubList: {
|
||||
type: Array,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
formData: {},
|
||||
formRules: {
|
||||
summaryFrom: [{required: true, message: '必填', trigger: ['blur']}],
|
||||
summaryType: [{required: true, message: '必填', trigger: ['blur']}],
|
||||
tissueId: [{required: true, message: '必填', trigger: ['blur']}],
|
||||
},
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onOpen(row) {
|
||||
if(row && row.id) {
|
||||
this.fetchOne(row.id)
|
||||
}
|
||||
},
|
||||
fetchOne(id) {
|
||||
this.$axios.post('/platform/yearSummary/manage/fetchOne', { id: id })
|
||||
.then((resp) => {
|
||||
this.formData = clone(resp.data)
|
||||
})
|
||||
},
|
||||
onSubmit() {
|
||||
this.$refs.formRef.validate((valid) => {
|
||||
if (valid) {
|
||||
this.$confirm("您确定要提交吗?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(async () => {
|
||||
this.formData.files = JSON.stringify(this.formData.files)
|
||||
const resp = await this.$axios.post("/platform/yearSummary/manage/onSubmit", this.formData)
|
||||
if (resp.code === 0) {
|
||||
this.$message.success(resp.msg)
|
||||
this.$emit('refresh')
|
||||
} else {
|
||||
this.$message.warning(resp.msg)
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
},
|
||||
style: /*language=CSS*/ `
|
||||
|
||||
`
|
||||
}
|
||||
@@ -0,0 +1,204 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
|
||||
<style>
|
||||
|
||||
</style>
|
||||
|
||||
<div id="app" v-cloak>
|
||||
<guava ref="guava">
|
||||
<template>
|
||||
<el-card shadow="never">
|
||||
<search @search="doSearch">
|
||||
<search-item label="年度">
|
||||
<el-date-picker
|
||||
placeholder="请选择年度"
|
||||
type="year"
|
||||
@change="doSearch"
|
||||
style="width: 100%"
|
||||
v-model="pageForm.year"
|
||||
value-format="yyyy"
|
||||
></el-date-picker>
|
||||
</search-item>
|
||||
<search-item label="总结类型">
|
||||
<el-select v-model="pageForm.summaryType" placeholder="请选择总结类型"
|
||||
clearable style="width: 100%;" @change="doSearch">
|
||||
<el-option v-for="item in dict.type.SUMMARY_TYPE" :label="item.name" :value="item.code" :key="item.code"></el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
<search-item v-if="$auth.hasRole('SYSADMIN') || $auth.hasRole('BRANCH_UNION_CHAIRMAN')" label="所属工会">
|
||||
<el-select v-model="pageForm.tissueIdByUnion" placeholder="请选择所属工会" filterable clearable
|
||||
@change="doSearch" style="width: 100%">
|
||||
<el-option
|
||||
v-for="item in unionList"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
<search-item v-if="$auth.hasRole('SYSADMIN') || $auth.hasRole('CLUB_PRESIDENT')" label="协会/社团:">
|
||||
<el-select v-model="pageForm.tissueIdByClub" placeholder="请选择所属协会/社团" filterable clearable
|
||||
@change="doSearch" style="width: 100%">
|
||||
<el-option
|
||||
v-for="item in clubList"
|
||||
:key="item.id"
|
||||
:label="item.clubName"
|
||||
:value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
</search>
|
||||
</el-card>
|
||||
|
||||
<el-card shadow="never" class="mt20">
|
||||
<table-tool label="年度总结">
|
||||
<el-button type="primary" size="small" @click="onDownLoad">
|
||||
<i class="el-icon-download"></i>
|
||||
下载全部附件
|
||||
</el-button>
|
||||
<el-button type="primary" size="small" @click="onAdd">
|
||||
<i class="ti-plus"></i>
|
||||
新增计划
|
||||
</el-button>
|
||||
</table-tool>
|
||||
<el-table :data="tableData" @sort-change="pageOrder" :size="tableSize">
|
||||
<el-table-column label="序号" type="index" :index="indexMethod" width="60"></el-table-column>
|
||||
<el-table-column
|
||||
:label="column.label"
|
||||
:prop="column.prop"
|
||||
:key="column.prop"
|
||||
:width="column.width"
|
||||
:sortable="column.sortable"
|
||||
align="center"
|
||||
header-align="center"
|
||||
show-overflow-tooltip
|
||||
v-for="column in tableColumns"
|
||||
>
|
||||
<template v-slot="{ row }" v-if="column.prop === 'planType'">
|
||||
<span v-if="row.planType === '40001'">校工会</span>
|
||||
<span v-if="row.planType === '40002'">分工会</span>
|
||||
<span v-if="row.planType === '40003'">协会/社团</span>
|
||||
</template>
|
||||
<template v-slot="{ row }" v-else-if="column.prop === 'tissueName'">
|
||||
{{ row.tissueName || '校工会' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="230">
|
||||
<template v-slot="{ row }">
|
||||
<el-button @click="onView(row)" size="mini" type="primary">查看</el-button>
|
||||
<el-button @click="onEdit(row)" size="mini" type="primary">编辑</el-button>
|
||||
<el-button @click="onDelete(row)" size="mini" type="danger">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--#include("/layouts/pagination.html"){}#-->
|
||||
</el-card>
|
||||
</template>
|
||||
|
||||
<template #edit>
|
||||
<basic-form ref="basicFormRef" @refresh="refresh" :union-list="unionList" :club-list="clubList"></basic-form>
|
||||
</template>
|
||||
|
||||
<template #view>
|
||||
<info ref="infoRef"></info>
|
||||
</template>
|
||||
|
||||
</guava>
|
||||
|
||||
</div>
|
||||
<script nonce="${cspNonce!}">
|
||||
<!--#include('basicForm.js'){}#-->
|
||||
<!--#include('info.js'){}#-->
|
||||
const vue = new Vue({
|
||||
el: "#app",
|
||||
dicts: ["SUMMARY_TYPE"],
|
||||
mixins: [initTableMixins],
|
||||
components: {
|
||||
"basic-form": basicForm,
|
||||
"info": info,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
tableColumns: [
|
||||
{label: '年度', prop: 'year'},
|
||||
{label: '总结类型', prop: 'summaryTypeName'},
|
||||
{label: '所属组织', prop: 'tissueName'},
|
||||
{label: '上传人', prop: 'userName'},
|
||||
{label: '上传时间', prop: 'cTime'},
|
||||
],
|
||||
unionList: [],
|
||||
clubList: [],
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onDownLoad() {
|
||||
this.$downLoad(loc() + '/downloadFiles', this.pageForm)
|
||||
},
|
||||
refresh() {
|
||||
this.doSearch()
|
||||
this.$refs.guava.index()
|
||||
},
|
||||
onView(row) {
|
||||
this.$refs.guava.view(() => {
|
||||
this.$refs.infoRef.onOpen(row)
|
||||
})
|
||||
},
|
||||
onAdd() {
|
||||
this.$refs.guava.edit(() => {
|
||||
this.$refs.basicFormRef.onOpen()
|
||||
})
|
||||
},
|
||||
onEdit(row) {
|
||||
this.$refs.guava.edit(() => {
|
||||
this.$refs.basicFormRef.onOpen(row)
|
||||
})
|
||||
},
|
||||
onDelete(row) {
|
||||
this.$confirm("您确定要删除吗, 是否继续?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
})
|
||||
.then(() => {
|
||||
this.$axios.post("/platform/yearSummary/manage/onDelete", { id: row.id }).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.$message.success(res.msg)
|
||||
this.pageData()
|
||||
}
|
||||
})
|
||||
})
|
||||
.catch(() => {})
|
||||
},
|
||||
pageData() {
|
||||
this.$axios.post(loc() + "/pageData", this.pageForm).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.tableData = res.data.list
|
||||
this.pageForm.totalCount = res.data.totalCount
|
||||
}
|
||||
})
|
||||
},
|
||||
queryUnion() {
|
||||
this.$axios.post('/platform/yearPlan/manage/queryUnion')
|
||||
.then((resp) => {
|
||||
this.unionList = resp.data
|
||||
})
|
||||
},
|
||||
queryClub() {
|
||||
this.$axios.post('/platform/yearPlan/manage/queryClub')
|
||||
.then((resp) => {
|
||||
this.clubList = resp.data
|
||||
})
|
||||
},
|
||||
},
|
||||
async created() {
|
||||
this.queryUnion()
|
||||
this.queryClub()
|
||||
this.pageData()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,43 @@
|
||||
const info = {
|
||||
template: /*language=HTML*/ `
|
||||
<div>
|
||||
<el-descriptions :column="2" border class="table_fixed">
|
||||
<el-descriptions-item label="上传人">
|
||||
{{viewData.userName}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="上传类型">
|
||||
{{ viewData.summaryFrom == 40001 ? '校工会计划' : viewData.type == 40002 ? '分工会计划' : '协会/社团计划' }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="所属组织">
|
||||
{{ viewData.tissueName || '校工会' }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="总结类型">
|
||||
{{viewData.summaryTypeName}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="上传时间" :span="2">
|
||||
{{viewData.cTime}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="附件">
|
||||
<file-preview v-if="viewData.files.length > 0" :files="viewData.files" complete_result></file-preview>
|
||||
<span v-else>暂无</span>
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</div>
|
||||
`,
|
||||
data() {
|
||||
return {
|
||||
viewData: {},
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onOpen(row) {
|
||||
this.$axios.post('/platform/yearSummary/manage/fetchOne', { id: row.id })
|
||||
.then((resp) => {
|
||||
this.viewData = resp.data
|
||||
})
|
||||
},
|
||||
},
|
||||
style: /*language=CSS*/ `
|
||||
|
||||
`
|
||||
}
|
||||
Reference in New Issue
Block a user