This commit is contained in:
2025-12-02 18:15:00 +08:00
parent 6a7332b7d7
commit 87c2603fff
21 changed files with 3614 additions and 70 deletions
@@ -0,0 +1,145 @@
<template>
<el-table :data="tableData" style="width: 100%;height: 100%" stripe border
ref="MaleFemaleTab"
:header-cell-style="{background:'#FAFAFA'}" row-key="id" @sort-change="pageOrder"
v-loading="tableLoading" size="mini" fixed>
<el-table-column align="center" header-align="center" type="index" :index="indexMethod" label="序号"
width="80px" fixed></el-table-column>
<el-table-column label="分工会" prop="unionname" header-align="center"
align="center" fixed show-overflow-tooltip width="250px"></el-table-column>
<el-table-column label="甲组" header-align="center" v-if="tableColumns.length>0">
<el-table-column
align="center"
header-align="center"
v-for="column in tableColumns"
:label="column.label"
:prop="column.prop"
:sortable="column.sortable"
show-overflow-tooltip>
</el-table-column>
</el-table-column>
<el-table-column label="乙组" header-align="center" v-if="tableColumns2.length>0">
<el-table-column
align="center"
header-align="center"
v-for="column in tableColumns2"
:label="column.label"
:prop="column.prop"
:sortable="column.sortable"
show-overflow-tooltip>
</el-table-column>
</el-table-column>
<el-table-column label="丙组" header-align="center" v-if="tableColumns3.length>0">
<el-table-column
align="center"
header-align="center"
v-for="column in tableColumns3"
:label="column.label"
:prop="column.prop"
:sortable="column.sortable"
show-overflow-tooltip>
</el-table-column>
</el-table-column>
<el-table-column label="丁组" header-align="center" v-if="tableColumns4.length>0">
<el-table-column
align="center"
header-align="center"
v-for="column in tableColumns4"
:label="column.label"
:prop="column.prop"
:sortable="column.sortable"
show-overflow-tooltip>
</el-table-column>
</el-table-column>
<el-table-column label="团体" header-align="center" v-if="tableColumns5.length>0">
<el-table-column
align="center"
header-align="center"
v-for="column in tableColumns5"
:label="column.label"
:prop="column.prop"
:sortable="column.sortable"
show-overflow-tooltip>
</el-table-column>
</el-table-column>
<el-table-column label="总分" prop="totalScore" header-align="center"
align="center" show-overflow-tooltip fixed="right"></el-table-column>
<el-table-column align="center" header-align="center" type="index" show-overflow-tooltip label="名次"
width="80px" fixed="right"></el-table-column>
</el-table>
</template>
<script>
module.exports = {
props: {
Form: {
type: Object,
default: {},
}
},
mixins: [initTableMixins],
data() {
return {
tableData: [],
maxHeight: 0,
tableColumns2: [],
tableColumns3: [],
tableColumns4: [],
tableColumns5: []
}
},
mounted() {
/* const tabHeight = document.getElementById("app").clientHeight - (this.$refs.MaleFemaleTab.$el.offsetTop + 60)
this.$nextTick(()=>{
this.maxHeight = tabHeight
})*/
},
methods: {
async isMaleFemale() {
this.tableColumns = []
this.tableColumns2 = []
this.tableColumns3 = []
this.tableColumns4 = []
this.tableColumns5 = []
this.tableData = []
const {data} = await this.$axios.post("/platform/activity/score/statistics/isMaleFemale", this.Form)
data.eventList.forEach(v => {
if (v.baname == "甲组" || v.baname == "乙组" || v.baname == "丙组" || v.baname == "丁组") {
this.tableColumns.push({label: v.isMenWomen ? v.label.substr(4) : v.label.substr(2), prop: v.label})
} else {
this.tableColumns5.push({label: v.label, prop: v.label})
}
})
this.tableData = data.score.sort(this.compare("totalScore"))
if (this.Form.unionname) {
this.tableData = this.tableData.filter(v => v.unionname == this.Form.unionname)
}
},
compare(prop) {
return function (obj1, obj2) {
const val1 = obj1[prop];
const val2 = obj2[prop];
if (val1 > val2) {
return -1;
} else if (val1 < val2) {
return 1;
} else {
return 0;
}
}
}
},
}
</script>
@@ -0,0 +1,71 @@
<template>
<el-table :data="tableData" style="width: 100%;height: 100%" stripe border
ref="MaleFemaleTab"
:header-cell-style="{background:'#FAFAFA'}" row-key="id" @sort-change="pageOrder"
v-loading="tableLoading" size="mini" fixed >
<!--:max-height="maxHeight"-->
<el-table-column align="center" header-align="center" type="index" :index="indexMethod" label="序号"
width="80px" fixed></el-table-column>
<el-table-column label="分工会" prop="unionname" header-align="center"
align="center" fixed show-overflow-tooltip></el-table-column>
<el-table-column label="总分" prop="totalScore" header-align="center"
align="center" show-overflow-tooltip></el-table-column>
<el-table-column align="center" header-align="center" type="index" :index="indexMethod" label="名次"
width="80px" ></el-table-column>
</el-table>
</template>
<script>
module.exports = {
props: {
Form: {
type: Object,
default: {},
}
},
mixins: [initTableMixins],
data() {
return {
tableData: [],
maxHeight: 0
}
},
mounted() {
/*const tabHeight = document.getElementById("app").clientHeight - (this.$refs.MaleFemaleTab.$el.offsetTop + 60)
this.$nextTick(() => {
this.maxHeight = tabHeight
})*/
},
methods: {
async isScoreTopEight() {
this.tableColumns = []
this.tableData = []
const {data} = await this.$axios.post(loc() + "/isScoreTopEight", this.Form)
const table = data.score.sort(this.compare("totalScore"))
this.tableData = table.slice(0, 8)
},
compare(prop) {
return function (obj1, obj2) {
const val1 = obj1[prop];
const val2 = obj2[prop];
if (val1 > val2) {
return -1;
} else if (val1 < val2) {
return 1;
} else {
return 0;
}
}
}
},
}
</script>
@@ -0,0 +1,93 @@
<template>
<div>
<!-- <el-table :data="tableData" style="width: 100%" stripe border
:header-cell-style="{background:'#FAFAFA'}" row-key="id" @sort-change="pageOrder"
v-loading="tableLoading" size="mini">
<el-table-column align="center" header-align="center" type="index" :index="indexMethod" label="名次"
width="100px"></el-table-column>
<el-table-column
align="center"
header-align="center"
v-for="column in tableColumns"
:label="column.label"
:prop="column.prop"
:sortable="column.sortable"
show-overflow-tooltip>
</el-table-column>
</el-table>-->
<table class="table table-bordered" style="table-layout: fixed;">
<thead>
<tr>
<th style="text-align: center!important;">项目</th>
<th style="text-align: center!important;" v-for="i in 8">{{ i }}</th>
</tr>
</thead>
<tbody>
<tr v-for="i in tableData">
<td align="center" width="20%">{{ i.label }}</td>
<td v-for="x in 8" align="center" width="10%">
{{ getTableTdContent(i.sss, x) }}
</td>
</tr>
</tbody>
</table>
</div>
</template>
<script>
module.exports = {
props: {
Form: {
type: Object,
default: {},
}
},
mixins: [initTableMixins],
data() {
return {
tableData: []
}
},
methods: {
getTableTdContent(d, i) {
return d.filter(v => {
if (v.ranking == i) {
return v.username
}
}).map(v => {
return v.username
}).toString()
},
async isTopEight() {
var loading = this.$loading({
lock: true,
text: '数据正在查询中,请稍后...',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
});
this.tableColumns = []
this.tableData = []
const {data} = await this.$axios.post(loc() + "/isTopEight", this.Form)
data.eventList.map(v => {
v.sss = []
data.userList.map(x => {
if (v.label === x.allname) {
console.log(x)
v.sss.push(x)
}
})
})
this.tableData = data.eventList
loading.close();
},
},
}
</script>
@@ -0,0 +1,151 @@
const branchUnionCadreAudit = {
template: /*language=HTML*/ `
<el-card shadow="never" class="mt10">
<table-tool label="基层干部">
<el-radio-group @change="doSearch" class="mr5" size="small" v-model="pageForm.audit">
<el-radio-button label="true">已审核</el-radio-button>
<el-radio-button label="false">未审核</el-radio-button>
</el-radio-group>
<!-- <el-button size="small" @click="doAudit(true)" :disabled="!multipleSelection.length" type="primary"-->
<!-- icon="el-icon-check">批量通过-->
<!-- </el-button>-->
<!-- <el-button size="small" @click="doAudit(false)" :disabled="!multipleSelection.length" type="danger"-->
<!-- icon="el-icon-check">批量拒绝-->
<!-- </el-button>-->
</table-tool>
<el-table :data="tableData" :size="tableSize" @sort-change="pageOrder" ref="table" row-key="id"
style="width: 100%" @selection-change="handleSelectionChange" height="65vh">
<el-table-column type="selection" width="55"></el-table-column>
<el-table-column align="center" header-align="center" type="index" :index="indexMethod"
label="序号" width="80px"></el-table-column>
<el-table-column
align="center"
header-align="center"
v-for="column in tableColumns"
show-overflow-tooltip
:label="column.label"
:prop="column.prop"
:sortable="column.sortable"
>
<template v-if="column.prop==='isJoin'" scope="{row:{isJoin}}">
<span v-if="isJoin" class="text-info">加入</span>
<span v-else class="text-danger">退出</span>
</template>
<template scope="{row}" v-else-if="column.prop=='instanceState'">
<enum-tag :value="row.instanceState" name="ProcessInstanceStateEnum" label_key="message"
size="small"></enum-tag>
</template>
</el-table-column>
<el-table-column label="操作" fixed="right" width="180px" v-if="!pageForm.audit">
<template scope="{row}">
<template v-if="row.taskState === 10">
<el-button @click="handleTaskAction(row, 1)" size="mini" type="primary">通过</el-button>
<el-button @click="handleTaskAction(row, 2)" size="mini" type="danger">拒绝</el-button>
</template>
<el-button v-if="row.canRevoke" @click="openRevoke(row)" size="mini" type="danger">
撤回
</el-button>
</template>
</el-table-column>
</el-table>
<el-row class="el-pagination-container" style="margin-bottom: 0">
<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"
:total="pageForm.totalCount">
</el-pagination>
</el-row>
</el-card>
`,
mixins: [initTableMixins],
data() {
return {
pageForm: {
audit: false
},
tableColumns: [
{ prop: 'loginName', label: '工号' },
{ prop: 'userName', label: '姓名' },
{ prop: 'unionName', label: '所属工会' },
{ prop: 'mobile', label: '联系方式' },
{ prop: 'roleName', label: '职务' },
{ prop: 'isJoin', label: '申请类型' },
{ prop: "curTaskName", label: "当前节点" },
{ prop: "instanceState", label: "流程状态" }
],
multipleSelection: [],
}
},
methods: {
handleSelectionChange(val) {
this.multipleSelection = val;
},
doAudit(pass) {
this.$confirm('是否确认提交?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(async () => {
const ids = JSON.stringify(this.multipleSelection.map(v => v.id))
this.$axios.post('/platform/sys/union/cadreDoAudit', {ids, pass})
.then(resp => {
if (resp.code === 0) {
this.pageData()
this.$refs.table.clearSelection();
this.$message.success(resp.msg)
}else{
this.$message.error(resp.msg)
}
})
})
},
handleTaskAction(row, val) {
const msg = val === 1 ? "通过" : "拒绝"
this.$confirm("您确定要" + msg + "吗?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
const loading = createLoading()
this.formData = {
origin: row.origin,
processTaskId: row.taskId,
taskName: row.curTaskName
}
this.$axios.post("/flow/common/executeTask", {
data: JSON.stringify({
...this.formData,
submitType: val
})
}).then((res) => {
if (res.code === 0) {
this.$message.success(res.msg)
this.doSearch()
}
}).finally(() => {
loading.close()
})
})
},
pageData() {
this.$axios.post('/platform/sys/union/cadrePageData', this.pageForm)
.then(resp => {
if (resp.code === 0) {
this.tableData = resp.data.list
this.pageForm.totalCount = resp.data.totalCount
}
})
}
}
}
@@ -6,7 +6,7 @@ const branchUnionManage = {
<el-input placeholder="请输入分工会名称" clearable size="small" style="width: 300px" v-model="pageForm.searchKeyword"></el-input>
<el-button type="primary" class="ml5" size="small" icon="el-icon-search" @click="doSearch"></el-button>
<!-- <el-button icon="el-icon-s-check" type="primary" style="margin-left: auto" size="small">基层干部审核</el-button>-->
<el-button @click="openAudit" icon="el-icon-s-check" type="primary" style="margin-left: auto" size="small">基层干部审核</el-button>
<el-button @click="openAdd" icon="ti-plus" type="primary" size="small" v-if="$auth.hasPermission('sys.manager.union.add')">新建分工会</el-button>
</el-row>
</el-card>
@@ -75,6 +75,10 @@ const branchUnionManage = {
this.pageForm.totalCount = res.data.totalCount
})
},
// 基层干部审核
openAudit() {
this.$emit('union-cadre')
},
openAdd() {
this.dialogFormVisible = true
this.$nextTick(() => {
@@ -3,89 +3,103 @@ layout("/layouts/platform.html"){
#-->
<div id="app" v-cloak>
<el-row type="flex" :gutter="20" style="height: calc(100vh - 84px)">
<el-col :span="5">
<el-card shadow="never" style="height: 100%" :body-style="{ height: '100%',display:'flex','flex-direction':'column' }">
<el-input placeholder="输入关键字进行查找" v-model="filterText" clearable></el-input>
<div style="flex: 1;overflow-y: auto">
<el-tree
:data="treeData"
ref="treeRef"
:expand-on-click-node="false"
:props="{
<guava ref="guava">
<template>
<el-row type="flex" :gutter="20" style="height: calc(100vh - 84px)">
<el-col :span="5">
<el-card shadow="never" style="height: 100%"
:body-style="{ height: '100%',display:'flex','flex-direction':'column' }">
<el-input placeholder="输入关键字进行查找" v-model="filterText" clearable></el-input>
<div style="flex: 1;overflow-y: auto">
<el-tree
:data="treeData"
ref="treeRef"
:expand-on-click-node="false"
:props="{
children: 'children',
label: 'name'
}"
default-expand-all
@node-click="treeNodeClick"
:filter-node-method="filterNode"
highlight-current
>
<template slot-scope="{ node, data }">
default-expand-all
@node-click="treeNodeClick"
:filter-node-method="filterNode"
highlight-current
>
<template slot-scope="{ node, data }">
<span class="el-tree-node__label">
<i class="el-icon-folder-opened" v-if="node.level===1"></i>
<i class="el-icon-folder" v-else></i>
{{node.label}}
</span>
</template>
</el-tree>
</div>
</el-card>
</el-col>
<el-col :span="19">
<el-card shadow="never">
<el-tabs v-model="schoolUnionTabActive" type="card" v-if="currentTreeNode==null || currentTreeNode.level===1">
<el-tab-pane name="branchUnionManage">
</template>
</el-tree>
</div>
</el-card>
</el-col>
<el-col :span="19">
<el-card shadow="never">
<el-tabs v-model="schoolUnionTabActive" type="card"
v-if="currentTreeNode==null || currentTreeNode.level===1">
<el-tab-pane name="branchUnionManage">
<span slot="label">
<i class="el-icon-school"></i>
分工会信息
</span>
<sys-union-branch-union-manage @refresh="getTreeData()"></sys-union-branch-union-manage>
</el-tab-pane>
<el-tab-pane name="schoolUnionInfo" v-if="$auth.hasPermission('sys.manager.union.schoolOfficer')">
<sys-union-branch-union-manage @refresh="getTreeData()"
@union-cadre="unionCadreInit"></sys-union-branch-union-manage>
</el-tab-pane>
<el-tab-pane name="schoolUnionInfo"
v-if="$auth.hasPermission('sys.manager.union.schoolOfficer')">
<span slot="label">
<i class="el-icon-office-building"></i>
校工会信息
</span>
<sys-union-school-union-user-manage></sys-union-school-union-user-manage>
</el-tab-pane>
</el-tabs>
<sys-union-school-union-user-manage></sys-union-school-union-user-manage>
</el-tab-pane>
</el-tabs>
<el-tabs v-model="branchUnionTabActive" @tab-click="branchTabChange" type="card" v-if="currentTreeNode && currentTreeNode.level===2">
<el-tab-pane name="branchUnionUserManage">
<el-tabs v-model="branchUnionTabActive" @tab-click="branchTabChange" type="card"
v-if="currentTreeNode && currentTreeNode.level===2">
<el-tab-pane name="branchUnionUserManage">
<span slot="label">
<i class="el-icon-school"></i>
分工会干部
</span>
<sys-union-branch-union-user-manage
ref="branchUnionUserManageRef"
:union_id="currentTreeData.id"
></sys-union-branch-union-user-manage>
</el-tab-pane>
<el-tab-pane name="branchUnionPartUnitManage">
<sys-union-branch-union-user-manage
ref="branchUnionUserManageRef"
:union_id="currentTreeData.id"
></sys-union-branch-union-user-manage>
</el-tab-pane>
<el-tab-pane name="branchUnionPartUnitManage">
<span slot="label">
<i class="el-icon-school"></i>
组成单位
</span>
<sys-union-branch-union-part-unit-manage
ref="branchUnionPartUnitManageRef"
:union_id="currentTreeData.id"
></sys-union-branch-union-part-unit-manage>
</el-tab-pane>
<el-tab-pane name="branchUnionGroup">
<sys-union-branch-union-part-unit-manage
ref="branchUnionPartUnitManageRef"
:union_id="currentTreeData.id"
></sys-union-branch-union-part-unit-manage>
</el-tab-pane>
<el-tab-pane name="branchUnionGroup">
<span slot="label">
<i class="el-icon-school"></i>
工会小组
</span>
<sys-union-branch-union-group-manage
ref="branchUnionGroupRef"
:union_id="currentTreeData.id"
></sys-union-branch-union-group-manage>
</el-tab-pane>
</el-tabs>
</el-card>
</el-col>
</el-row>
<sys-union-branch-union-group-manage
ref="branchUnionGroupRef"
:union_id="currentTreeData.id"
></sys-union-branch-union-group-manage>
</el-tab-pane>
</el-tabs>
</el-card>
</el-col>
</el-row>
</template>
<template #edit>
<sys-union-branch-union-cadre-audit ref="unionCadreAuditRef">
</sys-union-branch-union-cadre-audit>
</template>
</guava>
</div>
<script>
@@ -94,6 +108,7 @@ layout("/layouts/platform.html"){
<!--#include("branchUnionUserManage.js"){}#-->
<!--#include("branchUnionPartUnitManage.js"){}#-->
<!--#include("branchUnionGroupManage.js"){}#-->
<!--#include("branchUnionCadreAudit.js"){}#-->
new Vue({
el: "#app",
@@ -102,7 +117,8 @@ layout("/layouts/platform.html"){
"sys-union-school-union-user-manage": schoolUnionUserManage,
"sys-union-branch-union-user-manage": branchUnionUserManage,
"sys-union-branch-union-part-unit-manage": branchUnionPartUnitManage,
"sys-union-branch-union-group-manage": branchUnionGroupManage
"sys-union-branch-union-group-manage": branchUnionGroupManage,
"sys-union-branch-union-cadre-audit": branchUnionCadreAudit,
},
data() {
return {
@@ -144,6 +160,12 @@ layout("/layouts/platform.html"){
this.$nextTick(() => {
this.$refs[val.name + "Ref"].doSearch()
})
},
// 基层干部审核初始化
unionCadreInit() {
this.$refs.guava.edit(() => {
this.$refs.unionCadreAuditRef.pageData()
})
}
},
created() {
@@ -0,0 +1,854 @@
<!--#
layout("/layouts/platform.html"){
#-->
<div id="app" class="platform" v-cloak>
<guava ref="guava">
<template>
<el-card shadow="never">
<div class="search">
<div class="search-item">
<div class="search-item-label">&emsp;&emsp;</div>
<div class="search-item-option">
<el-date-picker
@change="yearChange"
v-model="pageForm.year"
type="year"
value-format="yyyy" style="width: 100%"
placeholder="选择年">
</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.activityId" placeholder="请选择活动名称" filterable clearable
style="width: 100%" @change="doSearchS">
<el-option
v-for="item in activityList"
:key="item.id"
: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.eventId" placeholder="请选择活动项目" filterable clearable
style="width: 100%" @change="doSearchS">
<el-option
v-for="item in events"
:key="item.eventId"
:label="item.allName"
:value="item.eventId">
</el-option>
</el-select>
</div>
</div>
</div>
</el-card>
<el-card shadow="never" class="mt10">
<table-tool label="项目列表">
<!--<el-radio-group v-model="pageForm.isMenWomen" @change="doSearch"
style="margin-left: 10px">
<el-radio-button :label="1">全部</el-radio-button>
<el-radio-button :label="2">男子</el-radio-button>
<el-radio-button :label="3">女子</el-radio-button>
<el-radio-button :label="4">团体</el-radio-button>
</el-radio-group>-->
<!-- <el-checkbox-group @change="doSearch" v-model="pageForm.isMenWomen">
<el-checkbox-button :key="2" :label="2">男子</el-checkbox-button>
<el-checkbox-button :key="3" :label="3">女子</el-checkbox-button>
</el-checkbox-group>-->
<!-- <el-checkbox-group @change="doSearch" v-model="pageForm.isMenWomen">
<el-checkbox-button :key="4" :label="4">单项</el-checkbox-button>
<el-checkbox-button :key="5" :label="5">团体</el-checkbox-button>
</el-checkbox-group>
<el-select v-model="pageForm.groupName" placeholder="请选择组别"
filterable clearable
style="width: 100%;margin-bottom: 5px;margin-left: 10px" @change="doSearch">
<el-option
v-for="item in groupList"
:key="item.id"
:label="item.name"
:value="item.name">
</el-option>
</el-select>-->
</table-tool>
<el-table :data="tableData" style="width: 100%;margin-bottom: 20px" row-key="id"
@sort-change="pageOrder" v-loading="tableLoading" :size="tableSize" class="vi-table">
<el-table-column align="center" header-align="center" type="index" :index="indexMethod" label="序号"
width="80px"></el-table-column>
<el-table-column prop="allName" align="center" header-align="center"
label="项目名称"></el-table-column>
<el-table-column prop="rs" align="center" header-align="center"
label="获奖数量"></el-table-column>
<el-table-column prop="userOnline" align="center" header-align="center" label="操作" width="150px">
<template scope="{row}">
<el-dropdown @command="dropdownCommand">
<el-button size="mini" :loading="row.loading">
<i class="ti-settings"></i>
<span class="ti-angle-down"></span>
</el-button>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item :command="{type:'input',row}">
录入成绩
</el-dropdown-item>
<el-dropdown-item :command="{type:'view',row}">
&emsp;&emsp;
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</template>
</el-table-column>
</el-table>
<!--#include("/layouts/pagination.html"){}#-->
</el-card>
</template>
<template #edit_func>
<el-button type="primary" @click="openAdd" v-if="awardsMode==1">临时获奖人员添加</el-button>
<el-button type="primary" @click="doAdd">确 定</el-button>
</template>
<template #edit>
<template>
<table-tool label="录入成绩"></table-tool>
<el-form :model="formData" ref="addForm" label-width="120px"
label-suffix="">
<el-row :gutter="40">
<el-col :span="12">
<el-form-item prop="name" label="活动名称">
<el-input maxlength="200" disabled v-model="name"
type="text"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item prop="allName" label="活动项目">
<el-input maxlength="200" disabled v-model="allName"
type="text"></el-input>
</el-form-item>
</el-col>
</el-row>
<div style="display: flex;margin: 20px 0">
<el-divider content-position="left">获奖名次列表</el-divider>
<div style="padding-left: 10px;padding-top: 10px;">
<el-tooltip class="item" effect="dark" content="点击添加活动人员" placement="top">
<el-button style="float: right;margin-bottom: 10px" type="primary" icon="el-icon-plus"
size="mini"
@click="openAddUser">
添加
</el-button>
</el-tooltip>
</div>
</div>
<el-table style="margin-bottom: 20px" border stripe :data="userData" size="small"
v-loading="userTabLoading">
<el-table-column
type="index" label="序号" header-align="center" align="center" width="100">
</el-table-column>
<el-table-column align="center" header-align="center"
:label="awardsMode==1?'姓名':'分工会'"
prop="id">
<template scope="{$index,row}">
<el-select v-model="row.userId" @change="(val)=>{userDetailsChange(val,row)}"
placeholder="请输入姓名" filterable clearable
style="width: 100%" size="small" v-if="awardsMode==1">
<el-option
v-for="item in userList"
:disabled="item.disabled"
:key="item.id"
:label="item.username+''+item.loginname+''+item.sex"
:value="item.id">
</el-option>
</el-select>
<el-select v-model="row.unionId" @change="(val)=>{unionDetailsChange(val,row)}"
placeholder="请输入分工会" filterable clearable
style="width: 100%" size="small" v-if="awardsMode==2">
<el-option
v-for="item in unionList"
:disabled="item.disabled"
:key="item.id"
:label="item.unionname"
:value="item.id">
</el-option>
</el-select>
</template>
</el-table-column>
<el-table-column align="center" header-align="center" label="名次" prop="ranking">
<template scope="{$index,row}">
<el-select v-model="row.ranking" @change="rankingChange(row)"
placeholder="请输入名次" filterable clearable
style="width: 100%" size="small">
<el-option
v-for="item in rankingList"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</template>
</el-table-column>
<el-table-column align="center" header-align="center" label="积分" prop="integral">
<template scope="{row}">
<el-input-number v-model="row.integral"
type="text"></el-input-number>
</template>
</el-table-column>
<el-table-column align="center" header-align="center" label="人数" prop="numberOfPeople"
v-if="awardsMode==2">
<template scope="{row}">
<el-input-number v-model="row.numberOfPeople"
type="text"></el-input-number>
</template>
</el-table-column>
<el-table-column align="center" header-align="center" label="分工会" prop="unionname"
v-if="awardsMode==1">
<template scope="{row}">
<el-input v-model="row.unionname" disabled placeholder="分工会"
type="text"></el-input>
</template>
</el-table-column>
<el-table-column prop="userOnline" align="center" header-align="center" label="操作"
width="150px">
<template scope="{$index,row}">
<el-button type="danger" icon="el-icon-delete" circle
@click="delUser($index,row)"></el-button>
</template>
</el-table-column>
</el-table>
</el-form>
</template>
</template>
<template #view>
<el-form :model="formData" ref="addForm" label-width="120px" label-suffix="">
<el-row :gutter="40">
<el-col :span="12">
<el-form-item prop="name" label="活动名称">
<el-input maxlength="200" disabled v-model="name"
type="text"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item prop="allName" label="活动项目">
<el-input maxlength="200" disabled v-model="allName"
type="text"></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div style="display: flex;margin: 20px 0">
<el-divider content-position="left">获奖名次列表</el-divider>
</div>
<el-table style="margin-bottom: 20px" border stripe :data="viewData" size="small"
v-loading="userTabLoading">
<el-table-column
type="index" label="序号" header-align="center" align="center" width="100">
</el-table-column>
<el-table-column align="center" header-align="center"
:label="awardsMode==1?'姓名':'分工会'"
prop="id">
<template scope="{$index,row}">
<el-select v-model="row.userId" @change="(val)=>{userDetailsChange(val,row)}"
placeholder="请输入姓名" filterable clearable disabled
style="width: 100%" size="small" v-if="awardsMode==1">
<el-option
v-for="item in userList"
:key="item.id"
:label="item.username+''+item.loginname+''+item.sex"
:value="item.id">
</el-option>
</el-select>
<el-select v-model="row.unionId" @change="(val)=>{unionDetailsChange(val,row)}"
placeholder="请输入分工会" filterable clearable disabled
style="width: 100%" size="small" v-if="awardsMode==2">
<el-option
v-for="item in unionList"
:key="item.id"
:label="item.unionname"
:value="item.id">
</el-option>
</el-select>
</template>
</el-table-column>
<el-table-column align="center" header-align="center" label="名次" prop="ranking">
<template scope="{$index,row}">
<el-select v-model="row.ranking" @change="rankingChange(row)"
placeholder="请输入名次" filterable clearable disabled
style="width: 100%" size="small">
<el-option
v-for="item in rankingList"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</template>
</el-table-column>
<el-table-column align="center" header-align="center" label="积分" prop="integral">
<template scope="{row}">
<el-input v-model="row.integral" disabled type="text"></el-input>
</template>
</el-table-column>
<el-table-column align="center" header-align="center" label="人数" prop="numberOfPeople"
v-if="awardsMode==2">
<template scope="{row}">
<el-input v-model="row.numberOfPeople" disabled type="text"></el-input>
</template>
</el-table-column>
<el-table-column align="center" header-align="center" label="分工会" prop="unionname"
v-if="awardsMode==1">
<template scope="{row}">
<el-input v-model="row.unionname" disabled placeholder="分工会"
type="text"></el-input>
</template>
</el-table-column>
</el-table>
</template>
</guava>
<el-dialog
title="添加人员"
:visible.sync="dialogVisible"
width="40%"
:close-on-click-modal="false"
>
<el-form :model="formData" ref="form" :rules="formRules" label-width="100px">
<!-- <el-form-item prop="loginname" label="工&emsp;&emsp;号">
<el-input maxlength="50" placeholder="请填写工号" v-model="formData.loginname"
type="text" @blur="userBlur"></el-input>
</el-form-item>
<el-form-item prop="username" label="姓&emsp;&emsp;名">
<el-input maxlength="50" placeholder="请填写姓名" v-model="formData.username"
type="text"></el-input>
</el-form-item>-->
<el-form-item prop="mobile" label="姓名或工号">
<el-select
style="width: 100%"
v-model="formData.userid"
filterable
clearable
remote
reserve-keyword
allow-create
default-first-option
placeholder="请输入姓名或工号查找"
:remote-method="userRemoteMethod"
@change="userChange2">
<el-option
v-for="item in userOptions"
:key="item.id"
:label="item.username+''+item.loginname+''"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item prop="loginname" label="工&emsp;&emsp;号">
<el-input maxlength="50" placeholder="请填写工号" v-model="formData.loginname"
type="text"></el-input>
</el-form-item>
<el-form-item prop="mobile" label="电&emsp;&emsp;话">
<el-input maxlength="50" placeholder="请填写电话" v-model="formData.mobile"
type="text"></el-input>
</el-form-item>
<el-form-item prop="sex" label="性&emsp;&emsp;别">
<el-radio-group v-model="formData.sex">
<el-radio :label="'男性'" border>男性</el-radio>
<el-radio :label="'女性'" border>女性</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item prop="unitId" label="所在单位">
<el-select v-model="formData.unitId" placeholder="请选择所在单位" clearable @change="unitChange"
filterable
style="width: 100%">
<el-option
v-for="item in unitOptions"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item prop="unionname" label="所属工会">
<el-input disabled placeholder="所属工会" v-model="formData.unionname"
type="text"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false">取 消</el-button>
<el-button type="primary" @click="doAddUser">确 定</el-button>
</span>
</el-dialog>
</div>
<script>
const vue = new Vue({
el: '#app',
mixins: [initTableMixins],
data() {
return {
userOptions: [],
groupList: [
{value: 1, name: "甲组"},
{value: 2, name: "乙组"},
{value: 3, name: "丙组"},
{value: 4, name: "丁组"}
],
dialogVisible: false,
viewData: [],
userTabLoading: false,
awardsMode: "",
isMenWomen: "",
allName: "",
name: "",
eventId: "",
activityId: "",
userData: [],
userList: [],
userList2: [],
unionList: [],
unionList2: [],
activityList: [],
events: [],
unitOptions: [],
rankingList: [
{name: "第一名", id: 1},
{name: "第二名", id: 2},
{name: "第三名", id: 3},
{name: "第四名", id: 4},
{name: "第五名", id: 5},
{name: "第六名", id: 6},
{name: "第七名", id: 7},
{name: "第八名", id: 8}],
sexList: [{sex: "男", id: 1}, {sex: "女", id: 2}],
pageForm: {
isMenWomen: [],
year: new Date().getFullYear() + "",
},
formRules: {
unitId: [{required: true, message: '必填', trigger: ['blur', 'change']}],
username: [{required: true, message: '必填', trigger: ['blur', 'change']}],
loginname: [{required: true, message: '必填', trigger: ['blur', 'change']}],
}
}
},
components: {},
methods: {
dropdownCommand(command) {
const {type, row} = command
if (type === 'view') {
this.openView(row)
} else if (type === 'input') {
this.openInput(row)
}
},
async userRemoteMethod(query) {
if (query) {
const resp = await this.$axios.post("/open/common/userOptions", {query: query})
this.userOptions = resp.data
}
},
userChange2(userid) {
const aa = this.userOptions.find(v => v.id === userid)
if (aa) {
const unit = this.unitOptions.find(v => v.id === aa.unitId)
this.$set(this.formData, "username", aa.username)
this.$set(this.formData, "loginname", aa.loginname)
this.$set(this.formData, "mobile", aa.mobile)
this.$set(this.formData, "unitId", aa.unitId)
this.$set(this.formData, "unionId", unit.unionId)
this.$set(this.formData, "unionname", unit.unionName)
this.$set(this.formData, "sex", aa.sex)
} else {
this.$set(this.formData, "username", userid)
}
},
async unitChange() {
const unit = this.unitOptions.find(v => v.id === this.formData.unitId)
this.$set(this.formData, "unionId", unit.id)
this.$set(this.formData, "unionname", unit.unionName)
this.$set(this.formData, "unitname", unit.name)
},
async openAdd() {
this.unitOptions = await this.$businessTool.listUnit()
this.$set(this.formData, "activityId", this.activityId)
this.$set(this.formData, "eventId", this.eventId)
this.$set(this.formData, "awardsMode", this.awardsMode)
this.$set(this.formData, "identity", ['1'])
this.$set(this.formData, "status", 2)
this.$set(this.formData, "sex", "男性")
this.dialogVisible = true
if (this.$refs['form']) {
this.$refs['form'].resetFields()
}
},
async doAddUser() {
this.$refs["form"].validate(async (valid) => {
if (valid) {
if (this.userList.some(v => v.id === this.formData.userid)) {
this.notifyWarning("您添加的运动员已经是远动员!")
return
}
await this.$axios.post(loc() + "/doAdd", {
activityResults: JSON.stringify(this.userData),
activityId: this.activityId,
eventId: this.eventId
})
const pageForm = clone(this.formData)
pageForm.identity = JSON.stringify(this.formData.identity)
const resp = await this.$axios.post(loc() + "/doAddUser", pageForm)
if (resp.code === 0) {
await this.userChange()
this.userDetailsChange()
this.dialogVisible = false
} else {
this.notifyWarning(resp.msg)
}
}
})
},
async yearChange() {
this.activityList = []
this.events = []
this.$set(this.pageForm, "activityId", "")
this.$set(this.pageForm, "eventId", "")
const {data} = await this.$axios.post("/platform/activity/score/statistics/getActivitys", {year: this.pageForm.year})
this.activityList = data
if (data.length > 0) {
this.pageForm.activityId = this.activityList[0].id
}
await this.doSearchS()
},
async changeActivit() {
const resp = await this.$axios.post("/platform/activity/apply/getEvents", {activityId: this.pageForm.activityId})
this.events = resp.data
},
async doAdd() {
this.userData.activityId = this.activityId
this.userData.eventId = this.eventId
const resp = await this.$axios.post(loc() + "/doAdd", {
activityResults: JSON.stringify(this.userData),
activityId: this.activityId,
eventId: this.eventId
})
if (resp.code === 0) {
this.pageData()
this.$refs.guava.index()
} else {
this.notifyWarning(resp.msg)
}
},
rankingChange() {
for (let ranking = 1; ranking <= 8; ranking++) {
let size = 0
let indexArray = [];
this.userData.forEach((v, index) => {
if (ranking == v.ranking) {
size++
indexArray.push(index)
}
})
if (size == 1) {
/*
if (this.awardsMode == 2) {
this.userData[indexArray[0]].integral = (this.calScore(ranking) / 2).toFixed(2);
console.log(this.calScore(ranking),2)
} else {
this.userData[indexArray[0]].integral = this.calScore(ranking).toFixed(2);
console.log(this.calScore(ranking),1)
}*/
this.userData[indexArray[0]].integral = this.calScore(ranking).toFixed(2);
} else {
var scoreArray = 0;
for (var i = 0; i < size; i++) {
scoreArray += this.calScore(ranking * 1 + i * 1);
}
/* if (this.awardsMode == 2) {
scoreArray = scoreArray / size / 2;
console.log(scoreArray, 2)
} else {
scoreArray = scoreArray / size;
console.log(scoreArray, 1)
}*/
scoreArray = scoreArray / size;
indexArray.forEach(v => {
this.userData[v].integral = scoreArray.toFixed(2);
})
}
}
},
calScore(ranking) {
let score;
if (ranking < 5) {// 1 2 3 4
if (ranking < 3) {//1 2
if (ranking == 1) {
score = this.awardsMode == 1 ? 9 : 9 * 2;
} else if (ranking == 2) {
score = this.awardsMode == 1 ? 7 : 7 * 2;
}
} else {//3 4
if (ranking == 3) {
score = this.awardsMode == 1 ? 6 : 6 * 2;
} else if (ranking == 4) {
score = this.awardsMode == 1 ? 5 : 5 * 2;
}
}
} else {//5 6 7 8
if (ranking < 7) {//5 6
if (ranking == 5) {
score = this.awardsMode == 1 ? 4 : 4 * 2;
} else if (ranking == 6) {
score = this.awardsMode == 1 ? 3 : 3 * 2;
}
} else {//7 8 9
if (ranking == 7) {
score = this.awardsMode == 1 ? 2 : 2 * 2;
} else if (ranking == 8) {
score = this.awardsMode == 1 ? 1 : 1 * 2;
} else if (ranking == 9) {
score = this.awardsMode == 1 ? 1 : 1 * 2;
}
}
}
return score;
},
userDetailsChange(val, row) {
const useridArr = this.userData.map(v => v.userId)
this.userList.forEach(v => {
v.disabled = useridArr.includes(v.id)
if (row && row.userId === v.id) {
const o = {
unionId: v.unionId,
activityId: this.activityId,
eventId: this.eventId,
isTeamPersonal: 1,
unionname: v.unionname
}
Object.assign(row, o)
}
})
},
async unionDetailsChange(val, row) {
let data = ''
if (row) {
const {unionId} = row
data = await this.$axios.post(loc() + "/getUnionDetails", {
activityId: this.activityId,
eventId: this.eventId,
unionId: unionId
})
}
this.$nextTick(() => {
const unionIdArr = this.userData.map(v => v.unionId)
this.unionList.forEach(v => {
v.disabled = unionIdArr.includes(v.id)
if (row && row.unionId === v.id) {
const o = {
numberOfPeople: data.data,
activityId: this.activityId,
eventId: this.eventId,
isTeamPersonal: 2
}
Object.assign(row, o)
}
})
})
},
delUser(index, row) {
this.userData.splice(index, 1)
this.userDetailsChange()
this.unionDetailsChange()
},
async getUserList() {
const {data} = await this.$axios.post(loc() + "/getUserList", {
activityId: this.activityId,
eventId: this.eventId,
isMenWomen: this.isMenWomen
})
return data;
},
async getUnionList(row) {
const {activityId, eventId} = row
const {data} = await this.$axios.post(loc() + "/getUnionList", {
activityId: activityId,
eventId: eventId
})
return data;
},
openAddUser() {
this.userData.push({})
},
async userChange() {
this.userList = await this.getUserList()
this.userList2 = this.userList
this.userData = []
const {data} = await this.$axios.post(loc() + "/getUserData", {
activityId: this.activityId,
eventId: this.eventId,
isMenWomen: this.isMenWomen
})
if (data.length > 0) {
this.userData = data
this.viewData = data
}
this.$forceUpdate();
},
async getUnionData(row) {
const {activityId, eventId} = row
const {data} = await this.$axios.post(loc() + "/getUnionData", {
activityId: activityId,
eventId: eventId
})
return data
},
async openView(row) {
this.isMenWomen = ""
this.userData = []
this.viewData = []
this.userList = []
this.awardsMode = row.awardsMode
this.name = row.name
this.allName = row.allName
this.activityId = row.activityId
this.eventId = row.eventId
if (row.awardsMode == 2) {
this.unionList = await this.getUnionList(row)
this.viewData = await this.getUnionData(row)
await this.unionDetailsChange(row)
} else {
await this.userChange()
this.userDetailsChange()
}
this.$refs.guava.view()
},
async openInput(row) {
this.isMenWomen = ""
this.userData = []
this.userList = []
this.awardsMode = row.awardsMode
this.name = row.name
this.allName = row.allName
this.activityId = row.activityId
this.eventId = row.eventId
this.isMenWomen = row.isMenWomen
if (row.awardsMode == 2) {
this.unionList = await this.getUnionList(row)
this.userData = await this.getUnionData(row)
await this.unionDetailsChange()
} else {
await this.userChange()
this.userDetailsChange()
}
this.$refs.guava.edit()
},
async getActivitys() {
const {data} = await this.$axios.post("/platform/activity/score/statistics/getActivitys", {year: this.pageForm.year})
return data;
},
async doSearchS() {
this.doSearch()
await this.changeActivit()
},
doSearch() {
this.pageForm.pageNumber = 1
this.pageData()
},
pageData() {
this.tabLoading = true
const pageForm = clone(this.pageForm)
pageForm.isMenWomen = JSON.stringify(pageForm.isMenWomen)
this.$axios.post("/platform/activity/results/input/pageData", pageForm).then(resp => {
this.tabLoading = false
if (resp.code == 0) {
this.tableData = resp.data.list;
this.pageForm.totalCount = resp.data.totalCount;
} else {
this.$message({
message: resp.msg,
type: 'error'
});
}
})
},
},
async created() {
this.yearChange()
// this.pageData()
this.activityList = await this.getActivitys()
if (this.activityList.length) {
this.pageForm.activityId = this.activityList[0].id
}
await this.changeActivit()
this.pageData()
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,433 @@
<!--#
layout("/layouts/platform.html"){
#-->
<style>
#app {
/*max-height: calc(100vh - 50px);
overflow: hidden;*/
}
.query-row {
height: 70px;
display: flex;
justify-content: center;
align-items: center;
box-sizing: border-box;
}
.query-row:not(:last-child) {
border-bottom: 1px dashed rgb(230, 230, 230);
}
.query-row-title {
width: 120px;
}
/* .el-select, .el-input {
width: 80%;
}*/
.el-date-editor.el-input, .el-date-editor.el-input__inner {
width: 175px !important;
}
</style>
<div id="app" v-cloak>
<guava ref="guava"
style="width: 100%;min-height: 100%;background-color: #f0f2f5;padding: 20px;box-sizing: border-box;">
<template>
<div style="max-height: 250px">
<el-card shadow="never">
<search @search="doSearch">
<search-item label="年度">
<el-date-picker
:clearable="false"
@change="getActivitys"
placeholder="选择年"
type="year"
v-model="pageForm.year" value-format="yyyy">
</el-date-picker>
</search-item>
<search-item label="活动名称">
<el-select :clearable="false" @change="activityChange" filterable
placeholder="请选择活动名称" style="width: 100%" v-model="pageForm.activityId">
<el-option
:key="item.id"
:label="item.name"
:value="item.id"
v-for="item in activityList">
</el-option>
</el-select>
</search-item>
<search-item label="所属工会">
<el-select @change="unionChange(pageForm.unionId)" clearable filterable
placeholder="请选择工会"
style="width: 100%" v-model="pageForm.name">
<el-option
:key="item.id"
:label="item.name"
:value="item.name"
v-for="item in unionList">
</el-option>
</el-select>
</search-item>
</search>
<!-- <div class="pull-right offscreen-right">
<el-button @click="getYear8(1)" icon="el-icon-search" type="primary">年度男子团体总分
</el-button>
<el-button @click="getYear8(2)" icon="el-icon-search" type="primary">年度女子团体总分
</el-button>
<el-button @click="annualResults" icon="el-icon-search" type="primary">年度团体总分</el-button>
<el-button @click="doExcelCj" class="mr10" icon="el-icon-printer" type="primary">导出成绩excel
</el-button>
</div>-->
</el-card>
<el-card shadow="never" style="margin-top: 10px">
<el-row type="flex" align="middle" class="query-row">
<el-col class="query-row-title">按活动统计:</el-col>
<el-col class="query-row-content" v-if="isSearchOptions">
<el-button
style="margin-left: 10px"
size="medium"
v-for="item in searchOptions"
:key="item.id"
:type="item.name" @click="searchClick(item.id)">{{item.name}}
</el-button>
</el-col>
<el-col class="query-row-content" v-else>
<el-button style="margin-left: 10px"
size="medium" @click="gradesClick(9)">成绩统计
</el-button>
</el-col>
<div class="pull-right offscreen-right" style="margin-left: auto">
<!--
<el-button type="primary" icon="el-icon-printer" @click="doExport8ByActivity"
v-if="[11,12].includes(isSearchOptions)&&pageForm.activityId">导出
</el-button>
<el-button type="primary" icon="el-icon-printer" @click="doGetYear8" v-else-if="isYear8">导出
</el-button>
<el-button type="primary" icon="el-icon-printer" @click="print" v-else>打 印</el-button>-->
<el-button @click="doExportByActivityStatisticsType" icon="el-icon-printer" type="primary">
导出
</el-button>
</div>
</el-row>
</el-card>
</div>
<div id=print ref="print">
<el-card shadow="never" class="mt10"
v-show="[1,2,3,4,5,9,10].includes(isSearchOptions)&&isSearchOptions">
<table-tool v-if="isSearchOptions==1" label="男子单项成绩"></table-tool>
<table-tool v-if="isSearchOptions==2" label="女子单项成绩"></table-tool>
<table-tool v-if="isSearchOptions==3" label="男子团体成绩"></table-tool>
<table-tool v-if="isSearchOptions==4" label="女子团体成绩"></table-tool>
<table-tool v-if="isSearchOptions==5" label="男女混合类成绩"></table-tool>
<table-tool v-if="isSearchOptions==9&&isSearch" label="分工会男子项目积分"></table-tool>
<table-tool v-if="isSearchOptions==9&&!isSearch" label="分工会项目成绩"></table-tool>
<table-tool v-if="isSearchOptions==10" label="分工会女子项目积分"></table-tool>
<is-male-female :form="pageForm" ref="female"></is-male-female>
</el-card>
<el-card shadow="never" class="mt10" v-show="[6,7,8].includes(isSearchOptions)&&isSearchOptions">
<table-tool v-if="isSearchOptions==6" label="男子项目前八"></table-tool>
<table-tool v-if="isSearchOptions==7" label="女子项目前八"></table-tool>
<table-tool v-if="isSearchOptions==8" label="综合类前八"></table-tool>
<el-row>
<top-eight :form="pageForm" ref="doeight"></top-eight>
</el-row>
</el-card>
<el-card shadow="never" class="mt10" v-show="[11,12].includes(isSearchOptions)&&isSearchOptions">
<table-tool v-if="isSearchOptions==11" label="分工会男子总分前八"></table-tool>
<table-tool v-if="isSearchOptions==12" label="分工会女子总分前八"></table-tool>
<score-top-eight :form="pageForm" ref="doTopEight"></score-top-eight>
</el-card>
<el-card shadow="never" class="mt10" v-show="[99].includes(isSearchOptions)">
<table-tool v-if="isSearchOptions==99" label="全年成绩"></table-tool>
<el-table :data="annualResultsTableData" style="width: 100%;height: 100%" stripe border
show-summary
:header-cell-style="{background:'#FAFAFA'}" row-key="id" @sort-change="pageOrder"
v-loading="tableLoading" size="mini" fixed ref="annualResults"
>
<el-table-column align="center" header-align="center" type="index"
label="名次"
width="80px" fixed></el-table-column>
<el-table-column
align="center"
header-align="center"
v-for="column in annualTableColumns"
:label="column.label"
:prop="column.prop"
:sortable="column.sortable"
show-overflow-tooltip>
</el-table-column>
</el-table>
</el-card>
</div>
</template>
</guava>
</div>
<link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/css/bootstrap.min.css">
<script>
const vue = new Vue({
el: '#app',
mixins: [initTableMixins],
data() {
return {
isMenWomen: "",
isUnion: false,
isYear8: false,
annualTableColumns: [],
annualResultsTableData: [],
annualMaxHeight: 0,
colspan: [],
eventList: [],
score: [],
titleCol: 0,
activityList: [],
events: [],
unionList: [],
units: [],
isSearch: true,
searchOptions: [],
Options: [
/* {id: 1, name: "男子单项"},
{id: 2, name: "女子单项"},
{id: 3, name: "男子团体"},
{id: 4, name: "女子团体"},
{id: 5, name: "男女混合类"},*/
{id: 9, name: "分工会男子项目积分"},
{id: 10, name: "分工会女子项目积分"},
{id: 6, name: "男子项目前八"},
{id: 7, name: "女子项目前八"},
{id: 8, name: "团体前八"},
{id: 11, name: "分工会男子总分前八"},
{id: 12, name: "分工会女子总分前八"},
],
isSearchOptions: 9,
pageForm: {
unionname: '',
activityId: "",
personTypes: [],
year: new Date().getFullYear() + "",
},
activityStatisticsType: 0//统计类型说明:1 年度男子团体总分2.年度女子团体总分3.年度团体总分4.分工会男子项目积分5.分工会女子项目积分,依次后推
}
},
components: {
'is-male-female': httpVueLoader('/components/module/activity/score/isMaleFemale.vue?v=' + new Date().getTime()),
'top-eight': httpVueLoader('/components/module/activity/score/topEight.vue?v=' + new Date().getTime()),
'score-top-eight': httpVueLoader('/components/module/activity/score/scoreTopEight.vue?v=' + new Date().getTime()),
},
methods: {
async doExportByActivityStatisticsType() {
const {activityId, year} = this.pageForm
const url = "/platform/activity/statistics/export"
if (this.activityStatisticsType === 1 || this.activityStatisticsType === 2) {
window.open(url + "/getYear8?year=" + year + "&isMenWomen=" + this.isMenWomen)
} else if (this.activityStatisticsType === 3) {
window.open(url + "/getAnnualResults?year=" + year)
} else if (this.activityStatisticsType === 4 || this.activityStatisticsType === 5) {
let sex = this.activityStatisticsType === 4 ? "男性" : "女性"
window.open(url + "/isMaleFemale?activityId=" + activityId + "&sex=" + sex + "&awardsMode=4")
} else if (this.activityStatisticsType === 6 || this.activityStatisticsType === 7 || this.activityStatisticsType === 8) {
let sex = this.activityStatisticsType === 6 ? "男性" : "女性"
let awardsMode = this.activityStatisticsType === 8 ? 2 : 1
window.open(url + "/isTopEight?activityId=" + activityId + "&sex=" + sex + "&awardsMode=" + awardsMode)
} else if (this.activityStatisticsType === 9 || this.activityStatisticsType === 10) {
let sex = this.activityStatisticsType === 9 ? "男性" : "女性"
window.open(url + "/isScoreTopEight?activityId=" + activityId + "&sex=" + sex)
}
},
doExport8ByActivity() {
window.open(loc() + "/doExport8ByActivity?activityId=" + this.pageForm.activityId + "&isMenWomen=" + (this.isSearchOptions === 11 ? 1 : 2))
},
doExcelCj() {
const {activityId, unionname} = this.pageForm
let unionId = ''
if (unionname) {
const unionlist = clone(this.unionList)
unionId = unionlist.find(v => v.unionname === unionname).id
}
window.open(loc() + "/doExcelCj?activityId=" + activityId + "&unionId=" + unionId)
},
print() {
let subOutputRankPrint = document.getElementById('print');
let newContent = subOutputRankPrint.innerHTML;
let oldContent = document.body.innerHTML;
document.body.innerHTML = newContent;
window.print();
window.location.reload();
document.body.innerHTML = oldContent;
return false;
},
activityChange() {
const aa = this.activityList.find(v => v.id == this.pageForm.activityId)
if (aa.applyType == 1) {
this.isSearch = false
this.searchOptions = [{id: 9, name: "分工会项目成绩"}]
} else {
this.searchOptions = this.Options
}
this.searchClick(9)
},
unionChange() {
this.searchClick(9)
},
searchClick(id) {
if (id === 9) {
this.activityStatisticsType = 4
} else if (id === 10) {
this.activityStatisticsType = 5
} else if (id === 6) {
this.activityStatisticsType = 6
} else if (id === 7) {
this.activityStatisticsType = 7
} else if (id === 8) {
this.activityStatisticsType = 8
} else if (id === 11) {
this.activityStatisticsType = 9
} else if (id === 12) {
this.activityStatisticsType = 10
}
this.isSearchOptions = id
if (id <= 5 || id == 9 || id == 10) {
if (id == 1 || id == 2) {
this.isUnion = false
this.isYear8 = false
this.pageForm.sex = id == 1 ? "男性" : "女性"
this.pageForm.awardsMode = 1
} else if (id == 3 || id == 4) {
this.isUnion = false
this.isUnionisYear8 = false
this.pageForm.sex = id == 3 ? "男性" : "女性"
this.pageForm.awardsMode = 2
} else if (id == 9 || id == 10) {
this.isUnion = true
this.pageForm.sex = id == 9 ? "男性" : "女性"
this.pageForm.awardsMode = 4
} else {
this.pageForm.awardsMode = 3
}
this.$refs.female.isMaleFemale()
} else if (id == 6 || id == 7 || id == 8) {
if (id == 6 || id == 7) {
this.isUnion = false
this.isYear8 = false
this.pageForm.sex = id == 6 ? "男性" : "女性"
this.pageForm.awardsMode = 1
} else if (id == 8) {
this.pageForm.awardsMode = 2
}
this.$refs.doeight.isTopEight()
} else if (id == 11 || id == 12) {
this.pageForm.sex = id == 11 ? "男性" : "女性"
this.$refs.doTopEight.isScoreTopEight()
}
},
async doGetYear8() {
location.href = loc() + "/doGetYear8?year=" + this.pageForm.year + "&isMenWomen=" + this.isMenWomen
},
async getYear8(isMenWomen) {
this.activityStatisticsType = isMenWomen
this.isMenWomen = isMenWomen
this.isUnion = false
this.isYear8 = true
this.$set(this.pageForm, "activityId", null)
this.$set(this.pageForm, "unionname", null)
this.annualTableColumns = []
this.annualResultsTableData = []
this.isSearchOptions = 99
const {data} = await this.$axios.post(loc() + "/getYear8", {
year: this.pageForm.year,
isMenWomen: isMenWomen
})
this.annualResultsTableData = data.score
this.annualResultsTableData = this.annualResultsTableData.sort((a, b) => b['总分'] - a['总分'])
data.label.forEach(v => {
this.annualTableColumns.push({label: v, prop: v})
})
},
async annualResults() {
this.activityStatisticsType = 3
this.isUnion = false
this.isYear8 = false
this.$set(this.pageForm, "activityId", null)
this.$set(this.pageForm, "unionname", null)
this.annualTableColumns = []
this.annualResultsTableData = []
this.isSearchOptions = 99
const {data} = await this.$axios.post(loc() + "/getAnnualResults", {
year: this.pageForm.year
})
this.annualResultsTableData = data.score
this.annualResultsTableData = this.annualResultsTableData.sort((a, b) => b['总分'] - a['总分'])
data.label.forEach(v => {
this.annualTableColumns.push({label: v, prop: v})
})
},
async getActivitys() {
const {data} = await this.$axios.post(loc() + "/getActivitys", {year: this.pageForm.year})
this.pageForm = {
activityId: "",
year: this.pageForm.year
}
this.activityList = data
},
async changeActivit() {
const resp = await this.$axios.post("/platform/activity/apply/getEvents", {activityId: this.pageForm.activityId})
this.events = resp
},
},
async created() {
this.searchOptions = this.Options
this.unionList = await this.$businessTool.listUnion()
await this.getActivitys()
if (this.activityList.length) {
this.pageForm.activityId = this.activityList[0].id
}
setTimeout(() => {
this.searchClick(9)
}, 200)
},
})
</script>
<!--#
}
#-->
@@ -46,6 +46,9 @@ layout("/layouts/platform.html"){
<enum-tag :value="row.instanceState" name="ProcessInstanceStateEnum" label_key="message"
size="small"></enum-tag>
</template>
<template v-else-if="column.prop === 'proposalTypeId'" scope="{row}">
{{row.proposalTypeId===1?'意见':'建议'}}
</template>
</el-table-column>
<el-table-column label="操作" fixed="right" width="400px">
<template scope="{row}">
@@ -104,6 +107,7 @@ layout("/layouts/platform.html"){
{label: "提案名称", prop: "name", width: "200px"},
{label: "提案人", prop: "createUserName"},
{label: "提案类别", prop: "typeName"},
{label: "提案类型", prop: "proposalTypeId"},
{label: "届次", prop: "sessionName"},
{label: "代表团", prop: "delegationName"},
{label: "当前节点", prop: "taskName"},
@@ -97,8 +97,17 @@ layout("/layouts/platform.html"){
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="提案类型" prop="proposalTypeId">
<el-select v-model="formData.proposalTypeId" style="width: 100%">
<el-option label="意见" :value="1"></el-option>
<el-option label="建议" :value="2"></el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<!-- <el-form-item label="提案摘要" prop="excerpt">-->
<!-- <span slot="label">-->
<!-- 提案摘要-->
@@ -206,7 +215,8 @@ layout("/layouts/platform.html"){
measures: [{required: true, message: "请填写", trigger: ["blur", "change"]}],
unitName: [{required: true, message: "请填写", trigger: ["blur", "change"]}],
mobile: [{required: true, message: "请填写", trigger: ["blur", "change"]}],
signature: [{required: false, message: "请扫描二维码进行签字", trigger: ["blur", "change"]}]
signature: [{required: false, message: "请扫描二维码进行签字", trigger: ["blur", "change"]}],
proposalTypeId: [{required: true, message: "请选择提案类型", trigger: ["blur", "change"]}]
},
proposalConfig: {},
noticeDialogVisible: false,
@@ -12,8 +12,8 @@ layout("/layouts/platform.html"){
<search-item label="姓名/工号">
<el-input placeholder="请输入姓名或工号" clearable v-model="pageForm.searchKeyword"></el-input>
</search-item>
<search-item label="性别">
<el-select v-model="pageForm.sex" placeholder="请选择性别" clearable style="width: 100%">
<search-item label="请假类型">
<el-select v-model="pageForm.sex" placeholder="请选择请假类型" clearable style="width: 100%">
<el-option label="男" value="男"></el-option>
<el-option label="女" value="女"></el-option>
</el-select>
@@ -72,7 +72,7 @@ layout("/layouts/platform.html"){
<el-radio-button :label="false">未选择</el-radio-button>
</el-radio-group>
<el-button type="primary" size="small" icon="el-icon-download" style="margin-left: 10px" @click="importCourierNumber">
<el-button type="primary" size="small" icon="el-icon-upload2" style="margin-left: 10px" @click="openImportCourierNumber">
导入快递单号
</el-button>
<el-button type="primary" size="small" icon="el-icon-download" style="margin-left: 10px" @click="exportXlsx">
@@ -118,6 +118,18 @@ layout("/layouts/platform.html"){
<option-select ref="optionSelectRef" @refresh="optionSelectVisible=false;doSearch();"></option-select>
</el-dialog>
</guava>
<!--导入福利名单-->
<excel-import
ref="excelImportRef"
url="/platform/welfare/selection/situation/importByExcel"
template_url="/platform/welfare/selection/situation/downloadTemplate"
:visible.sync="showImportDialog"
title="导入快递单号"
@import-success="showImportDialog=false;doSearch()"
width="700px"
:extra_params="{projectId:pageForm.projectId,welfareOptionId:pageForm.welfareOptionId}"
></excel-import>
</div>
<script>
@@ -134,7 +146,9 @@ layout("/layouts/platform.html"){
pageForm: {
searchName: "username",
year: new Date().getFullYear().toString(),
isSelect: null
isSelect: null,
welfareOptionId:'',
projectId:''
},
unionOptions: [],
unitOptions: [],
@@ -150,7 +164,8 @@ layout("/layouts/platform.html"){
{ prop: "courierNumbers", label: "快递号", sortable: true },
{ prop: "mobile", label: "联系电话", sortable: true }
],
optionSelectVisible: false
optionSelectVisible: false,
showImportDialog: false
}
},
computed: {
@@ -165,8 +180,12 @@ layout("/layouts/platform.html"){
}
},
methods: {
importCourierNumber(){
openImportCourierNumber(){
this.importData = {
isfg: 1,
fileList: []
}
this.showImportDialog = true
},
// 获取福利列表
getWelfareList() {
@@ -180,7 +199,6 @@ layout("/layouts/platform.html"){
this.doSearch()
})
},
// 获取数据
pageData() {
this.tableLoading = true