This commit is contained in:
2026-01-29 18:42:50 +08:00
parent c05f04d7d9
commit 76c3db3b7f
12 changed files with 1156 additions and 411 deletions
@@ -0,0 +1,486 @@
<!--#
layout("/layouts/platform.html"){
#-->
<div class="platform" id="app" v-cloak>
<template>
<el-card shadow="never">
<search @search="doSearch" :is-search-button="false">
<search-item label="年度">
<el-date-picker
:clearable="false"
@change="getActivitys"
placeholder="选择年"
style="width: 100%" type="year"
v-model="pageForm.year" value-format="yyyy">
</el-date-picker>
</search-item>
<search-item label="活动名称" v-if="!pageForm.status">
<el-select :clearable="false" @change="actChange(pageForm.activityId)"
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="工会名称" v-if="!pageForm.status">
<el-select :clearable="false" @change="unionChange(pageForm.unionId)"
filterable
placeholder="请选择工会"
style="width: 100%" v-model="pageForm.unionId">
<el-option
:key="item.id"
:label="item.name"
:value="item.id"
v-for="item in unionList">
</el-option>
</el-select>
</search-item>
<search-item label="性别" v-if="pageForm.status==='1'||!pageForm.status">
<el-select filterable
placeholder="请选择性别"
style="width: 100%" v-model="pageForm.sex">
<el-option label="男" value="男"></el-option>
<el-option label="女" value="女"></el-option>
</el-select>
</search-item>
</search>
</el-card>
<el-card class="mt10" shadow="never">
<table-tool
:label="pageForm.status==='2'?('中国地质大学(武汉)'+pageForm.year+'年教职工运动会获奖个数汇总表'):'奖品名单'">
<el-tag
:effect="pageForm.status===item.code?'dark':'plain'"
:key="item.code"
:type="item.name"
@click="statusType(item.code)"
style="margin-right: 10px;cursor: pointer"
v-for="item in statusOptions">
{{ item.name }}
</el-tag>
<el-button @click="print" icon="el-icon-printer" type="primary" size="small">打 印</el-button>
</table-tool>
<div id=print>
<template v-if="pageForm.activityId!=null">
<table class="table table-bordered" v-if="isSummary==1" v-loading="tableLoading">
<tr>
<td class="text-center" colspan="11">
<span v-if="activityList.find(v=>v.id === pageForm.activityId)">
中国地质大学(武汉){{ activityList.find(v=>v.id === pageForm.activityId).name }}
{{unionName}})获奖名单
</span>
</td>
</tr>
<tr>
<td></td>
<td>项目</td>
<td v-for="i in 8">
第{{i}}名
</td>
<td>备注</td>
</tr>
<tr v-for="(o,k,index) in tableDataUnionPrize['团体项目']">
<td :rowspan="Object.keys(tableDataUnionPrize['团体项目']).length"
style="vertical-align:middle"
v-if="0==index">团体项目
</td>
<td>{{k}}</td>
<td v-for="i in 8">
<span v-if="o.filter(f=>f.ranking==i && f.numberOfPeople!=null) && o.filter(f=>f.ranking==i && f.numberOfPeople!=null).length>0">
{{o.filter(f=>f.ranking==i && f.numberOfPeople!=null).map(g=>g.numberOfPeople).reduce((a,b)=>a+b)}}
</span>
</td>
<td></td>
</tr>
<tr v-for="(o,k,index) in tableDataUnionPrize['男子项目']">
<td :rowspan="Object.keys(tableDataUnionPrize['男子项目']).length"
style="vertical-align:middle"
v-if="0==index">男子项目
</td>
<td>{{k}}</td>
<td v-for="i in 8">
{{o.filter(f=>f.ranking==i).map(g=>g.username).join('、')}}
</td>
<td></td>
</tr>
<tr v-for="(o,k,index) in tableDataUnionPrize['女子项目']">
<td :rowspan="Object.keys(tableDataUnionPrize['女子项目']).length" dd
style="vertical-align:middle"
v-if="0==index">女子项目
</td>
<td>{{k}}</td>
<td v-for="i in 8">
{{o.filter(f=>f.ranking==i).map(g=>g.username).join('、')}}
</td>
<td></td>
</tr>
<tr>
<td>合计</td>
<td></td>
<td v-for="i in 9">
{{lastSum[i]}}
</td>
</tr>
</table>
<el-table :data="tableData" :header-cell-style="{background:'#FAFAFA'}"
@sort-change="pageOrder"
border row-key="id"
show-summary
size="mini" stripe style="width: 100%"
v-if="isSummary==2" v-loading="tableLoading">
<el-table-column :index="indexMethod" align="center"
header-align="center"
label="序号"
type="index"
width="80px"></el-table-column>
<el-table-column
:label="column.label"
:prop="column.prop"
:key="column.prop"
:sortable="column.sortable"
show-overflow-tooltip
v-for="column in summaryColumns"
v-if="isSummary==2">
</el-table-column>
<el-table-column align="center" header-align="center" label="签字"
show-overflow-tooltip
v-if="isSummary==2"></el-table-column>
</el-table>
</template>
<template v-else>
<table class="table table-bordered" v-if="isSummary==3">
<tr>
<td class="text-center" colspan="11">
{{pageForm.year}}田径运动会教工{{pageForm.sex}}子甲、乙、丙、丁、前八名记录表
</td>
</tr>
<tr>
<td></td>
<td>
<div style="display: flex;justify-content: center;">项目</div>
</td>
<td v-for="i in 8">
<div style="display: flex;justify-content: center;">
第{{i}}名
</div>
</td>
</tr>
<tr v-for="(o,k,index) in tableDataPrize['甲组']">
<td :rowspan="Object.keys(tableDataPrize['甲组']).length"
style="vertical-align:middle"
v-if="0==index">甲组
</td>
<td>{{k}}</td>
<td v-for="i in 8">
<span>
{{getSummaryByYear(o,i,'甲组')}}
</span>
</td>
</tr>
<tr v-for="(o,k,index) in tableDataPrize['乙组']">
<td :rowspan="Object.keys(tableDataPrize['乙组']).length"
style="vertical-align:middle"
v-if="0==index">乙组
</td>
<td>{{k}}</td>
<td v-for="i in 8">
<span>
{{getSummaryByYear(o,i,'乙组')}}
</span>
</td>
</tr>
<tr v-for="(o,k,index) in tableDataPrize['丙组']">
<td :rowspan="Object.keys(tableDataPrize['丙组']).length"
style="vertical-align:middle"
v-if="0==index">丙组
</td>
<td>{{k}}</td>
<td v-for="i in 8">
<span>
{{getSummaryByYear(o,i,'丙组')}}
</span>
</td>
</tr>
<tr v-for="(o,k,index) in tableDataPrize['丁组']">
<td :rowspan="Object.keys(tableDataPrize['丁组']).length"
style="vertical-align:middle"
v-if="0==index">丁组
</td>
<td>{{k}}</td>
<td v-for="i in 8">
<span>
{{getSummaryByYear(o,i,'丁组')}}
</span>
</td>
</tr>
<tr v-for="(o,k,index) in tableDataPrize['集体项目']">
<td :rowspan="Object.keys(tableDataPrize['集体项目']).length"
style="vertical-align:middle"
v-if="0==index">集体项目
</td>
<td>{{k}}</td>
<td v-for="i in 8">
<span>
{{getSummaryByYear(o,i,'集体项目')}}
</span>
</td>
</tr>
</table>
</template>
</div>
</el-card>
</template>
</div>
<link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/css/bootstrap.min.css">
<script nonce="${cspNonce!}">
const vue = new Vue({
el: '#app',
mixins: [initTableMixins],
data() {
return {
isSummary: 1,
activityList: [],
unionList: [],
unionName: "",
pageForm: {
activityId: "",
unionId: "",
status: null,
sex: null,
year: new Date().getFullYear() + ''
},
summaryColumns: [
{prop: 'unionname', label: '分工会'},
{prop: 'one', label: '第一名'},
{prop: 'two', label: '第二名'},
{prop: 'three', label: '第三名'},
{prop: 'four', label: '第四名'},
{prop: 'fives', label: '第五名'},
{prop: 'six', label: '第六名'},
{prop: 'seven', label: '第七名'},
{prop: 'eight', label: '第八名'},
{prop: 'totalPeople', label: '合计'},
],
tableDataUnionPrize: {},
lastSum: {},
tableDataPrize: [],
statusOptions: [{code: "1", name: "分组汇总年度前八"}, {code: "2", name: "奖品个数年度汇总表"}]
}
},
components: {},
methods: {
async statusType(state) {
this.tableLoading = true
if (state === "1") {
const data = await this.summaryYearPrizes()
if (!data) {
this.tableLoading = false
return
}
} else if (state === "2") {
this.pageForm.sex = null
await this.summary()
}
if (this.pageForm.status === state) {
this.pageForm.status = null
this.pageForm.sex = null
this.pageForm.activityId = this.activityList[0].id
this.pageForm.unionId = this.unionList[0].id
this.unionChange(this.unionList[0].id)
} else {
this.pageForm.status = state
}
this.tableLoading = false
},
getSummaryByYear(o, i, type) {
if (type === "集体项目") {
const datas = o.filter(o => o.ranking === i).map(o => o.unionname)
if (datas) {
return datas.join(",")
} else {
return ""
}
} else {
//甲组里面有可能有团体项目,所以说如果这个没有username就代表是团体
return o.filter(f => f.ranking === i).map(g => g.username ? g.username : g.unionname).join('、')
}
},
async summaryYearPrizes() {
try {
if (!this.pageForm.sex) {
this.$message.warning("请选择性别")
return false
}
this.$set(this.pageForm, "unionId", null)
this.$set(this.pageForm, "activityId", null)
this.isSummary = 3
const {data} = await this.$axios.post(loc() + "/getSummaryYearPrizes", this.pageForm)
this.tableDataPrize = data
return true
} catch (e) {
this.$message.error(e.msg)
return false
}
},
getTableTdContent(d, i) {
return d.filter(v => {
if (v.isteampersonal === 1) {
if (v.ranking == i) {
console.log(v, i)
return v.username
}
} else {
if (v.ranking == i) {
return v.numberofpeople
}
}
}).map(v => {
return v.isteampersonal === 1 ? v.username : v.numberofpeople
}).toString()
},
async summary() {
try {
if (this.activityList.length === 0) {
return
}
if (!this.pageForm.activityId) {
this.pageForm.activityId = this.activityList[0].id
}
this.$set(this.pageForm, "unionId", null)
this.isSummary = 2
this.tableData = []
const {data} = await this.$axios.post(loc() + "/summary", this.pageForm)
this.$set(this, "tableData", data.score)
this.unionName = "汇总"
} catch (e) {
this.$message.error(e.msg)
}
},
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;
},
actChange(activityId) {
this.tableColumns = []
this.tableData = []
this.pageForm.activityId = ""
const activityData = this.activityList.find(v => v.id == activityId)
this.pageForm.activityId = activityData.id
this.getPrizes()
},
unionChange(unionId) {
this.tableColumns = []
this.tableData = []
this.pageForm.unionId = ""
this.isSummary = 1
const unionData = this.unionList.find(v => v.id == unionId)
this.pageForm.unionId = unionData.id
this.unionName = unionData.name
this.getPrizes()
},
async getActivitys() {
this.tableData = []
const {data} = await this.$axios.post("/platform/activity/score/statistics/getActivitys", {year: this.pageForm.year})
this.pageForm.activityId = ""
this.activityList = data
if (data && data.length > 0) {
this.pageForm.activityId = data[0].id
}
await this.getPrizes()
},
async getPrizes() {
try {
this.tableLoading = true
const {data} = await this.$axios.post(loc() + "/getPrizes", this.pageForm)
this.tableDataUnionPrize = data
const lastSum = {}
for (let i = 1; i <= 8; i++) {
let sum = 0
if (!$.isEmptyObject(data['男子项目'])) {
let xm = []
for (let key in data['男子项目']) {
xm = xm.concat(data['男子项目'][key])
}
sum += xm.filter(v => v.ranking === i).length
}
if (!$.isEmptyObject(data['女子项目'])) {
let xm = []
for (let key in data['女子项目']) {
xm = xm.concat(data['女子项目'][key])
}
sum += xm.filter(v => v.ranking === i).length
}
if (!$.isEmptyObject(data['团体项目'])) {
let xm = []
for (let key in data['团体项目']) {
xm = xm.concat(data['团体项目'][key])
}
const teams = xm.filter(v => v.ranking === i).map(v => Number(v.numberOfPeople))
if (teams && teams.length > 0) {
sum += teams.reduce((a, b) => a + b)
}
}
lastSum[i] = sum
}
lastSum[9] = Object.values(lastSum).reduce((a, b) => a + b)
this.lastSum = lastSum
} catch (e) {
this.$message.error(e.msg)
} finally {
this.tableLoading = false
}
},
},
async created() {
await this.getActivitys()
this.unionList = await this.$businessTool.listUnion()
if (this.unionList.length > 0) {
this.pageForm.unionId = this.unionList[0].id
this.unionName = this.unionList[0].unionname
}
await this.getPrizes()
}
})
</script>
<!--#
}
#-->
@@ -423,7 +423,7 @@ layout("/layouts/platform.html"){
</el-dialog>
</div>
<script>
<script nonce="${cspNonce!}">
const vue = new Vue({
el: '#app',
mixins: [initTableMixins],
@@ -39,69 +39,75 @@ layout("/layouts/platform.html"){
<guava ref="guava"
style="width: 100%;min-height: 100%;background-color: #f0f2f5;padding: 20px;box-sizing: border-box;">
<template>
<el-card shadow="never">
<search @search="doSearch" :is-search-button="false">
<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="活动名称" v-if="!pageForm.status">
<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="所属工会" v-if="isUnion">
<el-select @change="unionChange(pageForm.unionId)" clearable filterable placeholder="请选择工会"
style="width: 100%" v-model="pageForm.unionname">
<el-option
:key="item.id"
:label="item.name"
:value="item.name"
v-for="item in unionList">
</el-option>
</el-select>
</search-item>
<search-item>
<el-button @click="doExcelCj" icon="el-icon-printer" type="primary">导出成绩excel
</el-button>
</search-item>
</search>
</el-card>
<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-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"
<el-tag
:effect="pageForm.status===item.code?'dark':'plain'"
:key="item.code"
:type="item.name"
@click="statusType(item.code)"
style="margin-right: 10px;cursor: pointer"
v-for="item in statusOptions">
{{ item.name }}
</el-tag>
</el-col>
</el-row>
<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-tag
:effect="pageForm.status2===item.id?'dark':'plain'"
:key="item.id"
:type="item.name" @click="searchClick(item.id)">{{item.name}}
</el-button>
:type="item.name"
@click="status2Type(item.id)"
style="margin-right: 10px;cursor: pointer"
v-for="item in searchOptions">
{{ item.name }}
</el-tag>
</el-col>
<el-col class="query-row-content" v-else>
<el-button style="margin-left: 10px"
@@ -111,77 +117,70 @@ layout("/layouts/platform.html"){
<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 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>
<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 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>
<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 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>
<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-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-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>
</el-table>
</el-card>
</template>
@@ -189,7 +188,7 @@ layout("/layouts/platform.html"){
</div>
<link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/css/bootstrap.min.css">
<script>
<script nonce="${cspNonce!}">
const vue = new Vue({
el: '#app',
@@ -218,24 +217,31 @@ layout("/layouts/platform.html"){
{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: 9, name: "男子项目分工会积分"},
{id: 10, name: "女子项目分工会积分"},
{id: 6, name: "男子项前八"},
{id: 7, name: "女子项前八"},
{id: 8, name: "团体项目前八"},
{id: 11, name: "分工会男子总分前八"},
{id: 12, name: "分工会女子总分前八"},
{id: 11, name: "男子总分前八"},
{id: 12, name: "女子总分前八"},
],
isSearchOptions: 9,
pageForm: {
status2: 9,
status: '',
unionname: '',
activityId: "",
personTypes: [],
year: new Date().getFullYear() + "",
},
activityStatisticsType: 0//统计类型说明:1 年度男子团体总分2.年度女子团体总分3.年度团体总分4.分工会男子项目积分5.分工会女子项目积分,依次后推
activityStatisticsType: 0,//统计类型说明:1 年度男子团体总分2.年度女子团体总分3.年度团体总分4.分工会男子项目积分5.分工会女子项目积分,依次后推
statusOptions: [
{code: "1", name: "年度男子团体总分"},
{code: "2", name: "年度女子团体总分"},
{code: "3", name: "年度团体总分"}
]
}
},
components: {
@@ -244,29 +250,55 @@ layout("/layouts/platform.html"){
'score-top-eight': httpVueLoader('/components/module/activity/score/scoreTopEight.vue?v=' + new Date().getTime()),
},
methods: {
async status2Type(id) {
if (this.pageForm.status2 === id) {
this.$set(this.pageForm, "status2", 9)
this.$set(this.pageForm, "sex", "男")
this.$set(this.pageForm, "activityId", this.activityList[0].id)
} else {
this.$set(this.pageForm, "status2", id)
}
this.searchClick(id)
},
async statusType(state) {
if (state === "1") {
await this.getYear8(1)
} else if (state === "2") {
await this.getYear8(2)
} else if (state === "3") {
await this.annualResults()
}
if (this.pageForm.status === state) {
this.$set(this.pageForm, "status", null)
this.$set(this.pageForm, "activityId", this.activityList[0].id)
this.activityChange()
this.$set(this.pageForm, "status2", 9)
} else {
this.$set(this.pageForm, "status", state)
this.$set(this.pageForm, "status2", '')
}
},
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)
this.$downLoad(url + "/getYear8", {year: year, isMenWomen: this.isMenWomen})
} else if (this.activityStatisticsType === 3) {
window.open(url + "/getAnnualResults?year=" + year)
this.$downLoad(url + "/getAnnualResults", {year})
} else if (this.activityStatisticsType === 4 || this.activityStatisticsType === 5) {
let sex = this.activityStatisticsType === 4 ? "男" : "女"
window.open(url + "/isMaleFemale?activityId=" + activityId + "&sex=" + sex + "&awardsMode=4")
let sex = this.activityStatisticsType === 4 ? "男" : "女"
this.$downLoad(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 sex = this.activityStatisticsType === 6 ? "男" : "女"
let awardsMode = this.activityStatisticsType === 8 ? 2 : 1
window.open(url + "/isTopEight?activityId=" + activityId + "&sex=" + sex + "&awardsMode=" + awardsMode)
this.$downLoad(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)
let sex = this.activityStatisticsType === 9 ? "男" : "女"
this.$downLoad(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 = ''
@@ -274,21 +306,11 @@ layout("/layouts/platform.html"){
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;
this.$downLoad(loc() + "/doExcelCj", {activityId: activityId, unionId: unionId})
},
activityChange() {
this.$set(this.pageForm, "yearDoSearch", null)
const aa = this.activityList.find(v => v.id == this.pageForm.activityId)
if (aa.applyType == 1) {
this.isSearch = false
@@ -302,6 +324,10 @@ layout("/layouts/platform.html"){
this.searchClick(9)
},
searchClick(id) {
this.$set(this.pageForm, "status", null)
if (!this.pageForm.activityId) {
this.$set(this.pageForm, "activityId", this.activityList[0].id)
}
if (id === 9) {
this.activityStatisticsType = 4
} else if (id === 10) {
@@ -322,16 +348,16 @@ layout("/layouts/platform.html"){
if (id == 1 || id == 2) {
this.isUnion = false
this.isYear8 = false
this.pageForm.sex = id == 1 ? "男" : "女"
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.sex = id == 3 ? "男" : "女"
this.pageForm.awardsMode = 2
} else if (id == 9 || id == 10) {
this.isUnion = true
this.pageForm.sex = id == 9 ? "男" : "女"
this.pageForm.sex = id == 9 ? "男" : "女"
this.pageForm.awardsMode = 4
} else {
this.pageForm.awardsMode = 3
@@ -341,76 +367,97 @@ layout("/layouts/platform.html"){
if (id == 6 || id == 7) {
this.isUnion = false
this.isYear8 = false
this.pageForm.sex = id == 6 ? "男" : "女"
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.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 = []
try {
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.tableLoading = true
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['总分'])
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})
})
} catch (e) {
this.$message().error(e.msg)
} finally {
this.tableLoading = false
}
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 = []
try {
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.tableLoading = true;
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['总分'])
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})
})
data.label.forEach(v => {
this.annualTableColumns.push({label: v, prop: v})
})
} catch (e) {
this.$message().error(e.msg)
} finally {
this.tableLoading = false
}
},
async getActivitys() {
const {data} = await this.$axios.post(loc() + "/getActivitys", {year: this.pageForm.year})
this.pageForm = {
activityId: "",
year: this.pageForm.year
try {
const {data} = await this.$axios.post(loc() + "/getActivitys", {year: this.pageForm.year})
this.pageForm = {
activityId: "",
status2: 9,
year: this.pageForm.year
}
this.activityList = data
} catch (e) {
this.$message().error(e.msg)
}
this.activityList = data
},
async changeActivit() {
const resp = await this.$axios.post("/platform/activity/apply/getEvents", {activityId: this.pageForm.activityId})
this.events = resp
try {
const resp = await this.$axios.post("/platform/activity/apply/getEvents", {activityId: this.pageForm.activityId})
this.events = resp
} catch (e) {
this.$message().error(e.msg)
}
},
},
async created() {