first commit

This commit is contained in:
2026-09-08 19:49:21 +08:00
commit ebffbab428
7320 changed files with 1477614 additions and 0 deletions
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,109 @@
<!--#
layout("/layouts/platform.html"){
#-->
<style>
.el-popover__title {
font-size: 15px;
font-weight: bold;
}
.my-mt {
margin-top: 15px;
}
</style>
<div id="app" class="platform" v-cloak>
<guava ref="guava">
<template>
<el-calendar>
<template slot="dateCell" slot-scope="{date, data}">
<p :class="data.isSelected ? 'is-selected' : ''">
{{ data.day.split('-').slice(1).join('-') }} {{ data.isSelected ? '✔️' : ''}}
</p>
<div v-for="item in tableData">
<div v-if="data.day.toString()==moment(item.startTime).format('YYYY-MM-DD')">
<el-popover placement="top-start" title="活动信息" width="320" trigger="hover">
<div style="font-size: 10px">
<el-row class="my-mt">
<el-col :span="5"><b>主办单位</b></el-col>
<el-col :span="19">{{item.unitName}}</el-col>
</el-row>
<el-row class="my-mt">
<el-col :span="5"><b>活动地址</b></el-col>
<el-col :span="19">{{item.address}}</el-col>
</el-row>
<el-row class="my-mt">
<el-col :span="5"><b>报名时间</b></el-col>
<el-col :span="19">{{moment(item.applyStartTime).format('YYYY-MM-DD HH:mm')}} 至
{{moment(item.applyEndTime).format('YYYY-MM-DD HH:mm')}}
</el-col>
</el-row>
<el-row class="my-mt">
<el-col :span="5"><b>活动时间</b></el-col>
<el-col :span="19">{{moment(item.startTime).format('YYYY-MM-DD HH:mm')}} 至
{{moment(item.endTime).format('YYYY-MM-DD HH:mm')}}
</el-col>
</el-row>
<el-row class="my-mt">
<el-col :span="5"><b>报名链接</b></el-col>
<el-col :span="19">
<el-link style="font-size: 8px" type="primary" target="_blank"
@click="djbm">
点击报名
</el-link>
</el-col>
</el-row>
</div>
<span class="text-primary" slot="reference">
{{item.name}}-(<span
v-html="activity.school.getStatus(item.close,item.applyStartTime,item.applyEndTime,item.startTime,item.endTime)"></span>)
</span>
</el-popover>
</div>
</div>
</template>
</el-calendar>
</template>
</guava>
</div>
<script>
var vue = new Vue({
el: '#app',
data() {
return {
tableKey: new Date().getTime(),
tabLoading: false,
tableData: []
}
},
components: {
'guava': httpVueLoader('/components/plugins/Guava.vue'),
},
methods: {
djbm() {
sublime.jumpPagePjax('/platform/activity/apply')
},
async getData() {
this.tabLoading = true
const resp = await $.get(loc() + "/getData")
this.tabLoading = false
if(resp.code===0){
this.tableData = resp.data
this.tableKey = new Date().getTime()
}else{
this.notifyWarning(resp.msg)
}
}
},
async created() {
await this.getData()
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,927 @@
<!--活动成绩管理 djx 2019-6-28 -->
<!--#
layout("/layouts/platform.html"){
#-->
<style>
.dia .el-dialog__body {
padding: 10px 20px;
}
.el-step__title {
font-size: 14px;
line-height: 24px;
}
.el-step__icon {
width: 20px;
height: 20px;
}
/*.el-card__body {*/
/* padding: 10px 20px 0px;*/
/*}*/
[class*=el-col-] {
text-align: center;
margin-bottom: 8px;
}
.el-divider__text {
color: #f56c6c;
}
.bmqk .el-card__body {
padding: 10px 20px;
}
.v-0x2323544 {
text-align: center;
color: rgb(180, 180, 180);
}
.v-0x345756765 {
text-align: center;
}
</style>
<div id="app" v-cloak>
<guava ref="guava">
<template>
<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
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="getEvents">
<el-option
v-for="item in activitys"
: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%">
<el-option
v-for="item in events"
:key="item.id"
:label="item.allname"
:value="item.eventid">
</el-option>
</el-select>
</div>
</div>
<div class="search-query">
<el-button type="primary" icon="el-icon-search" @click="doSearch">搜索</el-button>
</div>
</div>
<!-- <el-row type="flex" :gutter="20" align="center" class="search-card">-->
<!-- <el-col :span="7">-->
<!-- <el-date-picker-->
<!-- v-model="pageForm.year"-->
<!-- type="year"-->
<!-- value-format="yyyy" style="width: 100%"-->
<!-- placeholder="选择年">-->
<!-- </el-date-picker>-->
<!-- </el-col>-->
<!-- <el-col :span="7">-->
<!-- <el-select v-model="pageForm.activityId" placeholder="请选择活动名称" filterable clearable-->
<!-- style="width: 100%" @change="getEvents">-->
<!-- <el-option-->
<!-- v-for="item in activitys"-->
<!-- :key="item.id"-->
<!-- :label="item.name"-->
<!-- :value="item.id">-->
<!-- </el-option>-->
<!-- </el-select>-->
<!-- </el-col>-->
<!-- <el-col :span="7">-->
<!-- </el-col>-->
<!-- <el-col :span="1">-->
<!-- <div class="btn-group tool-button mt5">-->
<!-- <el-button type="primary" icon="el-icon-search" @click="doSearch"></el-button>-->
<!-- </div>-->
<!-- </el-col>-->
<!-- </el-row>-->
</el-card>
<!--表格-->
<el-card shadow="never" class="mt10">
<el-row class="el-table-container">
<el-table :data="tableData" style="width: 100%;margin-bottom: 20px" row-key="id" class="vi-table">
<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"
:label="column.label"
:prop="column.prop"
:sortable="column.sortable">
<template v-if="column.prop=='events'" scope="{row}">
<span>{{row.allName}}</span>
</template>
<template v-else-if="column.prop=='gameStyle'" scope="{row}">
<span>{{activity.school.gameStyle[row.gameStyle]}}</span>
</template>
<template v-else-if="column.prop=='startTime'" scope="{row}">
{{moment(row.startTime).format('YYYY-MM-DD')}} -
{{moment(row.endTime).format('YYYY-MM-DD')}}
</template>
<template v-else-if="column.prop=='state'"
scope="{row:{close,applyStartTime,applyEndTime,startTime,endTime}}">
<div v-html="activity.school.getStatus(close,applyStartTime,applyEndTime,startTime,endTime)"></div>
</template>
</el-table-column>
<el-table-column align="center" label="操作" width="220px">
<template slot-scope="scope">
<el-button @click="openView(scope)" size="mini">查看</el-button>
<el-button type="primary" @click="openCj(scope)" size="mini">
分配成绩
</el-button>
</template>
</el-table-column>
</el-table>
</el-row>
<!--#include("/layouts/pagination.html"){}#-->
</el-card>
</template>
<template #view>
<info ref="info"></info>
</template>
</guava>
<!--分配成绩-->
<el-dialog title="获奖设置" class="dia"
:visible.sync="tdDialogVisible" custom-class="ViewDialogClass" width="60%" top="3%">
<el-row style="text-align: right">
<el-select placeholder="请选择奖品类型" style="width: 16%" size="mini" @change="changeVal" v-model="jplx"
clearable="true" filterable="true">
<el-option label="奖品" value="奖品"></el-option>
<el-option label="现金奖赏" value="现金奖赏"></el-option>
</el-select>
<el-input size="mini" v-if="isShow" style="width: 14%" placeholder="统一设置奖品名称" v-model="jpmc"></el-input>
<el-input size="mini" style="width: 14%" placeholder="统一设置金额" v-model="money" type="number">
<template slot="append"></template>
</el-input>
</el-row>
<el-table :data="tdTableData" size="small">
<el-table-column align="center" width="280" header-align="center" label="获奖单位" prop="unitid">
<template slot-scope="scope">
<el-select placeholder="请选择获奖单位" size="small" v-model="scope.row.unitId" style="width: 68%;"
clearable filterable>
<el-option
v-for="item in unitSel"
:key="item.id"
:label="item.unitname"
:value="item.unitid">
</el-option>
<!-- <el-option v-for="item in unitSel" :label="item.unitname" :value="item.unitId"></el-option>-->
</el-select>
<el-popover popper-class="aa"
placement="top-start"
width="280"
trigger="click"
@show="popShow(scope)">
<el-table :data="cyUser" max-height="260" size="mini">
<el-table-column width="120" property="username" label="姓名"></el-table-column>
<el-table-column width="120" property="sex" label="性别"></el-table-column>
</el-table>
<el-link v-show="cyUser!=null" slot="reference" type="primary" :underline="false"
style="margin-left: 6px;margin-bottom: 6px;">参赛人员
</el-link>
</el-popover>
</template>
</el-table-column>
<el-table-column align="center" header-align="center" label="荣誉奖项" prop="mc">
<template slot-scope="scope">
<el-input size="small" v-model="scope.row.mc"></el-input>
</template>
</el-table-column>
<el-table-column v-if="isShow" align="center" header-align="center" label="奖品名称" prop="jpmc">
<template slot-scope="scope">
<el-input size="small" v-model="scope.row.jpmc"></el-input>
</template>
</el-table-column>
<el-table-column align="center" header-align="center" label="金额" prop="money">
<template slot-scope="scope">
<el-input size="small" v-model="scope.row.money" type="number">
<template slot="append"></template>
</el-input>
</template>
</el-table-column>
<el-table-column align="center" label="操作" width="60px">
<template slot-scope="scope">
<i v-if="scope.$index == 0" type="success" style="font-size: 2.8em;color:#67C23A;cursor: pointer"
@click="addRow(scope)" class="el-icon-circle-plus" circle></i>
<i v-if="scope.$index > 0" type="success" style="font-size: 2.8em;color:#f56c6c;cursor: pointer"
@click="delRow(scope)" class="el-icon-error" circle></i>
</template>
</el-table-column>
</el-table>
<span slot="footer" class="dialog-footer">
<el-button @click="tdDialogVisible = false">取 消</el-button>
<el-button type="primary" @click="tdSave">保 存</el-button>
<el-button type="success" @click="tdDo">提 交</el-button>
</span>
</el-dialog>
<!--个人-->
<el-dialog title="设置活动获奖人员" class="dia"
:visible.sync="grDialogVisible" custom-class="ViewDialogClass" width="60%" top="3%">
<el-steps :active="active" align-center>
<el-step title="选择获奖人员"></el-step>
<el-step title="设置获奖信息"></el-step>
</el-steps>
<el-row style="margin-top: 20px;" v-show="active=='1'">
<div class="btn-group tool-button mt5">
<el-input style="width:180px;" size="mini" placeholder="可按姓名、教工号查询" v-model="grPageForm.searchKeyword"
clearable></el-input>
</div>
<div class="btn-group tool-button mt5">
<el-select placeholder="请选择单位" size="mini" v-model="grPageForm.unit" style="width: 160px;"
clearable="true" filterable="true">
<el-option v-for="item in unit" :label="item.name" :value="item.id"></el-option>
</el-select>
</div>
<div class="btn-group tool-button mt5">
<el-button type="primary" size="mini" icon="el-icon-search" @click="doGrSearch"></el-button>
</div>
</el-row>
<el-table :data="grTableData" ref="grTable" size="small" :row-key="rowKey" @selection-change="changeFun"
v-show="active=='1'">
<el-table-column :reserve-selection="true"
@selection-change="changeFun"
type="selection"
width="40">
</el-table-column>
<el-table-column align="center" header-align="center" label="序号" type="index">
<template scope="scope">
<span>{{scope.$index+(grPageForm.pageNumber - 1) * grPageForm.pageSize + 1}} </span></template>
</el-table-column>
<el-table-column align="center" header-align="center" label="教工号" prop="loginname"></el-table-column>
<el-table-column align="center" header-align="center" label="姓名" prop="username"></el-table-column>
<el-table-column align="center" header-align="center" label="性别" prop="sex"></el-table-column>
<el-table-column align="center" header-align="center" label="单位" prop="unitname"></el-table-column>
<el-table-column align="center" header-align="center" label="电话" prop="mobile"></el-table-column>
</el-table>
<el-row class="el-pagination-container" v-show="active=='1'">
<el-pagination
@size-change="grpageSizeChange"
@current-change="grpageNumberChange"
:current-page="grPageForm.pageNumber"
:page-sizes="[10, 20, 30, 50]"
:page-size="grPageForm.pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="grPageForm.totalCount">
</el-pagination>
</el-row>
<el-card class="box-card" v-show="active=='2'" style="margin-top: 20px">
<div slot="header" class="clearfix">
<span style="color: #ebb563">请填写以下人员的获奖信息</span>
<el-input size="mini" style="width: 20%;float: right;" placeholder="统一设置金额" v-model="money"
type="number">
<template slot="append"></template>
</el-input>
<el-input size="mini" v-if="isShow" style="width: 20%;float: right;margin-left: 8px;margin-right: 8px;"
placeholder="统一设置奖品名称" v-model="jpmc"></el-input>
<el-select placeholder="请选择奖品类型" style="width: 20%;float: right;" size="mini" @change="changeVal"
v-model="jplx" clearable="true" filterable="true">
<el-option label="奖品" value="奖品"></el-option>
<el-option label="现金奖赏" value="现金奖赏"></el-option>
</el-select>
</div>
<el-form :model="formData" label-position="top" size="small" label-width="86px">
<el-row>
<el-col :span="3" style="background-color: #EBEEF5;color: black;font-weight: bold">姓名</el-col>
<el-col :span="3" style="background-color: #EBEEF5;color: black;font-weight: bold">性别</el-col>
<el-col :span="isShow==true?'6':'9'"
style="background-color: #EBEEF5;color: black;font-weight: bold">获奖信息
</el-col>
<el-col :span="6" v-if="isShow" style="background-color: #EBEEF5;color: black;font-weight: bold">
奖品名称
</el-col>
<el-col :span="isShow==true?'6':'9'"
style="background-color: #EBEEF5;color: black;font-weight: bold">金额
</el-col>
</el-row>
<el-row v-for="item in multipleSelection">
<el-col :span="3">
<el-lebel style="color: grey">{{item.username}}</el-lebel>
</el-col>
<el-col :span="3">
<el-lebel style="color: grey">{{item.sex}}</el-lebel>
</el-col>
<el-col :span="isShow==true?'6':'9'">
<el-input maxlength="100" placeholder="请输入获奖信息" size="mini" v-model="item.mc" style="width: 88%"
auto-complete="off" tabindex="4" type="text"></el-input>
</el-col>
<el-col :span="6" v-if="isShow">
<el-input maxlength="100" placeholder="请输入奖品名称" size="mini" v-model="item.jpmc"
style="width: 88%" auto-complete="off" tabindex="4" type="text"></el-input>
</el-col>
<el-col :span="isShow==true?'6':'9'">
<el-input maxlength="100" placeholder="请输入金额" size="mini" v-model="item.money"
style="width: 88%" auto-complete="off" tabindex="4" type="number">
<template slot="append"></template>
</el-input>
</el-col>
</el-row>
<el-row style="margin: 20px 0px;" v-if="multipleSelection.length==0">
<el-divider content-position="center">您还没有选择获奖人员</el-divider>
</el-row>
</el-form>
</el-card>
<span slot="footer" class="dialog-footer">
<el-button @click="grDialogVisible = false">取 消</el-button>
<el-button type="warning" @click="active = '1'" v-if="active == '2'">上一步</el-button>
<el-button type="primary" @click="active = '2'" v-if="active == '1'">下一步</el-button>
<el-button type="primary" @click="grSave" v-if="active == '2'">保 存</el-button>
<el-button type="success" @click="grjxDo" v-if="active == '2'">提 交</el-button>
</span>
</el-dialog>
</div>
<script>
var vue = new Vue({
el: "#app",
mixins: [initTableMixins],
data: function () {
return {
activitys: [],
events: [],
pageForm: {//分页
pageNumber: 1,
pageSize: 10,
totalCount: 0,
searchKeyword: "",
hdlx: "",
hdxm: "",
year: new Date().getFullYear() + "",
},
tableData: [],//表格
queryHdlx: [],
queryHdxm: [],
/*团队获奖设置*/
tdDialogVisible: false,
tdTableData: [],
unitSel: [],
temp: [],
cyUser: [],
/*个人获奖设置*/
grDialogVisible: false,
grTableData: [],
grPageForm: {//分页
pageNumber: 1,
pageSize: 10,
totalCount: 0,
searchKeyword: "",
id: "",
unit: "",
},
unit: [],
multipleSelection: [],
active: "1",
formData: {},
/*查看*/
infoDialogVisible: false,
activeName: '1',
viewData: [],
bmTableData: [],
bmfs: "",
hdms: "",
hjTableData: [],
gzryListTableData: [],
jplx: "",
isShow: true,
jpmc: "",
money: "",
isshow: true,
xqactive: "1",
tableColumns: [
{prop: 'name', label: '活动名称'},
{prop: 'address', label: '活动地点'},
{prop: 'allName', label: '活动项目'},
{prop: 'gameStyle', label: '活动类型'},
{prop: 'startTime', label: '活动日期'},
{prop: 'state', label: '活动状态'},
{prop: 'applyNum', label: '已报名人数'},
]
}
},
components: {
'guava': httpVueLoader('/components/plugins/Guava.vue'),
'info': httpVueLoader('/components/activity/school/Info.vue'),
},
methods: {
pageData: function () {
var self = this;
sublime.showLoadingbar();//显示loading
$.post(base + "/platform/activity/school/grades/data", self.pageForm, function (data) {
sublime.closeLoadingbar();//关闭loading
if (data.code == 0) {
self.tableData = data.data.hds.list;
self.pageForm.totalCount = data.data.hds.totalCount;
self.queryHdlx = data.data.hdlx;
self.unit = data.data.unit;
}
}, "json");
},
openView(data) {
this.$refs.info.getInfo(data.row.id)
this.$refs.guava.view()
},
/*分页*/
pageSizeChange: function (val) {
this.pageForm.pageSize = val;
this.pageData();
},
pageNumberChange: function (val) {
this.pageForm.pageNumber = val;
this.pageData();
},
grpageSizeChange: function (val) {
this.grPageForm.pageSize = val;
this.flag();
},
grpageNumberChange: function (val) {
this.grPageForm.pageNumber = val;
this.flag();
},
doSearch: function () {
this.pageForm.pageNumber = 1;
this.pageData();
},
doGrSearch() {
this.flag();
},
flag() {
$.post(base + "/platform/activity/school/grades/findGrUser", this.grPageForm, (data) => {
if (data.code == 0) {
this.grTableData = data.data.list;
this.grPageForm.totalCount = data.data.totalCount;
}
}, "json");
},
changeVal: function (obj) {
var self = this;
if (obj == "现金奖赏") {
self.isShow = false;
} else if (obj == "奖品") {
self.isShow = true;
}
},
openCj: function (scope) {
var self = this;
self.jplx = "";
self.tdTableData = [{
unitId: "",
mc: "",
jpmc: "",
money: "",
}];
self.temp = scope.row;
if (scope.row.awardsMode == 2) {
$.post(base + "/platform/activity/school/grades/findUnit", {id: scope.row.id}, function (data) {
if (data.code == 0) {
self.unitSel = data.data;
}
}, "json");
setTimeout(function () {
$.post(base + "/platform/activity/school/grades/findSaveCj", {
id: scope.row.id,
eventId: scope.row.eventId
}, function (data) {
if (data.code == 0) {
if (data.data.length == 0) {
self.tdTableData = [{
unitId: "",
mc: "",
jpmc: "",
money: "",
}];
} else {
self.jplx = data.data[0].jplx;
self.tdTableData = data.data;
}
}
}, "json");
}, 200);
self.tdDialogVisible = true;
} else if (scope.row.awardsMode == 1) {
self.grPageForm.id = scope.row.id;
self.grPageForm.eventId = scope.row.eventId;
self.active = "1";
$.post(base + "/platform/activity/school/grades/findGrUser", self.grPageForm, (data) => {
if (data.code == 0) {
self.grTableData = data.data.list;
self.grPageForm.totalCount = data.data.totalCount;
self.grDialogVisible = true;
}
}, "json");
setTimeout(function () {
$.post(base + "/platform/activity/school/grades/findGrCj", {
id: scope.row.id,
eventId: scope.row.eventId
}, function (data) {
if (data.code == 0) {
if (data.data.length > 0) {
self.jplx = data.data[0].jplx;
} else {
self.jplx = "";
}
for (var i = 0; i < data.data.length; i++) {
for (var d = 0; d < self.grTableData.length; d++) {
if (data.data[i].id == self.grTableData[d].id) {
self.grTableData[d].mc = data.data[i].mc;
self.grTableData[d].jpmc = data.data[i].jpmc;
self.grTableData[d].money = data.data[i].money;
/*self.grTableData[d]=data.data[i];*/
self.$refs.grTable.toggleRowSelection(self.grTableData[d], true);
}
}
}
}
}, "json");
}, 200);
}
},
addRow: function (scope) {
var self = this;
var list = {
unitId: "",
mc: "",
jpmc: self.jpmc,
money: self.money,
};
self.tdTableData.push(list);
},
delRow: function (scope) {
var self = this;
self.tdTableData.splice(scope.$index, 1);
},
popShow: function (scope) {
var self = this;
$.post(base + "/platform/activity/school/grades/findCyRy", {
unitid: scope.row.unitId,
activityId: self.temp.id
}, function (data) {
if (data.code == 0) {
self.cyUser = data.data;
}
}, "json");
},
tdSave: function () {
var self = this;
var array = new Array();
self.tdTableData.forEach(function (obj) {
array.push({
activityId: self.temp.id,
eventId: self.temp.eventId,
mc: obj.mc,
unitId: obj.unitId,
hdms: self.temp.awardsMode,
jpmc: obj.jpmc,
money: obj.money,
jplx: self.jplx,
});
});
$.post(base + "/platform/activity/school/grades/tdDo", {
data: JSON.stringify(array),
activityId: self.temp.id,
}, function (data) {
if (data.code == 0) {
self.$message({
message: data.msg,
type: 'success'
});
self.pageData();
self.tdDialogVisible = false;
}
}, "json");
},
tdDo: function () {
var self = this;
var array = new Array();
self.tdTableData.forEach(function (obj) {
array.push({
activityId: self.temp.id,
eventId: self.temp.eventId,
mc: obj.mc,
unitId: obj.unitId,
hdms: self.temp.awardsMode,
jpmc: obj.jpmc,
money: obj.money,
jplx: self.jplx,
});
});
if (self.jplx == "" || self.jplx == null) {
self.$message({
message: "请选择奖品类型!",
type: 'warning'
});
return;
}
if (self.jplx == "奖品") {
var flag = 0;
self.tdTableData.forEach(function (obj) {
if (obj.unitId == "" || obj.mc == "" || obj.jpmc == "" || obj.money == "") {
flag = 1;
return;
}
});
if (flag == 1) {
self.$message({
message: "请填写相应的信息!",
type: 'warning'
});
return;
}
}
if (self.jplx == "现金奖赏") {
var flag = 0;
self.tdTableData.forEach(function (obj) {
if (obj.unitId == "" || obj.mc == "" || obj.money == "") {
flag = 1;
return;
}
});
if (flag == 1) {
self.$message({
message: "请填写相应的信息!",
type: 'warning'
});
return;
}
}
self.$confirm("一旦提交不可修改,确定提交吗?", "温馨提示", {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
callback: async (a, b) => {
if ("confirm" == a) {
const resp = await $.post("/platform/activity/school/grades/tdDo", {
grades: JSON.stringify(array),
unitid: array.unitId,
eventId: eventId
})
if (resp.code===0){
self.pageData();
self.tdDialogVisible = false;
}
}
}
});
},
grSave: function () {
var self = this;
var array = new Array();
self.multipleSelection.forEach(function (obj) {
array.push({
activityId: self.temp.id,
userId: obj.id,
mc: obj.mc,
unitId: obj.unitId,
hdms: self.temp.awardsMode,
jpmc: obj.jpmc,
money: obj.money,
jplx: self.jplx,
});
});
$.post(base + "/platform/activity/school/grades/grjxDo", {
data: JSON.stringify(array),
}, function (data) {
if (data.code == 0) {
self.$message({
message: data.msg,
type: 'success'
});
self.pageData();
self.grDialogVisible = false;
}
}, "json");
},
grjxDo: function () {
var self = this;
if (self.multipleSelection.length == 0) {
self.$message({
message: "您还没有选择获奖人员!",
type: 'error'
});
return;
}
if (self.jplx == "" || self.jplx == null) {
self.$message({
message: "请选择奖品类型!",
type: 'warning'
});
return;
}
if (self.jplx == "奖品") {
var flag = 0;
self.multipleSelection.forEach(function (obj) {
if (obj.mc == "" || obj.jpmc == "" || obj.money == "") {
flag = 1;
return;
}
});
if (flag == 1) {
self.$message({
message: "请填写相应的信息!",
type: 'warning'
});
return;
}
}
if (self.jplx == "现金奖赏") {
var flag = 0;
self.multipleSelection.forEach(function (obj) {
if (obj.mc == "" || obj.money == "") {
flag = 1;
return;
}
});
if (flag == 1) {
self.$message({
message: "请填写相应的信息!",
type: 'warning'
});
return;
}
}
var array = new Array();
self.multipleSelection.forEach(function (obj) {
array.push({
activityId: self.temp.id,
userId: obj.userid,
mc: obj.mc,
unitId: obj.unitId,
hdms: self.temp.awardsMode,
jpmc: obj.jpmc,
money: obj.money,
jplx: self.jplx,
});
});
self.$confirm("一旦提交不可修改,确定提交吗?", "温馨提示", {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
callback: function (a, b) {
if ("confirm" == a) {
$.post(base + "/platform/activity/school/grades/grjxDo", {
grades: JSON.stringify(array),
}, function (data) {
if (data.code == 0) {
self.$message({
message: data.msg,
type: 'success'
});
self.pageData();
self.multipleSelection = [];
setTimeout(function () {
self.$refs.grTable.clearSelection();
}, 500)
self.grDialogVisible = false;
}
}, "json");
}
}
});
},
rowKey: function (row) {
var self = this;
return row.id;
},
changeFun: function (val) {
this.multipleSelection = val;
},
async getActivitys() {
const {data} = await $.get("/platform/activity/remind/getActivitys")
return data;
},
async getEvents() {
const resp = await $.post("/platform/activity/apply/getEvents", {activityId: this.pageForm.activityId})
this.events = resp
}
},
async created() {
this.pageData();
this.activitys = await this.getActivitys()
/*this.events = await activity.getEvents()*/
},
watch: {
"pageForm.hdlx": function (obj) {
var self = this;
if (obj != "" && obj != null && obj != "undefined") {
self.pageForm.hdxm = "";
$.post(base + "/platform/hd/xhdgl/xhdxxgl/findHdXm", {id: obj}, function (data) {
if (data.code == 0) {
self.queryHdxm = data.data;
self.pageForm.hdxm = data.data[0].id;
}
}, "json");
}
},
"jpmc": function (obj) {
var self = this;
self.tdTableData.forEach(function (value) {
value.jpmc = obj;
});
self.multipleSelection.forEach(function (value) {
value.jpmc = obj;
});
},
"money": function (obj) {
var self = this;
self.tdTableData.forEach(function (value) {
value.money = obj;
});
self.multipleSelection.forEach(function (value) {
value.money = obj;
});
}
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,392 @@
<!--#
layout("/layouts/platform.html"){
#-->
<style>
</style>
<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
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-input v-model="pageForm.name" placeholder="请输入活动名称" clearable></el-input>-->
<el-select v-model="pageForm.activityId" placeholder="请选择活动名称"
filterable clearable
style="width: 100%">
<el-option
v-for="item in activities"
: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.gameStyle" placeholder="请选择活动类型" filterable clearable
style="width: 100%">
<el-option
v-for="(k,v) in activity.school.gameStyle"
:key="v"
:label="k"
:value="v">
</el-option>
</el-select>-->
<el-select v-model="pageForm.activityLevel" placeholder="请选择活动级别"
clearable
style="width: 100%">
<el-option
v-for="item in activityTypeList"
:key="item.code"
:label="item.name"
:value="item.code">
</el-option>
</el-select>
</div>
</div>
<div class="search-query">
<el-button type="primary" icon="el-icon-search" @click="doSearch">搜索
</el-button>
</div>
<div class="search-item" style="width: 80vw">
<div class="search-item-label">一键查询</div>
<div class="search-item-option">
<el-radio-group v-model="pageForm.query" @change="doSearch">
<el-radio-button v-for="it in queryOptions" :label="it.key"
:key="it.key">
{{it.value}}
</el-radio-button>
</el-radio-group>
</div>
</div>
</div>
</el-card>
<el-card shadow="never" class="mt10">
<table-tool label="活动列表" :app="this">
<template #func>
<el-button type="primary" icon="el-icon-edit-outline" size="small"
@click="openAdd">
创建活动
</el-button>
</template>
</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
align="center"
header-align="center"
v-for="column in tableColumns"
:label="column.label"
:prop="column.prop"
show-overflow-tooltip
:sortable="column.sortable">
<template v-if="column.prop=='events'" scope="{row}">
<span>{{row.allName}}</span>
</template>
<template v-else-if="column.prop=='gameStyle'" scope="{row}">
<span>{{activity.school.gameStyle[row.gameStyle]}}</span>
</template>
<template v-else-if="column.prop=='foundUnit'" scope="{row}">
<span v-if="row.activityLevel===40001">校工会</span>
<span v-if="row.activityLevel===40002">{{row.unionname}}</span>
<span v-if="row.activityLevel===40003">{{row.clubName}}</span>
</template>
<template v-else-if="column.prop=='startTime'" scope="{row}">
{{moment(row.startTime).format('YYYY-MM-DD')}} -
{{moment(row.endTime).format('YYYY-MM-DD')}}
</template>
<template v-else-if="column.prop=='state'"
scope="{row:{close,applyStartTime,applyEndTime,startTime,endTime,isSave}}">
<div v-html="activity.school.getStatus(close,applyStartTime,applyEndTime,startTime,endTime,isSave)"></div>
</template>
</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:'sendMsg',row}">
通知
</el-dropdown-item>
<el-dropdown-item :command="{type:'openCode',row}">
二维码
</el-dropdown-item>
<el-dropdown-item :command="{type:'view',row}">
查看
</el-dropdown-item>
<!-- <el-dropdown-item :command="{type:'export',row}">
导出名单docx
</el-dropdown-item>-->
<el-dropdown-item :command="{type:'exportXlsx',row}">
导出名单
</el-dropdown-item>
<el-dropdown-item :command="{type:'edit',row}">
编辑
</el-dropdown-item>
<el-dropdown-item :command="{type:'delete',row}">
删除
</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="doSave">保 存</el-button>
<el-button type="primary" @click="doOperate">提 交</el-button>
</template>
<template #edit>
<add-activity :form="formData" ref="activity" @flip="flip" @flush="flush"
:is_club="is_club"
:is_union="is_union" :is_sysadmin="is_sysadmin" :is_a06="is_A06"
:is_h10="is_h10"
:unionid="'${@shiro.getPrincipalProperty('unit').getUnionid()}'"></add-activity>
</template>
<template #view>
<info ref="info"></info>
</template>
<send-msg ref="sendMsg" :url="url"></send-msg>
<open-qr-code ref="openQRCode" :url="url"></open-qr-code>
</guava>
</div>
<script>
let E = window.wangEditor
const editors = {}
var vue = new Vue({
el: '#app',
mixins: [initTableMixins],
data() {
return {
is_club: false,
is_union: false,
is_sysadmin: false,
is_A06: false,
is_h10: false,
activities: [],
unitOptions: [],
activityTypeList: [],
planList: [],
typeList: [],
types: [],
events: [],
submitDisabled: false,
formData: {
activityGroupId: null,
personType: 1,
activityLevel: 1,
gameStyle: 1,
applyWay: [2],
awardsMode: [],
combinationMethod: []
},
tableColumns: [
{prop: 'name', label: '活动名称'},
{prop: 'activityCode', label: '活动编号', sortable: true},
{prop: 'address', label: '活动地点'},
{prop: 'foundUnit', label: '创建单位', sortable: true},
{prop: 'activityLevelName', label: '活动级别', sortable: true},
{prop: 'startTime', label: '活动日期', sortable: true},
{prop: 'state', label: '活动状态', sortable: true},
{prop: 'applyNum', label: '已报名人数', sortable: true},
{prop: 'foundDate', label: '创建时间', sortable: true},
],
pageForm: {
query: 'zero'
},
queryOptions: [
{key: 'zero', value: '全部'},
{key: 'one', value: '正在报名'},
{key: 'two', value: '报名结束'},
{key: 'three', value: '活动进行中'},
{key: 'four', value: '活动已结束'},
],
url: '',
}
},
components: {
'guava': httpVueLoader('/components/plugins/Guava.vue'),
'info': httpVueLoader('/components/activity/school/Info.vue?v=' + new Date().getTime()),
'add-activity': httpVueLoader('/components/activity/school/AddActivity.vue?v=' + new Date().getTime()),
'send-msg': httpVueLoader('/components/plugins/SendMsgByGroupId.vue'),
'open-qr-code': httpVueLoader('/components/plugins/OpenQRCode.vue'),
},
methods: {
flip() {
this.pageData()
this.$refs.guava.index()
},
flush() {
this.pageData()
},
dropdownCommand(command) {
const {type, row} = command
if (type === 'view') {
this.openView(row)
} else if (type === 'edit') {
this.openEdit(row)
} else if (type === 'delete') {
this.doDelete(row)
} else if (type === 'export') {
window.open("/platform/activity/common/export?id=" + row.id)
} else if (type === 'exportXlsx') {
location.href = "/platform/activity/common/exportXlsx?id=" + row.id
} else if (type == 'sendMsg') {
this.sendMsg(row)
} else if (type === 'openCode') {
this.openCode(row)
}
},
openCode(row) {
this.$refs.openQRCode.openCode("/mobile/activity/Sports/list/activityList?id=" + row.id + "&signUpMethod=" + row.signUpMethod)
},
sendMsg(row) {
this.url = `<a href="` + (APP_DOMAIN + "/mobile/activity/Sports/list/activityList") + `">点击参与</a>`
this.$refs.sendMsg.openDialog(row.activityGroupId)
},
openView(row) {
const {id} = row
this.$refs.guava.view()
setTimeout(() => {
this.$refs.info.getInfo(id)
}, 500)
},
async openAdd() {
this.$refs.guava.edit()
setTimeout(() => {
this.$refs.activity.openAdd()
}, 500)
},
async openEdit(row) {
const {id, applyStartTime, isSave} = row
this.formData.id = id
const now = moment().valueOf()
this.$refs.guava.edit()
setTimeout(() => {
this.$refs.activity.openEdit(row, true)
}, 500)
},
doDelete(row) {
const {id} = row
this.$confirm('确定要删除该活动吗?', '提示', {type: 'warning'}).then(async () => {
this.$set(row, "loading", true)
const resp = await $.post(loc() + "/doDelete", {id});
this.$set(row, "loading", false)
if (resp.code === 0) {
this.pageData()
} else {
this.notifyWarning(resp.msg)
}
}
);
},
async getActivitys() {
const {data} = await $.get("/platform/activity/remind/getActivitys")
return data;
},
async getActivityTypeList(code) {
const {data} = await $.get("/platform/activity/basic/basic/settings/getActivityTwoLevelType", {code: code})
return data;
},
async doOperate() {
await this.$refs.activity.operate()
},
async doSave() {
this.$refs.activity.doSave()
},
pageData() {//加载分页数据
sublime.showLoadingbar();//显示loading
$.post(loc() + "/pageData", this.pageForm, (data) => {
sublime.closeLoadingbar();//关闭loading
if (data.code == 0) {
this.tableData = data.data.list;
this.pageForm.totalCount = data.data.totalCount;
} else {
this.$message({
message: data.msg,
type: 'error'
});
}
}, "json");
},
},
async created() {
if ("${@shiro.hasRole('club01')}" === "true") {
this.is_club = true
}
if ("${@shiro.hasRole('H04')}" === "true" || "${@shiro.hasRole('ghzl')}" === "true") {
this.is_union = true
}
if ("${@shiro.hasRole('sysadmin')}" === "true") {
this.is_sysadmin = true
}
if ("${@shiro.hasRole('A06')}" === "true") {
this.is_A06 = true
}
if ("${@shiro.hasRole('H10')}" === "true") {
this.is_h10 = true
}
this.pageData()
this.activities = await this.getActivitys()
this.unitOptions = await getUnits(null)
this.activityTypeList = await this.getActivityTypeList("40000")
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,385 @@
<!--#
layout("/layouts/platform.html"){
#-->
<style>
#content .w-e-toolbar, #content .w-e-text-container {
z-index: 1 !important;
}
</style>
<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">计划年份</div>
<div class="search-item-option">
<el-date-picker
style="width: 100%"
v-model="pageForm.year"
value-format="yyyy"
type="year"
placeholder="选择年">
</el-date-picker>
</div>
</div>
<div class="search-item">
<div class="search-item-label">计划名称</div>
<div class="search-item-option">
<el-input v-model="pageForm.name" placeholder="请输入计划名称" clearable></el-input>
</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%">
<el-option
v-for="item in eventList"
:key="item.id"
:label="item.allName"
: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="mt10">
<table-tool label="计划列表" :app="this">
<template #func>
<el-button type="primary" icon="el-icon-edit-outline" size="small"
@click="openAdd">
创建活动计划
</el-button>
</template>
</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
align="center"
header-align="center"
v-for="column in tableColumns"
:label="column.label"
:prop="column.prop"
show-overflow-tooltip
:sortable="column.sortable">
<template v-if="column.prop=='carryOut'" scope="{row}">
<span v-if="row.carryOut" class="text-success">已执行</span>
<span v-if="!row.carryOut" class="text-primary">未执行</span>
</template>
</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:'activity',row}" v-if="!row.carryOut">
创建活动
</el-dropdown-item>
<el-dropdown-item :command="{type:'view',row}">
查看
</el-dropdown-item>
<el-dropdown-item :command="{type:'edit',row}">
编辑
</el-dropdown-item>
<el-dropdown-item :command="{type:'delete',row}">
删除
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</template>
</el-table-column>
</el-table>
<!--#include("/layouts/pagination.html"){}#-->
</el-card>
</template>
<template #edit_func>
<template v-if="!flag">
<el-button type="primary" @click="operation">确 定</el-button>
</template>
<template v-if="flag">
<el-button type="primary" @click="doSave">保 存</el-button>
<el-button type="primary" @click="doActivity">确 定</el-button>
</template>
</template>
<template #edit>
<template v-if="!flag">
<vi-title title="填写计划信息"></vi-title>
<el-form :model="formData" ref="form" :rules="formRules" label-width="100px" label-position="left"
label-suffix="" style="padding: 0 2%">
<el-form-item prop="type" label="活动类型">
<el-radio-group v-model="formData.type">
<el-radio :label="1" border>校工会活动计划</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item prop="name" label="计划名称">
<el-input maxlength="50" placeholder="请填写计划名称" v-model="formData.name"
type="text"></el-input>
</el-form-item>
<el-form-item prop="time" label="计划时间">
<el-date-picker
v-model="formData.time"
type="date"
value-format="yyyy-MM-dd"
placeholder="选择日期"
style="width: 100%">
</el-date-picker>
</el-form-item>
<el-form-item prop="event" label="活动项目">
<el-select v-model="formData.event" placeholder="请选择活动项目" filterable multiple
style="width: 100%">
<el-option
v-for="item in eventList"
:key="item.id"
:label="item.allName"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item prop="content" label="计划内容" class="is-required">
<div id="content"></div>
</el-form-item>
<div style="float: right;margin: 20px 0">
<el-button type="primary" @click="operation">提 交</el-button>
</div>
</el-form>
</template>
<add-activity v-show="flag" :form="activityFormData" ref="activity" @flip="flip"></add-activity>
</template>
<template #view>
<plan-info ref="info"></plan-info>
</template>
</guava>
</div>
<script>
let E = window.wangEditor
const editors = {}
var vue = new Vue({
el: '#app',
mixins: [initTableMixins],
data() {
let validContent = (rule, value, callback) => {
if (!this.formData.content || !dd3s.html2txt(this.formData.content)) {
callback(new Error('请填写计划内容'));
} else {
callback();
}
};
return {
eventList: [],
flag: false,
formData: {
name: '',
time: '',
event: [],
content: ''
},
activityFormData: {
personType: 1,
activityLevel: 1,
gameStyle: 1,
applyWay: [2],
awardsMode: [],
combinationMethod: []
},
tableColumns: [
{prop: 'name', label: '计划名称'},
{prop: 'time', label: '计划时间'},
{prop: 'allName', label: '活动项目'},
{prop: 'carryOut', label: '计划状态'},
],
formRules: {
name: [{required: true, message: '必填', trigger: ['blur', 'change']}],
time: [{required: true, message: '必填', trigger: ['blur', 'change']}],
event: [{required: true, message: '必填', trigger: ['blur', 'change']}],
type: [{required: true, message: '必选', trigger: ['blur', 'change']}],
content: [{validator: validContent, trigger: ['blur', 'change']}]
},
}
},
components: {
'guava': httpVueLoader('/components/plugins/Guava.vue'),
'add-activity': httpVueLoader('/components/activity/school/AddActivity.vue'),
'plan-info': httpVueLoader('/components/activity/school/planInfo.vue?v=1.0.0'),
},
methods: {
flip() {
this.pageData()
this.$refs.guava.index()
},
dropdownCommand(command) {
const {type, row} = command
if (type === 'view') {
this.openView(row)
} else if (type === 'edit') {
this.openEdit(row)
} else if (type === 'delete') {
this.doDelete(row)
} else if (type === 'activity') {
this.openActivity(row)
}
},
openView(row) {
const {id} = row
this.$refs.info.getInfo(id)
this.$refs.guava.view()
},
openActivity(row) {
this.flag = true
this.activityFormData = {}
this.$refs.guava.edit()
this.$nextTick(() => {
this.$refs.activity.openAdd(row)
})
},
doSave() {
this.$refs.activity.doSave()
},
doActivity() {
this.formData.id ? this.$refs.activity.doEdit() : this.$refs.activity.doAdd()
},
async openEdit(row) {
this.flag = false
const cloneRow = clone(row)
cloneRow.event = JSON.parse(cloneRow.event)
this.formData = cloneRow
this.$refs.guava.edit()
this.$nextTick(() => {
this.initEditor()
})
},
async openAdd() {
this.formData = {
type: 1
}
this.flag = false
this.$refs.guava.edit()
this.$nextTick(() => {
this.initEditor()
if (this.$refs['form']) {
this.$refs['form'].resetFields()
}
this.formData = {
name: '',
time: '',
event: [],
content: ''
}
})
},
async operation() {
let url = this.formData.id ? "/doEdit" : "/doAdd"
this.$refs["form"].validate(async (valid) => {
if (valid) {
const loading = this.$loading({
lock: true,
text: '正在提交...',
spinner: 'el-icon-loading',
background: COVER_LAYER_COLOR
});
const resp = await $.post(loc() + url, {
id: this.formData.id,
name: this.formData.name,
time: this.formData.time,
content: this.formData.content,
event: JSON.stringify(this.formData.event)
})
loading.close()
if(resp.code===0){
this.pageData()
this.$refs.guava.index()
}else{
this.notifyWarning(resp.msg)
}
} else {
this.$notify.error({title: '错误', message: '存在未填写的的必填项'});
}
});
},
doDelete(row) {
const {id} = row
this.$confirm('确定要删除该计划吗?', '提示', {type: 'warning'}).then(async () => {
const resp = await $.post(loc() + "/doDelete", {id: id});
if(resp.code===0){
this.pageData()
}else{
this.notifyWarning(resp.msg)
}
})
},
initActivityEditor() {
let keys = ['athleteQualification', 'registrationMethod', 'competitionMethod', 'rewardMethod', 'precautions', 'eventNotification']
keys.forEach(key => {
$("#" + key).html("")
editors[key] = new E('#' + key)
editors[key].config.onchange = (html) => {
this.formData[key] = html
}
editors[key].create()
if (this.formData[key]) {
editors[key].txt.html(this.formData[key])
}
})
},
initEditor() {
let keys = ['content']
keys.forEach(key => {
$("#" + key).html("")
editors[key] = new E('#' + key)
editors[key].config.onchange = (html) => {
this.formData[key] = html
}
editors[key].create()
if (this.formData[key]) {
editors[key].txt.html(this.formData[key])
}
})
}
},
async created() {
this.pageData()
this.eventList = await activity.getEvents()
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,402 @@
<!--#
layout("/layouts/platform.html"){
#-->
<div id="app" class="platform" v-cloak>
<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
v-model="pageForm.year"
@change="getActivitys"
type="year"
value-format="yyyy" style="width: 100%"
placeholder="选择年" :clearable="false">
</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="false"
style="width: 100%" @change="actChange(pageForm.activityId)">
<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.unionId" placeholder="请选择工会" filterable :clearable="false"
style="width: 100%" @change="unionChange(pageForm.unionId)">
<el-option
v-for="item in unionList"
:key="item.id"
:label="item.unionname"
:value="item.id">
</el-option>
</el-select>
</div>
</div>
<div class="search-query">
<el-button type="primary" icon="el-icon-s-order" @click="summary">汇总表</el-button>
</div>
<div class="pull-right offscreen-right" style="margin-left: auto ">
<el-button type="primary" icon="el-icon-printer" @click="print">打 印</el-button>
</div>
</div>
</el-card>
<div id=print>
<!-- <el-card shadow="never" class="mt10">
<table class="table table-bordered">
<tr>
<td colspan="11" class="text-center">
<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 style="vertical-align:middle" v-if="0==index"
:rowspan="Object.keys(tableDataUnionPrize['团体项目']).length">团体项目
</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 style="vertical-align:middle" v-if="0==index"
:rowspan="Object.keys(tableDataUnionPrize['男子项目']).length">男子项目
</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 style="vertical-align:middle" dd v-if="0==index"
:rowspan="Object.keys(tableDataUnionPrize['女子项目']).length">女子项目
</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>
&lt;!&ndash; <tr v-for="(o,k,index) in tableDataUnionPrize['其他']">&ndash;&gt;
&lt;!&ndash; <td v-if="0==index" :rowspan="Object.keys(tableDataUnionPrize['其他']).length">其他</td>&ndash;&gt;
&lt;!&ndash; <td>{{k}}</td>&ndash;&gt;
&lt;!&ndash; <td v-for="i in 8">&ndash;&gt;
&lt;!&ndash; <span v-if="o.filter(f=>f.ranking==i && f.numberOfPeople!=null) && o.filter(f=>f.ranking==i && f.numberOfPeople!=null).length>0">&ndash;&gt;
&lt;!&ndash; {{o.filter(f=>f.ranking==i && f.numberOfPeople!=null).map(g=>g.numberOfPeople).reduce((a,b)=>a+b)}}&ndash;&gt;
&lt;!&ndash; </span>&ndash;&gt;
&lt;!&ndash; </td>&ndash;&gt;
&lt;!&ndash; <td></td>&ndash;&gt;
&lt;!&ndash; </tr>&ndash;&gt;
</table>
</el-card>-->
<el-card class="mt10" shadow="never" v-if="pageForm.activityId!=null">
<vi-title :title="unionName+'奖品名单'"></vi-title>
<template>
<table class="table table-bordered" v-if="isSummary==1">
<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"
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"
:sortable="column.sortable"
align="center"
header-align="center"
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>
</el-card>
</div>
</template>
</div>
<script>
var vue = new Vue({
el: '#app',
mixins: [initTableMixins],
data() {
return {
isSummary: 1,
activityList: [],
unionList: [],
unionName: "",
pageForm: {
activityId: "",
unionId: "",
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: {}
}
},
components: {},
methods: {
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() {
if (this.activityList.length === 0) {
return
}
this.$set(this.pageForm, "unionId", null)
this.isSummary = 2
this.tableData = []
// this.pageForm.activityId = this.activityList[1].id
const {data} = await $.get(loc() + "/summary", this.pageForm)
this.$set(this, "tableData", data.score)
this.unionName = "汇总"
},
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.unionname
this.getPrizes()
},
async getActivitys() {
this.tableData = []
const {data} = await $.get("/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() {
const {data} = await $.get(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
// if (this.pageForm.activityId == null) {
// this.tableDataUnionPrize = data
// } else {
// data.eventList.map(v => {
// v.sss = []
// data.score.map(x => {
// if (v.label === x.allname) {
// v.sss.push(x)
// }
// })
// })
// this.tableData = data.eventList
// }
},
},
async created() {
await this.getActivitys()
this.unionList = await getUnions(null)
if (this.unionList.length > 0) {
this.pageForm.unionId = this.unionList[0].id
this.unionName = this.unionList[0].unionname
}
await this.getPrizes()
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,959 @@
<!--#
layout("/layouts/platform.html"){
#-->
<style>
.mb10 {
margin-bottom: 10px;
}
.d .el-card__header {
padding: 10px 20px;
}
.d .el-card__body {
padding: 0;
}
.search .search-item {
width: calc((100% - 0px) / 4);
}
.search .search-item-label {
/*min-width: 70px;*/
}
.el-row-title {
margin-bottom: 20px;
font-weight: 600;
}
</style>
<div class="platform" id="app" v-cloak>
<guava ref="guava">
<template>
<el-card shadow="never">
<div class="search">
<div class="search-item">
<div class="search-item-label">活动年份</div>
<el-date-picker :clearable="false" @change="yearChange()" placeholder="选择年份"
style="width: 100%" type="year" v-model="pageForm.year"
value-format="yyyy"></el-date-picker>
</div>
<div class="search-item">
<div class="search-item-label">活动级别</div>
<div class="search-item-option">
<el-select @change="changeLevel" clearable
placeholder="请选择活动级别"
style="width: 100%" v-model="pageForm.activityLevel">
<el-option
:key="item.code"
:label="item.name"
:value="item.code"
v-for="item in activityTypeList">
</el-option>
</el-select>
</div>
</div>
<div class="search-item">
<div class="search-item-label">活动名称</div>
<el-select @change="getData()" filterable
placeholder="请选择活动"
style="width: 100%;font-weight:bold;"
v-model="pageForm.id">
<el-option :label="item.name" :value="item.id"
v-for="item in activities"></el-option>
</el-select>
</div>
<div class="search-item">
<div class="search-item-label" v-if="pageForm.activityLevel!=='40003'">
院级工会
</div>
<div class="search-item-label" v-if="pageForm.activityLevel==='40003'">
社团名称
</div>
<div class="search-item-option">
<el-select @change="changeVVV"
@clear="changeVVV"
clearable
filterable placeholder="院级工会筛选"
style="width: 100%;font-weight:bold;" v-model="pageForm.unionid">
<el-option
:key="item.id"
:label="item.unionname"
:value="item.id"
v-for="item in unions">
</el-option>
</el-select>
</div>
</div>
<!--#if(!@shiro.hasRole('H04') || !@shiro.hasRole('ghzl')){#-->
<div class="search-item">
<div class="search-item-label">报名状态</div>
<div class="search-item-option">
<el-radio-group size="medium" v-model="pageForm.applyed">
<el-radio border label="1" style="background-color: white">未报名
</el-radio>
<el-radio border label="2" style="background-color: white">已报名
</el-radio>
</el-radio-group>
</div>
</div>
<!--#}#-->
<!-- <div class="search-item">
<div class="search-item-label">导入导出</div>
<div class="search-item-option">
<el-button type="primary" plain @click="openImport">导入报名人员</el-button>
<el-button @click="doExportByEnroll" plain
type="primary">导出报名信息
</el-button>
&lt;!&ndash; <el-button @click="doExportByEnroll" icon="el-icon-printer" plain size="small"
style="position: absolute;right: 0px" type="primary">导出报名信息
</el-button>&ndash;&gt;
</div>
</div>-->
</div>
</el-card>
<el-card class="mt10 d" shadow="never" style="padding: 20px">
<vi-title2 title="报名列表">
<template #func>
<!--#if(@shiro.hasRole('sysadmin')){#-->
<el-button @click="exportUnionNum" size="small" type="primary">导出分工会报名人数
</el-button>
<el-button @click="exportUnionUser" size="small" type="primary">导出报名人员名单
</el-button>
<!--#}#-->
<!--#if(@shiro.hasRole('ghzl')){#-->
<el-button @click="exportUnionUser" size="small" type="primary">导出报名人员名单
</el-button>
<!--#}#-->
</template>
</vi-title2>
<el-row :gutter="20" class="el-row-title" style="margin-left: 0;margin-right: 0;">
<el-col :span="2">序号</el-col>
<el-col :span="4">年度</el-col>
<el-col :span="6">
<span v-if="pageForm.activityLevel!=='40003'">分工会名称</span>
<span v-if="pageForm.activityLevel==='40003'">社团名称</span>
</el-col>
<el-col :span="6">活动名称</el-col>
<el-col :span="4">人数</el-col>
<el-col :span="2">
<!-- <el-button style="position: absolute;right: 0px" plain size="small" icon="el-icon-printer"
type="primary" @click="doExport">导 出
</el-button>-->
</el-col>
</el-row>
<el-table :data="[]" size="mini" v-if="noneData||tabLoading"
v-loading="tabLoading"></el-table>
<el-card class="box-card mb10" shadow="hover" v-else v-for="app,tabIdx in apply"
v-loading="tabLoading">
<div class="clearfix" slot="header">
<el-row :gutter="20">
<el-col :span="2">{{tabIdx + 1}}</el-col>
<el-col :span="4">{{pageForm.year}}</el-col>
<el-col :span="6">
{{isDisPlayCode?''+app.unioncode+'':null}}{{app.unionname}}
</el-col>
<el-col :span="6">{{pageForm.activityName || '暂无'}}</el-col>
<el-col :span="2">{{app.num |money}} 人</el-col>
<el-col :span="4">
<el-button @click="$set(app,'show',!app.show)"
style="float: right; padding: 3px 5px"
type="text">{{app.show?'折叠':'展开'}}
</el-button>
</el-col>
</el-row>
</div>
<transition name="el-fade-in-linear">
<div class="text item transition-box" style="padding: 20px 20px"
v-show="app.show">
<el-timeline v-if="pageForm.applyType===1||pageForm.applyType===3">
<!-- <el-timeline-item timestamp="领队信息" placement="top" v-if="app.leader.username!=null">
<el-card shadow="never">
<el-form label-suffix="" label-position="right" label-width="80px"
style="margin-top: 30px">
<el-row gutter="20">
<el-col :span="4">
<el-form-item label="姓名">
{{ app.leader.username | str }}
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="性别">
{{ app.leader.sex | str }}
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="工号">
{{ app.leader.loginname | str }}
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="电话">
{{ app.leader.mobile | str }}
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="单位">
{{ app.leader.unitname | str }}
</el-form-item>
</el-col>
</el-row>
</el-form>
</el-card>
</el-timeline-item>
<el-timeline-item timestamp="教练信息" placement="top" v-if="app.coach.username!=null">
<el-card shadow="never">
<el-form label-suffix="" label-position="right" label-width="80px"
style="margin-top: 30px">
<el-row gutter="20">
<el-col :span="4">
<el-form-item label="姓名">
{{ app.coach.username | str }}
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="性别">
{{ app.coach.sex | str }}
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="工号">
{{ app.coach.loginname | str }}
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="电话">
{{ app.coach.mobile | str }}
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="单位">
{{ app.coach.unitname | str }}
</el-form-item>
</el-col>
</el-row>
</el-form>
</el-card>
</el-timeline-item>-->
<el-timeline-item placement="top" timestamp="教职工信息">
<el-table :data="app.apply2" :key="tableKey" border size="mini"
stripe>
<el-table-column
align="center" header-align="center" label="序号"
sortable type="index"
width="100">
</el-table-column>
<el-table-column
:label="column.label"
:prop="column.prop"
:sortable="column.sortable"
:width="column.width"
align="center"
header-align="center"
v-for="column in tableColumns">
<template scope="{row}" v-if="column.prop=='team'">
<span v-if="row.team">{{ row.team }}</span>
<span v-if="!row.team">暂无</span>
</template>
<template scope="{row:{projectType}}"
v-else-if="column.prop=='projectType'">
{{projectType==1?'单项':'团体'}}
</template>
<!-- <template scope="{row:{divisionLevelLeadership}}"
v-else-if="column.prop=='divisionLevelLeadership'">
<span v-if="divisionLevelLeadership" class="text-primary">是</span>
<span v-else class="text-danger">否</span>
</template>-->
<template scope="{row}"
v-else-if="column.prop=='identity'">
<el-tag effect="light"
v-if="row.identity.includes(1)">运动员
</el-tag>
<el-tag effect="light"
type="success" v-if="row.identity.includes(2)">教练
</el-tag>
<el-tag effect="light"
type="warning" v-if="row.identity.includes(3)">领队
</el-tag>
<el-tag effect="light"
type="warning"
v-if="row.identity.includes(4)">处级领导
</el-tag>
<el-tag effect="light"
type="warning" v-if="row.identity.includes(5)">替补
</el-tag>
</template>
</el-table-column>
</el-table>
</el-timeline-item>
</el-timeline>
<el-timeline v-else-if="pageForm.applyType===2">
<el-timeline-item placement="top" timestamp="领队信息"
v-if="app.leader.username!=null">
<el-card shadow="never">
<el-form label-position="right" label-suffix=""
label-width="80px"
style="margin-top: 30px">
<el-row gutter="20">
<el-col :span="4">
<el-form-item label="姓名">
{{ app.leader.username | str }}
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="性别">
{{ app.leader.sex | str }}
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="工号">
{{ app.leader.loginname | str }}
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="电话">
{{ app.leader.mobile | str }}
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="单位">
{{ app.leader.unitname | str }}
</el-form-item>
</el-col>
</el-row>
</el-form>
</el-card>
</el-timeline-item>
<el-timeline-item placement="top" timestamp="教练信息"
v-if="app.coach.username!=null">
<el-card shadow="never">
<el-form label-position="right" label-suffix=""
label-width="80px"
style="margin-top: 30px">
<el-row gutter="20">
<el-col :span="4">
<el-form-item label="姓名">
{{ app.coach.username | str }}
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="性别">
{{ app.coach.sex | str }}
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="工号">
{{ app.coach.loginname | str }}
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="电话">
{{ app.coach.mobile | str }}
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="单位">
{{ app.coach.unitname | str }}
</el-form-item>
</el-col>
</el-row>
</el-form>
</el-card>
</el-timeline-item>
<el-timeline-item placement="top" timestamp="团长信息"
v-if="app.head.username!=null">
<el-card shadow="never">
<el-form label-position="right" label-suffix=""
label-width="80px"
style="margin-top: 30px">
<el-row gutter="20">
<el-col :span="4">
<el-form-item label="姓名">
{{ app.head.username | str }}
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="性别">
{{ app.head.sex | str }}
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="工号">
{{ app.head.loginname | str }}
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="电话">
{{ app.head.mobile | str }}
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="单位">
{{ app.head.unitname | str }}
</el-form-item>
</el-col>
</el-row>
</el-form>
</el-card>
</el-timeline-item>
<el-timeline-item placement="top" timestamp="工作人员信息"
v-if="app.staff.username!=null">
<el-card shadow="never">
<el-form label-position="right" label-suffix=""
label-width="80px"
style="margin-top: 30px">
<el-row gutter="20">
<el-col :span="4">
<el-form-item label="姓名">
{{ app.staff.username | str }}
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="性别">
{{ app.staff.sex | str }}
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="工号">
{{ app.staff.loginname | str }}
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="电话">
{{ app.staff.mobile | str }}
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="单位">
{{ app.staff.unitname | str }}
</el-form-item>
</el-col>
</el-row>
</el-form>
</el-card>
</el-timeline-item>
<el-timeline-item placement="top" timestamp="教职工信息">
<el-row gutter="40">
<el-col :span="4">
<div class="search-item">
<div class="search-item-option">
<el-select @change="doEvent(app)"
clearable
filterable placeholder="请选择活动项目"
style="width: 100%"
v-model="app.eventId">
<el-option
:key="item.id"
:label="item.allName"
:value="item.eventId"
v-for="item in events">
</el-option>
</el-select>
</div>
</div>
</el-col>
<el-col :span="4">
<div class="search-item">
<div class="search-item-option">
<el-select @change="doEventType(app)"
allow-create
clearable default-first-option
filterable placeholder="请选择项目类型"
style="width: 100%"
v-model="app.projectType">
<el-option
:key="item.id"
:label="item.name"
:value="item.id"
v-for="item in projectTypeList">
</el-option>
</el-select>
</div>
</div>
</el-col>
</el-row>
<el-table :data="app.apply2" :key="tableKey" border class="mt10"
size="mini"
stripe>
<el-table-column
align="center" header-align="center" label="序号"
sortable type="index"
width="100">
</el-table-column>
<el-table-column
:label="column.label"
:prop="column.prop"
:sortable="column.sortable"
:width="column.width"
align="center"
header-align="center"
show-overflow-tooltip
v-for="column in tableColumns">
<template scope="{row}" v-if="column.prop=='team'">
<span v-if="row.team">{{ row.team }}</span>
<span v-if="!row.team">暂无</span>
</template>
<!-- <template scope="{row:{divisionLevelLeadership}}"
v-else-if="column.prop=='divisionLevelLeadership'">
<span v-if="divisionLevelLeadership" class="text-primary">是</span>
<span v-else class="text-danger">否</span>
</template>-->
<template scope="{row:{projectType}}"
v-else-if="column.prop=='projectType'">
{{projectType==1?'单项':'团体'}}
</template>
<template scope="{row}"
v-else-if="column.prop=='identity'">
<el-tag effect="light"
v-if="row.identity.includes(1)">运动员
</el-tag>
<el-tag effect="light"
type="success" v-if="row.identity.includes(2)">教练
</el-tag>
<el-tag effect="light"
type="warning" v-if="row.identity.includes(3)">领队
</el-tag>
<el-tag effect="light"
type="warning"
v-if="row.identity.includes(4)">处级领导
</el-tag>
<el-tag effect="light"
type="warning" v-if="row.identity.includes(5)">替补
</el-tag>
</template>
</el-table-column>
</el-table>
</el-timeline-item>
</el-timeline>
</div>
</transition>
</el-card>
</el-card>
</template>
</guava>
<el-dialog
:close-on-click-modal="false"
:visible.sync="importVisible"
title="导入"
width="50%"
>
<el-timeline>
<el-timeline-item placement="top" timestamp="下载模板">
<el-card>
<el-button
@click="location.href='/platform/basics/downloadTemplate?filePath=activity/ActivityApplyUser.xlsx&fileName=导入模板.xlsx'"
icon="el-icon-download" size="medium"
style="width: 200px"
type="">下载模板
</el-button>
</el-card>
</el-timeline-item>
<el-timeline-item placement="top" timestamp="上传文件">
<el-card>
<el-upload
:auto-upload="false"
:file-list="importData.fileList"
:limit="1"
:on-change="(file, fileList) => {
importData.fileList = fileHandleChange(file, fileList,{type:['xls','xlsx']})
}"
:on-remove="(file, fileList) => {
importData.fileList = fileHandleRemove(file, fileList)
}"
name="file"
ref="upload">
<el-button icon="el-icon-upload" size="medium" style="width: 200px" type="">
选择文件
</el-button>
</el-upload>
</el-card>
</el-timeline-item>
</el-timeline>
<span class="dialog-footer" slot="footer">
<el-button :disabled="importLoading" @click="importVisible = false">取 消</el-button>
<el-button :loading="importLoading" @click="doImport" type="primary">确定</el-button>
</span>
</el-dialog>
</div>
<script>
var vue = new Vue({
el: '#app',
mixins: [initTableMixins],
data() {
return {
importData: {},
importLoading: false,
importVisible: false,
events: [],
activityTypeList: [],
noneData: true,
tabLoading: true,
activities: [],
apply: [],
apply2: [],
unions: [],
rootData: [],
tableKey: '',
pageForm: {
id: '',
unionid: '',
year: new Date().getFullYear() + '',
},
tableColumns: [
{prop: 'allName', label: '项目名称', sortable: true, width: '200px'},
// {prop: 'team', label: '所属队', sortable: true},
{prop: 'username', label: '姓名'},
{prop: 'loginname', label: '教工号'},
{prop: 'sex', label: '性别'},
/* {prop: 'divisionLevelLeadership', label: '是否处级领导', sortable: true},*/
{prop: 'unitname', label: '单位', sortable: true},
{prop: 'mobile', label: '电话'},
// {prop: 'projectType', label: '项目类型', sortable: true},
// {prop: 'identity', label: '身份', sortable: true, width: '300px'},
// {prop: 'notes', label: '备注'},
{prop: 'campus', label: '参加地点'},
],
projectTypeList: [
{id: '1', name: '单项'},
{id: '2', name: '团体'},
],
}
},
components: {
'guava': httpVueLoader('/components/plugins/Guava.vue'),
'info': httpVueLoader('/components/activity/school/Info.vue'),
},
filters: {
money(val) {
return val ? val : 0
},
str(val) {
return val ? val : '暂无'
}
},
watch: {
'pageForm.applyed': (val) => {
vue.changeVVV(val)
}
},
methods: {
exportUnionNum() {
window.open(loc() + '/exportUnionNum?activityId=' + this.pageForm.id + '&activityLevel=' + this.pageForm.activityLevel)
},
exportUnionUser() {
window.open("/platform/activity/common/exportXlsx?id=" + this.pageForm.id + '&unionId=' + this.pageForm.unionid)
// window.open("/platform/activity/common/exportXlsx2?id=" + this.pageForm.id+'&unionId='+this.pageForm.unionid)
},
doImport() {
if (!this.importData.fileList.length) {
this.notifyWarning("请选择文件!")
return
}
const data = new FormData();
this.importData.fileList.forEach((val) => {
data.append("file", val.raw, val.raw.name);
data.append("activityId", this.pageForm.id);
});
this.importLoading = true
$.ajax({
url: loc() + "/importUserActivitys",
type: "post",
data: data,
processData: false,
contentType: false,
success: (data) => {
if (!data.code) {
this.notifySuccess(data.msg);
this.getData();
this.importVisible = false
} else {
this.notifyWarning(data.msg)
}
this.importLoading = false
},
error: (data) => {
this.notifyWarning(data.msg)
this.importLoading = false
}
});
},
openImport() {
this.importData = {
fileList: []
}
if (!this.pageForm.id) {
this.notifyWarning("请先选择活动名称")
return
}
this.importVisible = true;
},
doExportByEnroll() {
const {id, unionid} = this.pageForm
if (unionid === "") {
this.$notify.warning({title: '警告', message: "请选择要导出的工会"});
return
}
window.open(loc() + "/doExportByEnroll?id=" + id + "&unionId=" + unionid)
},
async changeLevel() {
await this.getNearActivity()
},
doExport() {
const {id, unionid} = this.pageForm
location.href = "/platform/activity/common/exportXlsx?id=" + id
},
async yearChange() {
this.pageForm.id = null
await this.getNearActivity()
},
changeVVV() {
if (this.pageForm.unionid) {
this.apply = this.rootData.filter(v => {
return v.id === this.pageForm.unionid
})
} else {
this.apply = JSON.parse(JSON.stringify(this.rootData))
}
if (this.pageForm.applyed === '1') {
this.apply = this.apply.filter(v => {
return v.num === 0
})
} else if (this.pageForm.applyed === '2') {
this.apply = this.apply.filter(v => {
return v.num > 0
})
}
this.tableKey = new Date().getTime()
},
async getNearActivity() {
const resp = await $.get(loc() + "/getNearActivity", {
year: this.pageForm.year,
activityLevel: this.pageForm.activityLevel
})
if (resp.code === 0) {
this.activities = resp.data
if (resp.data.length) {
this.pageForm.id = resp.data[0].id
this.getData()
} else {
this.pageForm.unionid = ""
this.unionis = []
this.pageForm.id = ""
this.noneData = true
this.tabLoading = false
}
} else {
this.notifyWarning(resp.msg)
}
},
async changeActivit() {
const resp = await $.post("/platform/activity/apply/getEvents", {activityId: this.pageForm.id})
this.events = resp
},
doEventType(app) {
const {apply, projectType} = app
if (!app.projectType) {
this.$set(app, "apply2", apply)
} else {
const arr = apply.filter(i => {
return i.projectType == projectType
})
this.$set(app, "apply2", arr)
}
},
doEvent(app) {
const {apply, eventId} = app
if (!app.eventId) {
this.$set(app, "apply2", apply)
} else {
const arr = apply.filter(i => {
return !i.unionLeader && !i.unionCoach && i.evid == eventId
})
this.$set(app, "apply2", arr)
}
},
async getData() {
this.noneData = true
this.tabLoading = true
await this.changeActivit()
const activity = this.activities.filter(v => {
return v.id === this.pageForm.id
})
this.pageForm.activityName = activity.length > 0 ? activity[0].name : null
this.pageForm.applyType = activity[0].applyType
const resp = await $.get(loc() + "/getData", this.pageForm)
this.tabLoading = false
if (resp.code === 0) {
const v = resp.data
if (v.length) {
/* if (activity[0].applyType == 2) {*/
v.forEach(x => {
const leaders = x.apply.filter(i => {
return i.unionLeader
})
x.leader = {}
if (leaders.length) {
x.leader = leaders[0]
}
const coachs = x.apply.filter(i => {
return i.unionCoach
})
x.coach = {}
if (coachs.length) {
x.coach = coachs[0]
}
const heads = x.apply.filter(i => {
return i.unionHead
})
x.head = {}
if (heads.length) {
x.head = heads[0]
}
const staffs = x.apply.filter(i => {
return i.unionStaff
})
x.staff = {}
if (staffs.length) {
x.staff = staffs[0]
}
x.apply = x.apply.filter(i => {
return !i.unionLeader && !i.unionCoach && !i.unionHead && !i.unionStaff
})
})
/*}*//* else {
v.forEach(x => {
const leaders = x.apply.filter(i => {
return i.identity.includes(3)
})
x.leader = {}
if (leaders.length) {
x.leader = leaders[0]
}
const coachs = x.apply.filter(i => {
return i.identity.includes(2)
})
x.coach = {}
if (coachs.length) {
x.coach = coachs[0]
}
x.apply = x.apply.filter(i => {
return i.identity.includes(1)
})
})
}*/
v.sort((a, b) => {
return b.num - a.num
})
this.unions = v.map(v => {
return {id: v.id, unionname: v.unionname}
})
if (this.unions.length == 1) {
this.pageForm.unionid = this.unions[0].id
}
this.rootData = JSON.parse(JSON.stringify(v))
this.rootData.forEach(x => {
x.apply2 = clone(x.apply)
})
this.noneData = false
} else {
this.unions = []
this.pageForm.unionid = ""
this.noneData = true
}
if (this.pageForm.activityLevel !== '40001' && this.rootData && this.rootData.length > 0) {
this.$set(this.rootData[0], "show", true)
}
this.apply = this.rootData
this.tableKey = new Date().getTime()
} else {
this.notifyWarning(resp.msg)
this.noneData = true
}
},
async getActivityTypeList(code) {
const {data} = await $.get("/platform/activity/basic/basic/settings/getActivityTwoLevelType", {code: code})
return data;
},
},
async created() {
await this.changeActivit()
this.activityTypeList = await this.getActivityTypeList("40000")
this.$set(this.pageForm, "activityLevel", this.activityTypeList[0].code)
await this.getNearActivity()
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,318 @@
<!--#
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">活动名称</div>
<div class="search-item-option">
<!-- <el-input v-model="pageForm.name" placeholder="请输入活动名称" clearable></el-input>-->
<el-select v-model="pageForm.activityId" placeholder="请选择活动项目" filterable clearable
style="width: 100%">
<el-option
v-for="item in activitys"
: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%">
<el-option
v-for="item in events"
:key="item.id"
:label="item.allname"
:value="item.id">
</el-option>
</el-select>
</div>
</div>-->
<div class="search-query">
<el-button type="primary" icon="el-icon-search" @click="doSearch">搜索</el-button>
</div>
</div>
</el-card>
<el-card shadow="never" class="mt10">
<table-tool label="活动信息" :app="this"></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
align="center"
header-align="center"
v-for="column in tableColumns"
:label="column.label"
:prop="column.prop"
:sortable="column.sortable">
<template v-if="column.prop=='events'" scope="{row}">
<span>{{row.allName}}</span>
</template>
<template v-else-if="column.prop=='gameStyle'" scope="{row}">
<span>{{activity.school.gameStyle[row.gameStyle]}}</span>
</template>
<template v-else-if="column.prop=='startTime'" scope="{row}">
{{moment(row.startTime).format('YYYY-MM-DD')}} -
{{moment(row.endTime).format('YYYY-MM-DD')}}
</template>
<template v-else-if="column.prop=='state'"
scope="{row:{close,applyStartTime,applyEndTime,startTime,endTime}}">
<div v-html="activity.school.getStatus(close,applyStartTime,applyEndTime,startTime,endTime)"></div>
</template>
</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
v-if="moment(row.applyEndTime).valueOf() >= moment().valueOf() && moment().valueOf() >= moment(row.applyStartTime).valueOf()"
:command="{type:'remind',row}">
发送提醒
</el-dropdown-item>
<el-dropdown-item :command="{type:'view',row}">
查看
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</template>
</el-table-column>
</el-table>
<!--#include("/layouts/pagination.html"){}#-->
</el-card>
</template>
<template #edit>
<vi-title title="发送提醒"></vi-title>
<el-divider content-position="right">
<el-button @click="sendAllRemind" type="primary" size="mini"><i class="el-icon-position"></i> 一键发送提醒
</el-button>
</el-divider>
<el-table :data="unionData" style="width: 100%;margin-bottom: 20px" row-key="id" v-loading="tableLoading"
class="vi-table">
<el-table-column align="center" header-align="center" type="index" :index="indexMethod" label="序号"
width="80px"></el-table-column>
<el-table-column type="expand" class="info">
<template slot-scope="{row}">
<el-card class="box-card">
<el-table :data="row.users" style="width: 100%;margin-bottom: 20px" row-key="id" border
stripe :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
align="center"
header-align="center"
v-for="column in applyColumns"
:label="column.label"
:prop="column.prop"
:sortable="column.sortable">
<template scope="{row}" v-if="column.prop=='divisionLevelLeadership'">
<span v-if="row.divisionLevelLeadership==true" class="text-primary"></span>
<span v-else class="text-danger"></span>
</template>
<template scope="{row:{identity}}" v-else-if="column.prop=='identity'">
<el-tag v-if="identity==1" effect="dark">运动员</el-tag>
<el-tag v-if="identity==2" type="success" effect="dark">教练</el-tag>
<el-tag v-if="identity==3" type="warning" effect="dark">领队</el-tag>
</template>
</el-table-column>
</el-table>
</el-card>
</template>
</el-table-column>
<el-table-column
align="center"
header-align="center"
v-for="column in unionColumns"
:label="column.label"
:prop="column.prop"
:sortable="column.sortable">
<template scope="{row}" v-if="column.prop=='telephone'">
<span>{{row.telephone?row.telephone:'暂无'}}</span>
</template>
<template scope="{row}" v-if="column.prop=='unionleader'">
<span>{{row.unionleader?row.unionleader:'暂无'}}</span>
</template>
</el-table-column>
<el-table-column align="center" header-align="center" label="操作" width="150px">
<template scope="{row}">
<el-tooltip class="item" effect="dark" content="发送提醒" placement="top-start">
<el-button @click="sendRemind(row)" type="primary" size="mini"
icon="el-icon-message"></el-button>
</el-tooltip>
</template>
</el-table-column>
</el-table>
</template>
<template #view>
<info ref="info"></info>
</template>
</guava>
</div>
<script>
var vue = new Vue({
el: '#app',
mixins: [initTableMixins],
data() {
return {
activityId: '',
planList: [],
typeList: [],
events: [],
activitys: [],
unionData: [],
unionColumns: [
{prop: 'unionname', label: '工会名称'},
{prop: 'unionleader', label: '负责人'},
{prop: 'telephone', label: '联系方式'},
{prop: 'num', label: '已报名人数'},
],
applyColumns: [
{prop: 'username', label: '姓名'},
{prop: 'loginname', label: '工号'},
{prop: 'mobile', label: '电话'},
{prop: 'sex', label: '性别'},
{prop: 'divisionLevelLeadership', label: '是否处级领导'},
{prop: 'identity', label: '身份'}
],
tableColumns: [
{prop: 'name', label: '活动名称'},
{prop: 'address', label: '活动地点'},
{prop: 'gameStyle', label: '活动类型'},
{prop: 'startTime', label: '活动日期'},
{prop: 'state', label: '活动状态'},
{prop: 'applyNum', label: '已报名人数'},
]
}
},
components: {
'guava': httpVueLoader('/components/plugins/Guava.vue'),
'info': httpVueLoader('/components/activity/school/Info.vue'),
},
methods: {
dropdownCommand(command) {
const {type, row} = command
if (type === 'remind') {
this.openRemind(row)
} else if (type === 'view') {
this.openView(row)
}
},
openView(row) {
const {id} = row
this.$refs.guava.view()
setTimeout(()=>{
this.$refs.info.getInfo(id)
},500)
},
async openRemind(row) {
this.activityId = row.id
this.$refs.guava.edit()
const {data} = await $.get(loc() + "/getUnionRemind", {activityId: row.id})
this.unionData = data
},
sendRemind(row) {
if (!row.telephone) {
this.$notify.warning({title: '警告', message: '该工会联系方式为空,无法发送短信进行提醒!'});
return
}
this.$confirm("确定要发送提醒短信给【" + row.unionname + "】的负责人吗?", '温馨提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(async () => {
const resp = await $.get(loc() + "/sendRemind", {phone: row.telephone, unionname: row.unionname})
if(resp.code===0){
this.notifySuccess(resp.msg)
}else{
this.notifyWarning(resp.msg)
}
});
},
sendAllRemind() {
this.$confirm("确定发送提醒短信给所有未报名的分工会吗?", '温馨提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(async () => {
const loading = this.$loading({
lock: true,
text: '正在发送...',
spinner: 'el-icon-loading',
background: COVER_LAYER_COLOR
});
const resp = await $.get(loc() + "/sendAllRemind", {activityId: this.activityId})
loading.close()
if(resp.code===0){
this.notifySuccess(resp.msg)
}else{
this.notifyWarning(resp.msg)
}
});
},
async getActivitys() {
const {data} = await $.get(loc() + "/getActivitys")
return data;
},
async getEvents() {
const resp = await $.post("/platform/activity/apply/getEvents", {activityId: this.pageForm.activityId})
this.events = resp
}
},
async created() {
this.pageData()
this.activitys = await this.getActivitys()
this.planList = await activity.getSchoolActivityPlan()
this.unitOptions = await getUnits(null)
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,868 @@
<!--#
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="项目列表" :app="this">
<template #label_end>
<!--<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" class="mr10" 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>
<div class="search-item-option">
<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>
</div>
</template>
</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>
<vi-title title="录入成绩"></vi-title>
<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>
var 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: {
'guava': httpVueLoader('/components/plugins/Guava.vue'),
},
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 userData = await searchUser(query, null, null, null, null)
this.userOptions = userData
}
},
userChange2(userid) {
const aa = this.userOptions.find(v => v.id === userid)
if (aa != undefined) {
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", aa.unionid)
this.$set(this.formData, "unionname", aa.unionname)
this.$set(this.formData, "sex", aa.sex)
} else {
this.$set(this.formData, "username", userid)
}
},
async unitChange() {
const uniotData = this.unitOptions.find(v => v.id == this.formData.unitId)
this.$set(this.formData, "unionname", uniotData.unionname)
this.$set(this.formData, "unionId", uniotData.unionid)
this.$set(this.formData, "unitname", uniotData.name)
},
async openAdd() {
this.unitOptions = await getUnits(null)
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 $.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 $.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 $.get("/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 $.post("/platform/activity/apply/getEvents", {activityId: this.pageForm.activityId})
this.events = resp
},
async doAdd() {
const loading = this.$loading({
lock: true,
text: '正在提交...',
spinner: 'el-icon-loading',
background: COVER_LAYER_COLOR
});
this.userData.activityId = this.activityId
this.userData.eventId = this.eventId
const resp = await $.post(loc() + "/doAdd", {
activityResults: JSON.stringify(this.userData),
activityId: this.activityId,
eventId: this.eventId
})
loading.close()
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)
console.log(useridArr)
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)
}
})
console.log(this.userList)
},
async unionDetailsChange(val, row) {
let data = ''
if (row) {
const {unionId} = row
data = await $.get(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 $.get(loc() + "/getUserList", {
activityId: this.activityId,
eventId: this.eventId,
isMenWomen: this.isMenWomen
})
return data;
},
async getUnionList(row) {
const {activityId, eventId} = row
const {data} = await $.get(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 $.get(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 $.get(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 $.get("/platform/activity/remind/getActivitys")
return data;
},
async doSearchS() {
this.doSearch()
await this.changeActivit()
},
doSearch() {
this.pageForm.pageNumber = 1
this.pageData()
},
pageData() {
sublime.showLoadingbar();
this.tabLoading = true
const pageForm = clone(this.pageForm)
pageForm.isMenWomen = JSON.stringify(pageForm.isMenWomen)
$.post(base + "/platform/activity/results/input/pageData", pageForm, (data) => {
sublime.closeLoadingbar();
this.tabLoading = false
if (data.code == 0) {
this.tableData = data.data.list;
this.pageForm.totalCount = data.data.totalCount;
} else {
this.$message({
message: data.msg,
type: 'error'
});
}
}, "json");
},
},
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,151 @@
<!--#
layout("/layouts/platform.html"){
#-->
<div id="app" class="platform" v-cloak>
<guava ref="guava" padding="0">
<template>
<el-card shadow="never">
<div class="search">
<div class="search-item">
<div class="search-item-label">活动项目:</div>
<div class="search-item-option">
<el-select v-model="pageForm.events" placeholder="请选择活动项目" filterable clearable
style="width: 100%">
<el-option
v-for="item in events"
:key="item.id"
:label="item.allName"
: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="mt10">
<table-tool label="活动信息" :app="this"></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
align="center"
header-align="center"
v-for="column in tableColumns"
:label="column.label"
:prop="column.prop"
:sortable="column.sortable">
<template v-if="column.prop=='identity'" scope="{row}">
<span v-if="row.identity===1">运动员</span>
<span v-if="row.identity===2">教练</span>
<span v-if="row.identity===3">领队</span>
</template>
<template v-else-if="column.prop=='events'" scope="{row}">
<span>{{row.allName}}</span>
</template>
<template v-else-if="column.prop=='gameStyle'" scope="{row}">
<span>{{activity.school.gameStyle[row.gameStyle]}}</span>
</template>
<template v-else-if="column.prop=='startTime'" scope="{row}">
{{moment(row.startTime).format('YYYY-MM-DD')}} -
{{moment(row.endTime).format('YYYY-MM-DD')}}
</template>
<template v-else-if="column.prop=='state'"
scope="{row:{close,applyStartTime,applyEndTime,startTime,endTime}}">
<div v-html="activity.school.getStatus(close,applyStartTime,applyEndTime,startTime,endTime)"></div>
</template>
</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:'pass',row}">
通过
</el-dropdown-item>
<el-dropdown-item :command="{type:'fail',row}">
不通过
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</template>
</el-table-column>
</el-table>
<!--#include("/layouts/pagination.html"){}#-->
</el-card>
</template>
</guava>
</div>
<script>
var vue = new Vue({
el: '#app',
mixins: [initTableMixins],
data() {
return {
events: [],
tableColumns: [
{prop: 'loginname', label: '申请人工号'},
{prop: 'username', label: '申请人姓名'},
{prop: 'mobile', label: '申请人电话'},
{prop: 'identity', label: '申请角色'},
{prop: 'allName', label: '活动项目'},
{prop: 'startTime', label: '活动日期'},
{prop: 'state', label: '活动状态'},
]
}
},
components: {
'guava': httpVueLoader('/components/plugins/Guava.vue'),
},
methods: {
dropdownCommand(command) {
const {type, row} = command
if (type === 'pass') {
this.doPassFail(row, 2)
} else if (type === 'fail') {
this.doPassFail(row, 3)
}
},
async doPassFail(row, status) {
const resp = await $.post(loc() + "/doPassFail", {id: row.id, status: status})
if(resp.code===0){
this.pageData()
}else{
this.notifyWarning(resp.msg)
}
},
},
async created() {
this.pageData()
this.events = await activity.getEvents()
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,443 @@
<!--#
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">
<div class="btn-group tool-button">
<el-date-picker
v-model="pageForm.year"
@change="getActivitys"
type="year"
value-format="yyyy"
placeholder="选择年" :clearable="false">
</el-date-picker>
</div>
<div class="btn-group tool-button">
<el-select v-model="pageForm.activityId" placeholder="请选择活动名称" filterable
:clearable="false" @change="activityChange" style="width: 100%">
<el-option
v-for="item in activityList"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</div>
<div class="btn-group tool-button" v-if="isUnion">
<el-select v-model="pageForm.unionname" placeholder="请选择工会" filterable clearable
@change="unionChange(pageForm.unionId)" style="width: 100%">
<el-option
v-for="item in unionList"
:key="item.id"
:label="item.unionname"
:value="item.unionname">
</el-option>
</el-select>
</div>
<div class="pull-right offscreen-right">
<el-button type="primary" icon="el-icon-search" @click="getYear8(1)">年度男子团体总分</el-button>
<el-button type="primary" icon="el-icon-search" @click="getYear8(2)">年度女子团体总分</el-button>
<el-button type="primary" icon="el-icon-search" @click="annualResults">年度团体总分</el-button>
<el-button type="primary" icon="el-icon-printer" @click="doExcelCj" class="mr10">导出成绩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 type="primary" icon="el-icon-printer" @click="doExportByActivityStatisticsType">
导出
</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">
<vi-title v-if="isSearchOptions==1" title="男子单项成绩"></vi-title>
<vi-title v-if="isSearchOptions==2" title="女子单项成绩"></vi-title>
<vi-title v-if="isSearchOptions==3" title="男子团体成绩"></vi-title>
<vi-title v-if="isSearchOptions==4" title="女子团体成绩"></vi-title>
<vi-title v-if="isSearchOptions==5" title="男女混合类成绩"></vi-title>
<vi-title v-if="isSearchOptions==9&&isSearch" title="分工会男子项目积分"></vi-title>
<vi-title v-if="isSearchOptions==9&&!isSearch" title="分工会项目成绩"></vi-title>
<vi-title v-if="isSearchOptions==10" title="分工会女子项目积分"></vi-title>
<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">
<vi-title v-if="isSearchOptions==6" title="男子项目前八"></vi-title>
<vi-title v-if="isSearchOptions==7" title="女子项目前八"></vi-title>
<vi-title v-if="isSearchOptions==8" title="综合类前八"></vi-title>
<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">
<vi-title v-if="isSearchOptions==11" title="分工会男子总分前八"></vi-title>
<vi-title v-if="isSearchOptions==12" title="分工会女子总分前八"></vi-title>
<score-top-eight :form="pageForm" ref="doTopEight"></score-top-eight>
</el-card>
<el-card shadow="never" class="mt10" v-show="[99].includes(isSearchOptions)">
<vi-title v-if="isSearchOptions==99" title="全年成绩"></vi-title>
<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>
<script>
var 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: {
'guava': httpVueLoader('/components/plugins/Guava.vue'),
'is-male-female': httpVueLoader('/components/activity/score/isMaleFemale.vue?v=' + new Date().getTime()),
'top-eight': httpVueLoader('/components/activity/score/topEight.vue?v=' + new Date().getTime()),
'score-top-eight': httpVueLoader('/components/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 = []
const loading = this.$loading({
lock: true,
text: '数据正在查询中,请稍后...',
spinner: 'el-icon-loading',
background: COVER_LAYER_COLOR
});
this.isSearchOptions = 99
const {data} = await $.get(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})
})
loading.close();
},
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 = []
const loading = this.$loading({
lock: true,
text: '数据正在查询中,请稍后...',
spinner: 'el-icon-loading',
background: COVER_LAYER_COLOR
});
this.isSearchOptions = 99
const {data} = await $.get(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})
})
loading.close();
},
async getActivitys() {
const {data} = await $.get(loc() + "/getActivitys", {year: this.pageForm.year})
this.pageForm = {
activityId: "",
year: this.pageForm.year
},
this.activityList = data
},
async changeActivit() {
const resp = await $.post("/platform/activity/apply/getEvents", {activityId: this.pageForm.activityId})
this.events = resp
},
},
async created() {
this.searchOptions = this.Options
this.unionList = await getUnions(null)
await this.getActivitys()
if (this.activityList.length) {
this.pageForm.activityId = this.activityList[0].id
}
setTimeout(() => {
this.searchClick(9)
}, 200)
},
})
</script>
<!--#
}
#-->