first commit
This commit is contained in:
@@ -0,0 +1,242 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
<style>
|
||||
.table_fixed {
|
||||
table-layout: fixed !important;
|
||||
}
|
||||
|
||||
.btn-group {
|
||||
margin-right: 6px;
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
<div id="app" v-cloak>
|
||||
<guava ref="guava">
|
||||
<el-card shadow="never">
|
||||
<div class="search">
|
||||
<div class="btn-group tool-button">
|
||||
<el-date-picker
|
||||
placeholder="选择年度"
|
||||
type="year"
|
||||
v-model="pageForm.year"
|
||||
value-format="yyyy">
|
||||
</el-date-picker>
|
||||
</div>
|
||||
<div class="btn-group tool-button">
|
||||
<el-select clearable="true" filterable="true" placeholder="评优评先名称"
|
||||
style="width: 100%;" v-model="pageForm.evaluateId">
|
||||
<el-option :label="item.evaluateName" :value="item.evaluateId"
|
||||
v-for="item in evaluateList"></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
<div class="search-query">
|
||||
<el-button @click="doSearch" icon="el-icon-search" type="primary">搜索</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
<el-card class="mt10" shadow="never">
|
||||
<el-table :data="tableData" :size="tableSize">
|
||||
<el-table-column :index="indexMethod" align="center" header-align="center" label="序号" type="index"
|
||||
width="80px"></el-table-column>
|
||||
|
||||
<el-table-column align="center" header-align="center" label="年度" prop="year" show-overflow-tooltip
|
||||
sortable>
|
||||
<template slot-scope="{row}">
|
||||
{{moment(row.startTime).format('YYYY')}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column align="center" header-align="center" label="名称" prop="name"
|
||||
show-overflow-tooltip></el-table-column>
|
||||
|
||||
<el-table-column align="center" header-align="center" label="荣誉类型" prop="type" show-overflow-tooltip
|
||||
sortable>
|
||||
<template slot-scope="{row}">
|
||||
{{row.directions ? '集体荣誉' : '个人荣誉'}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column align="center" header-align="center" label="申请时间" prop="year" show-overflow-tooltip
|
||||
sortable>
|
||||
<template slot-scope="{row}">
|
||||
{{moment(row.startTime).format('YYYY-MM-DD') + ' 至 ' +
|
||||
moment(row.endTime).format('YYYY-MM-DD')}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column align="center" header-align="center" label="参加活动范围" prop="groupName"
|
||||
show-overflow-tooltip></el-table-column>
|
||||
|
||||
<el-table-column align="center" header-align="center" label="状态" prop="year" show-overflow-tooltip
|
||||
sortable>
|
||||
<template slot-scope="{row}">
|
||||
<span :class="getStatus(row).class">{{getStatus(row).name}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="操作" width="300px">
|
||||
<template scope="{row}">
|
||||
<el-button @click="openView(row)" size="mini" type="primary">查看</el-button>
|
||||
<el-button @click="openEdit(row)" size="mini" type="primary">编辑</el-button>
|
||||
<el-button @click="deleteDo(row)" size="mini"
|
||||
type="danger" v-if="moment().unix() < moment(row.startTime).unix()">删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--#include("/layouts/pagination.html"){}#-->
|
||||
</el-card>
|
||||
|
||||
<template #view>
|
||||
<el-tabs>
|
||||
<el-tab-pane label="评优评先活动信息">
|
||||
<el-descriptions :column="2" border class="table_fixed">
|
||||
<el-descriptions-item :span="2" label="名称">
|
||||
{{viewData.name}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="年度">
|
||||
{{moment(viewData.startTime).format('YYYY')}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="申请时间">
|
||||
{{viewData.startTime + ' ~ ' + viewData.endTime}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item :span="2" label="参加人员范围">
|
||||
{{viewData.groupName}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item :span="2" label="评选条件">
|
||||
<div v-html="viewData.conditions"></div>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="评选表彰程序">
|
||||
<div v-html="viewData.program"></div>
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="名额分配信息">
|
||||
<el-table :data="viewDataTable" v-if="!viewData.directions">
|
||||
<el-table-column label="部门工会" prop="unionname"></el-table-column>
|
||||
<el-table-column label="会员人数" prop="membercount"></el-table-column>
|
||||
<el-table-column label="名额" prop="number"></el-table-column>
|
||||
</el-table>
|
||||
<template v-if="viewData.directions">
|
||||
<div style="float: left">评选名额:</div>
|
||||
<el-input maxlength="500" readonly="" rows="4" style="width: 94%"
|
||||
type="textarea" v-model="viewData.directions"></el-input>
|
||||
</template>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</template>
|
||||
</guava>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
const vue = new Vue({
|
||||
el: '#app',
|
||||
mixins: [initTableMixins],
|
||||
data() {
|
||||
return {
|
||||
pageForm: {
|
||||
year: moment().format('YYYY'),
|
||||
},
|
||||
viewData: {},
|
||||
viewDataTable: [],
|
||||
activityGroupList: [],
|
||||
evaluateList: [],
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
deleteDo(row) {
|
||||
this.$confirm('您确定要删除吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
callback: (a, b) => {
|
||||
if ("confirm" == a) {
|
||||
$.post("/platform/evaluate/doDelete", {id: row.id}, (data) => {
|
||||
if (data.code == 0) {
|
||||
this.$notify({title: '成功', message: '删除成功!', type: 'success'})
|
||||
this.pageData();
|
||||
} else {
|
||||
this.$notify({title: '警告', message: '删除失败!', type: 'warning'})
|
||||
}
|
||||
}, "json");
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
async getEvaluateByYear() {
|
||||
const {data} = await $.post('/platform/evaluate/apply/getEvaluateByYear', {year: this.pageForm.year})
|
||||
this.evaluateList = data
|
||||
},
|
||||
getStatus(row) {
|
||||
const now = new Date().getTime()
|
||||
const hdkssj = moment(row.startTime.valueOf())
|
||||
const hdjssj = moment(row.endTime.valueOf())
|
||||
|
||||
if (now < hdkssj) {
|
||||
return {
|
||||
class: 'text-info',
|
||||
name: '活动未开始'
|
||||
}
|
||||
} else if (now > hdkssj && now < hdjssj) {
|
||||
return {
|
||||
class: 'text-success',
|
||||
name: '活动进行中'
|
||||
}
|
||||
} else if (now > hdjssj) {
|
||||
return {
|
||||
class: 'text-danger',
|
||||
name: '活动已截止'
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
async openView(row) {
|
||||
const {id} = row
|
||||
const resp = await $.get('/platform/evaluate/findOne', {id})
|
||||
if (resp.code === 0) {
|
||||
this.viewData = resp.data.evaluate
|
||||
if (!this.viewData.directions) {
|
||||
const {data} = await $.post('/platform/evaluate/getUnions')
|
||||
data.map(v => {
|
||||
const fpmeGh = resp.data.fpme.find(o => o.unionId === v.id)
|
||||
this.viewDataTable.push({
|
||||
id: fpmeGh ? fpmeGh.id : '',
|
||||
ghid: v.id,
|
||||
unionname: v.unionname,
|
||||
number: fpmeGh ? fpmeGh.number : 0,
|
||||
unioncode: v.unioncode,
|
||||
membercount: v.membercount
|
||||
})
|
||||
})
|
||||
}
|
||||
this.$refs['guava'].view()
|
||||
}
|
||||
},
|
||||
openEdit(row) {
|
||||
sublime.jumpPagePjax('/platform/evaluate/add?id=' + row.id)
|
||||
},
|
||||
async pageData() {
|
||||
const res = await $.post('/platform/evaluate/pageData', this.pageForm)
|
||||
if (res.code === 0) {
|
||||
this.tableData = res.data.list;
|
||||
this.pageForm.totalCount = res.data.totalCount;
|
||||
}
|
||||
},
|
||||
async getActivityGroup() {
|
||||
const resp = await $.get('/platform/activity/basic/scope/getActivityUserScopeGroup')
|
||||
this.activityGroupList = resp.data
|
||||
},
|
||||
},
|
||||
async created() {
|
||||
await this.getActivityGroup()
|
||||
await this.getEvaluateByYear()
|
||||
this.pageData()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
Reference in New Issue
Block a user