first commit
This commit is contained in:
@@ -0,0 +1,112 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
|
||||
<div id="app" v-cloak>
|
||||
<guava ref="guava">
|
||||
<el-card shadow="never">
|
||||
<!--#include("/platform/activity/summary/common/addSummaryCommon.html"){}#-->
|
||||
</el-card>
|
||||
</guava>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
var vue = new Vue({
|
||||
el: '#app',
|
||||
components: {},
|
||||
data() {
|
||||
return {
|
||||
formData: {
|
||||
files: [],
|
||||
tissueId: '',
|
||||
},
|
||||
summaryType: [],
|
||||
id: '',
|
||||
clubOptions: [],
|
||||
userOptions: [],
|
||||
summaryFrom: '3',
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async querySqr(key) {
|
||||
const data = await selectUser(key, 30)
|
||||
this.userOptions = data.list
|
||||
},
|
||||
cancel() {
|
||||
if (this.id) {
|
||||
sublime.jumpPagePjax('/platform/activity/yearSummary/club')
|
||||
}
|
||||
},
|
||||
async doHandle() {
|
||||
const valid = await this.$refs['form'].validate()
|
||||
if (valid) {
|
||||
this.formData.userId = "${@shiro.getPrincipalProperty('id')}";
|
||||
this.formData.summaryFrom = "3";
|
||||
this.formData.files = JSON.stringify(this.formData.files)
|
||||
const resp = await $.post('/platform/activity/yearSummary/doHandle', this.formData)
|
||||
if (resp.code === 0) {
|
||||
this.$notify({
|
||||
title: '成功',
|
||||
message: resp.msg,
|
||||
type: 'success',
|
||||
duration: 500,
|
||||
onClose: () => {
|
||||
sublime.jumpPagePjax('/platform/activity/yearSummary/club')
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
async initData() {
|
||||
const id = GetQueryString("id")
|
||||
this.id = id
|
||||
if (id) {
|
||||
const resp = await $.post('/platform/activity/yearSummary/findOne', {id})
|
||||
if (resp.code === 0) {
|
||||
this.formData = resp.data
|
||||
this.formData.files = JSON.parse(this.formData.files)
|
||||
this.userOptions = [
|
||||
{
|
||||
username: this.formData.username,
|
||||
loginname: this.formData.loginname,
|
||||
id: this.formData.userId,
|
||||
}
|
||||
]
|
||||
}
|
||||
} else {
|
||||
this.formData.userId = "${@shiro.getPrincipalProperty('id')}"
|
||||
this.userOptions = [
|
||||
{
|
||||
username: "${@shiro.getPrincipalProperty('username')}",
|
||||
loginname: "${@shiro.getPrincipalProperty('loginname')}",
|
||||
id: "${@shiro.getPrincipalProperty('id')}",
|
||||
}
|
||||
]
|
||||
const clubs = await $.post('/platform/activity/yearSummary/getMyClub')
|
||||
this.formData.tissueId = clubs[0] === undefined ? '' : clubs[0]
|
||||
}
|
||||
},
|
||||
},
|
||||
async created() {
|
||||
await this.initData()
|
||||
this.summaryType = await getDictOptions('summaryType')
|
||||
this.clubOptions = await getClubs()
|
||||
const isAdmin = "${@shiro.hasAnyRoles('sysadmin', 'A06')}" === 'true'
|
||||
if (!isAdmin) {
|
||||
const clubs = await this.getMyClub()
|
||||
let clubArray = []
|
||||
for (let c of Array.from(clubs)) {
|
||||
const cl = this.clubOptions.find(x => x.id === c)
|
||||
if (cl) {
|
||||
clubArray.push(cl)
|
||||
}
|
||||
}
|
||||
this.clubOptions = clubArray
|
||||
}
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,245 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
|
||||
<style>
|
||||
.el-descriptions__table {
|
||||
table-layout: fixed !important;
|
||||
}
|
||||
|
||||
.el-descriptions-item__cell {
|
||||
text-align: center !important;
|
||||
}
|
||||
</style>
|
||||
<div id="app" v-cloak>
|
||||
<guava ref="guava">
|
||||
|
||||
<el-card shadow="never">
|
||||
<div class="search">
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">年度</div>
|
||||
<div class="search-item-option">
|
||||
<el-date-picker
|
||||
placeholder="选择年度" style="width: 100%"
|
||||
type="year"
|
||||
v-model="pageForm.year"
|
||||
value-format="yyyy">
|
||||
</el-date-picker>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">社团</div>
|
||||
<div class="search-item-option">
|
||||
<el-select v-model="pageForm.tissueId" placeholder="请选择社团(社团)" style="width: 100%;">
|
||||
<el-option v-for="item in unionOptions" :label="item.name" :value="item.id"></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">总结类型</div>
|
||||
<div class="search-item-option">
|
||||
<el-select v-model="pageForm.summaryType" placeholder="请选择总结类型" style="width: 100%;">
|
||||
<el-option v-for="item in summaryType" :label="item.name" :value="item.id"></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="search-query">
|
||||
<el-button type="primary" icon="el-icon-search" @click="pageData">搜索</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<el-card shadow="never" class="mt20">
|
||||
<el-table :data="tableData" @sort-change='pageOrder'>
|
||||
<el-table-column label="序号" type="index" header-align="center" align="center">
|
||||
<template scope="scope">
|
||||
<span>{{scope.$index+(pageForm.pageNumber - 1) * pageForm.pageSize + 1}} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="year" label="年度">
|
||||
</el-table-column>
|
||||
<el-table-column sortable prop="name" label="社团">
|
||||
</el-table-column>
|
||||
<el-table-column sortable prop="typename" label="总结类型">
|
||||
</el-table-column>
|
||||
<el-table-column sortable prop="username" label="上传人">
|
||||
</el-table-column>
|
||||
<el-table-column sortable prop="ctime" label="上传时间">
|
||||
</el-table-column>
|
||||
<el-table-column prop="userOnline" label="操作" width="100px">
|
||||
<template slot-scope="scope">
|
||||
<el-dropdown @command="dropdownCommand">
|
||||
<el-button plain size="mini"><i class="ti-settings"></i><span class="ti-angle-down"></span>
|
||||
</el-button>
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-item :command="{type:'view',data:scope.row}">
|
||||
查看
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item :command="{type:'edit',data:scope.row}">
|
||||
编辑
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item :command="{type:'delete',data:scope.row}">
|
||||
删除
|
||||
</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-row class="el-pagination-container">
|
||||
<el-pagination
|
||||
@size-change="pageSizeChange"
|
||||
@current-change="pageNumberChange"
|
||||
:current-page="pageForm.pageNumber"
|
||||
:page-sizes="[10, 20, 30, 50]"
|
||||
:page-size="pageForm.pageSize"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
:total="pageForm.totalCount">
|
||||
</el-pagination>
|
||||
</el-row>
|
||||
</el-card>
|
||||
|
||||
<template #view>
|
||||
<div style="width: 80%; margin: 0 auto">
|
||||
<vi-title title="总结详情"></vi-title>
|
||||
<el-descriptions :column="2" border class="table_fixed">
|
||||
<el-descriptions-item label="年度">
|
||||
{{viewData.year}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="社团">
|
||||
{{viewData.name}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="总结类型">
|
||||
{{viewData.typename}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="上传人">
|
||||
{{viewData.username}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="上传时间" :span="2">
|
||||
{{viewData.ctime}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="附件">
|
||||
<file-upload v-if="viewData.files&&viewData.files.length"
|
||||
:files="JSON.parse(viewData.files)"
|
||||
:view="true"></file-upload>
|
||||
<span v-else>暂无</span>
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</div>
|
||||
</template>
|
||||
</guava>
|
||||
|
||||
</div>
|
||||
|
||||
<script>
|
||||
let vue = new Vue({
|
||||
el: "#app",
|
||||
components: {
|
||||
'file-upload': httpVueLoader('/components/plugins/FileUpload.vue'),
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
tableData: [],
|
||||
fileList: [],
|
||||
pageForm: {
|
||||
pageNumber: 1,
|
||||
pageSize: 10,
|
||||
totalCount: 0,
|
||||
pageOrderName: "",
|
||||
pageOrderBy: "",
|
||||
summaryFrom: '3',
|
||||
year: moment().format('YYYY')
|
||||
},
|
||||
formData: {},
|
||||
summaryType: [],
|
||||
unionOptions: [],
|
||||
viewData: {},
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
openView(row) {
|
||||
this.$refs.guava.view()
|
||||
this.viewData = row
|
||||
},
|
||||
dropdownCommand(command) {
|
||||
const {type, data} = command
|
||||
if (type == 'view') {
|
||||
this.openView(data)
|
||||
} else if (type == 'edit') {
|
||||
this.openEdit(data)
|
||||
} else if (type == 'delete') {
|
||||
this.doDelete(data.id)
|
||||
}
|
||||
},
|
||||
doDelete(id) {
|
||||
this.$confirm('确定要删除吗', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
}).then(() => {
|
||||
$.post(base + '/platform/activity/yearSummary/doDelete', {id: id}).then(res => {
|
||||
if (res.code === 0) {
|
||||
this.doSearch()
|
||||
this.$message.success(res.msg)
|
||||
}
|
||||
})
|
||||
}).catch(() => {
|
||||
})
|
||||
},
|
||||
doSearch() {
|
||||
this.pageForm.pageNumber = 1
|
||||
this.pageData()
|
||||
},
|
||||
pageOrder(column) {
|
||||
this.pageForm.pageOrderName = column.prop
|
||||
this.pageForm.pageOrderBy = column.order
|
||||
this.pageData()
|
||||
},
|
||||
pageNumberChange(val) {
|
||||
this.pageForm.pageNumber = val;
|
||||
this.pageData()
|
||||
},
|
||||
pageSizeChange(val) {
|
||||
this.pageForm.pageSize = val;
|
||||
this.pageData()
|
||||
},
|
||||
pageData() {
|
||||
$.post('/platform/activity/yearSummary/pageData', this.pageForm).then(res => {
|
||||
if (res.code === 0) {
|
||||
this.tableData = res.data.list
|
||||
this.pageForm.totalCount = res.data.totalCount
|
||||
}
|
||||
})
|
||||
},
|
||||
openEdit(row) {
|
||||
sublime.jumpPagePjax('/platform/activity/yearSummary/addClubSummary?id=' + row.id)
|
||||
},
|
||||
async getMyClub() {
|
||||
return await $.post('/platform/activity/yearSummary/getMyClub')
|
||||
}
|
||||
},
|
||||
async created() {
|
||||
this.unionOptions = await getClubs()
|
||||
const isAdmin = "${@shiro.hasAnyRoles('sysadmin', 'A06')}" === 'true'
|
||||
if (!isAdmin) {
|
||||
const clubs = await this.getMyClub()
|
||||
let clubArray = []
|
||||
for (let c of Array.from(clubs)) {
|
||||
const cl = this.unionOptions.find(x => x.id === c)
|
||||
if (cl) {
|
||||
clubArray.push(cl)
|
||||
}
|
||||
}
|
||||
this.unionOptions = clubArray
|
||||
}
|
||||
this.summaryType = await getDictOptions('summaryType')
|
||||
this.pageData()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,57 @@
|
||||
<el-form :model="formData" label-width="120px" ref="form">
|
||||
<vi-title title="年度总结"></vi-title>
|
||||
<el-row :gutter="10" type="flex">
|
||||
<el-col :span="24">
|
||||
<el-form-item label="姓名" prop="username">
|
||||
<el-select v-model="formData.userId" style="width: 100%"
|
||||
filterable
|
||||
remote
|
||||
clearable
|
||||
reserve-keyword
|
||||
placeholder="输入工号或姓名查找"
|
||||
:remote-method="querySqr">
|
||||
<el-option v-for="o in userOptions" :label="o.username+'-'+o.loginname" :value="o.id"
|
||||
:key="o.id"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row v-if="summaryFrom === '2'" :gutter="10" type="flex">
|
||||
<el-col :span="24">
|
||||
<el-form-item label="所属工会" prop="tissueId">
|
||||
<el-select v-model="formData.tissueId" placeholder="请选择所属工会" style="width: 100%;">
|
||||
<el-option v-for="item in unionOptions" :label="item.unionname" :value="item.id"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row v-if="summaryFrom === '3'" :gutter="10" type="flex">
|
||||
<el-col :span="24">
|
||||
<el-form-item label="社团" prop="tissueId">
|
||||
<el-select v-model="formData.tissueId" placeholder="请选择社团(社团)" style="width: 100%;">
|
||||
<el-option v-for="item in clubOptions" :label="item.name" :value="item.id"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="10" type="flex">
|
||||
<el-col :span="24">
|
||||
<el-form-item label="总结类型" prop="summaryType" :rules="{required:true,message: '请选择总结类型', trigger: 'blur'}">
|
||||
<el-select v-model="formData.summaryType" placeholder="请选择总结类型" style="width: 100%;">
|
||||
<el-option v-for="item in summaryType" :label="item.name" :value="item.id"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="10" type="flex">
|
||||
<el-col :span="24">
|
||||
<el-form-item prop="files" label="附件上传">
|
||||
<file-upload :files.sync="formData.files"></file-upload>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<el-row class="mt10" justify="end" type="flex">
|
||||
<el-button @click="cancel">取消</el-button>
|
||||
<el-button @click="doHandle" type="primary">提交</el-button>
|
||||
</el-row>
|
||||
@@ -0,0 +1,99 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
|
||||
<div id="app" v-cloak>
|
||||
<guava ref="guava">
|
||||
<el-card shadow="never">
|
||||
<!--#include("/platform/activity/summary/common/addSummaryCommon.html"){}#-->
|
||||
</el-card>
|
||||
</guava>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
var vue = new Vue({
|
||||
el: '#app',
|
||||
components: {},
|
||||
data() {
|
||||
return {
|
||||
formData: {
|
||||
files: [],
|
||||
tissueId: '',
|
||||
},
|
||||
summaryFrom: '1',
|
||||
summaryType: [],
|
||||
id: '',
|
||||
unionOptions: [],
|
||||
userOptions: [],
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async querySqr(key) {
|
||||
const data = await selectUser(key, 30)
|
||||
this.userOptions = data.list
|
||||
},
|
||||
cancel() {
|
||||
if (this.id) {
|
||||
sublime.jumpPagePjax('/platform/activity/yearSummary/school')
|
||||
}
|
||||
},
|
||||
async doHandle() {
|
||||
const valid = await this.$refs['form'].validate()
|
||||
if (valid) {
|
||||
this.formData.userId = "${@shiro.getPrincipalProperty('id')}";
|
||||
this.formData.summaryFrom = "1";
|
||||
this.formData.files = JSON.stringify(this.formData.files)
|
||||
const resp = await $.post('/platform/activity/yearSummary/doHandle', this.formData)
|
||||
if (resp.code === 0) {
|
||||
this.$notify({
|
||||
title: '成功',
|
||||
message: resp.msg,
|
||||
type: 'success',
|
||||
duration: 500,
|
||||
onClose: () => {
|
||||
sublime.jumpPagePjax('/platform/activity/yearSummary/school')
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
async initData() {
|
||||
const id = GetQueryString("id")
|
||||
this.id = id
|
||||
if (id) {
|
||||
const resp = await $.post('/platform/activity/yearSummary/findOne', {id})
|
||||
if (resp.code === 0) {
|
||||
this.formData = resp.data
|
||||
this.formData.files = JSON.parse(this.formData.files)
|
||||
this.userOptions = [
|
||||
{
|
||||
username: this.formData.username,
|
||||
loginname: this.formData.loginname,
|
||||
id: this.formData.userId,
|
||||
}
|
||||
]
|
||||
}
|
||||
} else {
|
||||
this.formData.userId = "${@shiro.getPrincipalProperty('id')}"
|
||||
this.userOptions = [
|
||||
{
|
||||
username: "${@shiro.getPrincipalProperty('username')}",
|
||||
loginname: "${@shiro.getPrincipalProperty('loginname')}",
|
||||
id: "${@shiro.getPrincipalProperty('id')}",
|
||||
}
|
||||
]
|
||||
this.formData.tissueId = "${@shiro.getPrincipalProperty('union').getId()}"
|
||||
}
|
||||
},
|
||||
},
|
||||
async created() {
|
||||
await this.initData()
|
||||
this.summaryType = await getDictOptions('summaryType')
|
||||
this.unionOptions = await getUnions()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,236 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
|
||||
<style>
|
||||
.el-descriptions__table {
|
||||
table-layout: fixed !important;
|
||||
}
|
||||
|
||||
.el-descriptions-item__cell {
|
||||
text-align: center !important;
|
||||
}
|
||||
</style>
|
||||
<div id="app" v-cloak>
|
||||
<guava ref="guava">
|
||||
|
||||
<el-card shadow="never">
|
||||
<div class="search">
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">年度</div>
|
||||
<div class="search-item-option">
|
||||
<el-date-picker
|
||||
placeholder="选择年度" style="width: 100%"
|
||||
type="year"
|
||||
v-model="pageForm.year"
|
||||
value-format="yyyy">
|
||||
</el-date-picker>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!--<div class="search-item">
|
||||
<div class="search-item-label">所属工会</div>
|
||||
<div class="search-item-option">
|
||||
<el-select v-model="pageForm.tissueId" placeholder="请选择所属工会" style="width: 100%;">
|
||||
<el-option v-for="item in unionOptions" :label="item.unionname" :value="item.id"></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
</div>-->
|
||||
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">总结类型</div>
|
||||
<div class="search-item-option">
|
||||
<el-select v-model="pageForm.summaryType" placeholder="请选择总结类型"
|
||||
clearable style="width: 100%;">
|
||||
<el-option v-for="item in summaryType" :label="item.name" :value="item.id"></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="search-query">
|
||||
<el-button type="primary" icon="el-icon-search" @click="pageData">搜索</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<el-card shadow="never" class="mt20">
|
||||
<el-table :data="tableData" @sort-change='pageOrder'>
|
||||
<el-table-column label="序号" type="index" header-align="center" align="center">
|
||||
<template scope="scope">
|
||||
<span>{{scope.$index+(pageForm.pageNumber - 1) * pageForm.pageSize + 1}} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="year" label="年度">
|
||||
</el-table-column>
|
||||
<!--<el-table-column sortable prop="name" label="所属工会">
|
||||
</el-table-column>-->
|
||||
<el-table-column sortable prop="typename" label="总结类型">
|
||||
</el-table-column>
|
||||
<el-table-column sortable prop="username" label="上传人">
|
||||
</el-table-column>
|
||||
<el-table-column sortable prop="ctime" label="上传时间">
|
||||
</el-table-column>
|
||||
<el-table-column prop="userOnline" label="操作" width="100px">
|
||||
<template slot-scope="scope">
|
||||
<el-dropdown @command="dropdownCommand">
|
||||
<el-button plain size="mini"><i class="ti-settings"></i><span class="ti-angle-down"></span>
|
||||
</el-button>
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-item :command="{type:'view',data:scope.row}">
|
||||
查看
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item :command="{type:'edit',data:scope.row}">
|
||||
编辑
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item :command="{type:'delete',data:scope.row}">
|
||||
删除
|
||||
</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-row class="el-pagination-container">
|
||||
<el-pagination
|
||||
@size-change="pageSizeChange"
|
||||
@current-change="pageNumberChange"
|
||||
:current-page="pageForm.pageNumber"
|
||||
:page-sizes="[10, 20, 30, 50]"
|
||||
:page-size="pageForm.pageSize"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
:total="pageForm.totalCount">
|
||||
</el-pagination>
|
||||
</el-row>
|
||||
</el-card>
|
||||
|
||||
<template #view>
|
||||
<div style="width: 80%; margin: 0 auto">
|
||||
<vi-title title="总结详情"></vi-title>
|
||||
<el-descriptions :column="2" border class="table_fixed">
|
||||
<el-descriptions-item label="年度">
|
||||
{{viewData.year}}
|
||||
</el-descriptions-item>
|
||||
<!-- <el-descriptions-item label="所属工会">
|
||||
{{viewData.name}}
|
||||
</el-descriptions-item>-->
|
||||
<el-descriptions-item label="总结类型">
|
||||
{{viewData.typename}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="上传人">
|
||||
{{viewData.username}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="上传时间" :span="2">
|
||||
{{viewData.ctime}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="附件">
|
||||
<file-upload v-if="viewData.files&&viewData.files.length"
|
||||
:files="JSON.parse(viewData.files)"
|
||||
:view="true"></file-upload>
|
||||
<span v-else>暂无</span>
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</div>
|
||||
</template>
|
||||
</guava>
|
||||
|
||||
</div>
|
||||
|
||||
<script>
|
||||
let vue = new Vue({
|
||||
el: "#app",
|
||||
components: {
|
||||
'file-upload': httpVueLoader('/components/plugins/FileUpload.vue'),
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
tableData: [],
|
||||
fileList: [],
|
||||
pageForm: {
|
||||
pageNumber: 1,
|
||||
pageSize: 10,
|
||||
totalCount: 0,
|
||||
pageOrderName: "",
|
||||
pageOrderBy: "",
|
||||
summaryFrom: '1',
|
||||
year: moment().format('YYYY')
|
||||
},
|
||||
formData: {},
|
||||
summaryType: [],
|
||||
unionOptions: [],
|
||||
viewData: {},
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
openView(row) {
|
||||
this.$refs.guava.view()
|
||||
this.viewData = row
|
||||
},
|
||||
dropdownCommand(command) {
|
||||
const {type, data} = command
|
||||
if (type == 'view') {
|
||||
this.openView(data)
|
||||
} else if (type == 'edit') {
|
||||
this.openEdit(data)
|
||||
} else if (type == 'delete') {
|
||||
this.doDelete(data.id)
|
||||
}
|
||||
},
|
||||
doDelete(id) {
|
||||
this.$confirm('确定要删除吗', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
}).then(() => {
|
||||
$.post(base + '/platform/activity/yearSummary/doDelete', {id: id}).then(res => {
|
||||
if (res.code === 0) {
|
||||
this.doSearch()
|
||||
this.$message.success(res.msg)
|
||||
}
|
||||
})
|
||||
}).catch(() => {
|
||||
})
|
||||
},
|
||||
doSearch() {
|
||||
this.pageForm.pageNumber = 1
|
||||
this.pageData()
|
||||
},
|
||||
pageOrder(column) {
|
||||
this.pageForm.pageOrderName = column.prop
|
||||
this.pageForm.pageOrderBy = column.order
|
||||
this.pageData()
|
||||
},
|
||||
pageNumberChange(val) {
|
||||
this.pageForm.pageNumber = val;
|
||||
this.pageData()
|
||||
},
|
||||
pageSizeChange(val) {
|
||||
this.pageForm.pageSize = val;
|
||||
this.pageData()
|
||||
},
|
||||
pageData() {
|
||||
$.post('/platform/activity/yearSummary/pageData', this.pageForm).then(res => {
|
||||
if (res.code === 0) {
|
||||
this.tableData = res.data.list
|
||||
this.pageForm.totalCount = res.data.totalCount
|
||||
}
|
||||
})
|
||||
},
|
||||
openEdit(row) {
|
||||
sublime.jumpPagePjax('/platform/activity/yearSummary/addSchoolSummary?id=' + row.id)
|
||||
},
|
||||
},
|
||||
async created() {
|
||||
this.unionOptions = await getUnions()
|
||||
const isAdmin = "${@shiro.hasAnyRoles('sysadmin', 'A06')}" === 'true'
|
||||
if (!isAdmin) {
|
||||
const selfUnion = "${@shiro.getPrincipalProperty('union').getId()}";
|
||||
this.unionOptions = this.unionOptions.find(x => x.id === selfUnion)
|
||||
}
|
||||
this.summaryType = await getDictOptions('summaryType')
|
||||
this.pageData()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,105 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
|
||||
<div id="app" v-cloak>
|
||||
<guava ref="guava">
|
||||
<el-card shadow="never">
|
||||
<!--#include("/platform/activity/summary/common/addSummaryCommon.html"){}#-->
|
||||
</el-card>
|
||||
</guava>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
var vue = new Vue({
|
||||
el: '#app',
|
||||
components: {},
|
||||
data() {
|
||||
return {
|
||||
formData: {
|
||||
files: [],
|
||||
tissueId: '',
|
||||
},
|
||||
summaryFrom: '2',
|
||||
summaryType: [],
|
||||
id: '',
|
||||
unionOptions: [],
|
||||
userOptions: [],
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async querySqr(key) {
|
||||
const data = await selectUser(key, 30)
|
||||
this.userOptions = data.list
|
||||
},
|
||||
cancel() {
|
||||
if (this.id) {
|
||||
sublime.jumpPagePjax('/platform/activity/yearSummary/union')
|
||||
}
|
||||
},
|
||||
async doHandle() {
|
||||
const valid = await this.$refs['form'].validate()
|
||||
if (valid) {
|
||||
this.formData.userId = "${@shiro.getPrincipalProperty('id')}";
|
||||
this.formData.tissueId = "${@shiro.getPrincipalProperty('union').getId()}";
|
||||
this.formData.summaryFrom = "2";
|
||||
this.formData.files = JSON.stringify(this.formData.files)
|
||||
const resp = await $.post('/platform/activity/yearSummary/doHandle', this.formData)
|
||||
if (resp.code === 0) {
|
||||
this.$notify({
|
||||
title: '成功',
|
||||
message: resp.msg,
|
||||
type: 'success',
|
||||
duration: 500,
|
||||
onClose: () => {
|
||||
sublime.jumpPagePjax('/platform/activity/yearSummary/union')
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
async initData() {
|
||||
const id = GetQueryString("id")
|
||||
this.id = id
|
||||
if (id) {
|
||||
const resp = await $.post('/platform/activity/yearSummary/findOne', {id})
|
||||
if (resp.code === 0) {
|
||||
this.formData = resp.data
|
||||
this.formData.files = JSON.parse(this.formData.files)
|
||||
this.userOptions = [
|
||||
{
|
||||
username: this.formData.username,
|
||||
loginname: this.formData.loginname,
|
||||
id: this.formData.userId,
|
||||
}
|
||||
]
|
||||
}
|
||||
} else {
|
||||
this.formData.userId = "${@shiro.getPrincipalProperty('id')}"
|
||||
this.userOptions = [
|
||||
{
|
||||
username: "${@shiro.getPrincipalProperty('username')}",
|
||||
loginname: "${@shiro.getPrincipalProperty('loginname')}",
|
||||
id: "${@shiro.getPrincipalProperty('id')}",
|
||||
}
|
||||
]
|
||||
this.formData.tissueId = "${@shiro.getPrincipalProperty('union').getId()}"
|
||||
}
|
||||
},
|
||||
},
|
||||
async created() {
|
||||
await this.initData()
|
||||
this.summaryType = await getDictOptions('summaryType')
|
||||
this.unionOptions = await getUnions()
|
||||
const isAdmin = "${@shiro.hasAnyRoles('sysadmin', 'A06')}" === 'true'
|
||||
if (!isAdmin) {
|
||||
const selfUnion = "${@shiro.getPrincipalProperty('union').getId()}";
|
||||
this.unionOptions = [this.unionOptions.find(x => x.id === selfUnion)]
|
||||
}
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,236 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
|
||||
<style>
|
||||
.el-descriptions__table {
|
||||
table-layout: fixed !important;
|
||||
}
|
||||
|
||||
.el-descriptions-item__cell {
|
||||
text-align: center !important;
|
||||
}
|
||||
</style>
|
||||
<div id="app" v-cloak>
|
||||
<guava ref="guava">
|
||||
|
||||
<el-card shadow="never">
|
||||
<div class="search">
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">年度</div>
|
||||
<div class="search-item-option">
|
||||
<el-date-picker
|
||||
placeholder="选择年度" style="width: 100%"
|
||||
type="year"
|
||||
v-model="pageForm.year"
|
||||
value-format="yyyy">
|
||||
</el-date-picker>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">所属工会</div>
|
||||
<div class="search-item-option">
|
||||
<el-select v-model="pageForm.tissueId" placeholder="请选择所属工会" style="width: 100%;">
|
||||
<el-option v-for="item in unionOptions" :label="item.unionname"
|
||||
:value="item.id"></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">总结类型</div>
|
||||
<div class="search-item-option">
|
||||
<el-select v-model="pageForm.summaryType" placeholder="请选择总结类型" style="width: 100%;">
|
||||
<el-option v-for="item in summaryType" :label="item.name" :value="item.id"></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="search-query">
|
||||
<el-button type="primary" icon="el-icon-search" @click="pageData">搜索</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<el-card shadow="never" class="mt20">
|
||||
<el-table :data="tableData" @sort-change='pageOrder'>
|
||||
<el-table-column label="序号" type="index" header-align="center" align="center">
|
||||
<template scope="scope">
|
||||
<span>{{scope.$index+(pageForm.pageNumber - 1) * pageForm.pageSize + 1}} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="year" label="年度">
|
||||
</el-table-column>
|
||||
<el-table-column sortable prop="name" label="所属工会">
|
||||
</el-table-column>
|
||||
<el-table-column sortable prop="typename" label="总结类型">
|
||||
</el-table-column>
|
||||
<el-table-column sortable prop="username" label="上传人">
|
||||
</el-table-column>
|
||||
<el-table-column sortable prop="ctime" label="上传时间">
|
||||
</el-table-column>
|
||||
<el-table-column prop="userOnline" label="操作" width="100px">
|
||||
<template slot-scope="scope">
|
||||
<el-dropdown @command="dropdownCommand">
|
||||
<el-button plain size="mini"><i class="ti-settings"></i><span class="ti-angle-down"></span>
|
||||
</el-button>
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-item :command="{type:'view',data:scope.row}">
|
||||
查看
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item :command="{type:'edit',data:scope.row}">
|
||||
编辑
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item :command="{type:'delete',data:scope.row}">
|
||||
删除
|
||||
</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-row class="el-pagination-container">
|
||||
<el-pagination
|
||||
@size-change="pageSizeChange"
|
||||
@current-change="pageNumberChange"
|
||||
:current-page="pageForm.pageNumber"
|
||||
:page-sizes="[10, 20, 30, 50]"
|
||||
:page-size="pageForm.pageSize"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
:total="pageForm.totalCount">
|
||||
</el-pagination>
|
||||
</el-row>
|
||||
</el-card>
|
||||
|
||||
<template #view>
|
||||
<div style="width: 80%; margin: 0 auto">
|
||||
<vi-title title="总结详情"></vi-title>
|
||||
<el-descriptions :column="2" border class="table_fixed">
|
||||
<el-descriptions-item label="年度">
|
||||
{{viewData.year}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="所属工会">
|
||||
{{viewData.name}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="总结类型">
|
||||
{{viewData.typename}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="上传人">
|
||||
{{viewData.username}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="上传时间" :span="2">
|
||||
{{viewData.ctime}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="附件">
|
||||
<file-upload v-if="viewData.files&&viewData.files.length"
|
||||
:files="JSON.parse(viewData.files)"
|
||||
:view="true"></file-upload>
|
||||
<span v-else>暂无</span>
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</div>
|
||||
</template>
|
||||
</guava>
|
||||
|
||||
</div>
|
||||
|
||||
<script>
|
||||
let vue = new Vue({
|
||||
el: "#app",
|
||||
components: {
|
||||
'file-upload': httpVueLoader('/components/plugins/FileUpload.vue'),
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
tableData: [],
|
||||
fileList: [],
|
||||
pageForm: {
|
||||
pageNumber: 1,
|
||||
pageSize: 10,
|
||||
totalCount: 0,
|
||||
pageOrderName: "",
|
||||
pageOrderBy: "",
|
||||
summaryFrom: '2',
|
||||
year: moment().format('YYYY')
|
||||
},
|
||||
formData: {},
|
||||
summaryType: [],
|
||||
unionOptions: [],
|
||||
viewData: {},
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
openView(row) {
|
||||
this.$refs.guava.view()
|
||||
this.viewData = row
|
||||
},
|
||||
dropdownCommand(command) {
|
||||
const {type, data} = command
|
||||
if (type == 'view') {
|
||||
this.openView(data)
|
||||
} else if (type == 'edit') {
|
||||
this.openEdit(data)
|
||||
} else if (type == 'delete') {
|
||||
this.doDelete(data.id)
|
||||
}
|
||||
},
|
||||
doDelete(id) {
|
||||
this.$confirm('确定要删除吗', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
}).then(() => {
|
||||
$.post(base + '/platform/activity/yearSummary/doDelete', {id: id}).then(res => {
|
||||
if (res.code === 0) {
|
||||
this.doSearch()
|
||||
this.$message.success(res.msg)
|
||||
}
|
||||
})
|
||||
}).catch(() => {
|
||||
})
|
||||
},
|
||||
doSearch() {
|
||||
this.pageForm.pageNumber = 1
|
||||
this.pageData()
|
||||
},
|
||||
pageOrder(column) {
|
||||
this.pageForm.pageOrderName = column.prop
|
||||
this.pageForm.pageOrderBy = column.order
|
||||
this.pageData()
|
||||
},
|
||||
pageNumberChange(val) {
|
||||
this.pageForm.pageNumber = val;
|
||||
this.pageData()
|
||||
},
|
||||
pageSizeChange(val) {
|
||||
this.pageForm.pageSize = val;
|
||||
this.pageData()
|
||||
},
|
||||
pageData() {
|
||||
$.post('/platform/activity/yearSummary/pageData', this.pageForm).then(res => {
|
||||
if (res.code === 0) {
|
||||
this.tableData = res.data.list
|
||||
this.pageForm.totalCount = res.data.totalCount
|
||||
}
|
||||
})
|
||||
},
|
||||
openEdit(row) {
|
||||
sublime.jumpPagePjax('/platform/activity/yearSummary/addUnionSummary?id=' + row.id)
|
||||
},
|
||||
},
|
||||
async created() {
|
||||
this.unionOptions = await getUnions()
|
||||
const isAdmin = "${@shiro.hasAnyRoles('sysadmin', 'A06')}" === 'true'
|
||||
if (!isAdmin) {
|
||||
const selfUnion = "${@shiro.getPrincipalProperty('union').getId()}";
|
||||
this.unionOptions = [this.unionOptions.find(x => x.id === selfUnion)]
|
||||
}
|
||||
this.summaryType = await getDictOptions('summaryType')
|
||||
this.pageData()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
Reference in New Issue
Block a user