first commit
This commit is contained in:
@@ -0,0 +1,362 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
<style>
|
||||
.v-tree-layout-left {
|
||||
overflow: unset !important;
|
||||
}
|
||||
|
||||
.v-tree-layout-left .v-tree {
|
||||
width: 100%;
|
||||
height: calc(100vh - 170px);
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.v-tree:hover::-webkit-scrollbar {
|
||||
width: 3px;
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
.v-tree-layout-left .custom-tree-node {
|
||||
width: 90%;
|
||||
position: relative;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.v-tree-layout-left .v-tree .v-node {
|
||||
width: 100%;
|
||||
display: inline-block;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar {
|
||||
/*width: 3px;*/
|
||||
/*background-color: transparent;*/
|
||||
display: none;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-thumb {
|
||||
background-color: rgba(0, 0, 0, 0.2);
|
||||
border-radius: 10px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div id="app" v-cloak>
|
||||
<guava ref="guava">
|
||||
<el-card shadow="never" style="height: calc(100vh - 70px)">
|
||||
<tree-layout>
|
||||
<template #tree>
|
||||
<div style="padding:0 20px 20px;">
|
||||
<el-input placeholder="输入关键字进行查找" v-model="filterText"></el-input>
|
||||
</div>
|
||||
|
||||
<el-tree ref="tree" :data="treeData" class="v-tree" v-loading="treeLoading" node-key="id"
|
||||
:props="defaultProps"
|
||||
:default-expanded-keys="['7e3f5fcbc24f442dbb3a6cc9412e7960']" :expand-on-click-node="false"
|
||||
@node-click="handleNodeClick" accordion
|
||||
highlight-current :filter-node-method="filterNode">
|
||||
<div class="custom-tree-node" slot-scope="{ node, data }">
|
||||
|
||||
<div v-if="node.level==1" style="font-size: 16px;" class="v-node"><i
|
||||
class="el-icon-s-home"></i>
|
||||
{{ data.name }}
|
||||
</div>
|
||||
|
||||
<div v-if="node.level==2"
|
||||
style="font-size: 15px" :title="data.name" class="v-node">
|
||||
<i class="el-icon-star-on" v-if="checkData.name==data.name"></i>
|
||||
<i class="el-icon-star-off" v-else></i>
|
||||
{{ data.name }}
|
||||
</div>
|
||||
|
||||
|
||||
<div v-if="node.level==3"
|
||||
style="font-size: 14px" :title="data.name" class="v-node">
|
||||
<i class="fa fa-dot-circle-o" v-if="checkData.name==data.name"></i>
|
||||
<i class="fa fa-circle-o" v-else></i>
|
||||
{{ data.name }}
|
||||
</div>
|
||||
|
||||
|
||||
<div v-if="node.level>3"
|
||||
style="font-size: 14px" :title="data.name" class="v-node">
|
||||
<i class="fa fa-dot-circle-o" v-if="checkData.name==data.name"></i>
|
||||
<i class="fa fa-circle-o" v-else></i>
|
||||
{{ data.name }}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</el-tree>
|
||||
|
||||
</template>
|
||||
|
||||
<template v-if="node.level==1">
|
||||
<div v-if="node.level==1" style="padding:0 10px">
|
||||
<el-card shadow="never">
|
||||
<div class="text-right">
|
||||
<el-button size="medium" type="primary" @click="openBasicType()">
|
||||
<i class="el-icon-plus"></i>
|
||||
新建基础类型
|
||||
</el-button>
|
||||
</div>
|
||||
</el-card>
|
||||
<el-card shadow="never" class="mt10">
|
||||
<el-table :data="basicTypeData" height="656px">
|
||||
<el-table-column label="序号" type="index">
|
||||
<template scope="scope">
|
||||
<span>{{scope.$index+(pageForm.pageNumber - 1) * pageForm.pageSize + 1}} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="name" align="center" label="名称"></el-table-column>
|
||||
<el-table-column prop="code" align="center" label="代码"></el-table-column>
|
||||
<el-table-column prop="note" align="center" show-overflow-tooltip
|
||||
label="备注"></el-table-column>
|
||||
<el-table-column align="center" label="操作" width="100px">
|
||||
<template scope="{row}">
|
||||
<el-dropdown @command="dropdownCommand">
|
||||
<el-button plain size="mini">
|
||||
<i class="ti-settings"></i>
|
||||
<span class="ti-angle-down"></span>
|
||||
</el-button>
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-item :command="{type:'edit',data:row}"
|
||||
:disabled="checkData.code==50000||checkData.code==40000">
|
||||
编辑
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item :command="{type:'delete',data:row}"
|
||||
:disabled="checkData.code==50000||checkData.code==40000||checkData.code=='jcsjgl'">
|
||||
删除
|
||||
</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<el-pagination
|
||||
@size-change="(val)=>{pageForm.pageSize = val;pageData()}"
|
||||
@current-change="(val)=>{pageForm.pageNumber = val;pageData()}"
|
||||
:current-page="pageForm.pageNumber"
|
||||
:page-sizes="[10, 20, 30, 50]"
|
||||
:page-size="pageForm.pageSize"
|
||||
layout="total, sizes, prev, pager, next"
|
||||
:total="pageForm.totalCount">
|
||||
</el-pagination>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
</tree-layout>
|
||||
</el-card>
|
||||
</guava>
|
||||
|
||||
<el-dialog :close-on-click-modal="false" :title="title" :visible.sync="basicTypeDialog" width="50%">
|
||||
<el-form :model="formData" ref="addForm" :rules="rules" label-width="100px">
|
||||
<el-row gutter="30">
|
||||
<el-form-item label="上级名称" prop="name" label-width="110px">
|
||||
<el-input maxlength="100" disabled :value="checkData.name"
|
||||
type="text"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="基础类型名称" prop="name" label-width="110px">
|
||||
<el-input maxlength="100" placeholder="请输入基础类型名称" v-model="formData.name"
|
||||
type="text"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="基础类型代码" prop="code" label-width="110px">
|
||||
<el-input maxlength="100" placeholder="请输入基础类型名称" v-model="formData.code"
|
||||
type="text"
|
||||
:disabled="checkData.code==50000||checkData.code==40000||checkData.code=='jcsjgl'"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="基础类型备注" prop="note" label-width="110px">
|
||||
<el-input maxlength="100" placeholder="请输入基础类型备注" v-model="formData.note"
|
||||
type="textarea"></el-input>
|
||||
</el-form-item>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<div style="display: flex;justify-content:flex-end;margin-top: 30px">
|
||||
<el-button type="primary" :loading="loading" @click="!formData.id?doAddType():doEditType()">提 交
|
||||
</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
</div>
|
||||
|
||||
<script>
|
||||
var vue = new Vue({
|
||||
el: '#app',
|
||||
mixins: [initTableMixins],
|
||||
data() {
|
||||
return {
|
||||
title: '',
|
||||
checkData: {},
|
||||
filterText: '',
|
||||
treeData: [],
|
||||
basicTypeData: [],
|
||||
tableData: [],
|
||||
treeLoading: true,
|
||||
basicTypeDialog: false,
|
||||
loading: false,
|
||||
defaultProps: {
|
||||
children: 'child',
|
||||
label: 'name',
|
||||
},
|
||||
node: {
|
||||
level: 1
|
||||
},
|
||||
options: [{
|
||||
value: 'ziyuan',
|
||||
label: '资源',
|
||||
children: [{
|
||||
value: 'axure',
|
||||
label: 'Axure Components'
|
||||
}]
|
||||
}],
|
||||
rules: {
|
||||
name: [{required: true, message: '必填', trigger: ['change', 'blur']}],
|
||||
code: [{required: true, message: '必填', trigger: ['change', 'blur']}],
|
||||
},
|
||||
}
|
||||
},
|
||||
components: {
|
||||
'tree-layout': httpVueLoader('/components/plugins/TreeLayout.vue'),
|
||||
'guava': httpVueLoader('/components/plugins/Guava.vue'),
|
||||
},
|
||||
watch: {
|
||||
filterText(val) {
|
||||
this.$refs.tree.filter(val);
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
dropdownCommand: function (command) {
|
||||
const {type, data} = command
|
||||
if (type == 'edit') {
|
||||
this.openEditType(data)
|
||||
} else if (type == 'delete') {
|
||||
this.doDelete(data.id)
|
||||
}
|
||||
},
|
||||
pageData() {//加载机构数据
|
||||
sublime.showLoadingbar();//显示loading
|
||||
this.tabLoading = true
|
||||
this.pageForm.parentId = this.checkData.id
|
||||
$.post(loc() + "/pageData", this.pageForm, (data) => {
|
||||
sublime.closeLoadingbar();//关闭loading
|
||||
this.tabLoading = false
|
||||
if (data.code == 0) {
|
||||
this.basicTypeData = data.data.list;
|
||||
this.pageForm.totalCount = data.data.totalCount;
|
||||
} else {
|
||||
this.$message({
|
||||
message: data.msg,
|
||||
type: 'error'
|
||||
});
|
||||
}
|
||||
}, "json");
|
||||
},
|
||||
filterNode(value, data, node) {
|
||||
if (!value) return true;
|
||||
return data.name.indexOf(value) !== -1
|
||||
return false
|
||||
},
|
||||
async handleNodeClick(data, node) {
|
||||
this.checkData = data
|
||||
this.checkNode = node
|
||||
console.log(this.checkData)
|
||||
this.pageData()
|
||||
},
|
||||
async loadTree(flush) {
|
||||
this.treeLoading = true
|
||||
const resp = await $.post(loc() + "/getTreeData")
|
||||
this.treeLoading = false
|
||||
if(resp.code===0){
|
||||
this.treeLoading = false
|
||||
this.treeData = resp.data
|
||||
}else{
|
||||
this.notifyWarning(resp.msg)
|
||||
}
|
||||
if (flush && resp.code === 0) {
|
||||
this.checkData = resp.data[0]
|
||||
this.pageData();
|
||||
}
|
||||
},
|
||||
async openBasicType() {
|
||||
const {id} = this.checkData
|
||||
this.formData = {
|
||||
parentId: id
|
||||
}
|
||||
this.basicTypeDialog = true
|
||||
if (this.$refs['addForm']) {
|
||||
this.$refs['addForm'].resetFields()
|
||||
}
|
||||
},
|
||||
doAddType() {
|
||||
this.$refs["addForm"].validate(async (valid) => {
|
||||
if (valid) {
|
||||
this.loading = true
|
||||
const resp = await $.post(loc() + "/doAdd", this.formData)
|
||||
this.loading = false
|
||||
if(resp.code===0){
|
||||
this.basicTypeDialog = false
|
||||
this.pageData();
|
||||
this.loadTree(true)
|
||||
}else{
|
||||
this.notifyWarning(resp.msg)
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
doEditType() {
|
||||
this.$refs["addForm"].validate(async (valid) => {
|
||||
if (valid) {
|
||||
this.loading = true
|
||||
const resp = await $.post(loc() + "/doEditType", this.formData)
|
||||
this.loading = false
|
||||
this.basicTypeDialog = false
|
||||
if(resp.code===0){
|
||||
this.pageData();
|
||||
}else{
|
||||
this.notifyWarning(resp.msg)
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
openEditType(row) {
|
||||
this.formData = {
|
||||
id: row.id,
|
||||
name: row.name,
|
||||
code: row.code,
|
||||
note: row.note
|
||||
}
|
||||
this.basicTypeDialog = true
|
||||
},
|
||||
doDelete(id) {
|
||||
this.$confirm('确定要删除该机构吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
callback: async (a, b) => {
|
||||
if ("confirm" == a) {
|
||||
const resp = await $.post(loc() + "/doDelete", {id: id})
|
||||
if(resp.code===0){
|
||||
this.notifySuccess(resp.msg)
|
||||
this.pageData()
|
||||
this.loadTree(true)
|
||||
}else{
|
||||
this.notifyWarning(resp.msg)
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
async created() {
|
||||
this.loadTree(true)
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,713 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
|
||||
|
||||
<div id="app" class="platform" v-cloak>
|
||||
<guava ref="guava">
|
||||
<template>
|
||||
<el-card shadow="never">
|
||||
<div class="search">
|
||||
|
||||
|
||||
<div class="d-search-item btn-group tool-button mr10">
|
||||
<el-checkbox-group @change="doSearch" v-model="pageForm.isMenWomen">
|
||||
<el-checkbox-button :key="2" :label="2">男子</el-checkbox-button>
|
||||
<el-checkbox-button :key="3" :label="3">女子</el-checkbox-button>
|
||||
</el-checkbox-group>
|
||||
</div>
|
||||
<div class="d-search-item btn-group tool-button mr10">
|
||||
<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>
|
||||
|
||||
<div class="d-search-item btn-group tool-button mr10">
|
||||
<el-select v-model="pageForm.group" @focus="focusGroup"
|
||||
placeholder="请选择比赛组别" clearable
|
||||
style="width: 100%">
|
||||
<el-option
|
||||
v-for="item in groupList"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
|
||||
<div class="d-search-item btn-group tool-button mr10">
|
||||
<el-select @focus="exerciseType" clearable filterable placeholder="请选择运动类型"
|
||||
style="width: 100%" v-model="pageForm.events">
|
||||
<el-option
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
v-for="item in exerciseTypeList">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</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">
|
||||
|
||||
<template #label_end>
|
||||
|
||||
</template>
|
||||
|
||||
<template #func>
|
||||
<el-input type="number" v-model="pageForm.age" placeholder="输入年龄算出身年"
|
||||
@input="ageInput"
|
||||
style="width: auto">
|
||||
<template slot="prepend">年龄计算器</template>
|
||||
</el-input>
|
||||
<el-tag class="ml10">{{ pageForm.ageYear }}</el-tag>
|
||||
<el-date-picker
|
||||
class="ml10"
|
||||
v-model="pageForm.ageDate"
|
||||
type="daterange"
|
||||
range-separator="-"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
format="yyyy 年 MM 月 dd 日"
|
||||
value-format="yyyy-MM-dd">
|
||||
</el-date-picker>
|
||||
<el-button class="ml10" type="primary" icon="el-icon-check"
|
||||
@click="doAssignmentDate">统赋年龄限制
|
||||
</el-button>
|
||||
<el-button type="primary" icon="el-icon-edit-outline"
|
||||
@click="openAdd">
|
||||
创建比赛项目
|
||||
</el-button>
|
||||
</template>
|
||||
</table-tool>
|
||||
|
||||
|
||||
<el-table :data="tableData" style="width: 100%;margin-bottom: 20px" row-key="id"
|
||||
@sort-change="pageOrder"
|
||||
ref="multipleTable"
|
||||
v-loading="tableLoading" :size="tableSize" class="vi-table"
|
||||
@selection-change="handleSelectionChange">
|
||||
<el-table-column
|
||||
:reserve-selection="true"
|
||||
type="selection"
|
||||
width="55">
|
||||
</el-table-column>
|
||||
<el-table-column align="center" header-align="center" type="index"
|
||||
:index="indexMethod" label="序号"
|
||||
width="80px"></el-table-column>
|
||||
<el-table-column
|
||||
align="center"
|
||||
header-align="center"
|
||||
v-for="column in tableColumns"
|
||||
:label="column.label"
|
||||
:width="column.width"
|
||||
:prop="column.prop" :sortable="column.sortable"
|
||||
:sortable="column.sortable" show-overflow-tooltip>
|
||||
|
||||
<template scope="{row}" v-if="column.prop=='baname'">
|
||||
<span>{{row.baname!=null?row.baname:'暂无'}}</span>
|
||||
</template>
|
||||
|
||||
<template scope="{row}" v-else-if="column.prop=='diname'">
|
||||
<span>{{row.diname!=null?row.diname:'暂无'}}</span>
|
||||
</template>
|
||||
|
||||
<template scope="{row}" v-else-if="column.prop=='isMenWomen'">
|
||||
<span v-if="row.isMenWomen==1">男子</span>
|
||||
<span v-if="row.isMenWomen==2">女子</span>
|
||||
</template>
|
||||
|
||||
<template scope="{row}" v-else-if="column.prop=='spname'">
|
||||
<span>{{row.spname!=null?row.spname:''}}</span>
|
||||
</template>
|
||||
|
||||
<template scope="{row}" v-else-if="column.prop=='projectType'">
|
||||
<span>{{row.projectType=='1'?'单项':'团体'}}</span>
|
||||
</template>
|
||||
|
||||
<template scope="{row}" v-else-if="column.prop=='note'">
|
||||
<span>{{row.note!=''?row.note:'暂无'}}</span>
|
||||
</template>
|
||||
|
||||
<template scope="{row}" v-else-if="column.prop=='whetherEnable'">
|
||||
<el-switch @change="switchChange(row)" v-model="row.whetherEnable"
|
||||
active-color="#13ce66"
|
||||
inactive-color="#ff4949"></el-switch>
|
||||
</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:'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>
|
||||
|
||||
<vi-title title="填写比赛项目信息"></vi-title>
|
||||
|
||||
|
||||
<el-form :model="formData" ref="form" :rules="formRules" label-width="120px"
|
||||
label-suffix=":">
|
||||
<el-row gutter="40">
|
||||
<el-col :span="24">
|
||||
<el-form-item prop="isInterest" label="是否趣味项目">
|
||||
<el-checkbox v-model="formData.isInterest">
|
||||
{{formData.isInterest?'是趣味':'不是趣味'}}
|
||||
</el-checkbox>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item prop="projectCode" label="比赛项目编号">
|
||||
<el-input v-model="formData.projectCode"
|
||||
placeholder="请填写比赛项目编号"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item prop="isMenWomen" label="性别">
|
||||
<el-select v-model="formData.isMenWomen" placeholder="请选择男女分组"
|
||||
allow-create filterable
|
||||
default-first-option clearable style="width: 100%">
|
||||
<el-option
|
||||
v-for="item in menWomenList"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item prop="competitionCategory" label="比赛组别">
|
||||
<el-select v-model="formData.competitionCategory" @focus="focusGroup"
|
||||
placeholder="请选择比赛组别"
|
||||
clearable style="width: 100%">
|
||||
<el-option
|
||||
v-for="item in groupList"
|
||||
:key="item.id"
|
||||
:label="item.name+'('+item.code+')'"
|
||||
:value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item prop="distance" label="距离">
|
||||
<el-select v-model="formData.distance" @focus="focusDistance"
|
||||
placeholder="请选择距离"
|
||||
clearable style="width: 100%">
|
||||
<el-option
|
||||
v-for="item in distanceList"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item prop="exerciseType" label="运动类型">
|
||||
<el-select v-model="formData.exerciseType" @focus="exerciseType"
|
||||
@change="changeExercise_typeList" placeholder="请选择运动类型"
|
||||
filterable
|
||||
clearable style="width: 100%">
|
||||
<el-option
|
||||
v-for="item in exerciseTypeList"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item prop="sports" label="运动项目">
|
||||
<el-select v-model="formData.sports" placeholder="请选择具体运动项目"
|
||||
clearable style="width: 100%">
|
||||
<el-option
|
||||
v-for="item in exerciseTypeList2"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item prop="projectType" label="项目类型">
|
||||
<el-select v-model="formData.projectType" placeholder="请选择具体运动项目"
|
||||
allow-create filterable
|
||||
default-first-option clearable style="width: 100%">
|
||||
<el-option
|
||||
v-for="item in projectTypeList"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item prop="ageDate" label="年龄限制范围" v-if="formData.projectType==1">
|
||||
<el-date-picker
|
||||
style="width: 100%"
|
||||
v-model="formData.ageDate"
|
||||
type="daterange"
|
||||
range-separator="-"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
format="yyyy 年 MM 月 dd 日"
|
||||
value-format="yyyy-MM-dd">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
|
||||
</el-col>
|
||||
|
||||
|
||||
</el-row>
|
||||
|
||||
</el-form>
|
||||
<div style="float: right;margin: 20px 0">
|
||||
<el-button type="primary" @click="formData.id?doEdit():doAdd()">提 交</el-button>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
||||
</guava>
|
||||
</div>
|
||||
|
||||
|
||||
<script>
|
||||
var vue = new Vue({
|
||||
el: '#app',
|
||||
mixins: [initTableMixins],
|
||||
data() {
|
||||
return {
|
||||
multipleSelection: [],
|
||||
groupList: [],
|
||||
exerciseTypeList: [],
|
||||
distanceList: [],
|
||||
exerciseTypeList2: [],
|
||||
eventDialog: false,
|
||||
loading: false,
|
||||
title: "",
|
||||
pageForm: {
|
||||
age: 1,
|
||||
ageYear: null,
|
||||
activityId: null,
|
||||
ageDate: null,
|
||||
isMenWomen: []
|
||||
},
|
||||
tableColumns: [
|
||||
{prop: 'projectCode', label: '项目编号', sortable: true},
|
||||
{prop: 'allName', label: '全称', width: "200"},
|
||||
{prop: 'isMenWomen', label: '男子/女子', sortable: true},
|
||||
{prop: 'baname', label: '比赛组别', sortable: true},
|
||||
{prop: 'diname', label: '距离', sortable: true},
|
||||
{prop: 'exename', label: '运动类型', sortable: true},
|
||||
{prop: 'spname', label: '运动项目', sortable: true},
|
||||
{prop: 'projectType', label: '项目类型', sortable: true},
|
||||
{prop: 'whetherEnable', label: '是否启用'},
|
||||
|
||||
],
|
||||
projectTypeList: [
|
||||
{id: '1', name: '单项'},
|
||||
{id: '2', name: '团体'},
|
||||
],
|
||||
menWomenList: [
|
||||
{id: 1, name: '男子'},
|
||||
{id: 2, name: '女子'},
|
||||
],
|
||||
formRules: {
|
||||
exerciseType: [{required: true, message: '必填', trigger: ['change', 'blur']}],
|
||||
projectType: [{required: true, message: '必填', trigger: ['change', 'blur']}],
|
||||
projectCode: [{required: true, message: '必填', trigger: ['change', 'blur']}],
|
||||
/* competitionCategory: [{required: true, message: '必填', trigger: ['change', 'blur']}],
|
||||
distance: [{required: true, message: '必填', trigger: ['change', 'blur']}],
|
||||
exerciseType: [{required: true, message: '必填', trigger: ['change', 'blur']}],
|
||||
*/
|
||||
},
|
||||
}
|
||||
},
|
||||
components: {
|
||||
'guava': httpVueLoader('/components/plugins/Guava.vue'),
|
||||
},
|
||||
methods: {
|
||||
ageInput(val) {
|
||||
const year = new Date().getFullYear()
|
||||
this.$set(this.pageForm, "ageYear", year - val)
|
||||
},
|
||||
handleSelectionChange(val) {
|
||||
this.multipleSelection = val;
|
||||
},
|
||||
async doAssignmentDate() {
|
||||
const aa = this.multipleSelection.map(v => {
|
||||
if (v.isInterest) {
|
||||
return true
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
})
|
||||
if (aa.find(v => v == true)) {
|
||||
this.$notify({
|
||||
title: '警告',
|
||||
message: '您勾选的列表中包含趣味项目,趣味项目暂不需要年龄限制',
|
||||
type: 'warning'
|
||||
});
|
||||
return
|
||||
}
|
||||
if (this.multipleSelection.length === 0) {
|
||||
this.$notify({
|
||||
title: '警告',
|
||||
message: '请先在旁边勾选需要设置的项目',
|
||||
type: 'warning'
|
||||
});
|
||||
return
|
||||
}
|
||||
|
||||
if (this.pageForm.ageDate == null) {
|
||||
this.$notify({
|
||||
title: '警告',
|
||||
message: '请选择需要赋值的时间段',
|
||||
type: 'warning'
|
||||
});
|
||||
return
|
||||
}
|
||||
const confirm = await this.$confirm('确定要勾选的项目赋年龄限制吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
})
|
||||
if (confirm === "confirm") {
|
||||
const data = await $.post(loc() + "/doAssignmentDate", {
|
||||
startAgeDate: this.pageForm.ageDate[0],
|
||||
endAgeDate: this.pageForm.ageDate[1],
|
||||
eventIds: JSON.stringify(this.multipleSelection.map(v => v.id))
|
||||
})
|
||||
this.$notify.success({title: '成功', message: data.msg});
|
||||
this.$refs.multipleTable.clearSelection();
|
||||
this.doSearch()
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
dropdownCommand(command) {
|
||||
const {type, row} = command
|
||||
if (type === 'edit') {
|
||||
this.openEdit(row)
|
||||
} else if (type === 'delete') {
|
||||
this.doDelete(row)
|
||||
}
|
||||
},
|
||||
openAdd() {
|
||||
this.$refs.guava.edit()
|
||||
if (this.$refs['form']) {
|
||||
this.$refs['form'].resetFields()
|
||||
}
|
||||
this.formData = {}
|
||||
},
|
||||
|
||||
//查询比赛组别
|
||||
async focusGroup() {
|
||||
const resp = await $.post(loc() + "/focusGroup")
|
||||
if(resp.code===0){
|
||||
this.groupList = resp.data
|
||||
}else{
|
||||
this.notifyWarning(resp.msg)
|
||||
}
|
||||
},
|
||||
|
||||
//查询运动类型
|
||||
async exerciseType() {
|
||||
const resp = await $.post(loc() + "/exerciseType")
|
||||
if(resp.code===0){
|
||||
this.exerciseTypeList = resp.data
|
||||
}else{
|
||||
this.notifyWarning(resp.msg)
|
||||
}
|
||||
},
|
||||
|
||||
//查询距离
|
||||
async focusDistance() {
|
||||
const resp = await $.post(loc() + "/focusDistance")
|
||||
if(resp.code===0){
|
||||
this.distanceList = resp.data;
|
||||
}else{
|
||||
this.notifyWarning(resp.msg)
|
||||
}
|
||||
},
|
||||
|
||||
//根据运动id查询下面有哪些具体的运动项目
|
||||
async changeExercise_typeList() {
|
||||
const resp = await $.post(loc() + "/changeExercise_typeList", {exerciseType: this.formData.exerciseType})
|
||||
if(resp.code===0){
|
||||
this.exerciseTypeList2 = resp.data
|
||||
}else{
|
||||
this.notifyWarning(resp.msg)
|
||||
}
|
||||
},
|
||||
doAdd() {
|
||||
this.$refs["form"].validate(async (valid) => {
|
||||
if (valid) {
|
||||
const {data} = await $.post(loc() + "/getProjectCodeIsExist", {projectCode: this.formData.projectCode})
|
||||
if (data) {
|
||||
this.$message.error("编号已存在");
|
||||
return
|
||||
}
|
||||
let allName = '';
|
||||
|
||||
this.menWomenList.find(v => {
|
||||
if (v.id === this.formData.isMenWomen) {
|
||||
allName += v.name
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
this.groupList.find(v => {
|
||||
if (v.id === this.formData.competitionCategory) {
|
||||
allName += v.name
|
||||
}
|
||||
})
|
||||
|
||||
this.distanceList.find(v => {
|
||||
if (v.id === this.formData.distance) {
|
||||
allName += v.name + '米'
|
||||
}
|
||||
})
|
||||
|
||||
/* this.exerciseTypeList.find(v => {
|
||||
if (v.id === this.formData.exerciseType) {
|
||||
allName += v.name
|
||||
}
|
||||
})*/
|
||||
|
||||
this.exerciseTypeList2.find(v => {
|
||||
if (v.id === this.formData.sports) {
|
||||
allName += v.name
|
||||
}
|
||||
})
|
||||
|
||||
this.projectTypeList.find(v => {
|
||||
if (v.id === this.formData.projectType) {
|
||||
allName += "(" + v.name + ")"
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
this.formData.allName = allName
|
||||
if (this.formData.ageDate && this.formData.ageDate.length > 0) {
|
||||
this.formData.startAgeDate = this.formData.ageDate[0]
|
||||
this.formData.endAgeDate = this.formData.ageDate[1]
|
||||
}
|
||||
|
||||
|
||||
this.loading = true
|
||||
const resp = await $.post(loc() + "/doAdd", this.formData)
|
||||
this.loading = false
|
||||
if(resp.code===0){
|
||||
this.pageData();
|
||||
this.$refs.guava.index()
|
||||
}else{
|
||||
this.notifyWarning(resp.msg)
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
pageData() {
|
||||
sublime.showLoadingbar();
|
||||
this.tabLoading = true
|
||||
const pageForm = clone(this.pageForm)
|
||||
pageForm.isMenWomen = JSON.stringify(pageForm.isMenWomen)
|
||||
$.post(base + "/platform/activity/basic/event/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 switchChange(data) {
|
||||
this.formData = data
|
||||
const resp = await $.post(loc() + "/doEdit", this.formData)
|
||||
if(resp.code===0){
|
||||
this.notifySuccess(resp.msg)
|
||||
this.pageData()
|
||||
}else{
|
||||
this.notifyWarning(resp.msg)
|
||||
}
|
||||
},
|
||||
doEdit() {
|
||||
this.$refs["form"].validate(async (valid) => {
|
||||
if (valid) {
|
||||
if (this.formData.oldProjectCode !== this.formData.projectCode) {
|
||||
const {data} = await $.post(loc() + "/getProjectCodeIsExist", {projectCode: this.formData.projectCode})
|
||||
if (data) {
|
||||
this.$message.error("编号已存在");
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
let allName = '';
|
||||
|
||||
this.menWomenList.find(v => {
|
||||
if (v.id === this.formData.isMenWomen) {
|
||||
allName += v.name
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
this.groupList.find(v => {
|
||||
if (v.id === this.formData.competitionCategory) {
|
||||
allName += v.name
|
||||
}
|
||||
})
|
||||
|
||||
this.distanceList.find(v => {
|
||||
if (v.id === this.formData.distance) {
|
||||
allName += v.name + '米'
|
||||
}
|
||||
})
|
||||
|
||||
/* this.exerciseTypeList.find(v => {
|
||||
if (v.id === this.formData.exerciseType) {
|
||||
allName += v.name
|
||||
}
|
||||
})*/
|
||||
|
||||
this.exerciseTypeList2.find(v => {
|
||||
if (v.id === this.formData.sports) {
|
||||
allName += v.name
|
||||
}
|
||||
})
|
||||
|
||||
this.projectTypeList.find(v => {
|
||||
if (v.id === this.formData.projectType) {
|
||||
allName += "(" + v.name + ")"
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
this.formData.allName = allName
|
||||
if (this.formData.ageDate && this.formData.ageDate.length > 0) {
|
||||
this.formData.startAgeDate = this.formData.ageDate[0]
|
||||
this.formData.endAgeDate = this.formData.ageDate[1]
|
||||
}
|
||||
|
||||
this.loading = true
|
||||
const resp = await $.post(loc() + "/doEdit", this.formData)
|
||||
this.loading = true
|
||||
if(resp.code===0){
|
||||
this.pageData();
|
||||
this.$refs.guava.index()
|
||||
}else{
|
||||
this.notifyWarning(resp.msg)
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
openEdit(data) {
|
||||
this.focusGroup()
|
||||
this.exerciseType()
|
||||
this.focusDistance()
|
||||
this.formData = {
|
||||
id: data.id,
|
||||
isInterest: data.isInterest,
|
||||
competitionCategory: data.competitionCategory,
|
||||
distance: data.distance,
|
||||
exerciseType: data.exerciseType,
|
||||
sports: data.sports,
|
||||
projectType: data.projectType,
|
||||
note: data.note,
|
||||
isMenWomen: data.isMenWomen,
|
||||
projectCode: data.projectCode,
|
||||
oldProjectCode: data.projectCode
|
||||
|
||||
}
|
||||
if (data.startAgeDate != null) {
|
||||
this.$set(this.formData, "ageDate", [data.startAgeDate, data.endAgeDate])
|
||||
}
|
||||
|
||||
this.changeExercise_typeList()
|
||||
this.$refs.guava.edit()
|
||||
},
|
||||
doDelete(row) {
|
||||
const {id} = row
|
||||
this.$confirm('确定要删除该活动吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
callback: async (a, b) => {
|
||||
if ("confirm" === a) {//确认后再执行
|
||||
|
||||
this.$set(row, "loading", true)
|
||||
const resp = await $.post(loc() + "/doDelete", {id: id});
|
||||
this.$set(row, "loading", false)
|
||||
if(resp.code===0){
|
||||
this.pageData()
|
||||
}else{
|
||||
this.notifyWarning(resp.msg)
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
async created() {
|
||||
this.pageData()
|
||||
this.ageInput(this.pageForm.age)
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,310 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
|
||||
<style>
|
||||
.query-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 10px 0;
|
||||
}
|
||||
|
||||
.query-row:not(:last-child) {
|
||||
border-bottom: 1px dashed rgb(230, 230, 230);
|
||||
}
|
||||
|
||||
.query-row > .query-title {
|
||||
width: 100px;
|
||||
max-width: 100px;
|
||||
min-width: 100px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.query-row > .query-content {
|
||||
min-width: 200px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.query-row > .query-content > .el-tag {
|
||||
margin-bottom: 5px;
|
||||
margin-top: 5px;
|
||||
}
|
||||
|
||||
@media screen and (max-width: 992px) {
|
||||
.query-row:nth-child(4) .query-content .el-col:not(:last-child) {
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
.query-title {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
.reverseCheckBox {
|
||||
margin: 0 10px 0 0 !important;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
<div id="app" v-cloak>
|
||||
<guava>
|
||||
<user-scope ref="userScope"></user-scope>
|
||||
</guava>
|
||||
|
||||
</div>
|
||||
|
||||
<script>
|
||||
var vue = new Vue({
|
||||
el: '#app',
|
||||
mixins: [initTableMixins],
|
||||
data() {
|
||||
return {
|
||||
/* userList: [],
|
||||
is_H04: "${@shiro.hasRole('H04')}" === 'true',
|
||||
is_A06: "${@shiro.hasRole('A06')}" === 'true',
|
||||
is_H10: "${@shiro.hasRole('H10')}" === 'true',
|
||||
is_H02: "${@shiro.hasRole('club01')}" === 'true',
|
||||
is_sysadmin: "${@shiro.hasRole('sysadmin')}" === 'true',
|
||||
clubOptions: [],
|
||||
settingLoading: false,
|
||||
setDialogVisible: false,
|
||||
setGroupType: null,
|
||||
setGroupId: null,
|
||||
setGroupName: null,
|
||||
personTypeOptions: [],
|
||||
userStateOptions: [],
|
||||
activityGroupList: [],
|
||||
activityGroupList2: [],
|
||||
memberTypeOptions: [{
|
||||
code: 'unionMember',
|
||||
name: '工会会员'
|
||||
}, {
|
||||
code: 'welfareMember',
|
||||
name: '福利会员'
|
||||
}, {
|
||||
code: 'sickFundMember',
|
||||
name: '基金会员'
|
||||
}],
|
||||
sexTypeOptions: [
|
||||
{code: '男', name: '男'},
|
||||
{code: '女', name: '女'}
|
||||
],
|
||||
pageForm: {
|
||||
unionId: "",
|
||||
unitId: "",
|
||||
searchName: "u.username",
|
||||
personTypes: [],
|
||||
userStates: [],
|
||||
memberStatus: [],
|
||||
memberTypes: [],
|
||||
sexTypes: [],
|
||||
minAge: 0,
|
||||
maxAge: 0,
|
||||
year: moment().format('YYYY'),
|
||||
module: "",
|
||||
teacherMeetingId: "",
|
||||
roleIds: [],
|
||||
userId: []
|
||||
},
|
||||
activityUnions: [],
|
||||
unions: [],
|
||||
units: [],
|
||||
activityUnits: [],
|
||||
menuOptions: [],
|
||||
meetingOptions: [],
|
||||
roleList: [],
|
||||
tableHeight: '0px',
|
||||
tableColumns: [
|
||||
{prop: 'loginName', label: '工号'},
|
||||
{prop: 'userName', label: '姓名'},
|
||||
{prop: 'sex', label: '性别'},
|
||||
{prop: 'birthday', label: '出生年月', sortable: true},
|
||||
{prop: 'age', label: '年龄', sortable: true},
|
||||
{prop: 'mobile', label: '联系电话'},
|
||||
{prop: 'personType', label: '人员类型', sortable: true},
|
||||
{prop: 'userState', label: '在职状态', sortable: true},
|
||||
{prop: 'unitName', label: '所属单位', sortable: true},
|
||||
{prop: 'unionName', label: '所属工会', sortable: true},
|
||||
{prop: 'activityUnionName', label: '活动工会', sortable: true},
|
||||
],
|
||||
rules: {
|
||||
setGroupType: [{required: true, message: '请选择添加方式', trigger: ['blur', 'change']}],
|
||||
setGroupId: [{required: true, message: '请选择分组', trigger: ['blur', 'change']}],
|
||||
setGroupName: [{required: true, message: '请输入分组名称', trigger: ['blur', 'change']}]
|
||||
},
|
||||
relatedSessionMenus: ['aca4d14498c145ceb5b24ed70776aae2', '733d7266652740a3aeac9da97ab5eeca', 'fe2d0768e26d4a80beeb159306bb8d01']*/
|
||||
}
|
||||
},
|
||||
components: {
|
||||
'user-scope': httpVueLoader('/components/plugins/UserScope.vue'),
|
||||
},
|
||||
methods: {
|
||||
/* doReset() {
|
||||
this.pageForm.userId = []
|
||||
this.pageForm.memberTypes = []
|
||||
this.pageForm.sexTypes = []
|
||||
this.pageForm.personTypes = []
|
||||
this.pageForm.userStates = []
|
||||
this.pageForm.unionId = null
|
||||
this.pageForm.module = null
|
||||
this.pageForm.teacherMeetingId = null
|
||||
this.pageForm.roleIds = []
|
||||
this.pageForm.clubId = null
|
||||
this.pageForm.activityGroupId = null
|
||||
this.pageForm.age = [0, 100]
|
||||
this.pageForm.reverseSelection = false
|
||||
},
|
||||
async queryUser(val) {
|
||||
const {list} = await selectUser(val, 10)
|
||||
this.userList = list
|
||||
},
|
||||
tagClick(key, val) {
|
||||
let idx = this.pageForm[key].indexOf(val)
|
||||
if (idx !== -1) {
|
||||
this.pageForm[key].splice(idx, 1)
|
||||
} else {
|
||||
this.pageForm[key].push(val)
|
||||
}
|
||||
this.doSearch()
|
||||
},
|
||||
async flushUnits() {
|
||||
this.$set(this.pageForm, "unitId", "")
|
||||
if ("${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')||@shiro.hasRole('H03')}" === 'true') {
|
||||
this.units = await getUnits(this.pageForm.unionId)
|
||||
this.activityUnits = await getActivityUnits(this.pageForm.activityUnionId)
|
||||
} else {
|
||||
this.units = await getUnits("${@shiro.getPrincipalProperty('unit').getUnionid()}")
|
||||
}
|
||||
},
|
||||
async pageData() {
|
||||
sublime.showLoadingbar()
|
||||
const pageForm = clone(this.pageForm)
|
||||
pageForm.personTypes = JSON.stringify(pageForm.personTypes)
|
||||
pageForm.userStates = JSON.stringify(pageForm.userStates)
|
||||
pageForm.memberStatus = JSON.stringify(pageForm.memberStatus)
|
||||
pageForm.memberTypes = JSON.stringify(pageForm.memberTypes)
|
||||
pageForm.sexTypes = JSON.stringify(pageForm.sexTypes)
|
||||
pageForm.roleIds = JSON.stringify(pageForm.roleIds)
|
||||
pageForm.userId = JSON.stringify(pageForm.userId)
|
||||
pageForm.age = JSON.stringify(pageForm.age)
|
||||
|
||||
const resp = await $.post(loc() + '/pageData', pageForm)
|
||||
if (resp.code === 0) {
|
||||
this.tableData = resp.data.list
|
||||
this.pageForm.totalCount = resp.data.totalCount
|
||||
}
|
||||
sublime.closeLoadingbar()
|
||||
},
|
||||
async doSetActivityUser() {
|
||||
const valid = await this.$refs.setForm.validate()
|
||||
if (!valid) {
|
||||
return
|
||||
}
|
||||
|
||||
// const {personTypes, userState, unionId, unitId} = this.pageForm
|
||||
// if (personTypes.length === 0 && userState.length === 0 && unionId === '' && unitId === '') {
|
||||
// this.$message.warning('请先指定筛选条件!')
|
||||
// return
|
||||
// }
|
||||
|
||||
if (this.tableData.length === 0) {
|
||||
this.$message.warning('请先指定筛选条件!')
|
||||
return
|
||||
}
|
||||
const confirm = await this.$confirm('是否将符合搜索条件的用户设为活动人员?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
})
|
||||
if (confirm === 'confirm') {
|
||||
this.settingLoading = true
|
||||
const pageForm = clone(this.pageForm)
|
||||
pageForm.personTypes = JSON.stringify(pageForm.personTypes)
|
||||
pageForm.userStates = JSON.stringify(pageForm.userStates)
|
||||
pageForm.memberStatus = JSON.stringify(pageForm.memberStatus)
|
||||
pageForm.memberTypes = JSON.stringify(pageForm.memberTypes)
|
||||
pageForm.sexTypes = JSON.stringify(pageForm.sexTypes)
|
||||
pageForm.roleIds = JSON.stringify(pageForm.roleIds)
|
||||
pageForm.userId = JSON.stringify(pageForm.userId)
|
||||
pageForm.clubId = pageForm.clubId
|
||||
Object.assign(pageForm, this.formData)
|
||||
const resp = await $.post(loc() + '/doSetActivityUser', pageForm)
|
||||
if (resp.code === 0) {
|
||||
this.setDialogVisible = false
|
||||
await this.getActivityGroup()
|
||||
this.doSearch()
|
||||
this.notifySuccess(resp.msg)
|
||||
this.formData = {
|
||||
setGroupType: null,
|
||||
setGroupId: null,
|
||||
setGroupName: null
|
||||
}
|
||||
}
|
||||
this.settingLoading = false
|
||||
}
|
||||
},*/
|
||||
/* async getActivityGroup() {
|
||||
const resp = await $.get(loc() + '/getActivityUserScopeGroup')
|
||||
this.activityGroupList = resp.data
|
||||
resp.data.forEach(v => {
|
||||
this.activityGroupList2.push({groupId: v.groupId, groupName: v.groupName + "范围之外人员"})
|
||||
})
|
||||
},
|
||||
async getMenuOptions() {
|
||||
const {data} = await $.get("/platform/sys/role/getMenuOptions")
|
||||
this.menuOptions = data
|
||||
},
|
||||
async getRoleListByMenuId() {
|
||||
if (['aca4d14498c145ceb5b24ed70776aae2', '733d7266652740a3aeac9da97ab5eeca'].includes(this.pageForm.module)) {
|
||||
//教代会
|
||||
let meets = await proposal.getOpenMeeting()
|
||||
this.meetingOptions = meets.map(v => ({...v, name: v.jdhallname}))
|
||||
} else if (['fe2d0768e26d4a80beeb159306bb8d01'].includes(this.pageForm.module)) {
|
||||
//工代会
|
||||
let meets = await getGdh(true)
|
||||
this.meetingOptions = meets.map(v => ({...v, name: v.gdhAllName}))
|
||||
}
|
||||
this.pageForm.teacherMeetingId = ''
|
||||
const {data} = await $.post(loc() + "/getRoleListByMenuId", {menuId: this.pageForm.module})
|
||||
this.roleList = data
|
||||
},*/
|
||||
},
|
||||
mounted() {
|
||||
setTimeout(() => {
|
||||
/**
|
||||
* .el-table::before 下有1px边框 故减1
|
||||
*/
|
||||
// this.tableHeight = window.innerHeight - (this.$refs.userTable.$el.getBoundingClientRect().top) - 20 - 50 - 10 - 1 + 'px'
|
||||
// window.onresize = () => {
|
||||
// this.tableHeight = window.innerHeight - (this.$refs.userTable.$el.getBoundingClientRect().top) - 20 - 50 - 10 - 1 + 'px'
|
||||
// }
|
||||
}, 500)
|
||||
},
|
||||
async created() {
|
||||
/* this.clubOptions = await getClubsByRole()
|
||||
if ("${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')||@shiro.hasRole('club01')}" === 'false' && "${@shiro.hasRole('H04')}" === 'true') {
|
||||
this.unions = await getUnionList("${@shiro.getPrincipalProperty('unit').getUnionid()}")
|
||||
this.$set(this.pageForm, "unionId", this.unions[0].id)
|
||||
} else {
|
||||
this.unions = await getUnions(null)
|
||||
this.activityUnions = await getActivityUnions()
|
||||
}
|
||||
if ("${@shiro.hasRole('H04')}" === 'false' && "${@shiro.hasRole('club01')}" === 'true') {
|
||||
if (this.clubOptions.length > 0) {
|
||||
this.$set(this.pageForm, "clubId", this.clubOptions[0].stid)
|
||||
}
|
||||
}
|
||||
this.flushUnits()
|
||||
await this.getActivityGroup()
|
||||
this.personTypeOptions = await getDictOptions("UserType")
|
||||
this.userStateOptions = await getDictOptions("UserState")
|
||||
await this.getMenuOptions()
|
||||
this.pageData()*/
|
||||
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,629 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
<style>
|
||||
.el-tag {
|
||||
border-radius: 50%;
|
||||
height: 22px;
|
||||
}
|
||||
|
||||
.el-transfer {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.el-transfer-panel {
|
||||
text-align: left;
|
||||
width: 35%;
|
||||
height: 400px;
|
||||
}
|
||||
|
||||
.el-transfer-panel__list.is-filterable {
|
||||
height: 300px;
|
||||
}
|
||||
|
||||
.v-tree-layout-left {
|
||||
overflow: unset !important;
|
||||
}
|
||||
|
||||
.v-tree-layout-left .v-tree {
|
||||
width: 100%;
|
||||
height: calc(100vh - 170px);
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.v-tree:hover::-webkit-scrollbar {
|
||||
width: 3px;
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
.v-tree-layout-left .custom-tree-node {
|
||||
width: 90%;
|
||||
position: relative;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.v-tree-layout-left .v-tree .v-node {
|
||||
width: 100%;
|
||||
display: inline-block;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar {
|
||||
/*width: 3px;*/
|
||||
/*background-color: transparent;*/
|
||||
display: none;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-thumb {
|
||||
background-color: rgba(0, 0, 0, 0.2);
|
||||
border-radius: 10px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div id="app" v-cloak>
|
||||
<guava ref="guava">
|
||||
<el-card shadow="never" style="height: calc(100vh - 70px)">
|
||||
<tree-layout >
|
||||
<template #tree>
|
||||
<div style="padding:0 20px 20px;">
|
||||
<el-input
|
||||
placeholder="输入关键字进行查找" clearable
|
||||
v-model="filterText">
|
||||
</el-input>
|
||||
</div>
|
||||
<el-tree ref="tree" :data="treeData" class="v-tree" v-loading="treeLoading" node-key="id"
|
||||
:props="defaultProps"
|
||||
default-expand-all :expand-on-click-node="false"
|
||||
@node-click="handleNodeClick" accordion @node-expand="nodeExpand"
|
||||
highlight-current :filter-node-method="filterNode">
|
||||
<div class="custom-tree-node" slot-scope="{ node, data }">
|
||||
|
||||
<div v-if="node.level==1" style="font-size: 16px;" class="v-node"><i
|
||||
class="el-icon-s-home"></i>
|
||||
{{ data.name }}
|
||||
</div>
|
||||
|
||||
<div v-if="node.level==2"
|
||||
style="font-size: 15px" :title="data.name" class="v-node">
|
||||
<i class="el-icon-star-on" v-if="checkData.name==data.name"></i>
|
||||
<i class="el-icon-star-off" v-else></i>
|
||||
{{ data.name }}
|
||||
</div>
|
||||
|
||||
|
||||
<div v-if="node.level==3"
|
||||
style="font-size: 14px" :title="data.name" class="v-node">
|
||||
<i class="fa fa-dot-circle-o" v-if="checkData.name==data.name"></i>
|
||||
<i class="fa fa-circle-o" v-else></i>
|
||||
{{ data.name }}
|
||||
</div>
|
||||
|
||||
|
||||
<div v-if="node.level>3"
|
||||
style="font-size: 14px" :title="data.name" class="v-node">
|
||||
<i class="fa fa-dot-circle-o" v-if="checkData.name==data.name"></i>
|
||||
<i class="fa fa-circle-o" v-else></i>
|
||||
{{ data.name }}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</el-tree>
|
||||
|
||||
</template>
|
||||
<template>
|
||||
<div v-if="checkNode.level===1" style="padding:0 10px">
|
||||
<el-card shadow="never">
|
||||
<div class="btn-group tool-button mt5">
|
||||
<el-input placeholder="请输入内容" clearable v-model="pageForm.searchKeyword"
|
||||
@keyup.enter.native="doSearch">
|
||||
<el-select v-model="pageForm.searchName" slot="prepend" placeholder="查询类型"
|
||||
style="width: 120px;">
|
||||
<el-option label="单位名称" value="name"></el-option>
|
||||
<el-option label="单位代码" value="unitcode"></el-option>
|
||||
</el-select>
|
||||
</el-input>
|
||||
</div>
|
||||
<div class="btn-group tool-button mt5">
|
||||
<el-button type="primary" icon="el-icon-search" @click="doSearch"></el-button>
|
||||
</div>
|
||||
|
||||
<div class="pull-right offscreen-right mt5">
|
||||
<div class="btn-group tool-button">
|
||||
<el-button icon="el-icon-plus" @click="openAdd">新建单位</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<el-card class="mt10" shadow="never">
|
||||
<el-table :data="tableData" style="width: 100%" row-key="id" @sort-change="pageOrder"
|
||||
v-loading="tabLoading" size="medium">
|
||||
<el-table-column align="center" :key="1" header-align="center" label="序号"
|
||||
type="index">
|
||||
<template scope="scope">
|
||||
<span>{{scope.$index+(pageForm.pageNumber - 1) * pageForm.pageSize + 1}} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column align="center" header-align="center" label="单位名称"
|
||||
prop="name"></el-table-column>
|
||||
|
||||
<el-table-column align="center" header-align="center" label="单位代码"
|
||||
prop="unitcode">
|
||||
<template scope="{row}">
|
||||
{{row.unitcode}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="单位等级" header-align="center" prop="unitlevel"
|
||||
:show-overflow-tooltip="true" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-button v-if="scope.row.unitlevel==1" size="mini" type="success" round
|
||||
style=" vertical-align: middle;">1级
|
||||
</el-button>
|
||||
<el-button v-if="scope.row.unitlevel==2" size="mini" type="warning" round
|
||||
style=" vertical-align: middle;">2级
|
||||
</el-button>
|
||||
<el-button v-if="scope.row.unitlevel==3" size="mini" type="danger" round
|
||||
style=" vertical-align: middle;">3级
|
||||
</el-button>
|
||||
<el-button v-if="scope.row.unitlevel>3" size="mini" type="info" round
|
||||
style=" vertical-align: middle;">{{scope.row.unitlevel}}级
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column align="center" header-align="center" prop="operating" label="操作"
|
||||
width="200px">
|
||||
<template slot-scope="{row}">
|
||||
<el-dropdown @command="dropdownCommand">
|
||||
<el-button size="mini">
|
||||
<i class="ti-settings"></i>
|
||||
<span class="ti-angle-down"></span>
|
||||
</el-button>
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-item :command="{type:'edit',data:row}">
|
||||
编辑
|
||||
</el-dropdown-item>
|
||||
|
||||
<el-dropdown-item :command="{type:'delete',data:row}">
|
||||
删除
|
||||
</el-dropdown-item>
|
||||
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
</el-table>
|
||||
<!--#include("/layouts/pagination.html"){}#-->
|
||||
</el-card>
|
||||
|
||||
</div>
|
||||
|
||||
<div v-if="checkNode.level===2" style="padding:0 10px">
|
||||
<el-card shadow="never">
|
||||
<div class="btn-group tool-button mt5">
|
||||
<el-input placeholder="请输入内容" clearable v-model="userPageForm.searchKeyword"
|
||||
@keyup.enter.native="doUserSearch">
|
||||
<el-select v-model="userPageForm.searchName" slot="prepend" placeholder="查询类型"
|
||||
style="width: 80px;">
|
||||
<el-option label="姓名" value="username"></el-option>
|
||||
<el-option label="工号" value="loginname"></el-option>
|
||||
</el-select>
|
||||
</el-input>
|
||||
</div>
|
||||
<div class="btn-group tool-button mt5">
|
||||
<el-button type="primary" icon="el-icon-search" @click="doUserSearch"></el-button>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<el-card shadow="never" class="mt10">
|
||||
<el-tabs v-model="activeName1" type="card" @tab-click="handleClick">
|
||||
<el-tab-pane label="单位人员" name="first"></el-tab-pane>
|
||||
<el-tab-pane label="单位负责人" name="second"></el-tab-pane>
|
||||
</el-tabs>
|
||||
|
||||
<el-table :data="userTableData" style="width: 100%" @sort-change="userPageOrder"
|
||||
size="medium">
|
||||
<el-table-column align="center" header-align="center" label="序号" type="index">
|
||||
<template scope="scope">
|
||||
<span>{{scope.$index+(userPageForm.pageNumber - 1) * userPageForm.pageSize + 1}} </span>
|
||||
</template>
|
||||
</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="loginname"></el-table-column>
|
||||
|
||||
<el-table-column align="center" header-align="center" label="性别"
|
||||
prop="sex">
|
||||
<template scope="{row:{sex}}">
|
||||
<span v-if="sex">{{sex}}</span>
|
||||
<span v-else>暂无</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column align="center" header-align="center" label="手机号"
|
||||
prop="mobile">
|
||||
<template scope="{row:{mobile}}">
|
||||
<span v-if="mobile">{{mobile}}</span>
|
||||
<span v-else>暂无</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column align="center" header-align="center" label="是否会员"
|
||||
prop="member">
|
||||
<template scope="{row:{member}}">
|
||||
<span v-if="member==1" class="text-success">是</span>
|
||||
<span v-else>否</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
</el-table>
|
||||
<el-row v-if="activeName1 === 'first'" class="el-pagination-container">
|
||||
<el-pagination
|
||||
@size-change="userPageSizeChange"
|
||||
@current-change="userPageNumberChange"
|
||||
:current-page="userPageForm.pageNumber"
|
||||
:page-sizes="[10, 20, 30, 50]"
|
||||
:page-size="userPageForm.pageSize"
|
||||
layout="total, sizes, prev, pager, next"
|
||||
:total="userPageForm.totalCount">
|
||||
</el-pagination>
|
||||
</el-row>
|
||||
</el-card>
|
||||
|
||||
|
||||
</div>
|
||||
</template>
|
||||
</tree-layout>
|
||||
</el-card>
|
||||
<template #edit>
|
||||
|
||||
<el-divider content-position="left"><span style="color: rgb(121, 187, 255)">请填写以下单位信息</span>
|
||||
</el-divider>
|
||||
<el-form :model="formData" ref="form" :rules="formRules" label-position="top"
|
||||
label-width="120px"
|
||||
style="padding: 0 30px">
|
||||
<el-row gutter="30">
|
||||
<el-col :span="24">
|
||||
<el-form-item label="上级单位">
|
||||
<el-input maxlength="100" disabled :value="checkData.name"
|
||||
type="text"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="单位名称" prop="name">
|
||||
<el-input maxlength="100" placeholder="请输入单位名称" v-model="formData.name"
|
||||
type="text"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="单位代码" prop="unitcode">
|
||||
<el-input maxlength="100" placeholder="请输入社团编码" v-model="formData.unitcode"
|
||||
type="text"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="单位简称" prop="aliasName">
|
||||
<el-input maxlength="100" placeholder="请输入单位简称" v-model="formData.aliasName"
|
||||
type="text"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="联系电话" prop="telephone">
|
||||
<el-input maxlength="100" placeholder="请输入联系电话" v-model="formData.telephone"
|
||||
type="text"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="单位邮箱" prop="email">
|
||||
<el-input maxlength="100" placeholder="请输入单位邮箱" v-model="formData.email"
|
||||
type="text"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="单位网站" prop="website">
|
||||
<el-input maxlength="100" placeholder="请输入单位网站" v-model="formData.website"
|
||||
type="text"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="24">
|
||||
<el-form-item label="单位地址" prop="address">
|
||||
<el-input maxlength="100" placeholder="请输入单位地址" v-model="formData.address"
|
||||
type="text"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="单位介绍" prop="note">
|
||||
<el-input maxlength="500" type="textarea" placeholder="请输入单位介绍"
|
||||
v-model="formData.note"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
|
||||
<div style="display: flex;justify-content:flex-end;margin-top: 30px">
|
||||
<el-button type="primary" :loading="loading" @click="!formData.id?doAdd():doEdit()">提 交
|
||||
</el-button>
|
||||
</div>
|
||||
</el-form>
|
||||
|
||||
</template>
|
||||
</guava>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
|
||||
var vue = new Vue({
|
||||
el: '#app',
|
||||
data() {
|
||||
return {
|
||||
activeName1: 'first',
|
||||
userTableData: [],
|
||||
userPageForm: {
|
||||
searchName: "username",
|
||||
searchKeyword: "",
|
||||
pageNumber: 1,
|
||||
pageSize: 10,
|
||||
totalCount: 0,
|
||||
pageOrderName: "",
|
||||
pageOrderBy: ""
|
||||
},
|
||||
loading: false,
|
||||
filterText: '',
|
||||
defaultProps: {
|
||||
children: 'child',
|
||||
label: 'name',
|
||||
},
|
||||
exKeys: ['0'],
|
||||
activeName: [],
|
||||
typeOptions: [],
|
||||
treeLoading: true,
|
||||
tabLoading: false,
|
||||
formData: {},
|
||||
detailData: {},
|
||||
treeData: [],
|
||||
tableData: [],
|
||||
pageForm: {
|
||||
searchName: "name",
|
||||
searchKeyword: "",
|
||||
pageNumber: 1,
|
||||
pageSize: 10,
|
||||
totalCount: 0,
|
||||
pageOrderName: "",
|
||||
pageOrderBy: ""
|
||||
},
|
||||
formRules: {
|
||||
name: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
code: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
},
|
||||
checkNode: {level: 1},
|
||||
checkData: {},
|
||||
campusOptions: [],
|
||||
loading: false,
|
||||
}
|
||||
},
|
||||
components: {
|
||||
'tree-layout': httpVueLoader('/components/plugins/TreeLayout.vue'),
|
||||
'guava': httpVueLoader('/components/plugins/Guava.vue'),
|
||||
},
|
||||
watch: {
|
||||
filterText(val) {
|
||||
this.$refs.tree.filter(val);
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handleClick(tab, event) {
|
||||
this.doUserSearch()
|
||||
},
|
||||
|
||||
dropdownCommand: function (command) {
|
||||
const {type, data} = command
|
||||
if (type == 'view') {
|
||||
|
||||
} else if (type == 'edit') {
|
||||
this.openEdit(data.id)
|
||||
} else if (type == 'delete') {
|
||||
this.doDelete(data.id)
|
||||
}
|
||||
},
|
||||
filterNode(value, data, node) {
|
||||
if (!value) return true;
|
||||
return data.name.indexOf(value) !== -1
|
||||
|
||||
return false
|
||||
},
|
||||
nodeExpand(data, node, e) {
|
||||
|
||||
},
|
||||
async handleNodeClick(data, node) {
|
||||
this.checkData = data
|
||||
this.checkNode = node
|
||||
if (node.level === 1) {
|
||||
this.doSearch()
|
||||
} else if (node.level === 2) {
|
||||
this.doUserSearch()
|
||||
}
|
||||
},
|
||||
async doDelete(id) {
|
||||
const confirm = await this.$confirm('确定要删除该单位吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
})
|
||||
if (confirm === "confirm") {
|
||||
const resp = await $.post(loc() + "/doDelete", {id})
|
||||
if(resp.code===0){
|
||||
this.loadTree(false)
|
||||
this.pageData()
|
||||
}else{
|
||||
this.notifyWarning(resp.msg)
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
doEdit() {
|
||||
this.$refs["form"].validate(async (valid) => {
|
||||
if (valid) {
|
||||
this.loading = true
|
||||
const resp = await $.post(loc() + "/doEdit", this.formData)
|
||||
this.loading = false
|
||||
if(resp.code===0){
|
||||
this.loadTree(false)
|
||||
this.pageData();
|
||||
this.$refs.guava.index()
|
||||
}else{
|
||||
this.notifyWarning(resp.msg)
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
async openEdit(id) {
|
||||
const resp = await $.get(loc() + "/findOne", {id})
|
||||
if(resp.code===0){
|
||||
this.formData = data
|
||||
this.$refs.guava.edit()
|
||||
if (this.$refs['form']) {
|
||||
this.$refs['form'].resetFields()
|
||||
}
|
||||
}else{
|
||||
this.notifyWarning(resp.msg)
|
||||
}
|
||||
},
|
||||
doAdd() {
|
||||
this.$refs["form"].validate(async (valid) => {
|
||||
if (valid) {
|
||||
this.loading = true
|
||||
const resp = await $.post(loc() + "/doAdd", this.formData)
|
||||
this.loading = false
|
||||
if(resp.code===0){
|
||||
this.loadTree(false)
|
||||
this.pageData();
|
||||
this.$refs.guava.index()
|
||||
}else{
|
||||
this.notifyWarning(resp.msg)
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
openAdd() {
|
||||
const {id, unitlevel} = this.checkData
|
||||
this.formData = {
|
||||
parentId: id,
|
||||
unitlevel: unitlevel + 1
|
||||
}
|
||||
this.$refs.guava.edit()
|
||||
if (this.$refs['form']) {
|
||||
this.$refs['form'].resetFields()
|
||||
}
|
||||
},
|
||||
doSearch() {
|
||||
this.tabKey = new Date().getTime()
|
||||
this.pageForm.pageNumber = 1
|
||||
this.pageData()
|
||||
},
|
||||
pageOrder(column) {//按字段排序
|
||||
this.pageForm.pageOrderName = column.prop;
|
||||
this.pageForm.pageOrderBy = column.order;
|
||||
this.pageData();
|
||||
},
|
||||
pageNumberChange(val) {//页码更新操作
|
||||
this.pageForm.pageNumber = val;
|
||||
this.pageData();
|
||||
},
|
||||
pageSizeChange(val) {//分页大小更新操作
|
||||
this.pageForm.pageSize = val;
|
||||
this.pageData();
|
||||
},
|
||||
pageData() {//加载分页数据
|
||||
sublime.showLoadingbar();//显示loading
|
||||
this.tabLoading = true
|
||||
this.pageForm.parentId = this.checkData.id
|
||||
$.post(loc() + "/pageData", this.pageForm, (data) => {
|
||||
sublime.closeLoadingbar();//关闭loading
|
||||
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 loadTree(flush) {
|
||||
this.treeLoading = true
|
||||
const {code, data, msg} = await $.get(loc() + "/getUnitTreeData")
|
||||
this.treeLoading = false
|
||||
if (code == 0) {
|
||||
this.treeData = data
|
||||
} else {
|
||||
this.$message({
|
||||
message: data.msg,
|
||||
type: 'error'
|
||||
});
|
||||
}
|
||||
|
||||
if (flush && code == 0) {
|
||||
this.checkData = data[0]
|
||||
this.pageData();
|
||||
}
|
||||
},
|
||||
|
||||
doUserSearch() {
|
||||
this.tabKey = new Date().getTime()
|
||||
this.userPageForm.pageNumber = 1
|
||||
this.userPageData()
|
||||
},
|
||||
userPageOrder(column) {
|
||||
this.userPageForm.pageOrderName = column.prop;
|
||||
this.userPageForm.pageOrderBy = column.order;
|
||||
this.userPageData();
|
||||
},
|
||||
userPageNumberChange(val) {
|
||||
this.userPageForm.pageNumber = val;
|
||||
this.userPageData();
|
||||
},
|
||||
userPageSizeChange(val) {
|
||||
this.userPageForm.pageSize = val;
|
||||
this.userPageData();
|
||||
},
|
||||
async userPageData() {
|
||||
this.userPageForm.unitId = this.checkData.id
|
||||
sublime.showLoadingbar()
|
||||
const resp = await $.post(loc() + "/findPersonByUnitId", this.userPageForm)
|
||||
sublime.closeLoadingbar();
|
||||
if(resp.code===0){
|
||||
if (this.activeName1 === 'first') {
|
||||
this.userTableData = resp.data.userList.list
|
||||
this.userPageForm.totalCount = resp.data.userList.totalCount;
|
||||
} else {
|
||||
this.userTableData = resp.data.principal
|
||||
this.userPageForm.totalCount = 0;
|
||||
}
|
||||
}else{
|
||||
this.notifyWarning(resp.msg)
|
||||
}
|
||||
}
|
||||
},
|
||||
async created() {
|
||||
this.loadTree(true)
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,275 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
|
||||
<style>
|
||||
.query-row {
|
||||
|
||||
}
|
||||
|
||||
.query-title {
|
||||
color: rgb(100, 100, 100);
|
||||
margin-right: 10px;
|
||||
min-width: 75px;
|
||||
}
|
||||
|
||||
.query-content {
|
||||
|
||||
}
|
||||
</style>
|
||||
|
||||
<div id="app" v-cloak>
|
||||
<guava>
|
||||
<user-data-scope
|
||||
ref="userDataScope"
|
||||
:group_id.sync="formData.activityGroupId"
|
||||
></user-data-scope>
|
||||
</guava>
|
||||
<!--<guava>
|
||||
<el-card shadow="never">
|
||||
<div class="search">
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">活动分组:</div>
|
||||
<div class="search-item-option">
|
||||
<el-select placeholder="活动分组" v-model="pageForm.groupId"
|
||||
style="width: 100%;"
|
||||
@change="doSearch"
|
||||
filterable>
|
||||
<el-option v-for="item in activityGroupList" :label="item.groupName"
|
||||
:value="item.groupId"></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">姓名工号:</div>
|
||||
<div class="search-item-option">
|
||||
<el-input placeholder="请输入内容" clearable v-model="pageForm.searchKeyword"
|
||||
style="width: 100%"
|
||||
@keyup.enter.native="doSearch">
|
||||
<el-select v-model="pageForm.searchName" slot="prepend"
|
||||
placeholder="查询类型"
|
||||
style="width: 80px;">
|
||||
<el-option label="姓名" value="username"></el-option>
|
||||
<el-option label="工号" value="loginname"></el-option>
|
||||
</el-select>
|
||||
</el-input>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="search-item"
|
||||
v-if="${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')||@shiro.hasRole('H03')}">
|
||||
<div class="search-item-label">所属工会:</div>
|
||||
<div class="search-item-option">
|
||||
<el-select placeholder="所属工会" v-model="pageForm.unionId"
|
||||
style="width: 100%;"
|
||||
clearable="true"
|
||||
@change="flushUnits" @clear="flushUnits"
|
||||
filterable="true">
|
||||
<el-option v-for="item in unions" :label="item.unionname"
|
||||
:value="item.id"></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">所属单位:</div>
|
||||
<div class="search-item-option">
|
||||
<el-select placeholder="所属单位" v-model="pageForm.unitId" style="width: 100%;"
|
||||
clearable="true"
|
||||
@change="doSearch"
|
||||
filterable="true">
|
||||
<el-option v-for="item in units" :label="item.name"
|
||||
:value="item.id"></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!–<div class="search-item"
|
||||
v-if="${@shiro.hasRole('sysadmin')}">
|
||||
<div class="search-item-label">活动工会:</div>
|
||||
<div class="search-item-option">
|
||||
<el-select placeholder="所属工会" v-model="pageForm.activityUnionId"
|
||||
style="width: 100%;"
|
||||
clearable="true"
|
||||
@change="flushUnits" @clear="flushUnits"
|
||||
filterable="true">
|
||||
<el-option v-for="item in ActivityUnions" :label="item.unionname"
|
||||
:value="item.id"></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="search-item" v-if="${@shiro.hasRole('sysadmin')}">
|
||||
<div class="search-item-label">活动单位:</div>
|
||||
<div class="search-item-option">
|
||||
<el-select placeholder="所属单位" v-model="pageForm.activityUnitId"
|
||||
style="width: 100%;"
|
||||
clearable="true"
|
||||
@change="doSearch"
|
||||
filterable="true">
|
||||
<el-option v-for="item in ActivityUnits" :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">
|
||||
<dict-select v-model="pageForm.personType" style="width: 100%" clearable
|
||||
placeholder="人员类型"
|
||||
@change="doSearch"
|
||||
code="UserType"></dict-select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">在职状态:</div>
|
||||
<div class="search-item-option">
|
||||
<dict-select v-model="pageForm.userState" style="width: 100%" clearable
|
||||
placeholder="在职状态"
|
||||
@change="doSearch"
|
||||
code="UserState"></dict-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="currentGroupName" :app="this">
|
||||
<template #label_end>
|
||||
<span class="text-danger pl5">提醒:删除活动分组操作,请先选择某个活动分组后,再点击右边的删除按钮。</span>
|
||||
</template>
|
||||
<template #func>
|
||||
<el-button @click="doDelete(null,pageForm.groupId)"
|
||||
type="danger"
|
||||
size="medium" :disabled="tableData.length===0">
|
||||
删除{{currentGroupName}}
|
||||
</el-button>
|
||||
</template>
|
||||
</table-tool>
|
||||
<el-table ref="userTable" :data="tableData" stripe border :size="tableSize">
|
||||
<el-table-column type="index" label="序号" width="80px"></el-table-column>
|
||||
<el-table-column
|
||||
align="center"
|
||||
header-align="center"
|
||||
v-for="column in tableColumns"
|
||||
show-overflow-tooltip
|
||||
:label="column.label"
|
||||
:prop="column.prop"
|
||||
:sortable="column.sortable"
|
||||
></el-table-column>
|
||||
<el-table-column align="center" header-align="center" label="操作" width="100">
|
||||
<template scope="{row}">
|
||||
<el-button size="mini" type="danger" @click="doDelete(row.id,null)">删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!–#include("/layouts/pagination.html"){}#–>
|
||||
</el-card>
|
||||
|
||||
</guava>-->
|
||||
</div>
|
||||
|
||||
<script>
|
||||
var vue = new Vue({
|
||||
el: '#app',
|
||||
mixins: [initTableMixins],
|
||||
components: {
|
||||
'dict-select': httpVueLoader('/components/plugins/DictSelect.vue?v=1.0.0'),
|
||||
'user-data-scope': httpVueLoader('/components/plugins/UserDataScope.vue'),
|
||||
},
|
||||
computed: {
|
||||
currentGroupName() {
|
||||
if (this.pageForm.groupId) {
|
||||
const group = this.activityGroupList.find(v => v.groupId === this.pageForm.groupId)
|
||||
return group.groupName + '人员'
|
||||
}
|
||||
return '全部人员'
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
activityGroupList: [],
|
||||
ActivityUnions: [],
|
||||
ActivityUnits: [],
|
||||
unions: [],
|
||||
units: [],
|
||||
pageForm: {
|
||||
unionId: "",
|
||||
unitId: "",
|
||||
searchName: "username",
|
||||
personTypes: [],
|
||||
userStates: [],
|
||||
memberStatus: [],
|
||||
year: moment().format('YYYY')
|
||||
},
|
||||
tableColumns: [
|
||||
{prop: 'loginName', label: '工号'},
|
||||
{prop: 'userName', label: '姓名'},
|
||||
{prop: 'sex', label: '性别'},
|
||||
{prop: 'birthday', label: '出生年月'},
|
||||
{prop: 'mobile', label: '联系电话'},
|
||||
{prop: 'personType', label: '人员类型', sortable: true},
|
||||
{prop: 'userState', label: '在职状态', sortable: true},
|
||||
{prop: 'unitName', label: '所属单位', sortable: true},
|
||||
{prop: 'unionName', label: '所属工会', sortable: true},
|
||||
{prop: 'activityUnionName', label: '活动工会', sortable: true},
|
||||
{prop: 'groupName', label: '所属分组', sortable: true},
|
||||
],
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async doDelete(id, groupId) {
|
||||
const confirm = await this.$confirm('您确定要删除吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
})
|
||||
if (confirm === 'confirm') {
|
||||
this.pageForm.id = id
|
||||
const resp = await $.post(loc() + '/doDelete', this.pageForm)
|
||||
if (resp.code === 0) {
|
||||
this.notifySuccess(resp.msg)
|
||||
this.doSearch()
|
||||
}
|
||||
}
|
||||
},
|
||||
async flushUnits() {
|
||||
this.$set(this.pageForm, "unitId", "")
|
||||
if ("${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')||@shiro.hasRole('H03')}" === 'true') {
|
||||
this.units = await getUnits(this.pageForm.unionId)
|
||||
this.ActivityUnits = await getActivityUnits(this.pageForm.activityUnionId)
|
||||
} else {
|
||||
this.units = await getClubUnits()
|
||||
}
|
||||
this.doSearch()
|
||||
},
|
||||
async getActivityGroup() {
|
||||
const resp = await $.get('/platform/activity/basic/scope/getActivityUserScopeGroup')
|
||||
this.activityGroupList = resp.data
|
||||
if (resp.data && resp.data.length > 0) {
|
||||
this.$set(this.pageForm, "groupId", resp.data[0].groupId)
|
||||
}
|
||||
}
|
||||
},
|
||||
async created() {
|
||||
this.pageData()
|
||||
await this.getActivityGroup()
|
||||
this.unions = await getUnions(null)
|
||||
this.ActivityUnions = await getActivityUnions()
|
||||
this.flushUnits()
|
||||
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,31 @@
|
||||
|
||||
class typeUtil {
|
||||
|
||||
constructor() {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取全部会议类型
|
||||
* @returns {Promise<*[]|*>}
|
||||
*/
|
||||
async getAllType() {
|
||||
const resp = await $.get('/platform/activity/site/type/findAll')
|
||||
if (resp.code === 0) {
|
||||
resp.data.forEach(v => {
|
||||
v['text'] = v['meetingTypeName']
|
||||
v['value'] = v['id']
|
||||
})
|
||||
return resp.data
|
||||
}
|
||||
return []
|
||||
}
|
||||
|
||||
async findMaxStateId() {
|
||||
const resp = await $.get('/platform/activity/site/type/findMaxStateId')
|
||||
if (resp.code === 0) {
|
||||
return resp.data
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
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">年  度</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">年  度</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>
|
||||
<!– <tr v-for="(o,k,index) in tableDataUnionPrize['其他']">–>
|
||||
<!– <td 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>–>
|
||||
|
||||
|
||||
</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>
|
||||
<!– <el-button @click="doExportByEnroll" icon="el-icon-printer" plain size="small"
|
||||
style="position: absolute;right: 0px" type="primary">导出报名信息
|
||||
</el-button>–>
|
||||
</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">年  度</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}">
|
||||
查  看
|
||||
</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="工  号">
|
||||
<el-input maxlength="50" placeholder="请填写工号" v-model="formData.loginname"
|
||||
type="text" @blur="userBlur"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="username" label="姓  名">
|
||||
<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="工  号">
|
||||
<el-input maxlength="50" placeholder="请填写工号" v-model="formData.loginname"
|
||||
type="text"></el-input>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item prop="mobile" label="电  话">
|
||||
<el-input maxlength="50" placeholder="请填写电话" v-model="formData.mobile"
|
||||
type="text"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="sex" label="性  别">
|
||||
<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>
|
||||
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,422 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
<style>
|
||||
.el-select {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.remindTextArea textarea {
|
||||
resize: none;
|
||||
}
|
||||
|
||||
.remindClass {
|
||||
width: 100%;
|
||||
white-space: break-spaces;
|
||||
font-size: 14px;
|
||||
line-height: 25px;
|
||||
background-color: white;
|
||||
max-height: 600px;
|
||||
overflow-y: scroll;
|
||||
}
|
||||
|
||||
.el-divider {
|
||||
background-color: #1867b0;
|
||||
}
|
||||
|
||||
.el-divider__text {
|
||||
color: #1867b0;
|
||||
}
|
||||
</style>
|
||||
<div id="app" v-cloak>
|
||||
<guava ref="guava">
|
||||
<template>
|
||||
<el-card shadow="never">
|
||||
<template #header>
|
||||
<h3 style="color: #1867b0">场地预约</h3>
|
||||
</template>
|
||||
|
||||
<template>
|
||||
<el-divider content-position="left">申请信息填写</el-divider>
|
||||
<el-form :model="formData" :rules="formRules" label-width="120px" ref="addForm">
|
||||
|
||||
<el-row :gutter="20" type="flex">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="预约人" prop="reserve_person_username">
|
||||
<el-input readonly placeholder="预约人"
|
||||
v-model="formData.reserve_person_username"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="预约人工号" prop="reserve_person_loginname">
|
||||
<el-input readonly placeholder="预约人工号"
|
||||
v-model="formData.reserve_person_loginname"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="20" type="flex">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="预约人性别" prop="reserve_person_sex">
|
||||
<el-input readonly placeholder="预约人性别"
|
||||
v-model="formData.reserve_person_sex"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="联系电话" prop="reserve_person_phone">
|
||||
<el-input readonly placeholder="联系电话"
|
||||
v-model="formData.reserve_person_phone"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="20" type="flex">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="申请部门" prop="reserve_person_unit">
|
||||
<el-select disabled
|
||||
placeholder="申请部门"
|
||||
v-model="formData.reserve_person_unit">
|
||||
<el-option :label="item.name"
|
||||
:value="item.id"
|
||||
v-for="item in units">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="申请工会" prop="reserve_person_unionname">
|
||||
<el-input readonly placeholder="申请工会"
|
||||
v-model="formData.reserve_person_unionname"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="20" type="flex">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="预约场地" prop="site_id">
|
||||
<el-select clearable @change="siteChange"
|
||||
filterable placeholder="请选择预约场地"
|
||||
v-model="formData.site_id">
|
||||
<el-option :key="item.id" :label="item.name"
|
||||
:value="item.id"
|
||||
v-for="item in siteInfoList">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<div style="margin-top: 10px">
|
||||
<span style="color: red">提示:选择不同的预约场地,可以查看不同场地的申请情况!</span>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="20" type="flex">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="预约开始时间" prop="reserve_start_time">
|
||||
<el-date-picker style="width: 100%"
|
||||
type="datetime"
|
||||
:picker-options="pickerOptions"
|
||||
placeholder="请选择预约开始时间"
|
||||
@focus="timeEditable"
|
||||
:editable="false"
|
||||
v-model="formData.reserve_start_time"
|
||||
format="yyyy-MM-dd HH:mm:ss"
|
||||
value-format="yyyy-MM-dd HH:mm:ss">
|
||||
</el-date-picker>
|
||||
<!-- <span class="text-danger">由于2024年3月14,15两日开展教代会会议故无法申请该两天的场地。</span>-->
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="预约结束时间" prop="reserve_end_time">
|
||||
<el-date-picker style="width: 100%"
|
||||
type="datetime"
|
||||
:editable="false"
|
||||
@focus="timeEditable"
|
||||
placeholder="请选择预约结束时间"
|
||||
:picker-options="pickerOptions"
|
||||
v-model="formData.reserve_end_time"
|
||||
format="yyyy-MM-dd HH:mm:ss"
|
||||
value-format="yyyy-MM-dd HH:mm:ss">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="20" type="flex">
|
||||
<!-- <el-col :span="12">-->
|
||||
<!-- <el-form-item label="预约活动项目" prop="reserve_activity">-->
|
||||
<!-- <el-input placeholder="请填写预约活动项目" maxlength="100"-->
|
||||
<!-- v-model="formData.reserve_activity"></el-input>-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- </el-col>-->
|
||||
<el-col :span="12">
|
||||
<el-form-item label="预约事由" prop="reserve_cause">
|
||||
<el-input placeholder="请填写预约事由" maxlength="100"
|
||||
v-model="formData.reserve_cause"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="参加人数" prop="reserve_join_user_num">
|
||||
<el-input placeholder="请填写参加人数"
|
||||
v-model="formData.reserve_join_user_num"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="20" type="flex">
|
||||
|
||||
<!-- <el-col :span="12">-->
|
||||
<!-- <el-form-item label="场地需求" prop="reserve_demand">-->
|
||||
<!-- <el-input placeholder="请填写场地需求" maxlength="100"-->
|
||||
<!-- v-model="formData.reserve_demand"></el-input>-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- </el-col>-->
|
||||
</el-row>
|
||||
</el-form>
|
||||
|
||||
<el-divider content-position="left">场地预约申请情况</el-divider>
|
||||
|
||||
<el-table :data="tableData" style="width: 100%;margin-bottom: 20px;padding: 20px" row-key="id"
|
||||
@sort-change="pageOrder" v-loading="tableLoading" :size="tableSize"
|
||||
empty-text="该场地暂无预约"
|
||||
border
|
||||
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"
|
||||
:key="column.prop"
|
||||
:label="column.label"
|
||||
:prop="column.prop"
|
||||
:sortable="column.sortable"
|
||||
show-overflow-tooltip>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<div style="float: right;margin: 20px 0">
|
||||
<el-button type="primary" @click="doSubmit()">提 交</el-button>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
</el-card>
|
||||
</template>
|
||||
</guava>
|
||||
|
||||
<el-dialog :close-on-click-modal="false" :visible.sync="writeRemindDialog" top="50px" width="60%"
|
||||
append-to-body>
|
||||
<div style="padding: 0 20px">
|
||||
<h4>职工之家场地预约</h4>
|
||||
<h4>主管部门:校工会</h4>
|
||||
<h3 style="text-align: center">欢迎使用《职工之家场地预约申请流程》服务!</h3>
|
||||
<h4 style="font-weight: bold">流程说明:</h4>
|
||||
<h4 style="font-weight: bold">一、为提高职工之家场地使用效率,充分保障我校相关活动正常有序开展,特制订本管理规定。</h4>
|
||||
<h4 style="font-weight: bold">二、职工之家场地是服务于学校及各部门教职工重大会议及重要文化活动的重要场所,由校工会遵循“申请与统筹协调”相结合的原则统一调度与管理。</h4>
|
||||
<h4 style="font-weight: bold">三、场地管理</h4>
|
||||
<div style="padding-left: 30px;">
|
||||
<h4>1.校工会现有场地3个,位于校工会一层。其中多功能厅座位80个,党员之家会议室座位20个,研讨室座位12个。</h4>
|
||||
<h4>2.职工之家场地的使用安排遵循校级活动优先的原则,兼顾院系活动。如无校级重大会议及活动安排,则按照预约时间顺序安排使用。</h4>
|
||||
<h4>3.校工会负责场地的使用协调、保障场地及设备日常维护;仅提供开水服务,会场布置(大屏设备调试等)及善后工作由各使用单位自行负责。</h4>
|
||||
<h4>4.各使用单位应负责参会人员在会场内的组织和管理工作,保证会后公共设施完好并物归原位,做好使用期间的安全防范等工作。</h4>
|
||||
</div>
|
||||
<h4 style="font-weight: bold">四、职工之家场地申请使用程序</h4>
|
||||
<div style="padding-left: 30px;">
|
||||
<h4>1.使用单位至少提前两天使用南京体育学院信息门户中的“智慧工会系统”申请,经审批通过后方可使用。</h4>
|
||||
<h4>2.需要使用多媒体设备(电子大屏、音视频设备)的单位,请与信息化中心联系,并委派专人提前一天到校工会调试,校工会原则上不提供现场值守服务。</h4>
|
||||
<h4>3.校工会对每次使用情况进行登记、检查与反馈。</h4>
|
||||
</div>
|
||||
<h4 style="font-weight: bold">五、各单位、个人在会场时应自觉遵守以下要求,拒不执行者,校工会有权取消其使用资格。</h4>
|
||||
<div style="padding-left: 30px;">
|
||||
<h4>1.全场禁止吸烟,禁止餐饮。</h4>
|
||||
<h4>2.讲究卫生,禁止随地吐痰、乱丢垃圾;自觉维护良好的秩序,严禁大声喧哗;使用结束后应保持场地干净整洁,会议物品应及时清理。</h4>
|
||||
<h4>3.爱护场地内部的设备、设施、家具和陈设。使用后负责将物品摆放回原位并保证电子大屏及音响等多媒体设备完好,造成损坏须照价赔偿。</h4>
|
||||
<h4>4.如需张贴会标、条幅,须按照管理人员要求在指定位置张贴悬挂,会后应及时拆除;因随意张贴损坏墙面等设施应给予修复或照价赔偿。</h4>
|
||||
<h4>5.严禁使用礼花、喷雾、鞭炮等危险物品。</h4>
|
||||
<h4>6.遇到紧急或异常情况,使用单位应及时报告,并采取应急措施,积极配合有关部门做好善后处理工作。</h4>
|
||||
</div>
|
||||
<h4 style="font-weight: bold">六、本管理规定的解释权归校工会。</h4>
|
||||
<h4 style="font-weight: bold">七、相关事项联系方式:</h4>
|
||||
<div style="padding-left: 30px;">
|
||||
<h4>多功能厅、研讨室使用咨询——校工会办公室</h4>
|
||||
<h4>联系电话:84755127</h4>
|
||||
<h4>党员之家会议室使用咨询——党委组织部、综合考核办公室</h4>
|
||||
<h4>联系电话:84755117 </h4>
|
||||
</div>
|
||||
<br/>
|
||||
</div>
|
||||
<!-- <div v-html="config.writeRemind"></div>-->
|
||||
<div class="text-center" slot="footer">
|
||||
<el-button @click="writeRemindDialog = false" type="primary">开始办理</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
<script>
|
||||
|
||||
var vue = new Vue({
|
||||
el: '#app',
|
||||
mixins: [initTableMixins],
|
||||
data() {
|
||||
|
||||
const validateEndTime = (rule, value, callback) => {
|
||||
if (!value) {
|
||||
callback(new Error('请选择结束时间'))
|
||||
}
|
||||
if (this.formData.reserve_start_time) {
|
||||
//判断是否跨天预约
|
||||
const startTime = this.formData.reserve_start_time.substr(0, 10);
|
||||
const endTime = value.substr(0, 10);
|
||||
if (endTime > startTime) {
|
||||
callback(new Error('预约仅限当天时间段,请勿跨天预约!'))
|
||||
}
|
||||
if (Date.parse(value) <= Date.parse(this.formData.reserve_start_time)) {
|
||||
callback(new Error('结束时间必须大于开始时间'))
|
||||
}
|
||||
}
|
||||
callback()
|
||||
}
|
||||
return {
|
||||
writeRemindDialog: false,
|
||||
units: [],
|
||||
siteInfoList: [],
|
||||
formData: {},
|
||||
tableData: [],
|
||||
pickerOptions: {
|
||||
disabledDate(time) {
|
||||
// const twoDaysLater = new Date(); // 获取当前日期
|
||||
// const day = time.getDay();
|
||||
// twoDaysLater.setDate(twoDaysLater.getDate());
|
||||
// // return time.getTime() < twoDaysLater.getTime() || [0, 6].includes(day)
|
||||
// return time.getTime() <= twoDaysLater.getTime() || [0, 6].includes(day)
|
||||
|
||||
const today = new Date();
|
||||
today.setHours(0,0,0,0);
|
||||
const day = time.getDay()
|
||||
const year = time.getFullYear();
|
||||
const month = time.getMonth();
|
||||
const date = time.getDate();
|
||||
|
||||
if (time.getTime() < today.getTime()){
|
||||
return true;
|
||||
}
|
||||
|
||||
if (year === 2024 && month === 3 && date === 28){
|
||||
return false;
|
||||
}
|
||||
|
||||
if (year === 2024 && month === 4 && date === 11){
|
||||
return false;
|
||||
}
|
||||
|
||||
if ([0,6].includes(day)){
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
},
|
||||
selectableRange: '08:30:00 - 17:00:00',
|
||||
},
|
||||
tableColumns: [
|
||||
{label: '场地名称', prop: 'sitename'},
|
||||
{label: '开始时间', prop: 'reserve_start_time'},
|
||||
{label: '结束时间', prop: 'reserve_end_time'},
|
||||
{label: '预约人姓名', prop: 'reserve_person_username'},
|
||||
{label: '预约人部门', prop: 'reserve_person_unitname'},
|
||||
{label: '联系电话', prop: 'reserve_person_phone'},
|
||||
{label: '预约事由', prop: 'reserve_cause'},
|
||||
],
|
||||
formRules: {
|
||||
reserve_start_time: [{required: true, message: '请选择开始时间', trigger: ['change', 'blur']}],
|
||||
site_id: [{required: true, message: '请选择预约场地', trigger: ['change', 'blur']}],
|
||||
// reserve_activity: [{required: true, message: '请选填写活动项目', trigger: ['change', 'blur']}],
|
||||
reserve_cause: [{required: true, message: '请选填写预约事由', trigger: ['change', 'blur']}],
|
||||
reserve_join_user_num: [{required: true, message: '请选填写参加人数', trigger: ['change', 'blur']}],
|
||||
// reserve_demand: [{required: true, message: '请填写场地需求', trigger: ['change', 'blur']}],
|
||||
reserve_end_time: [{required: true, validator: validateEndTime, trigger: ['change', 'blur']}],
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
timeEditable() {//组件禁止组件里面的input输入值
|
||||
this.$nextTick(() => {
|
||||
let els = document.querySelectorAll('.el-date-picker__editor-wrap input');
|
||||
for (var i = 0; i <= els.length - 1; i++) {
|
||||
els[i].setAttribute('readonly', 'readonly');
|
||||
}
|
||||
})
|
||||
},
|
||||
async findAllOpenSite() {
|
||||
const resp = await $.get("/platform/activity/site/apply/getAllSite")
|
||||
if (resp.code === 0) {
|
||||
this.siteInfoList = resp.data
|
||||
}
|
||||
},
|
||||
async siteChange() {
|
||||
const resp = await $.get('/platform/activity/site/apply/siteChange', {siteId: this.formData.site_id})
|
||||
console.log(resp)
|
||||
if (resp.code === 0) {
|
||||
this.tableData = resp.data
|
||||
}
|
||||
},
|
||||
async doSubmit() {
|
||||
const res = await $.get('/platform/activity/site/apply/checkApplyTime', {
|
||||
time: this.formData.reserve_start_time,
|
||||
endTime: this.formData.reserve_end_time,
|
||||
siteId: this.formData.site_id
|
||||
})
|
||||
if (res.code === 1) {
|
||||
this.$notify.warning(res.msg)
|
||||
this.formData.reserve_start_time = ''
|
||||
this.formData.reserve_end_time = ''
|
||||
return
|
||||
}
|
||||
const valid = await this.$refs['addForm'].validate()
|
||||
if (!valid) return
|
||||
|
||||
const {site_id, reserve_start_time, reserve_end_time} = this.formData
|
||||
const siteInfo = this.siteInfoList.find(v => v.id == site_id)
|
||||
|
||||
const confirm = await this.$confirm('您确定要提交【' + siteInfo.name + '】\n,时间为:' + reserve_start_time + "\n至\n" + reserve_end_time + '\n的预约吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
})
|
||||
if (confirm === 'confirm') {
|
||||
const resp = await $.post('/platform/activity/site/apply/insert', {"siteReserve": JSON.stringify(this.formData)})
|
||||
if (resp.code === 0) {
|
||||
this.$notify.success(resp.msg);
|
||||
setTimeout(() => {
|
||||
window.location.href = '/platform/activity/site/reserve'
|
||||
}, 500)
|
||||
} else {
|
||||
this.$notify.error(resp.msg);
|
||||
}
|
||||
}
|
||||
},
|
||||
async initData() {
|
||||
const {data} = await $.get(loc() + '/applyUserInfo')
|
||||
this.$set(this.formData, 'reserve_person_id', data.reserve_person_id)
|
||||
this.$set(this.formData, 'reserve_person_username', data.reserve_person_username)
|
||||
this.$set(this.formData, 'reserve_person_loginname', data.reserve_person_loginname)
|
||||
this.$set(this.formData, 'reserve_person_sex', data.reserve_person_sex)
|
||||
this.$set(this.formData, 'reserve_person_phone', data.reserve_person_phone)
|
||||
this.$set(this.formData, 'reserve_person_unitname', data.reserve_person_unitname)
|
||||
this.$set(this.formData, 'reserve_person_unionname', data.reserve_person_unionname)
|
||||
this.$set(this.formData, 'reserve_person_unionid', data.reserve_person_unionid)
|
||||
this.$set(this.formData, 'reserve_person_unit', '${@shiro.getPrincipalProperty("unit").getId()}')
|
||||
this.writeRemindDialog = true
|
||||
}
|
||||
},
|
||||
async created() {
|
||||
this.units = await getUnits();
|
||||
await this.findAllOpenSite();
|
||||
this.initData();
|
||||
}
|
||||
})
|
||||
</script>
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,406 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
<style>
|
||||
.el-divider--horizontal {
|
||||
margin: 5px 0;
|
||||
}
|
||||
</style>
|
||||
<div id="app" v-cloak>
|
||||
<guava ref="guava">
|
||||
<template>
|
||||
<el-card shadow="never">
|
||||
<div class="btn-group tool-button mt5">
|
||||
<el-date-picker v-model="pageForm.year"
|
||||
type="year" value-format="yyyy" style="width: 200px" placeholder="选择年">
|
||||
</el-date-picker>
|
||||
</div>
|
||||
<div class="btn-group tool-button mt5">
|
||||
<el-input placeholder="请输入内容" clearable v-model="pageForm.searchKeyword"
|
||||
@keyup.enter.native="doSearch">
|
||||
<el-select v-model="pageForm.searchName" slot="prepend" placeholder="查询类型"
|
||||
style="width: 110px;">
|
||||
<el-option label="场地名称" value="name"></el-option>
|
||||
<el-option label="场地地址" value="address"></el-option>
|
||||
</el-select>
|
||||
</el-input>
|
||||
</div>
|
||||
<div class="btn-group tool-button mt5">
|
||||
<el-select v-model="pageForm.siteType" placeholder="场地类型" clearable
|
||||
style="width: 200px;">
|
||||
<el-option v-for="item in activityTypeList" :label="item.text" :value="item.value"></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
<div class="btn-group tool-button mt5">
|
||||
<el-button type="primary" icon="el-icon-search" @click="doSearch"></el-button>
|
||||
</div>
|
||||
|
||||
<div class="pull-right offscreen-right mt5">
|
||||
<el-button type="primary" icon="el-icon-plus" @click="openAdd">新建场地</el-button>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<el-card shadow="never" class="mt20">
|
||||
<el-table :data="tableData" row-key="id" @sort-change="pageOrder"
|
||||
v-loading="tableLoading">
|
||||
<el-table-column align="center" header-align="center" label="序号" type="index">
|
||||
<template scope="scope">
|
||||
<span>{{scope.$index+(pageForm.pageNumber - 1) * pageForm.pageSize + 1}} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" show-overflow-tooltip header-align="center" label="场地名称"
|
||||
prop="name"></el-table-column>
|
||||
<el-table-column align="center" show-overflow-tooltip header-align="center" label="场地地址"
|
||||
prop="address"></el-table-column>
|
||||
<el-table-column align="center" show-overflow-tooltip header-align="center" label="联系人"
|
||||
prop="contact_person"></el-table-column>
|
||||
<el-table-column align="center" show-overflow-tooltip header-align="center" label="联系方式"
|
||||
prop="contact_phone"></el-table-column>
|
||||
|
||||
<el-table-column align="center" show-overflow-tooltip header-align="center" label="每日开放场次"
|
||||
prop="count">
|
||||
<template slot-scope="{row}">
|
||||
<el-tooltip class="item" effect="dark" placement="right">
|
||||
<div slot="content">
|
||||
<div v-if="row.open_hours" v-for="item in row.open_hours">
|
||||
{{item.start_time}} - {{item.end_time}}
|
||||
<el-divider></el-divider>
|
||||
</div>
|
||||
<div v-else>暂无开放场次</div>
|
||||
</div>
|
||||
<el-link :underline="false" type="primary">
|
||||
<i class="el-icon-view el-icon--left"></i>{{row.open_hours.length}}
|
||||
</el-link>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column align="center" :show-overflow-tooltip="true" header-align="center" label="开启状态"
|
||||
prop="state">
|
||||
<template slot-scope="{row}">
|
||||
<el-switch disabled v-model="row.state" active-color="#13ce66"
|
||||
inactive-color="#ff4949"></el-switch>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column align="center" :show-overflow-tooltip="true" header-align="center" label="是否多次预约"
|
||||
prop="multiple">
|
||||
<template slot-scope="{row}">
|
||||
<el-switch disabled v-model="row.multiple" active-color="#13ce66"
|
||||
inactive-color="#ff4949"></el-switch>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column align="center" :show-overflow-tooltip="true" header-align="center" label="限定工作日预约"
|
||||
prop="workday">
|
||||
<template slot-scope="{row}">
|
||||
<el-switch disabled v-model="row.workday" active-color="#13ce66"
|
||||
inactive-color="#ff4949"></el-switch>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column align="center" label="操作" width="250px">
|
||||
<template slot-scope="{row}">
|
||||
<el-button type="primary" @click="openEdit(row.id)" size="mini">编辑</el-button>
|
||||
<el-button type="danger" @click="doDelete(row)" size="mini">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
</el-table>
|
||||
<!--#include("/layouts/pagination.html"){}#-->
|
||||
</el-card>
|
||||
|
||||
|
||||
</template>
|
||||
|
||||
<template #edit>
|
||||
<vi-title title="填写场地信息"></vi-title>
|
||||
<div style="padding: 0 5%">
|
||||
<el-form :model="formData" ref="addForm" :rules="formRules" label-width="120px">
|
||||
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item prop="create_username" label="创建人">
|
||||
<el-input readonly v-model="formData.create_username" type="text"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item prop="create_time" label="创建时间">
|
||||
<el-input readonly v-model="formData.create_time" type="text"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item prop="name" label="场地名称">
|
||||
<el-input maxlength="100" placeholder="请填写场地名称" v-model="formData.name"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item prop="address" label="场地地址">
|
||||
<el-input maxlength="100" placeholder="请填写场地地址" v-model="formData.address"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item prop="contact_person" label="联系人">
|
||||
<el-input v-model="formData.contact_person" placeholder="请填写联系人" type="text"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item prop="contact_phone" label="联系方式">
|
||||
<el-input v-model="formData.contact_phone" placeholder="请填写联系方式" type="text"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="4">
|
||||
<el-form-item prop="state" label="开启状态">
|
||||
<el-switch v-model="formData.state" active-color="#13ce66" inactive-color="#ff4949">
|
||||
</el-switch>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
<el-form-item prop="state" label="是否多次预约">
|
||||
<el-switch v-model="formData.multiple" active-color="#13ce66" inactive-color="#ff4949">
|
||||
</el-switch>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
<el-form-item prop="state" label="限定工作日预约">
|
||||
<el-switch v-model="formData.workday" active-color="#13ce66" inactive-color="#ff4949">
|
||||
</el-switch>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item prop="typeId" label="场地类型">
|
||||
<el-select v-model="formData.typeId" style="width: 100%" filterable
|
||||
placeholder="请选择场地类型">
|
||||
<el-option v-for="item in activityTypeList" :label="item.meetingTypeName"
|
||||
:value="item.id"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item prop="sexLimit" label="性别限制">
|
||||
<el-radio-group v-model="formData.sexLimit" size="medium">
|
||||
<el-radio-button label="0">不限制</el-radio-button>
|
||||
<el-radio-button label="1">男</el-radio-button>
|
||||
<el-radio-button label="2">女</el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-form-item label="添加场次 " label-width="110px" class="view-header">
|
||||
<el-button style="float: right;margin-bottom: 10px" icon="el-icon-plus" size="mini"
|
||||
type="primary" @click="formData.open_hours.push({})">添加
|
||||
</el-button>
|
||||
|
||||
<el-table :data="formData.open_hours" border size="mini">
|
||||
<el-table-column prop="start_time" label="开始时间" align="center" header-align="center">
|
||||
<template slot-scope="{row}">
|
||||
<el-time-select
|
||||
placeholder="开始时间"
|
||||
v-model="row.start_time"
|
||||
:picker-options="{ start: '00:00',step: '00:30',end: '24:00'}">
|
||||
</el-time-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column prop="end_time" label="结束时间" align="center" header-align="center">
|
||||
<template slot-scope="{row}">
|
||||
<el-time-select
|
||||
placeholder="结束时间"
|
||||
v-model="row.end_time"
|
||||
:picker-options="{start: '00:00',step: '00:30',end: '24:00',minTime: row.start_time }">
|
||||
</el-time-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="操作" align="center" header-align="center" width="100px">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="danger" icon="el-icon-delete" circle
|
||||
:disabled="formData.open_hours.length==0"
|
||||
@click="formData.open_hours.splice(scope.$index, 1)"></el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
</el-table>
|
||||
</el-form-item>
|
||||
|
||||
</el-form>
|
||||
<div style="float: right;margin: 20px 0">
|
||||
<el-button type="primary" :disabled="subDis" @click="operation">确 定</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<template #view>
|
||||
</template>
|
||||
</guava>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
<!--# include("/platform/activity/includeJs/activityUtil.js"){} #-->
|
||||
const activityUtil = new typeUtil()
|
||||
var vue = new Vue({
|
||||
el: '#app',
|
||||
data() {
|
||||
return {
|
||||
activityTypeList: [],
|
||||
tabKey: '',
|
||||
tableLoading: false,
|
||||
subDis: false,
|
||||
tableData: [],
|
||||
formData: {
|
||||
open_hours: [{}],
|
||||
sexLimit: '0'
|
||||
},
|
||||
pageForm: {
|
||||
searchName: "name",
|
||||
searchKeyword: "",
|
||||
pageNumber: 1,
|
||||
pageSize: 10,
|
||||
totalCount: 0,
|
||||
pageOrderName: "",
|
||||
pageOrderBy: "",
|
||||
year: ""
|
||||
},
|
||||
formRules: {
|
||||
name: [{required: true, message: '请填写场地名称', trigger: ['blur', 'change']}],
|
||||
address: [{required: true, message: '请填写场地地址', trigger: ['blur', 'change']}],
|
||||
contact_person: [{required: true, message: '请填写联系人', trigger: ['blur', 'change']}],
|
||||
contact_phone: [{required: true, message: '请填写联系电话', trigger: ['blur', 'change']}],
|
||||
state: [{required: true, message: '请选择开启状态', trigger: ['blur', 'change']}],
|
||||
typeId: [{required: true, message: '请选择场地类型', trigger: ['blur', 'change']}],
|
||||
}
|
||||
}
|
||||
},
|
||||
components: {
|
||||
'guava': httpVueLoader('/components/plugins/Guava.vue'),
|
||||
},
|
||||
methods: {
|
||||
doDelete(row) {
|
||||
this.$confirm('此操作将删除【' + row.name + '】场地的所有信息!', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
callback: (a, b) => {
|
||||
if ("confirm" == a) {
|
||||
$.post(location.href + "/doDelete", {id: row.id}, (data) => {
|
||||
if (data.code == 0) {
|
||||
this.$message.success(data.msg)
|
||||
this.pageData();
|
||||
} else {
|
||||
this.$message.error(data.msg)
|
||||
}
|
||||
}, "json");
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
async operation() {
|
||||
let method = this.formData.id ? "/doEdit" : "/doAdd"
|
||||
this.subDis = true
|
||||
this.$refs["addForm"].validate(async (valid) => {
|
||||
if (valid) {
|
||||
const loading = this.$loading({
|
||||
lock: true,
|
||||
text: '正在提交...',
|
||||
spinner: 'el-icon-loading',
|
||||
background: 'rgba(0, 0, 0, 0.7)'
|
||||
});
|
||||
|
||||
const {code, data, msg} = await $.post(location.href + method, {data: JSON.stringify(this.formData)})
|
||||
if (code === 0) {
|
||||
this.pageData()
|
||||
this.$message.success(msg);
|
||||
this.$refs.guava.index()
|
||||
} else {
|
||||
this.$message.error(msg);
|
||||
}
|
||||
loading.close()
|
||||
this.subDis = false
|
||||
}
|
||||
});
|
||||
},
|
||||
async findOneSite(id) {
|
||||
const {data} = await $.get("/platform/activity/site/mange/findOneSite", {id: id})
|
||||
return data
|
||||
},
|
||||
openView(row) {
|
||||
this.$refs.guava.view()
|
||||
},
|
||||
async openEdit(id) {
|
||||
this.formData = await this.findOneSite(id)
|
||||
this.$refs.guava.edit()
|
||||
},
|
||||
openAdd() {
|
||||
this.formData = {
|
||||
state: true,
|
||||
multiple: true,
|
||||
open_hours: [{}],
|
||||
create_username: '${@shiro.getPrincipalProperty("username")}',
|
||||
create_time: moment().format('YYYY-MM-DD'),
|
||||
sexLimit: '0'
|
||||
}
|
||||
this.$refs.guava.edit()
|
||||
|
||||
if (this.$refs['addForm']) {
|
||||
this.$refs['addForm'].resetFields()
|
||||
}
|
||||
},
|
||||
doSearch() {
|
||||
this.tabKey = new Date().getTime()
|
||||
this.pageForm.pageNumber = 1
|
||||
this.pageData()
|
||||
},
|
||||
pageOrder(column) {
|
||||
this.pageForm.pageOrderName = column.prop;
|
||||
this.pageForm.pageOrderBy = column.order;
|
||||
this.pageData();
|
||||
},
|
||||
pageNumberChange(val) {
|
||||
this.pageForm.pageNumber = val;
|
||||
this.pageData();
|
||||
},
|
||||
pageSizeChange(val) {
|
||||
this.pageForm.pageSize = val;
|
||||
this.pageData();
|
||||
},
|
||||
pageData() {
|
||||
sublime.showLoadingbar();
|
||||
this.tableLoading = true
|
||||
$.post(location.href + "/pageData", this.pageForm, (res) => {
|
||||
const {code, data, msg} = res
|
||||
sublime.closeLoadingbar();
|
||||
this.tableLoading = false
|
||||
if (code == 0) {
|
||||
for (let i = 0; i < data.list.length; i++) {
|
||||
data.list[i].open_hours = site.reverseRankingDate(data.list[i].open_hours)
|
||||
}
|
||||
this.tableData = data.list;
|
||||
this.pageForm.totalCount = data.totalCount;
|
||||
} else {
|
||||
this.$message.error(msg);
|
||||
}
|
||||
}, "json");
|
||||
}
|
||||
},
|
||||
async created() {
|
||||
this.pageData();
|
||||
this.activityTypeList = await activityUtil.getAllType()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,385 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
|
||||
<link rel="stylesheet" href="${base!}/assets/platform/plugins/jqFullCalendar/css/fullcalendar.css">
|
||||
<script src="${base!}/assets/platform/plugins/jqFullCalendar/js/fullcalendar.min.js"></script>
|
||||
<script src="${base!}/assets/platform/plugins/jqFullCalendar/js/moment.min.js"></script>
|
||||
|
||||
<style>
|
||||
.fc-toolbar {
|
||||
display: block !important;
|
||||
visibility: unset !important;
|
||||
}
|
||||
|
||||
.yantaoshi {
|
||||
background: #39b54a;
|
||||
}
|
||||
|
||||
.duogongnengting {
|
||||
background: #31b48d;
|
||||
}
|
||||
|
||||
.dangyuanzhijia {
|
||||
background: #9c26b0;
|
||||
}
|
||||
|
||||
.other {
|
||||
|
||||
}
|
||||
|
||||
</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
|
||||
style="width: 100%"
|
||||
@change="doSearch"
|
||||
v-model="pageForm.time"
|
||||
placeholder="请选择月份"
|
||||
type="month"
|
||||
value-format="yyyy-MM">
|
||||
</el-date-picker>
|
||||
</div>
|
||||
</div>
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">姓名工号:</div>
|
||||
<div class="search-item-option">
|
||||
<el-input placeholder="请输入内容" clearable v-model="pageForm.searchKeyword"
|
||||
style="width: 100%"
|
||||
@keyup.enter.native="doSearch">
|
||||
<el-select v-model="pageForm.searchName" slot="prepend"
|
||||
placeholder="查询类型"
|
||||
style="width: 80px;">
|
||||
<el-option label="姓名" value="u.username"></el-option>
|
||||
<el-option label="工号" value="u.loginname"></el-option>
|
||||
</el-select>
|
||||
</el-input>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">场地名称:</div>
|
||||
<div class="search-item-option">
|
||||
<el-input @keyup.enter.native="doSearch" clearable clearable
|
||||
placeholder="请输入场地名称"
|
||||
style="width: 100%"
|
||||
v-model="pageForm.siteName">
|
||||
</el-input>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">场地类型:</div>
|
||||
<div class="search-item-option">
|
||||
<el-select v-model="pageForm.siteType" placeholder="场地类型"
|
||||
clearable filterable style="width: 100%">
|
||||
<el-option v-for="item in activityTypeList" :label="item.text"
|
||||
:value="item.value"></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="search-query">
|
||||
<el-button @click="doSearch" icon="el-icon-search" type="primary">搜索</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<el-card shadow="never" class="mt20">
|
||||
<vi-title2 title="预约列表">
|
||||
<template #func>
|
||||
<el-button size="small" type="primary" class="el-icon-date" @click="openCalendar">预约日历
|
||||
</el-button>
|
||||
</template>
|
||||
</vi-title2>
|
||||
<el-table :data="tableData" :size="tableSize" @sort-change="pageOrder"
|
||||
align="center"
|
||||
header-align="center">
|
||||
<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 tableColumns"
|
||||
>
|
||||
|
||||
<template scope="{row}" v-if="column.prop==='state_name'">
|
||||
<!--<span :style="'color:'+row.state_color">{{row.state_name}}</span>-->
|
||||
<span v-if="[0].includes(row.stateaudittype)"
|
||||
style="color: #e6a23c">{{row.state_name}}</span>
|
||||
<span v-if="row.stateaudittype==3" style="color: #67c23a">{{row.state_name}}</span>
|
||||
<span v-if="row.stateaudittype==1" style="color: #f56c6c">{{row.state_name}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" header-align="center" label="操作" fixed="right"
|
||||
width="200px">
|
||||
<template scope="{row}">
|
||||
<el-button @click="openView(row)" size="mini" type="primary">查看</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--#include("/layouts/pagination.html"){}#-->
|
||||
</el-card>
|
||||
</template>
|
||||
|
||||
<template #view>
|
||||
<reserve-info ref="reserve"></reserve-info>
|
||||
</template>
|
||||
|
||||
<template #public>
|
||||
<div id="site-calendar"></div>
|
||||
</template>
|
||||
|
||||
<el-dialog title="预约详情" :visible.sync="siteInfoDialog" width="60%">
|
||||
<reserve-info ref="reserveDialogInfo"></reserve-info>
|
||||
</el-dialog>
|
||||
|
||||
</guava>
|
||||
|
||||
</div>
|
||||
|
||||
<script>
|
||||
<!--# include("/platform/activity/includeJs/activityUtil.js"){} #-->
|
||||
const activityUtil = new typeUtil()
|
||||
let calendar = null
|
||||
var vue = new Vue({
|
||||
el: '#app',
|
||||
mixins: [initTableMixins],
|
||||
data() {
|
||||
return {
|
||||
userid: "${@shiro.getPrincipalProperty('id')}",
|
||||
role: "${@shiro.hasRole('sysadmin')||@shiro.hasRole('xghng')||@shiro.hasRole('A06')}",
|
||||
activityTypeList: [],
|
||||
siteList: [],
|
||||
pageForm: {
|
||||
searchName: "u.username",
|
||||
searchKeyword: "",
|
||||
isAudit: false,
|
||||
time: "",
|
||||
},
|
||||
tableColumns: [
|
||||
{label: '场地名称', prop: 'site_name', sortable: true},
|
||||
{label: '预约人姓名', prop: 'reserve_person_username', sortable: true},
|
||||
{label: '预约人部门', prop: 'reserve_person_unitname', sortable: true},
|
||||
{label: '开始时间', prop: 'reserve_start_time', sortable: true},
|
||||
{label: '结束时间', prop: 'reserve_end_time', sortable: true},
|
||||
{label: '联系电话', prop: 'reserve_person_phone'},
|
||||
// {label: '活动名称', prop: 'reserve_activity'},
|
||||
{label: '预约事由', prop: 'reserve_cause'},
|
||||
{label: '预约状态', prop: 'state_name'},
|
||||
],
|
||||
sites: [],
|
||||
events: [],
|
||||
calendarHeight: 0,
|
||||
siteInfoDialog: false
|
||||
}
|
||||
},
|
||||
components: {
|
||||
'reserve-info': httpVueLoader('/components/activity/site/ReserveInfo.vue'),
|
||||
},
|
||||
methods: {
|
||||
openView(row) {
|
||||
this.$refs.guava.view()
|
||||
this.$refs.reserve.openView(row.id)
|
||||
},
|
||||
async doDelete(id) {
|
||||
const confirm = await this.$confirm("您确定要删除此预约吗?", '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
})
|
||||
if (confirm !== 'confirm') return
|
||||
const resp = await $.post('/platform/activity/site/reserve/doDelete', {id, op: 1})
|
||||
if (resp.code === 0) {
|
||||
this.notifySuccess(resp.msg)
|
||||
this.doSearch()
|
||||
} else {
|
||||
this.notifyWarning(resp.msg)
|
||||
}
|
||||
},
|
||||
async getSites() {
|
||||
const {data} = await $.get(loc() + '/getSites')
|
||||
this.sites = data
|
||||
},
|
||||
|
||||
initCalendar() {
|
||||
const that = this
|
||||
if (calendar) {
|
||||
return
|
||||
}
|
||||
calendar = $('#site-calendar').fullCalendar({
|
||||
header: { //设置日历头部信息,false,则不显示头部信息。包括left,center,right左中右三个位置
|
||||
left: 'prev,next, today', //上一个、下一个、今天
|
||||
center: 'title', //标题
|
||||
right: 'month,agendaWeek,agendaDay' //月、周、日、日程列表
|
||||
},
|
||||
locale: 'zh-cn', //?没用?
|
||||
timeFormat: 'HH:mm', //日程事件的时间格式
|
||||
buttonText: { //各按钮的显示文本信息
|
||||
today: '今天',
|
||||
month: '月',
|
||||
agendaWeek: '周',
|
||||
agendaDay: '日',
|
||||
listMonth: '日程',
|
||||
},
|
||||
monthNames: ["1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"], //月份全称
|
||||
monthNamesShort: ["1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"], //月份简写
|
||||
dayNames: ["周日", "周一", "周二", "周三", "周四", "周五", "周六"], //周全称
|
||||
dayNamesShort: ["周日", "周一", "周二", "周三", "周四", "周五", "周六"], //周简写
|
||||
noEventsMessage: "当月无数据", //listview视图下,无数据提示
|
||||
allDayText: "全天", //自定义全天视图的名称
|
||||
allDaySlot: false, //是否在周日历上方显示全天
|
||||
allDayDefault: false, //是否为全天日程事件,显示这一天中所做的事情
|
||||
slotDuration: "00:30:00", //一格时间槽代表多长时间,默认00:30:00(30分钟)
|
||||
slotLabelFormat: "H(:mm)a", //日期视图左边那一列显示的每一格日期时间格式
|
||||
slotLabelInterval: "01:00:00", //日期视图左边那一列多长间隔显示一条日期文字(默认跟着slotDuration走的,可自定义)
|
||||
snapDuration: "01:00:00", //其实就是动态创建一个日程时,默认创建多长的时间块
|
||||
firstDay: 1, //一周中显示的第一天是哪天,周日是0,周一是1,类推
|
||||
hiddenDays: [], //隐藏一周中的某一天或某几天,数组形式,如隐藏周二和周五:[2,5],默认不隐藏,除非weekends设置为false。
|
||||
weekends: true, //是否显示周六和周日,设为false则不显示周六和周日。默认值为true
|
||||
weekMode: 'fixed', //月视图里显示周的模式,因每月周数不同月视图高度不定。fixed:固定显示6周高,日历高度保持不变liquid:不固定周数,高度随周数变化variable:不固定周数,但高度固定
|
||||
weekNumbers: false, //是否在日历中显示周次(一年中的第几周),如果设置为true,则会在月视图的左侧、周视图和日视图的左上角显示周数。
|
||||
weekNumberCalculation: 'iso', //周次的显示格式。
|
||||
height: that.calendarHeight, //设置日历的高度,包括header日历头部,默认未设置,高度根据aspectRatio值自适应。
|
||||
// contentHeight: 600, //设置日历主体内容的高度,不包括header部分,默认未设置,高度根据aspectRatio值自适应。
|
||||
handleWindowResize: true, //是否随浏览器窗口大小变化而自动变化。
|
||||
defaultView: 'agendaWeek', //初始化时默认视图,默认是月month,agendaWeek是周,agendaDay是当天
|
||||
slotEventOverlap: false, //事件是否可以重叠覆盖
|
||||
defaultDate: moment().format('YYYY-MM-DD'), //默认显示那一天的日期视图getDates(true)2020-05-10
|
||||
nowIndicator: false, //周/日视图中显示今天当前时间点(以红线标记),默认false不显示
|
||||
eventLimit: 2, //数据条数太多时,限制显示条数(多余的以“+2more”格式显示),默认false不限制,支持输入数字设定固定的显示条数
|
||||
eventLimitText: "更多", //当一块区域内容太多以"+2 more"格式显示时,这个more的名称自定义(应该与eventLimit: true一并用)
|
||||
dayPopoverFormat: "YYYY年M月d日预约信息", //点开"+2 more"弹出的小窗口标题,与eventLimitClick可以结合用
|
||||
render: (view) => { //method,绑定日历到id上。$('#id').fullCalendar('render');
|
||||
},
|
||||
viewRender: (view) => {
|
||||
that.getCalendarData()
|
||||
},
|
||||
eventRender: (info, element) => {
|
||||
console.log($(info.el))
|
||||
console.log(info)
|
||||
console.log(element)
|
||||
console.log(element.find('.fc-event-title'))
|
||||
element.find('.fc-title').append("<br/>申请人:" + info.reserve_person_username)
|
||||
element.find('.fc-title').append("<br/>申请事由:" + info.reserve_cause)
|
||||
element.find('.fc-title').append("<br/>申请活动:" + info.reserve_activity)
|
||||
element.find('.fc-title').append("<br/>审核状态:" + info.state_name)
|
||||
// $(info.el).html(info.event.title);
|
||||
},
|
||||
//日历数据源
|
||||
events: that.events,
|
||||
eventClick: (event, jsEvent) => {
|
||||
console.log(event)
|
||||
console.log(jsEvent)
|
||||
// that.openView(event)
|
||||
|
||||
that.siteInfoDialog = true
|
||||
setTimeout(async () => {
|
||||
await httpVueLoader('/components/activity/site/ReserveInfo.vue')()
|
||||
// that.$refs.reserveDialogInfo.openView(event.id)
|
||||
}, 1000)
|
||||
|
||||
// if (event.is_auditing === 1) {
|
||||
// sublime.jumpPagePjax('/platform/activity/site/review')
|
||||
// } else {
|
||||
//
|
||||
// }
|
||||
// this.askTypeArray = []
|
||||
// if (event.o.appointmentUser) {
|
||||
// return
|
||||
// }
|
||||
// if (new Date().getTime() > event.o.startTimeTs) {
|
||||
// return
|
||||
// }
|
||||
// this.appointmentDialogVisible = true
|
||||
// that.formData = event.o
|
||||
// if (event.askTypeList) {
|
||||
// const array = JSON.parse(event.askTypeList)
|
||||
// this.askTypeList.map(o => {
|
||||
// if (array.includes(o.code)) {
|
||||
// this.askTypeArray.push(o)
|
||||
// }
|
||||
// })
|
||||
// }
|
||||
// if (this.askTypeArray && this.askTypeArray.length === 1) {
|
||||
// that.$set(that.formData, 'appointmentAskTypeValue', this.askTypeArray[0].code)
|
||||
// }
|
||||
},
|
||||
selectable: false, //是否允许通过单击或拖动选择日历中的对象,包括天和时间
|
||||
selectMirror: true, //镜像
|
||||
lazyFetching: false, //是否启用懒加载技术--即只取当前条件下的视图数据,其它数据在切换时触发,默认true只取当前视图的,false是取全视图的
|
||||
defaultTimedEventDuration: "01:00:00", //在Event Object中如果没有end参数时使用,如start=7:00pm,则该日程对象时间范围就是7:00~9:00
|
||||
defaultAllDayEventDuration: {days: 1}, //默认1天是多长,(有的是采用工作时间模式,所以支持自定义)
|
||||
});
|
||||
},
|
||||
async getCalendarData() {
|
||||
if (!calendar) {
|
||||
return
|
||||
}
|
||||
const view = calendar.fullCalendar('getView')
|
||||
//这里取时间戳
|
||||
const startTimeTs = view.start.format('YYYY-MM-DD HH:mm:ss')
|
||||
const endTimeTs = view.end.format('YYYY-MM-DD HH:mm:ss')
|
||||
const {data} = await $.get(loc() + '/getCalendarData', {
|
||||
siteId: this.pageForm.siteId,
|
||||
startTimeTs,
|
||||
endTimeTs
|
||||
})
|
||||
if (data && data.length > 0) {
|
||||
data.map(x => {
|
||||
console.log(x)
|
||||
if (x.site_id === '83dfd7d780f448aea307d2ce967b51fe') {
|
||||
x.className = 'yantaoshi'
|
||||
} else if (x.site_id === 'd6ebd7e454a24e3495b0d18438fb6a59') {
|
||||
x.className = 'duogongnengting'
|
||||
} else if (x.site_id === 'a6486481018b479ab137bac53936f15e') {
|
||||
x.className = 'dangyuanzhijia'
|
||||
} else {
|
||||
x.className = 'other'
|
||||
}
|
||||
})
|
||||
let events = data
|
||||
calendar.fullCalendar('removeEvents', () => true)
|
||||
calendar.fullCalendar('addEventSource', events, true);
|
||||
} else {
|
||||
calendar.fullCalendar('removeEvents', () => true)
|
||||
}
|
||||
},
|
||||
openCalendar() {
|
||||
this.$refs.guava.public()
|
||||
setTimeout(() => {
|
||||
this.initCalendar()
|
||||
this.getCalendarData()
|
||||
}, 500)
|
||||
},
|
||||
async findAllOpenSite() {
|
||||
const {data} = await $.get("/platform/activity/site/apply/getAllSite")
|
||||
return data
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
setTimeout(() => {
|
||||
this.calendarHeight = window.innerHeight - 164 - 6
|
||||
}, 100)
|
||||
},
|
||||
async created() {
|
||||
this.activityTypeList = await activityUtil.getAllType()
|
||||
this.siteList = await this.findAllOpenSite()
|
||||
this.pageData()
|
||||
this.getSites()
|
||||
},
|
||||
})
|
||||
</script>
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,273 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
<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
|
||||
style="width: 100%"
|
||||
@change="doSearch"
|
||||
v-model="pageForm.time"
|
||||
placeholder="请选择月份"
|
||||
type="month"
|
||||
value-format="yyyy-MM">
|
||||
</el-date-picker>
|
||||
</div>
|
||||
</div>
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">姓名工号:</div>
|
||||
<div class="search-item-option">
|
||||
<el-input placeholder="请输入内容" clearable v-model="pageForm.searchKeyword"
|
||||
style="width: 100%"
|
||||
@keyup.enter.native="doSearch">
|
||||
<el-select v-model="pageForm.searchName" slot="prepend"
|
||||
placeholder="查询类型"
|
||||
style="width: 80px;">
|
||||
<el-option label="姓名" value="u.username"></el-option>
|
||||
<el-option label="工号" value="u.loginname"></el-option>
|
||||
</el-select>
|
||||
</el-input>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">场地名称:</div>
|
||||
<div class="search-item-option">
|
||||
<el-input @keyup.enter.native="doSearch" clearable clearable
|
||||
placeholder="请输入场地名称"
|
||||
style="width: 100%"
|
||||
v-model="pageForm.siteName">
|
||||
</el-input>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">场地类型:</div>
|
||||
<div class="search-item-option">
|
||||
<el-select v-model="pageForm.siteType" placeholder="场地类型"
|
||||
clearable filterable style="width: 100%">
|
||||
<el-option v-for="item in activityTypeList" :label="item.text" :value="item.value"></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="search-query">
|
||||
<el-button @click="doSearch" icon="el-icon-search" type="primary">搜索</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
|
||||
<el-card shadow="never" class="mt10">
|
||||
<table-tool :app="this" label="预约列表">
|
||||
<template #func>
|
||||
<el-button @click="location.href='/platform/activity/site/apply'" size="medium" type="primary">我要预约</el-button>
|
||||
</template>
|
||||
</table-tool>
|
||||
<el-table :data="tableData" :size="tableSize" @sort-change="pageOrder"
|
||||
align="center"
|
||||
header-align="center">
|
||||
<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 tableColumns"
|
||||
>
|
||||
|
||||
<template scope="{row}" v-if="column.prop==='state_name'">
|
||||
<!--<span :style="'color:'+row.state_color">{{row.state_name}}</span>-->
|
||||
<span v-if="[0].includes(row.stateaudittype)"
|
||||
style="color: #e6a23c">{{row.state_name}}</span>
|
||||
<span v-if="row.stateaudittype==3" style="color: #67c23a">{{row.state_name}}</span>
|
||||
<span v-if="row.stateaudittype==1" style="color: #f56c6c">{{row.state_name}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" header-align="center" label="操作" fixed="right"
|
||||
width="200px">
|
||||
<template scope="scope">
|
||||
<!--<el-button @click="() => {dropdownCommand({type:'view',data:scope.row})}" size="mini">查看</el-button>
|
||||
<el-button type="danger" @click="() => {dropdownCommand({type:'delete',data:scope.row})}" size="mini">删除</el-button>-->
|
||||
<el-dropdown @command="dropdownCommand">
|
||||
<el-button size="mini">
|
||||
<i class="ti-settings"></i>
|
||||
<span class="ti-angle-down"></span>
|
||||
</el-button>
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-item :command="{type:'view',data:scope.row}">
|
||||
查看
|
||||
</el-dropdown-item>
|
||||
<!--# if(@shiro.hasRole('sysadmin')){ #-->
|
||||
<el-dropdown-item
|
||||
:command="{type:'delete',data:scope.row}">
|
||||
删除
|
||||
</el-dropdown-item>
|
||||
<!--# } #-->
|
||||
<el-dropdown-item
|
||||
v-if="scope.row.reserve_person_id === '${@shiro.getPrincipalProperty('id')}'
|
||||
&& (scope.row.reserve_person_union_process == null || scope.row.reserve_person_union_process == '')"
|
||||
:command="{type:'cancel',data:scope.row}">
|
||||
撤销预约
|
||||
</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--#include("/layouts/pagination.html"){}#-->
|
||||
</el-card>
|
||||
</template>
|
||||
|
||||
<template #view>
|
||||
<reserve-info ref="reserve"></reserve-info>
|
||||
</template>
|
||||
</guava>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
<!--# include("/platform/activity/includeJs/activityUtil.js"){} #-->
|
||||
const activityUtil = new typeUtil()
|
||||
var vue = new Vue({
|
||||
el: '#app',
|
||||
mixins: [initTableMixins],
|
||||
data() {
|
||||
return {
|
||||
activityTypeList: [],
|
||||
siteList: [],
|
||||
tableData: [],
|
||||
userid:'',
|
||||
pageForm: {
|
||||
searchName: "u.username",
|
||||
searchKeyword: "",
|
||||
pageNumber: 1,
|
||||
pageSize: 10,
|
||||
totalCount: 0,
|
||||
pageOrderName: "",
|
||||
pageOrderBy: "",
|
||||
time: ''
|
||||
},
|
||||
tableColumns: [
|
||||
{label: '场地名称', prop: 'site_name', sortable: true},
|
||||
{label: '预约人姓名', prop: 'reserve_person_username', sortable: true},
|
||||
{label: '预约人部门', prop: 'reserve_person_unitname', sortable: true},
|
||||
{label: '开始时间', prop: 'reserve_start_time', sortable: true},
|
||||
{label: '结束时间', prop: 'reserve_end_time', sortable: true},
|
||||
{label: '联系电话', prop: 'reserve_person_phone'},
|
||||
{label: '预约事由', prop: 'reserve_cause'},
|
||||
{label: '预约状态', prop: 'state_name'},
|
||||
],
|
||||
}
|
||||
},
|
||||
components: {
|
||||
'guava': httpVueLoader('/components/plugins/Guava.vue'),
|
||||
'reserve-info': httpVueLoader('/components/activity/site/ReserveInfo.vue'),
|
||||
},
|
||||
methods: {
|
||||
dropdownCommand(command) {
|
||||
const {type, data} = command
|
||||
if (type === 'view') {
|
||||
this.userid = data.reserve_person_id;
|
||||
this.openView(data)
|
||||
} else if (type === 'delete') {
|
||||
this.doClean(data.id)
|
||||
} else if (type === 'cancel') {
|
||||
this.doRevoke(data.id)
|
||||
}
|
||||
},
|
||||
backOption(row) {
|
||||
this.$prompt('请填写反馈意见', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
inputValidator: (value) => {
|
||||
if (value === null) {
|
||||
return '反馈意见不能为空'
|
||||
}
|
||||
}
|
||||
}).then(async ({value}) => {
|
||||
const res = await $.post('/mobile/activity/site/info/backOption', {
|
||||
id: row.id,
|
||||
option: value
|
||||
})
|
||||
if (res.code === 0) {
|
||||
await this.doSearch()
|
||||
this.$notify.success({title: '提示', message: '操作成功!'});
|
||||
} else {
|
||||
this.$notify.warning({title: '警告', message: '操作失败!'});
|
||||
}
|
||||
}).catch(() => {
|
||||
});
|
||||
},
|
||||
async doClean(id){
|
||||
this.$confirm("您确定要删除此预约吗?", '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
callback: (a, b) => {
|
||||
if ("confirm" === a) {
|
||||
$.post("/platform/activity/site/apply/doClean", {id}, (data) => {
|
||||
if (data.code === 0) {
|
||||
this.$message.success(data.msg)
|
||||
this.pageData();
|
||||
} else {
|
||||
this.$message.warning(data.msg)
|
||||
}
|
||||
}, "json");
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
async doRevoke(id) {
|
||||
this.$confirm("您确定要撤销此预约吗?", '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
callback: (a, b) => {
|
||||
if ("confirm" === a) {
|
||||
$.post("/platform/activity/site/apply/revoke", {id}, (data) => {
|
||||
if (data.code === 0) {
|
||||
this.$message.success(data.msg)
|
||||
this.pageData();
|
||||
} else {
|
||||
this.$message.warning(data.msg)
|
||||
}
|
||||
}, "json");
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
openView(row) {
|
||||
this.$refs.guava.view()
|
||||
const role = "${@shiro.hasRole('sysadmin')||@shiro.hasRole('xghng')||@shiro.hasRole('A06')}"
|
||||
this.$refs.reserve.role = role
|
||||
const backOptionShow = "${@shiro.getPrincipalProperty('id')}" === this.userid
|
||||
this.$refs.reserve.backOptionShow = (role || backOptionShow)
|
||||
this.$refs.reserve.openView(row.id)
|
||||
},
|
||||
async doSearch() {
|
||||
this.pageForm.pageNumber = 1
|
||||
this.pageData()
|
||||
this.siteList = await this.findAllOpenSite()
|
||||
},
|
||||
async findAllOpenSite() {
|
||||
const {data} = await $.get("/platform/activity/site/apply/getAllSite")
|
||||
return data
|
||||
},
|
||||
},
|
||||
async created() {
|
||||
this.activityTypeList = await activityUtil.getAllType()
|
||||
this.siteList = await this.findAllOpenSite()
|
||||
this.pageData();
|
||||
}
|
||||
})
|
||||
</script>
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,228 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
<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
|
||||
style="width: 100%"
|
||||
@change="doSearch"
|
||||
v-model="pageForm.time"
|
||||
placeholder="请选择月份"
|
||||
type="month"
|
||||
value-format="yyyy-MM">
|
||||
</el-date-picker>
|
||||
</div>
|
||||
</div>
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">姓名工号:</div>
|
||||
<div class="search-item-option">
|
||||
<el-input placeholder="请输入内容" clearable v-model="pageForm.searchKeyword"
|
||||
style="width: 100%"
|
||||
@keyup.enter.native="doSearch">
|
||||
<el-select v-model="pageForm.searchName" slot="prepend"
|
||||
placeholder="查询类型"
|
||||
style="width: 80px;">
|
||||
<el-option label="姓名" value="u.username"></el-option>
|
||||
<el-option label="工号" value="u.loginname"></el-option>
|
||||
</el-select>
|
||||
</el-input>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">场地名称:</div>
|
||||
<div class="search-item-option">
|
||||
<el-input @keyup.enter.native="doSearch" clearable clearable
|
||||
placeholder="请输入场地名称"
|
||||
style="width: 100%"
|
||||
v-model="pageForm.siteName">
|
||||
</el-input>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">场地类型:</div>
|
||||
<div class="search-item-option">
|
||||
<el-select v-model="pageForm.siteType" placeholder="场地类型"
|
||||
clearable filterable style="width: 100%">
|
||||
<el-option v-for="item in activityTypeList" :label="item.text" :value="item.value"></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="search-query">
|
||||
<el-button @click="doSearch" icon="el-icon-search" type="primary">搜索</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<el-card shadow="never" class="mt10">
|
||||
<table-tool :app="this" label="预约列表">
|
||||
<template #func>
|
||||
<el-radio-group @change="doSearch" class="mr10" size="small" v-model="pageForm.isAudit">
|
||||
<el-radio-button :label="null">全部</el-radio-button>
|
||||
<el-radio-button :label="true">已审核</el-radio-button>
|
||||
<el-radio-button :label="false">未审核</el-radio-button>
|
||||
</el-radio-group>
|
||||
</template>
|
||||
</table-tool>
|
||||
<el-table :data="tableData" :size="tableSize" @sort-change="pageOrder"
|
||||
align="center"
|
||||
header-align="center">
|
||||
<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 tableColumns"
|
||||
>
|
||||
|
||||
<template scope="{row}" v-if="column.prop==='state_name'">
|
||||
<!--<span :style="'color:'+row.state_color">{{row.state_name}}</span>-->
|
||||
<span v-if="[0].includes(row.stateaudittype)"
|
||||
style="color: #e6a23c">{{row.state_name}}</span>
|
||||
<span v-if="row.stateaudittype==3" style="color: #67c23a">{{row.state_name}}</span>
|
||||
<span v-if="row.stateaudittype==1" style="color: #f56c6c">{{row.state_name}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" header-align="center" label="操作" fixed="right"
|
||||
width="200px">
|
||||
<template scope="{row}">
|
||||
<el-button @click="openView(row)" size="mini" type="primary">查看</el-button>
|
||||
<el-button v-if="row.reserve_state == 6118" @click="doProcess(row)" size="mini" type="primary">审核</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--#include("/layouts/pagination.html"){}#-->
|
||||
</el-card>
|
||||
</template>
|
||||
|
||||
<template #edit style="padding: 0 10%">
|
||||
<reserve-info ref="auditInfo">
|
||||
<template #handle>
|
||||
<el-tab-pane label="校工会审核" name="xghsh">
|
||||
<el-form :model="formData" label-suffix=":" label-width="100px" ref="auditForm">
|
||||
<el-form-item label="审核人">
|
||||
${@shiro.getPrincipalProperty('username')}
|
||||
</el-form-item>
|
||||
<el-form-item label="审核时间">
|
||||
{{moment().format('YYYY-MM-DD')}}
|
||||
</el-form-item>
|
||||
<el-form-item :rules="[{required: true, message: '请输入审核意见', trigger: ['blur']}]"
|
||||
label="审核意见"
|
||||
prop="schoolOption">
|
||||
<el-input maxlength="300" rows="5" type="textarea"
|
||||
v-model="formData.schoolOption"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-row style="margin: 40px 0;text-align: right">
|
||||
<el-button type="danger" @click="doReview(false)">拒绝</el-button>
|
||||
<el-button type="primary" @click="doReview(true)">通过</el-button>
|
||||
</el-row>
|
||||
</el-tab-pane>
|
||||
</template>
|
||||
</reserve-info>
|
||||
</template>
|
||||
|
||||
<template #view>
|
||||
<reserve-info ref="reserve"></reserve-info>
|
||||
</template>
|
||||
</guava>
|
||||
|
||||
</div>
|
||||
|
||||
<script>
|
||||
<!--# include("/platform/activity/includeJs/activityUtil.js"){} #-->
|
||||
const activityUtil = new typeUtil()
|
||||
var vue = new Vue({
|
||||
el: '#app',
|
||||
mixins: [initTableMixins],
|
||||
data() {
|
||||
return {
|
||||
activityTypeList:[],
|
||||
siteList:[],
|
||||
pageForm: {
|
||||
searchName: "u.username",
|
||||
searchKeyword: "",
|
||||
isAudit: false,
|
||||
time: "",
|
||||
},
|
||||
tableColumns: [
|
||||
{label: '场地名称', prop: 'site_name', sortable: true},
|
||||
{label: '预约人姓名', prop: 'reserve_person_username', sortable: true},
|
||||
{label: '预约人部门', prop: 'reserve_person_unitname', sortable: true},
|
||||
{label: '开始时间', prop: 'reserve_start_time', sortable: true},
|
||||
{label: '结束时间', prop: 'reserve_end_time', sortable: true},
|
||||
{label: '联系电话', prop: 'reserve_person_phone'},
|
||||
// {label: '活动名称', prop: 'reserve_activity'},
|
||||
{label: '预约事由', prop: 'reserve_cause'},
|
||||
{label: '预约状态', prop: 'state_name'},
|
||||
],
|
||||
}
|
||||
},
|
||||
components: {
|
||||
'guava': httpVueLoader('/components/plugins/Guava.vue'),
|
||||
'reserve-info': httpVueLoader('/components/activity/site/ReserveInfo.vue'),
|
||||
},
|
||||
methods: {
|
||||
openView(row) {
|
||||
this.$refs.guava.view()
|
||||
const role = "${@shiro.hasRole('sysadmin')||@shiro.hasRole('xghng')||@shiro.hasRole('A06')}"
|
||||
this.$refs.reserve.role = role
|
||||
const backOptionShow = "${@shiro.getPrincipalProperty('id')}" === row.reserve_person_id
|
||||
this.$refs.reserve.backOptionShow = (role || backOptionShow)
|
||||
this.$refs.reserve.openView(row.id)
|
||||
},
|
||||
doProcess(row){
|
||||
this.$refs.guava.edit()
|
||||
this.$refs.auditInfo.openView(row.id, 'xghsh')
|
||||
this.formData={
|
||||
id: row.id,
|
||||
schoolOption: null,
|
||||
}
|
||||
},
|
||||
async doReview(row){
|
||||
const valid = await this.$refs['auditForm'].validate()
|
||||
if (!valid) return
|
||||
this.formData.reserve_state = row ? 6138 : 6128
|
||||
this.formData.isPass = row
|
||||
const resp = await $.post('/platform/activity/site/review/doProcess', this.formData)
|
||||
if (resp.code === 0) {
|
||||
this.$refs.guava.index()
|
||||
this.notifySuccess(resp.msg)
|
||||
this.pageData()
|
||||
}
|
||||
},
|
||||
doInstructions() {
|
||||
$.post(location.href + "/doReview", this.formData, (res) => {
|
||||
if (res.code == 0) {
|
||||
this.$message.success(res.msg)
|
||||
this.pageData();
|
||||
this.$refs.guava.index()
|
||||
}
|
||||
}, "json");
|
||||
},
|
||||
async findAllOpenSite() {
|
||||
const {data} = await $.get("/platform/activity/site/apply/getAllSite")
|
||||
return data
|
||||
},
|
||||
},
|
||||
async created() {
|
||||
this.activityTypeList = await activityUtil.getAllType()
|
||||
this.siteList = await this.findAllOpenSite()
|
||||
this.pageData();
|
||||
},
|
||||
})
|
||||
</script>
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,445 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
|
||||
<style>
|
||||
.audit-userids-select .el-select__tags {
|
||||
flex-wrap: unset;
|
||||
overflow: auto;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div id="app" v-cloak>
|
||||
<guava ref="guava">
|
||||
<el-card shadow="never">
|
||||
<table-tool :app="this" label="类型列表">
|
||||
<template #func>
|
||||
<el-button @click="openAdd" size="small" type="primary">新增类型</el-button>
|
||||
</template>
|
||||
</table-tool>
|
||||
<el-table :data="tableData" :size="tableSize"
|
||||
@sort-change="pageOrder" class="vi-table"
|
||||
row-key="id" style="width: 100%">
|
||||
|
||||
<el-table-column 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"
|
||||
:width="column.width"
|
||||
align="center"
|
||||
header-align="center"
|
||||
min-width="50"
|
||||
show-overflow-tooltip
|
||||
v-for="column in tableColumns"
|
||||
>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="操作">
|
||||
<template scope="{row}">
|
||||
<el-button @click="openEdit(row)" size="mini" type="primary">编辑</el-button>
|
||||
<el-button @click="doDelete(row.id)" size="mini" type="danger">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
</el-table>
|
||||
</el-card>
|
||||
|
||||
<template #edit>
|
||||
<vi-title title="基础信息"></vi-title>
|
||||
<el-form :model="formData" :rules="formRules" label-width="80px" ref="form">
|
||||
<el-form-item label="名称" prop="meetingTypeName">
|
||||
<el-input v-model="formData.meetingTypeName"></el-input>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="模块名称" prop="moduleName">
|
||||
<el-input v-model="formData.moduleName"></el-input>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="序号" prop="sortNum">
|
||||
<el-input-number :max="tableData.length + 1" :min="1" :precision="0"
|
||||
v-model="formData.sortNum"></el-input-number>
|
||||
</el-form-item>
|
||||
|
||||
<vi-title title="审核节点信息(温馨提醒:如审核节点没有限制,审核节点类型不选或选择不限制)"></vi-title>
|
||||
<el-table :data="formData.auditStateList">
|
||||
<el-table-column label="节点ID" prop="stateId" width="100px">
|
||||
<template slot-scope="scope">
|
||||
<el-input readonly v-model="scope.row.stateId"></el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="审核节点名称" prop="stateName">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.stateName"></el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="审核节点类型" prop="auditAfterType" width="150px">
|
||||
<template slot-scope="scope">
|
||||
<el-select v-model="scope.row.auditAfterType" clearable>
|
||||
<el-option :label="item.desc"
|
||||
:value="item.value"
|
||||
v-for="item in activityAuditTypeEnum"></el-option>
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="审核人" prop="selectUserId">
|
||||
<template slot-scope="scope">
|
||||
<el-select :remote-method="userRemoteMethod" class="audit-userids-select" filterable
|
||||
multiple placeholder="请输入姓名或工号查找"
|
||||
remote style="width: 100%"
|
||||
v-model="scope.row.selectUserId">
|
||||
<el-option :key="item.id" :label="item.username + '(' + item.loginname + ')'"
|
||||
:value="item.id"
|
||||
v-for="item in userList"></el-option>
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="筛选审核人" width="100px">
|
||||
<template scope="scope">
|
||||
<el-button @click="openUserSelect(scope.$index)" type="text">筛选用户</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="通过下个节点" pro="afterPassStateId" width="120px">
|
||||
<template slot-scope="scope">
|
||||
<el-select v-model="scope.row.afterPassStateId">
|
||||
<el-option :label="item"
|
||||
:value="item"
|
||||
v-for="item in stateIdList"></el-option>
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="拒绝下个节点" pro="afterRejectStateId" width="120px">
|
||||
<template slot-scope="scope">
|
||||
<el-select v-model="scope.row.afterRejectStateId">
|
||||
<el-option :label="item"
|
||||
:value="item"
|
||||
v-for="item in stateIdList"></el-option>
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="审核类型" prop="stateAuditType" width="150px">
|
||||
<template slot-scope="scope">
|
||||
<el-select v-model="scope.row.stateAuditType">
|
||||
<el-option :label="item.desc"
|
||||
:value="item.value"
|
||||
v-for="item in stateAuditTypeList"></el-option>
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column width="100px">
|
||||
<template scope="scope" slot="header">
|
||||
<el-button @click="addState"
|
||||
icon="el-icon-circle-plus-outline"
|
||||
size="mini"
|
||||
type="primary"></el-button>
|
||||
</template>
|
||||
<template scope="scope">
|
||||
<el-button @click="formData.auditStateList.splice(scope.$index, 1)"
|
||||
icon="el-icon-delete"
|
||||
size="mini"
|
||||
type="danger"></el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-form>
|
||||
<el-row class="mt10" justify="end" type="flex">
|
||||
<el-button @click="$refs.guava.index()">取消</el-button>
|
||||
<el-button @click="doConfirm" type="primary">确定</el-button>
|
||||
</el-row>
|
||||
</template>
|
||||
</guava>
|
||||
|
||||
<condition :fields="fields"
|
||||
:show_filter_result="true"
|
||||
@confirm="cndConfirm"
|
||||
ref="cnd"
|
||||
v-model="cnd"></condition>
|
||||
|
||||
</div>
|
||||
|
||||
<script>
|
||||
<!--# include("/platform/activity/includeJs/activityUtil.js"){} #-->
|
||||
function isJson(str){
|
||||
if(typeof str == 'string'){
|
||||
try{
|
||||
var obj = JSON.parse(str);
|
||||
if (typeof obj == 'object' && obj){
|
||||
return true;
|
||||
}else {
|
||||
return false;
|
||||
}
|
||||
}catch (e){
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
const activityUtil = new typeUtil()
|
||||
var vue = new Vue({
|
||||
el: '#app',
|
||||
mixins: [initTableMixins],
|
||||
components: {
|
||||
'condition': httpVueLoader('/components/plugins/ConditionStructure.vue?v=1.0.0'),
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
tableColumns: [
|
||||
{prop: 'meetingTypeName', label: '类型名称'},
|
||||
{prop: 'moduleName', label: '模块名称'},
|
||||
{prop: 'sortNum', label: '排序编号'}],
|
||||
stateAuditTypeList: [],
|
||||
formData: {
|
||||
auditStateList: []
|
||||
},
|
||||
formRules: {
|
||||
meetingTypeName: [{required: true, message: '请输入类型名称', trigger: ['blur', 'change']}],
|
||||
moduleName: [{required: true, message: '请输入模块名称,英文命名', trigger: ['blur', 'change']}],
|
||||
sortNum: [{required: true, message: '请输入排序编号', trigger: ['blur', 'change']}]
|
||||
},
|
||||
userList: [],
|
||||
maxStateId: 0,
|
||||
userSelectDialogVisible: false,
|
||||
cnd: {},
|
||||
fields: [],
|
||||
nodeIndex: null,
|
||||
activityAuditTypeEnum:[],
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
async 'formData.auditStateList'(val) {
|
||||
const {id} = this.formData
|
||||
for (let i = 0; i < val.length; i++) {
|
||||
let item = val[i]
|
||||
if (id) {
|
||||
if (item.isAddRow) {
|
||||
//当前行是新增的第几行
|
||||
const addIndex = i + 1 - val.filter(v => !v.isAddRow).length
|
||||
|
||||
const stateId = val[0].stateId + i * 10
|
||||
const licitStateCode = await this.checkStateId(stateId, addIndex)
|
||||
item['stateId'] = licitStateCode
|
||||
}
|
||||
} else {
|
||||
item['stateId'] = this.maxStateId + (i + 1) * 10
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
// this.$set(this.formData,'auditStateList',val)
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
dialogTitle() {
|
||||
if (this.formData.id) {
|
||||
return '编辑'
|
||||
}
|
||||
return '新增'
|
||||
},
|
||||
stateIdList() {
|
||||
return this.formData.auditStateList.map(v => v.stateId)
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async checkStateId(stateId, stateIndex) {
|
||||
const resp = await $.get(loc() + '/checkStateId', {stateId, stateIndex})
|
||||
if (resp.code === 0) {
|
||||
return resp.data
|
||||
} else {
|
||||
this.notifyError(resp.msg)
|
||||
}
|
||||
},
|
||||
|
||||
addState() {
|
||||
this.formData.auditStateList.push({
|
||||
stateId: this.maxStateId,
|
||||
stateName: null,
|
||||
selectUserId: [],
|
||||
auditStateUserList: [],
|
||||
afterPassStateId: null,
|
||||
afterRejectStateId: null,
|
||||
isAddRow: true
|
||||
})
|
||||
},
|
||||
|
||||
async findAll() {
|
||||
const resp_data = await $.get(loc() + '/findAll')
|
||||
if (resp_data.code === 0) {
|
||||
resp_data.data.forEach(v => {
|
||||
v.auditStateList.forEach(x => {
|
||||
if (x.matchCnd) {
|
||||
x.matchCnd = JSON.parse(x.matchCnd)
|
||||
}
|
||||
})
|
||||
})
|
||||
this.tableData = resp_data.data
|
||||
}
|
||||
},
|
||||
openAdd() {
|
||||
this.formData = {
|
||||
meetingName: null,
|
||||
sortNum: this.tableData.length + 1,
|
||||
auditStateList: [{}]
|
||||
}
|
||||
this.$refs.guava.edit()
|
||||
},
|
||||
async doConfirm() {
|
||||
try {
|
||||
const valid = await this.$refs['form'].validate()
|
||||
if (valid) {
|
||||
this.formData.auditStateList.forEach(v => {
|
||||
v['auditStateUserList'] = v.selectUserId.map(x => {
|
||||
return {userId: x}
|
||||
})
|
||||
if(v['matchCnd']) {
|
||||
const o = isJson(v['matchCnd']);
|
||||
if (!o){
|
||||
v['matchCnd'] = JSON.stringify(v['matchCnd'])
|
||||
}
|
||||
}
|
||||
})
|
||||
const resp = await $.post(loc() + '/doHandle', {data: JSON.stringify(this.formData)})
|
||||
if (resp.code === 0) {
|
||||
this.$refs.guava.index()
|
||||
this.notifySuccess(resp.msg)
|
||||
this.findAll()
|
||||
} else {
|
||||
this.notifyError(resp.msg)
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
}
|
||||
},
|
||||
async openEdit(row) {
|
||||
const d = clone(row)
|
||||
let u = []
|
||||
const {data} = await $.post(loc() + '/findOne', {module: row.moduleName})
|
||||
data.forEach(v => {
|
||||
v['selectUserId'] = v.auditStateUserList.map(x => x.userId)
|
||||
u = u.concat(v['selectUserId'])
|
||||
})
|
||||
d.auditStateList = data
|
||||
this.userList = await queryUserByIds(u)
|
||||
|
||||
this.formData = d
|
||||
this.$refs.guava.edit()
|
||||
},
|
||||
async doDelete(id) {
|
||||
try {
|
||||
const confirm = await this.$confirm('您确定要删除吗', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
})
|
||||
if (confirm === 'confirm') {
|
||||
const resp = await $.post(loc() + '/delete/' + id)
|
||||
if (resp.code === 0) {
|
||||
this.notifySuccess(resp.msg)
|
||||
this.findAll()
|
||||
} else {
|
||||
this.notifyWarning(resp.msg)
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
console.log(e)
|
||||
}
|
||||
},
|
||||
async userRemoteMethod(query) {
|
||||
if (query) {
|
||||
this.userList = await searchUser(query)
|
||||
}
|
||||
},
|
||||
openUserSelect(node_index) {
|
||||
this.nodeIndex = node_index
|
||||
const node = this.formData.auditStateList[node_index]
|
||||
if (node.matchCnd) {
|
||||
if (this.cnd == null){
|
||||
if(this.cnd == null) {
|
||||
this.cnd = {
|
||||
method: "AND",
|
||||
conditions: [{}],
|
||||
}
|
||||
}
|
||||
}else {
|
||||
try {
|
||||
this.cnd = JSON.parse(node.matchCnd)
|
||||
}catch (e){
|
||||
this.cnd = node.matchCnd
|
||||
}
|
||||
}
|
||||
} else {
|
||||
this.cnd = {method: "AND", conditions: [{}]}
|
||||
}
|
||||
this.$refs.cnd.open(false)
|
||||
},
|
||||
async initCndFields() {
|
||||
this.cnd = {
|
||||
method: "AND",
|
||||
conditions: [{}],
|
||||
}
|
||||
/*const meet_data = await getOpenMeeting()
|
||||
const meet_options = meet_data.map(v => {
|
||||
return {"label": v.jdhallname, "value": v.id}
|
||||
})
|
||||
this.fields.push(
|
||||
{label: '教代会', value: 'jdhid', type: "select", options: meet_options}
|
||||
)*/
|
||||
const {data: role_data} = await $.get('/platform/sys/role/getAllRoles')
|
||||
const role_options = role_data.map(v => {
|
||||
return {"label": v.name, "value": v.id}
|
||||
})
|
||||
this.fields.push(
|
||||
{label: '角色', value: 'roleId', type: "select", options: role_options}
|
||||
)
|
||||
this.fields.push(
|
||||
{label: '姓名', value: 'username', options: null}
|
||||
)
|
||||
|
||||
|
||||
},
|
||||
async cndConfirm(val) {
|
||||
if (val) {
|
||||
const matchCnd = clone(val)
|
||||
if (matchCnd.conditions && matchCnd.conditions.length > 0) {
|
||||
this.formData.auditStateList[this.nodeIndex].matchCnd = matchCnd
|
||||
const resp = await $.post('/platform/userFilter/findUserByCnd', {cnd: JSON.stringify(matchCnd)})
|
||||
if (resp.code === 0) {
|
||||
if (resp.data) {
|
||||
const d = this.formData.auditStateList[this.nodeIndex]
|
||||
d.matchCnd = matchCnd
|
||||
d.selectUserId = [...new Set(d.selectUserId.concat(resp.data.map(v => v.id)))]
|
||||
|
||||
this.$set(this.formData.auditStateList, this.nodeIndex, d)
|
||||
let u = []
|
||||
this.formData.auditStateList.forEach(v => {
|
||||
u = u.concat(v.selectUserId.map(x => x))
|
||||
})
|
||||
this.userList = await queryUserByIds([...new Set(u)])
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
async created() {
|
||||
this.findAll()
|
||||
this.initCndFields()
|
||||
this.maxStateId = await activityUtil.findMaxStateId()
|
||||
this.stateAuditTypeList = await getEnumOptions('AuditTypeEnum')
|
||||
this.activityAuditTypeEnum = await getEnumOptions('ActivityAuditTypeEnum')
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,217 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
<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
|
||||
style="width: 100%"
|
||||
@change="doSearch"
|
||||
v-model="pageForm.time"
|
||||
placeholder="请选择月份"
|
||||
type="month"
|
||||
value-format="yyyy-MM">
|
||||
</el-date-picker>
|
||||
</div>
|
||||
</div>
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">姓名工号:</div>
|
||||
<div class="search-item-option">
|
||||
<el-input placeholder="请输入内容" clearable v-model="pageForm.searchKeyword"
|
||||
style="width: 100%"
|
||||
@keyup.enter.native="doSearch">
|
||||
<el-select v-model="pageForm.searchName" slot="prepend"
|
||||
placeholder="查询类型"
|
||||
style="width: 80px;">
|
||||
<el-option label="姓名" value="u.username"></el-option>
|
||||
<el-option label="工号" value="u.loginname"></el-option>
|
||||
</el-select>
|
||||
</el-input>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">场地名称:</div>
|
||||
<div class="search-item-option">
|
||||
<el-input @keyup.enter.native="doSearch" clearable clearable
|
||||
placeholder="请输入场地名称"
|
||||
style="width: 100%"
|
||||
v-model="pageForm.siteName">
|
||||
</el-input>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">场地类型:</div>
|
||||
<div class="search-item-option">
|
||||
<el-select v-model="pageForm.siteType" placeholder="场地类型"
|
||||
clearable filterable style="width: 100%">
|
||||
<el-option v-for="item in activityTypeList" :label="item.text" :value="item.value"></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="search-query">
|
||||
<el-button @click="doSearch" icon="el-icon-search" type="primary">搜索</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<el-card shadow="never" class="mt10">
|
||||
<table-tool :app="this" label="预约列表">
|
||||
<template #func>
|
||||
<el-radio-group @change="doSearch" class="mr10" size="small" v-model="pageForm.isAudit">
|
||||
<el-radio-button :label="null">全部</el-radio-button>
|
||||
<el-radio-button :label="true">已审核</el-radio-button>
|
||||
<el-radio-button :label="false">未审核</el-radio-button>
|
||||
</el-radio-group>
|
||||
</template>
|
||||
</table-tool>
|
||||
<el-table :data="tableData" :size="tableSize" @sort-change="pageOrder"
|
||||
align="center"
|
||||
header-align="center">
|
||||
<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 tableColumns"
|
||||
>
|
||||
|
||||
<template scope="{row}" v-if="column.prop==='state_name'">
|
||||
<!--<span :style="'color:'+row.state_color">{{row.state_name}}</span>-->
|
||||
<span v-if="[0].includes(row.stateaudittype)"
|
||||
style="color: #e6a23c">{{row.state_name}}</span>
|
||||
<span v-if="row.stateaudittype==3" style="color: #67c23a">{{row.state_name}}</span>
|
||||
<span v-if="row.stateaudittype==1" style="color: #f56c6c">{{row.state_name}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" header-align="center" label="操作" fixed="right"
|
||||
width="200px">
|
||||
<template scope="{row}">
|
||||
<el-button @click="openView(row)" size="mini" type="primary">查看</el-button>
|
||||
<el-button v-if="row.reserve_state == 6098" @click="doProcess(row)" size="mini" type="primary">审核</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--#include("/layouts/pagination.html"){}#-->
|
||||
</el-card>
|
||||
</template>
|
||||
|
||||
<template #edit style="padding: 0 10%">
|
||||
<reserve-info ref="auditInfo">
|
||||
<template #handle>
|
||||
<el-tab-pane label="分工会审核" name="fghsh">
|
||||
<el-form :model="formData" label-suffix=":" label-width="100px" ref="auditForm">
|
||||
<el-form-item label="审核人">
|
||||
${@shiro.getPrincipalProperty('username')}
|
||||
</el-form-item>
|
||||
<el-form-item label="审核时间">
|
||||
{{moment().format('YYYY-MM-DD')}}
|
||||
</el-form-item>
|
||||
<el-form-item :rules="[{required: true, message: '请输入审核意见', trigger: ['blur']}]"
|
||||
label="审核意见"
|
||||
prop="unionOption">
|
||||
<el-input maxlength="300" rows="5" type="textarea"
|
||||
v-model="formData.unionOption"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-row style="margin: 40px 0;text-align: right">
|
||||
<el-button type="danger" @click="doReview(false)">拒绝</el-button>
|
||||
<el-button type="primary" @click="doReview(true)">通过</el-button>
|
||||
</el-row>
|
||||
</el-tab-pane>
|
||||
</template>
|
||||
</reserve-info>
|
||||
</template>
|
||||
|
||||
<template #view>
|
||||
<reserve-info ref="reserve"></reserve-info>
|
||||
</template>
|
||||
</guava>
|
||||
</div>
|
||||
<script>
|
||||
<!--# include("/platform/activity/includeJs/activityUtil.js"){} #-->
|
||||
const activityUtil = new typeUtil()
|
||||
var vue = new Vue({
|
||||
el: '#app',
|
||||
mixins: [initTableMixins],
|
||||
data(){
|
||||
return{
|
||||
activityTypeList:[],
|
||||
siteList:[],
|
||||
pageForm: {
|
||||
searchName: "u.username",
|
||||
searchKeyword: "",
|
||||
isAudit: false,
|
||||
time: "",
|
||||
},
|
||||
tableColumns: [
|
||||
{label: '场地名称', prop: 'site_name', sortable: true},
|
||||
{label: '预约人姓名', prop: 'reserve_person_username', sortable: true},
|
||||
{label: '预约人部门', prop: 'reserve_person_unitname', sortable: true},
|
||||
{label: '开始时间', prop: 'reserve_start_time', sortable: true},
|
||||
{label: '结束时间', prop: 'reserve_end_time', sortable: true},
|
||||
{label: '联系电话', prop: 'reserve_person_phone'},
|
||||
// {label: '活动名称', prop: 'reserve_activity'},
|
||||
{label: '预约事由', prop: 'reserve_cause'},
|
||||
{label: '预约状态', prop: 'state_name'},
|
||||
],
|
||||
}
|
||||
},
|
||||
components: {
|
||||
'guava': httpVueLoader('/components/plugins/Guava.vue'),
|
||||
'reserve-info': httpVueLoader('/components/activity/site/ReserveInfo.vue'),
|
||||
},
|
||||
methods:{
|
||||
openView(row){
|
||||
this.$refs.guava.view()
|
||||
const role = "${@shiro.hasRole('sysadmin')||@shiro.hasRole('xghng')||@shiro.hasRole('A06')}"
|
||||
this.$refs.reserve.role = role
|
||||
const backOptionShow = "${@shiro.getPrincipalProperty('id')}" === row.reserve_person_id
|
||||
this.$refs.reserve.backOptionShow = (role || backOptionShow)
|
||||
this.$refs.reserve.openView(row.id)
|
||||
},
|
||||
doProcess(row){
|
||||
this.$refs.guava.edit()
|
||||
this.$refs.auditInfo.openView(row.id, 'fghsh')
|
||||
this.formData={
|
||||
id: row.id,
|
||||
unionOption: null,
|
||||
}
|
||||
},
|
||||
async doReview(row){
|
||||
const valid = await this.$refs['auditForm'].validate()
|
||||
if (!valid) return
|
||||
this.formData.reserve_state = row ? 6118 : 6108
|
||||
this.formData.isPass = row
|
||||
const resp = await $.post('/platform/activity/site/unionProcess/doProcess', this.formData)
|
||||
if (resp.code === 0) {
|
||||
this.$refs.guava.index()
|
||||
this.notifySuccess(resp.msg)
|
||||
this.pageData()
|
||||
}
|
||||
},
|
||||
async findAllOpenSite() {
|
||||
const {data} = await $.get("/platform/activity/site/apply/getAllSite")
|
||||
return data
|
||||
},
|
||||
},
|
||||
async created(){
|
||||
this.activityTypeList = await activityUtil.getAllType()
|
||||
this.siteList = await this.findAllOpenSite()
|
||||
this.pageData();
|
||||
}
|
||||
})
|
||||
</script>
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,228 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
<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
|
||||
style="width: 100%"
|
||||
@change="doSearch"
|
||||
v-model="pageForm.time"
|
||||
placeholder="请选择月份"
|
||||
type="month"
|
||||
value-format="yyyy-MM">
|
||||
</el-date-picker>
|
||||
</div>
|
||||
</div>
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">姓名工号:</div>
|
||||
<div class="search-item-option">
|
||||
<el-input placeholder="请输入内容" clearable v-model="pageForm.searchKeyword"
|
||||
style="width: 100%"
|
||||
@keyup.enter.native="doSearch">
|
||||
<el-select v-model="pageForm.searchName" slot="prepend"
|
||||
placeholder="查询类型"
|
||||
style="width: 80px;">
|
||||
<el-option label="姓名" value="u.username"></el-option>
|
||||
<el-option label="工号" value="u.loginname"></el-option>
|
||||
</el-select>
|
||||
</el-input>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- <div class="search-item">-->
|
||||
<!-- <div class="search-item-label">场地名称:</div>-->
|
||||
<!-- <div class="search-item-option">-->
|
||||
<!-- <el-input @keyup.enter.native="doSearch" clearable clearable-->
|
||||
<!-- placeholder="请输入场地名称"-->
|
||||
<!-- style="width: 100%"-->
|
||||
<!-- v-model="pageForm.siteName">-->
|
||||
<!-- </el-input>-->
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
|
||||
<!-- <div class="search-item">-->
|
||||
<!-- <div class="search-item-label">场地类型:</div>-->
|
||||
<!-- <div class="search-item-option">-->
|
||||
<!-- <el-select v-model="pageForm.siteType" placeholder="场地类型"-->
|
||||
<!-- clearable filterable style="width: 100%">-->
|
||||
<!-- <el-option v-for="item in activityTypeList" :label="item.text" :value="item.value"></el-option>-->
|
||||
<!-- </el-select>-->
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
<div class="search-query">
|
||||
<el-button @click="doSearch" icon="el-icon-search" type="primary">搜索</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<el-card shadow="never" class="mt10">
|
||||
<table-tool :app="this" label="预约列表">
|
||||
<template #func>
|
||||
<el-radio-group @change="doSearch" class="mr10" size="small" v-model="pageForm.isAudit">
|
||||
<el-radio-button :label="null">全部</el-radio-button>
|
||||
<el-radio-button :label="true">已审核</el-radio-button>
|
||||
<el-radio-button :label="false">未审核</el-radio-button>
|
||||
</el-radio-group>
|
||||
</template>
|
||||
</table-tool>
|
||||
<el-table :data="tableData" :size="tableSize" @sort-change="pageOrder"
|
||||
align="center"
|
||||
header-align="center">
|
||||
<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 tableColumns"
|
||||
>
|
||||
|
||||
<template scope="{row}" v-if="column.prop==='state_name'">
|
||||
<!--<span :style="'color:'+row.state_color">{{row.state_name}}</span>-->
|
||||
<span v-if="[0].includes(row.stateaudittype)"
|
||||
style="color: #e6a23c">{{row.state_name}}</span>
|
||||
<span v-if="row.stateaudittype==3" style="color: #67c23a">{{row.state_name}}</span>
|
||||
<span v-if="row.stateaudittype==1" style="color: #f56c6c">{{row.state_name}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" header-align="center" label="操作" fixed="right"
|
||||
width="200px">
|
||||
<template scope="{row}">
|
||||
<el-button @click="openView(row)" size="mini" type="primary">查看</el-button>
|
||||
<el-button v-if="row.reserve_state == 6118" @click="doProcess(row)" size="mini" type="primary">审核</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--#include("/layouts/pagination.html"){}#-->
|
||||
</el-card>
|
||||
</template>
|
||||
|
||||
<template #edit style="padding: 0 10%">
|
||||
<reserve-info ref="auditInfo">
|
||||
<template #handle>
|
||||
<el-tab-pane label="校工会审核" name="xghsh">
|
||||
<el-form :model="formData" label-suffix=":" label-width="100px" ref="auditForm">
|
||||
<el-form-item label="审核人">
|
||||
${@shiro.getPrincipalProperty('username')}
|
||||
</el-form-item>
|
||||
<el-form-item label="审核时间">
|
||||
{{moment().format('YYYY-MM-DD')}}
|
||||
</el-form-item>
|
||||
<el-form-item :rules="[{required: true, message: '请输入审核意见', trigger: ['blur']}]"
|
||||
label="审核意见"
|
||||
prop="schoolOption">
|
||||
<el-input maxlength="300" rows="5" type="textarea"
|
||||
v-model="formData.schoolOption"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-row style="margin: 40px 0;text-align: right">
|
||||
<el-button type="danger" @click="doReview(false)">拒绝</el-button>
|
||||
<el-button type="primary" @click="doReview(true)">通过</el-button>
|
||||
</el-row>
|
||||
</el-tab-pane>
|
||||
</template>
|
||||
</reserve-info>
|
||||
</template>
|
||||
|
||||
<template #view>
|
||||
<reserve-info ref="reserve"></reserve-info>
|
||||
</template>
|
||||
</guava>
|
||||
|
||||
</div>
|
||||
|
||||
<script>
|
||||
<!--# include("/platform/activity/includeJs/activityUtil.js"){} #-->
|
||||
const activityUtil = new typeUtil()
|
||||
var vue = new Vue({
|
||||
el: '#app',
|
||||
mixins: [initTableMixins],
|
||||
data() {
|
||||
return {
|
||||
activityTypeList:[],
|
||||
siteList:[],
|
||||
pageForm: {
|
||||
searchName: "u.username",
|
||||
searchKeyword: "",
|
||||
isAudit: false,
|
||||
time: "",
|
||||
},
|
||||
tableColumns: [
|
||||
{label: '场地名称', prop: 'site_name', sortable: true},
|
||||
{label: '预约人姓名', prop: 'reserve_person_username', sortable: true},
|
||||
{label: '预约人部门', prop: 'reserve_person_unitname', sortable: true},
|
||||
{label: '开始时间', prop: 'reserve_start_time', sortable: true},
|
||||
{label: '结束时间', prop: 'reserve_end_time', sortable: true},
|
||||
{label: '联系电话', prop: 'reserve_person_phone'},
|
||||
// {label: '活动名称', prop: 'reserve_activity'},
|
||||
{label: '预约事由', prop: 'reserve_cause'},
|
||||
{label: '预约状态', prop: 'state_name'},
|
||||
],
|
||||
}
|
||||
},
|
||||
components: {
|
||||
'guava': httpVueLoader('/components/plugins/Guava.vue'),
|
||||
'reserve-info': httpVueLoader('/components/activity/site/ReserveInfo.vue'),
|
||||
},
|
||||
methods: {
|
||||
openView(row) {
|
||||
this.$refs.guava.view()
|
||||
const role = "${@shiro.hasRole('sysadmin')||@shiro.hasRole('xghng')||@shiro.hasRole('A06')}"
|
||||
this.$refs.reserve.role = role
|
||||
const backOptionShow = "${@shiro.getPrincipalProperty('id')}" === row.reserve_person_id
|
||||
this.$refs.reserve.backOptionShow = (role || backOptionShow)
|
||||
this.$refs.reserve.openView(row.id)
|
||||
},
|
||||
doProcess(row){
|
||||
this.$refs.guava.edit()
|
||||
this.$refs.auditInfo.openView(row.id, 'xghsh')
|
||||
this.formData={
|
||||
id: row.id,
|
||||
schoolOption: null,
|
||||
}
|
||||
},
|
||||
async doReview(row){
|
||||
const valid = await this.$refs['auditForm'].validate()
|
||||
if (!valid) return
|
||||
this.formData.reserve_state = row ? 6138 : 6128
|
||||
this.formData.isPass = row
|
||||
const resp = await $.post('/platform/activity/site/partyMemberHomeAudit/doProcess', this.formData)
|
||||
if (resp.code === 0) {
|
||||
this.$refs.guava.index()
|
||||
this.notifySuccess(resp.msg)
|
||||
this.pageData()
|
||||
}
|
||||
},
|
||||
doInstructions() {
|
||||
$.post(location.href + "/doReview", this.formData, (res) => {
|
||||
if (res.code == 0) {
|
||||
this.$message.success(res.msg)
|
||||
this.pageData();
|
||||
this.$refs.guava.index()
|
||||
}
|
||||
}, "json");
|
||||
},
|
||||
async findAllOpenSite() {
|
||||
const {data} = await $.get("/platform/activity/site/apply/getAllSite")
|
||||
return data
|
||||
},
|
||||
},
|
||||
async created() {
|
||||
this.activityTypeList = await activityUtil.getAllType()
|
||||
this.siteList = await this.findAllOpenSite()
|
||||
this.pageData();
|
||||
},
|
||||
})
|
||||
</script>
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,112 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
|
||||
<div id="app" v-cloak>
|
||||
<guava ref="guava">
|
||||
<el-card shadow="never">
|
||||
<!--#include("/platform/activity/summary/common/addSummaryCommon.html"){}#-->
|
||||
</el-card>
|
||||
</guava>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
var vue = new Vue({
|
||||
el: '#app',
|
||||
components: {},
|
||||
data() {
|
||||
return {
|
||||
formData: {
|
||||
files: [],
|
||||
tissueId: '',
|
||||
},
|
||||
summaryType: [],
|
||||
id: '',
|
||||
clubOptions: [],
|
||||
userOptions: [],
|
||||
summaryFrom: '3',
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async querySqr(key) {
|
||||
const data = await selectUser(key, 30)
|
||||
this.userOptions = data.list
|
||||
},
|
||||
cancel() {
|
||||
if (this.id) {
|
||||
sublime.jumpPagePjax('/platform/activity/yearSummary/club')
|
||||
}
|
||||
},
|
||||
async doHandle() {
|
||||
const valid = await this.$refs['form'].validate()
|
||||
if (valid) {
|
||||
this.formData.userId = "${@shiro.getPrincipalProperty('id')}";
|
||||
this.formData.summaryFrom = "3";
|
||||
this.formData.files = JSON.stringify(this.formData.files)
|
||||
const resp = await $.post('/platform/activity/yearSummary/doHandle', this.formData)
|
||||
if (resp.code === 0) {
|
||||
this.$notify({
|
||||
title: '成功',
|
||||
message: resp.msg,
|
||||
type: 'success',
|
||||
duration: 500,
|
||||
onClose: () => {
|
||||
sublime.jumpPagePjax('/platform/activity/yearSummary/club')
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
async initData() {
|
||||
const id = GetQueryString("id")
|
||||
this.id = id
|
||||
if (id) {
|
||||
const resp = await $.post('/platform/activity/yearSummary/findOne', {id})
|
||||
if (resp.code === 0) {
|
||||
this.formData = resp.data
|
||||
this.formData.files = JSON.parse(this.formData.files)
|
||||
this.userOptions = [
|
||||
{
|
||||
username: this.formData.username,
|
||||
loginname: this.formData.loginname,
|
||||
id: this.formData.userId,
|
||||
}
|
||||
]
|
||||
}
|
||||
} else {
|
||||
this.formData.userId = "${@shiro.getPrincipalProperty('id')}"
|
||||
this.userOptions = [
|
||||
{
|
||||
username: "${@shiro.getPrincipalProperty('username')}",
|
||||
loginname: "${@shiro.getPrincipalProperty('loginname')}",
|
||||
id: "${@shiro.getPrincipalProperty('id')}",
|
||||
}
|
||||
]
|
||||
const clubs = await $.post('/platform/activity/yearSummary/getMyClub')
|
||||
this.formData.tissueId = clubs[0] === undefined ? '' : clubs[0]
|
||||
}
|
||||
},
|
||||
},
|
||||
async created() {
|
||||
await this.initData()
|
||||
this.summaryType = await getDictOptions('summaryType')
|
||||
this.clubOptions = await getClubs()
|
||||
const isAdmin = "${@shiro.hasAnyRoles('sysadmin', 'A06')}" === 'true'
|
||||
if (!isAdmin) {
|
||||
const clubs = await this.getMyClub()
|
||||
let clubArray = []
|
||||
for (let c of Array.from(clubs)) {
|
||||
const cl = this.clubOptions.find(x => x.id === c)
|
||||
if (cl) {
|
||||
clubArray.push(cl)
|
||||
}
|
||||
}
|
||||
this.clubOptions = clubArray
|
||||
}
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,245 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
|
||||
<style>
|
||||
.el-descriptions__table {
|
||||
table-layout: fixed !important;
|
||||
}
|
||||
|
||||
.el-descriptions-item__cell {
|
||||
text-align: center !important;
|
||||
}
|
||||
</style>
|
||||
<div id="app" v-cloak>
|
||||
<guava ref="guava">
|
||||
|
||||
<el-card shadow="never">
|
||||
<div class="search">
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">年度</div>
|
||||
<div class="search-item-option">
|
||||
<el-date-picker
|
||||
placeholder="选择年度" style="width: 100%"
|
||||
type="year"
|
||||
v-model="pageForm.year"
|
||||
value-format="yyyy">
|
||||
</el-date-picker>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">社团</div>
|
||||
<div class="search-item-option">
|
||||
<el-select v-model="pageForm.tissueId" placeholder="请选择社团(社团)" style="width: 100%;">
|
||||
<el-option v-for="item in unionOptions" :label="item.name" :value="item.id"></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">总结类型</div>
|
||||
<div class="search-item-option">
|
||||
<el-select v-model="pageForm.summaryType" placeholder="请选择总结类型" style="width: 100%;">
|
||||
<el-option v-for="item in summaryType" :label="item.name" :value="item.id"></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="search-query">
|
||||
<el-button type="primary" icon="el-icon-search" @click="pageData">搜索</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<el-card shadow="never" class="mt20">
|
||||
<el-table :data="tableData" @sort-change='pageOrder'>
|
||||
<el-table-column label="序号" type="index" header-align="center" align="center">
|
||||
<template scope="scope">
|
||||
<span>{{scope.$index+(pageForm.pageNumber - 1) * pageForm.pageSize + 1}} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="year" label="年度">
|
||||
</el-table-column>
|
||||
<el-table-column sortable prop="name" label="社团">
|
||||
</el-table-column>
|
||||
<el-table-column sortable prop="typename" label="总结类型">
|
||||
</el-table-column>
|
||||
<el-table-column sortable prop="username" label="上传人">
|
||||
</el-table-column>
|
||||
<el-table-column sortable prop="ctime" label="上传时间">
|
||||
</el-table-column>
|
||||
<el-table-column prop="userOnline" label="操作" width="100px">
|
||||
<template slot-scope="scope">
|
||||
<el-dropdown @command="dropdownCommand">
|
||||
<el-button plain size="mini"><i class="ti-settings"></i><span class="ti-angle-down"></span>
|
||||
</el-button>
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-item :command="{type:'view',data:scope.row}">
|
||||
查看
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item :command="{type:'edit',data:scope.row}">
|
||||
编辑
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item :command="{type:'delete',data:scope.row}">
|
||||
删除
|
||||
</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-row class="el-pagination-container">
|
||||
<el-pagination
|
||||
@size-change="pageSizeChange"
|
||||
@current-change="pageNumberChange"
|
||||
:current-page="pageForm.pageNumber"
|
||||
:page-sizes="[10, 20, 30, 50]"
|
||||
:page-size="pageForm.pageSize"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
:total="pageForm.totalCount">
|
||||
</el-pagination>
|
||||
</el-row>
|
||||
</el-card>
|
||||
|
||||
<template #view>
|
||||
<div style="width: 80%; margin: 0 auto">
|
||||
<vi-title title="总结详情"></vi-title>
|
||||
<el-descriptions :column="2" border class="table_fixed">
|
||||
<el-descriptions-item label="年度">
|
||||
{{viewData.year}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="社团">
|
||||
{{viewData.name}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="总结类型">
|
||||
{{viewData.typename}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="上传人">
|
||||
{{viewData.username}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="上传时间" :span="2">
|
||||
{{viewData.ctime}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="附件">
|
||||
<file-upload v-if="viewData.files&&viewData.files.length"
|
||||
:files="JSON.parse(viewData.files)"
|
||||
:view="true"></file-upload>
|
||||
<span v-else>暂无</span>
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</div>
|
||||
</template>
|
||||
</guava>
|
||||
|
||||
</div>
|
||||
|
||||
<script>
|
||||
let vue = new Vue({
|
||||
el: "#app",
|
||||
components: {
|
||||
'file-upload': httpVueLoader('/components/plugins/FileUpload.vue'),
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
tableData: [],
|
||||
fileList: [],
|
||||
pageForm: {
|
||||
pageNumber: 1,
|
||||
pageSize: 10,
|
||||
totalCount: 0,
|
||||
pageOrderName: "",
|
||||
pageOrderBy: "",
|
||||
summaryFrom: '3',
|
||||
year: moment().format('YYYY')
|
||||
},
|
||||
formData: {},
|
||||
summaryType: [],
|
||||
unionOptions: [],
|
||||
viewData: {},
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
openView(row) {
|
||||
this.$refs.guava.view()
|
||||
this.viewData = row
|
||||
},
|
||||
dropdownCommand(command) {
|
||||
const {type, data} = command
|
||||
if (type == 'view') {
|
||||
this.openView(data)
|
||||
} else if (type == 'edit') {
|
||||
this.openEdit(data)
|
||||
} else if (type == 'delete') {
|
||||
this.doDelete(data.id)
|
||||
}
|
||||
},
|
||||
doDelete(id) {
|
||||
this.$confirm('确定要删除吗', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
}).then(() => {
|
||||
$.post(base + '/platform/activity/yearSummary/doDelete', {id: id}).then(res => {
|
||||
if (res.code === 0) {
|
||||
this.doSearch()
|
||||
this.$message.success(res.msg)
|
||||
}
|
||||
})
|
||||
}).catch(() => {
|
||||
})
|
||||
},
|
||||
doSearch() {
|
||||
this.pageForm.pageNumber = 1
|
||||
this.pageData()
|
||||
},
|
||||
pageOrder(column) {
|
||||
this.pageForm.pageOrderName = column.prop
|
||||
this.pageForm.pageOrderBy = column.order
|
||||
this.pageData()
|
||||
},
|
||||
pageNumberChange(val) {
|
||||
this.pageForm.pageNumber = val;
|
||||
this.pageData()
|
||||
},
|
||||
pageSizeChange(val) {
|
||||
this.pageForm.pageSize = val;
|
||||
this.pageData()
|
||||
},
|
||||
pageData() {
|
||||
$.post('/platform/activity/yearSummary/pageData', this.pageForm).then(res => {
|
||||
if (res.code === 0) {
|
||||
this.tableData = res.data.list
|
||||
this.pageForm.totalCount = res.data.totalCount
|
||||
}
|
||||
})
|
||||
},
|
||||
openEdit(row) {
|
||||
sublime.jumpPagePjax('/platform/activity/yearSummary/addClubSummary?id=' + row.id)
|
||||
},
|
||||
async getMyClub() {
|
||||
return await $.post('/platform/activity/yearSummary/getMyClub')
|
||||
}
|
||||
},
|
||||
async created() {
|
||||
this.unionOptions = await getClubs()
|
||||
const isAdmin = "${@shiro.hasAnyRoles('sysadmin', 'A06')}" === 'true'
|
||||
if (!isAdmin) {
|
||||
const clubs = await this.getMyClub()
|
||||
let clubArray = []
|
||||
for (let c of Array.from(clubs)) {
|
||||
const cl = this.unionOptions.find(x => x.id === c)
|
||||
if (cl) {
|
||||
clubArray.push(cl)
|
||||
}
|
||||
}
|
||||
this.unionOptions = clubArray
|
||||
}
|
||||
this.summaryType = await getDictOptions('summaryType')
|
||||
this.pageData()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,57 @@
|
||||
<el-form :model="formData" label-width="120px" ref="form">
|
||||
<vi-title title="年度总结"></vi-title>
|
||||
<el-row :gutter="10" type="flex">
|
||||
<el-col :span="24">
|
||||
<el-form-item label="姓名" prop="username">
|
||||
<el-select v-model="formData.userId" style="width: 100%"
|
||||
filterable
|
||||
remote
|
||||
clearable
|
||||
reserve-keyword
|
||||
placeholder="输入工号或姓名查找"
|
||||
:remote-method="querySqr">
|
||||
<el-option v-for="o in userOptions" :label="o.username+'-'+o.loginname" :value="o.id"
|
||||
:key="o.id"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row v-if="summaryFrom === '2'" :gutter="10" type="flex">
|
||||
<el-col :span="24">
|
||||
<el-form-item label="所属工会" prop="tissueId">
|
||||
<el-select v-model="formData.tissueId" placeholder="请选择所属工会" style="width: 100%;">
|
||||
<el-option v-for="item in unionOptions" :label="item.unionname" :value="item.id"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row v-if="summaryFrom === '3'" :gutter="10" type="flex">
|
||||
<el-col :span="24">
|
||||
<el-form-item label="社团" prop="tissueId">
|
||||
<el-select v-model="formData.tissueId" placeholder="请选择社团(社团)" style="width: 100%;">
|
||||
<el-option v-for="item in clubOptions" :label="item.name" :value="item.id"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="10" type="flex">
|
||||
<el-col :span="24">
|
||||
<el-form-item label="总结类型" prop="summaryType" :rules="{required:true,message: '请选择总结类型', trigger: 'blur'}">
|
||||
<el-select v-model="formData.summaryType" placeholder="请选择总结类型" style="width: 100%;">
|
||||
<el-option v-for="item in summaryType" :label="item.name" :value="item.id"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="10" type="flex">
|
||||
<el-col :span="24">
|
||||
<el-form-item prop="files" label="附件上传">
|
||||
<file-upload :files.sync="formData.files"></file-upload>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<el-row class="mt10" justify="end" type="flex">
|
||||
<el-button @click="cancel">取消</el-button>
|
||||
<el-button @click="doHandle" type="primary">提交</el-button>
|
||||
</el-row>
|
||||
@@ -0,0 +1,99 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
|
||||
<div id="app" v-cloak>
|
||||
<guava ref="guava">
|
||||
<el-card shadow="never">
|
||||
<!--#include("/platform/activity/summary/common/addSummaryCommon.html"){}#-->
|
||||
</el-card>
|
||||
</guava>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
var vue = new Vue({
|
||||
el: '#app',
|
||||
components: {},
|
||||
data() {
|
||||
return {
|
||||
formData: {
|
||||
files: [],
|
||||
tissueId: '',
|
||||
},
|
||||
summaryFrom: '1',
|
||||
summaryType: [],
|
||||
id: '',
|
||||
unionOptions: [],
|
||||
userOptions: [],
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async querySqr(key) {
|
||||
const data = await selectUser(key, 30)
|
||||
this.userOptions = data.list
|
||||
},
|
||||
cancel() {
|
||||
if (this.id) {
|
||||
sublime.jumpPagePjax('/platform/activity/yearSummary/school')
|
||||
}
|
||||
},
|
||||
async doHandle() {
|
||||
const valid = await this.$refs['form'].validate()
|
||||
if (valid) {
|
||||
this.formData.userId = "${@shiro.getPrincipalProperty('id')}";
|
||||
this.formData.summaryFrom = "1";
|
||||
this.formData.files = JSON.stringify(this.formData.files)
|
||||
const resp = await $.post('/platform/activity/yearSummary/doHandle', this.formData)
|
||||
if (resp.code === 0) {
|
||||
this.$notify({
|
||||
title: '成功',
|
||||
message: resp.msg,
|
||||
type: 'success',
|
||||
duration: 500,
|
||||
onClose: () => {
|
||||
sublime.jumpPagePjax('/platform/activity/yearSummary/school')
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
async initData() {
|
||||
const id = GetQueryString("id")
|
||||
this.id = id
|
||||
if (id) {
|
||||
const resp = await $.post('/platform/activity/yearSummary/findOne', {id})
|
||||
if (resp.code === 0) {
|
||||
this.formData = resp.data
|
||||
this.formData.files = JSON.parse(this.formData.files)
|
||||
this.userOptions = [
|
||||
{
|
||||
username: this.formData.username,
|
||||
loginname: this.formData.loginname,
|
||||
id: this.formData.userId,
|
||||
}
|
||||
]
|
||||
}
|
||||
} else {
|
||||
this.formData.userId = "${@shiro.getPrincipalProperty('id')}"
|
||||
this.userOptions = [
|
||||
{
|
||||
username: "${@shiro.getPrincipalProperty('username')}",
|
||||
loginname: "${@shiro.getPrincipalProperty('loginname')}",
|
||||
id: "${@shiro.getPrincipalProperty('id')}",
|
||||
}
|
||||
]
|
||||
this.formData.tissueId = "${@shiro.getPrincipalProperty('union').getId()}"
|
||||
}
|
||||
},
|
||||
},
|
||||
async created() {
|
||||
await this.initData()
|
||||
this.summaryType = await getDictOptions('summaryType')
|
||||
this.unionOptions = await getUnions()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,236 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
|
||||
<style>
|
||||
.el-descriptions__table {
|
||||
table-layout: fixed !important;
|
||||
}
|
||||
|
||||
.el-descriptions-item__cell {
|
||||
text-align: center !important;
|
||||
}
|
||||
</style>
|
||||
<div id="app" v-cloak>
|
||||
<guava ref="guava">
|
||||
|
||||
<el-card shadow="never">
|
||||
<div class="search">
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">年度</div>
|
||||
<div class="search-item-option">
|
||||
<el-date-picker
|
||||
placeholder="选择年度" style="width: 100%"
|
||||
type="year"
|
||||
v-model="pageForm.year"
|
||||
value-format="yyyy">
|
||||
</el-date-picker>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!--<div class="search-item">
|
||||
<div class="search-item-label">所属工会</div>
|
||||
<div class="search-item-option">
|
||||
<el-select v-model="pageForm.tissueId" placeholder="请选择所属工会" style="width: 100%;">
|
||||
<el-option v-for="item in unionOptions" :label="item.unionname" :value="item.id"></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
</div>-->
|
||||
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">总结类型</div>
|
||||
<div class="search-item-option">
|
||||
<el-select v-model="pageForm.summaryType" placeholder="请选择总结类型"
|
||||
clearable style="width: 100%;">
|
||||
<el-option v-for="item in summaryType" :label="item.name" :value="item.id"></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="search-query">
|
||||
<el-button type="primary" icon="el-icon-search" @click="pageData">搜索</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<el-card shadow="never" class="mt20">
|
||||
<el-table :data="tableData" @sort-change='pageOrder'>
|
||||
<el-table-column label="序号" type="index" header-align="center" align="center">
|
||||
<template scope="scope">
|
||||
<span>{{scope.$index+(pageForm.pageNumber - 1) * pageForm.pageSize + 1}} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="year" label="年度">
|
||||
</el-table-column>
|
||||
<!--<el-table-column sortable prop="name" label="所属工会">
|
||||
</el-table-column>-->
|
||||
<el-table-column sortable prop="typename" label="总结类型">
|
||||
</el-table-column>
|
||||
<el-table-column sortable prop="username" label="上传人">
|
||||
</el-table-column>
|
||||
<el-table-column sortable prop="ctime" label="上传时间">
|
||||
</el-table-column>
|
||||
<el-table-column prop="userOnline" label="操作" width="100px">
|
||||
<template slot-scope="scope">
|
||||
<el-dropdown @command="dropdownCommand">
|
||||
<el-button plain size="mini"><i class="ti-settings"></i><span class="ti-angle-down"></span>
|
||||
</el-button>
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-item :command="{type:'view',data:scope.row}">
|
||||
查看
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item :command="{type:'edit',data:scope.row}">
|
||||
编辑
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item :command="{type:'delete',data:scope.row}">
|
||||
删除
|
||||
</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-row class="el-pagination-container">
|
||||
<el-pagination
|
||||
@size-change="pageSizeChange"
|
||||
@current-change="pageNumberChange"
|
||||
:current-page="pageForm.pageNumber"
|
||||
:page-sizes="[10, 20, 30, 50]"
|
||||
:page-size="pageForm.pageSize"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
:total="pageForm.totalCount">
|
||||
</el-pagination>
|
||||
</el-row>
|
||||
</el-card>
|
||||
|
||||
<template #view>
|
||||
<div style="width: 80%; margin: 0 auto">
|
||||
<vi-title title="总结详情"></vi-title>
|
||||
<el-descriptions :column="2" border class="table_fixed">
|
||||
<el-descriptions-item label="年度">
|
||||
{{viewData.year}}
|
||||
</el-descriptions-item>
|
||||
<!-- <el-descriptions-item label="所属工会">
|
||||
{{viewData.name}}
|
||||
</el-descriptions-item>-->
|
||||
<el-descriptions-item label="总结类型">
|
||||
{{viewData.typename}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="上传人">
|
||||
{{viewData.username}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="上传时间" :span="2">
|
||||
{{viewData.ctime}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="附件">
|
||||
<file-upload v-if="viewData.files&&viewData.files.length"
|
||||
:files="JSON.parse(viewData.files)"
|
||||
:view="true"></file-upload>
|
||||
<span v-else>暂无</span>
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</div>
|
||||
</template>
|
||||
</guava>
|
||||
|
||||
</div>
|
||||
|
||||
<script>
|
||||
let vue = new Vue({
|
||||
el: "#app",
|
||||
components: {
|
||||
'file-upload': httpVueLoader('/components/plugins/FileUpload.vue'),
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
tableData: [],
|
||||
fileList: [],
|
||||
pageForm: {
|
||||
pageNumber: 1,
|
||||
pageSize: 10,
|
||||
totalCount: 0,
|
||||
pageOrderName: "",
|
||||
pageOrderBy: "",
|
||||
summaryFrom: '1',
|
||||
year: moment().format('YYYY')
|
||||
},
|
||||
formData: {},
|
||||
summaryType: [],
|
||||
unionOptions: [],
|
||||
viewData: {},
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
openView(row) {
|
||||
this.$refs.guava.view()
|
||||
this.viewData = row
|
||||
},
|
||||
dropdownCommand(command) {
|
||||
const {type, data} = command
|
||||
if (type == 'view') {
|
||||
this.openView(data)
|
||||
} else if (type == 'edit') {
|
||||
this.openEdit(data)
|
||||
} else if (type == 'delete') {
|
||||
this.doDelete(data.id)
|
||||
}
|
||||
},
|
||||
doDelete(id) {
|
||||
this.$confirm('确定要删除吗', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
}).then(() => {
|
||||
$.post(base + '/platform/activity/yearSummary/doDelete', {id: id}).then(res => {
|
||||
if (res.code === 0) {
|
||||
this.doSearch()
|
||||
this.$message.success(res.msg)
|
||||
}
|
||||
})
|
||||
}).catch(() => {
|
||||
})
|
||||
},
|
||||
doSearch() {
|
||||
this.pageForm.pageNumber = 1
|
||||
this.pageData()
|
||||
},
|
||||
pageOrder(column) {
|
||||
this.pageForm.pageOrderName = column.prop
|
||||
this.pageForm.pageOrderBy = column.order
|
||||
this.pageData()
|
||||
},
|
||||
pageNumberChange(val) {
|
||||
this.pageForm.pageNumber = val;
|
||||
this.pageData()
|
||||
},
|
||||
pageSizeChange(val) {
|
||||
this.pageForm.pageSize = val;
|
||||
this.pageData()
|
||||
},
|
||||
pageData() {
|
||||
$.post('/platform/activity/yearSummary/pageData', this.pageForm).then(res => {
|
||||
if (res.code === 0) {
|
||||
this.tableData = res.data.list
|
||||
this.pageForm.totalCount = res.data.totalCount
|
||||
}
|
||||
})
|
||||
},
|
||||
openEdit(row) {
|
||||
sublime.jumpPagePjax('/platform/activity/yearSummary/addSchoolSummary?id=' + row.id)
|
||||
},
|
||||
},
|
||||
async created() {
|
||||
this.unionOptions = await getUnions()
|
||||
const isAdmin = "${@shiro.hasAnyRoles('sysadmin', 'A06')}" === 'true'
|
||||
if (!isAdmin) {
|
||||
const selfUnion = "${@shiro.getPrincipalProperty('union').getId()}";
|
||||
this.unionOptions = this.unionOptions.find(x => x.id === selfUnion)
|
||||
}
|
||||
this.summaryType = await getDictOptions('summaryType')
|
||||
this.pageData()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,105 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
|
||||
<div id="app" v-cloak>
|
||||
<guava ref="guava">
|
||||
<el-card shadow="never">
|
||||
<!--#include("/platform/activity/summary/common/addSummaryCommon.html"){}#-->
|
||||
</el-card>
|
||||
</guava>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
var vue = new Vue({
|
||||
el: '#app',
|
||||
components: {},
|
||||
data() {
|
||||
return {
|
||||
formData: {
|
||||
files: [],
|
||||
tissueId: '',
|
||||
},
|
||||
summaryFrom: '2',
|
||||
summaryType: [],
|
||||
id: '',
|
||||
unionOptions: [],
|
||||
userOptions: [],
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async querySqr(key) {
|
||||
const data = await selectUser(key, 30)
|
||||
this.userOptions = data.list
|
||||
},
|
||||
cancel() {
|
||||
if (this.id) {
|
||||
sublime.jumpPagePjax('/platform/activity/yearSummary/union')
|
||||
}
|
||||
},
|
||||
async doHandle() {
|
||||
const valid = await this.$refs['form'].validate()
|
||||
if (valid) {
|
||||
this.formData.userId = "${@shiro.getPrincipalProperty('id')}";
|
||||
this.formData.tissueId = "${@shiro.getPrincipalProperty('union').getId()}";
|
||||
this.formData.summaryFrom = "2";
|
||||
this.formData.files = JSON.stringify(this.formData.files)
|
||||
const resp = await $.post('/platform/activity/yearSummary/doHandle', this.formData)
|
||||
if (resp.code === 0) {
|
||||
this.$notify({
|
||||
title: '成功',
|
||||
message: resp.msg,
|
||||
type: 'success',
|
||||
duration: 500,
|
||||
onClose: () => {
|
||||
sublime.jumpPagePjax('/platform/activity/yearSummary/union')
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
async initData() {
|
||||
const id = GetQueryString("id")
|
||||
this.id = id
|
||||
if (id) {
|
||||
const resp = await $.post('/platform/activity/yearSummary/findOne', {id})
|
||||
if (resp.code === 0) {
|
||||
this.formData = resp.data
|
||||
this.formData.files = JSON.parse(this.formData.files)
|
||||
this.userOptions = [
|
||||
{
|
||||
username: this.formData.username,
|
||||
loginname: this.formData.loginname,
|
||||
id: this.formData.userId,
|
||||
}
|
||||
]
|
||||
}
|
||||
} else {
|
||||
this.formData.userId = "${@shiro.getPrincipalProperty('id')}"
|
||||
this.userOptions = [
|
||||
{
|
||||
username: "${@shiro.getPrincipalProperty('username')}",
|
||||
loginname: "${@shiro.getPrincipalProperty('loginname')}",
|
||||
id: "${@shiro.getPrincipalProperty('id')}",
|
||||
}
|
||||
]
|
||||
this.formData.tissueId = "${@shiro.getPrincipalProperty('union').getId()}"
|
||||
}
|
||||
},
|
||||
},
|
||||
async created() {
|
||||
await this.initData()
|
||||
this.summaryType = await getDictOptions('summaryType')
|
||||
this.unionOptions = await getUnions()
|
||||
const isAdmin = "${@shiro.hasAnyRoles('sysadmin', 'A06')}" === 'true'
|
||||
if (!isAdmin) {
|
||||
const selfUnion = "${@shiro.getPrincipalProperty('union').getId()}";
|
||||
this.unionOptions = [this.unionOptions.find(x => x.id === selfUnion)]
|
||||
}
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,236 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
|
||||
<style>
|
||||
.el-descriptions__table {
|
||||
table-layout: fixed !important;
|
||||
}
|
||||
|
||||
.el-descriptions-item__cell {
|
||||
text-align: center !important;
|
||||
}
|
||||
</style>
|
||||
<div id="app" v-cloak>
|
||||
<guava ref="guava">
|
||||
|
||||
<el-card shadow="never">
|
||||
<div class="search">
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">年度</div>
|
||||
<div class="search-item-option">
|
||||
<el-date-picker
|
||||
placeholder="选择年度" style="width: 100%"
|
||||
type="year"
|
||||
v-model="pageForm.year"
|
||||
value-format="yyyy">
|
||||
</el-date-picker>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">所属工会</div>
|
||||
<div class="search-item-option">
|
||||
<el-select v-model="pageForm.tissueId" placeholder="请选择所属工会" style="width: 100%;">
|
||||
<el-option v-for="item in unionOptions" :label="item.unionname"
|
||||
:value="item.id"></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">总结类型</div>
|
||||
<div class="search-item-option">
|
||||
<el-select v-model="pageForm.summaryType" placeholder="请选择总结类型" style="width: 100%;">
|
||||
<el-option v-for="item in summaryType" :label="item.name" :value="item.id"></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="search-query">
|
||||
<el-button type="primary" icon="el-icon-search" @click="pageData">搜索</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<el-card shadow="never" class="mt20">
|
||||
<el-table :data="tableData" @sort-change='pageOrder'>
|
||||
<el-table-column label="序号" type="index" header-align="center" align="center">
|
||||
<template scope="scope">
|
||||
<span>{{scope.$index+(pageForm.pageNumber - 1) * pageForm.pageSize + 1}} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="year" label="年度">
|
||||
</el-table-column>
|
||||
<el-table-column sortable prop="name" label="所属工会">
|
||||
</el-table-column>
|
||||
<el-table-column sortable prop="typename" label="总结类型">
|
||||
</el-table-column>
|
||||
<el-table-column sortable prop="username" label="上传人">
|
||||
</el-table-column>
|
||||
<el-table-column sortable prop="ctime" label="上传时间">
|
||||
</el-table-column>
|
||||
<el-table-column prop="userOnline" label="操作" width="100px">
|
||||
<template slot-scope="scope">
|
||||
<el-dropdown @command="dropdownCommand">
|
||||
<el-button plain size="mini"><i class="ti-settings"></i><span class="ti-angle-down"></span>
|
||||
</el-button>
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-item :command="{type:'view',data:scope.row}">
|
||||
查看
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item :command="{type:'edit',data:scope.row}">
|
||||
编辑
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item :command="{type:'delete',data:scope.row}">
|
||||
删除
|
||||
</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-row class="el-pagination-container">
|
||||
<el-pagination
|
||||
@size-change="pageSizeChange"
|
||||
@current-change="pageNumberChange"
|
||||
:current-page="pageForm.pageNumber"
|
||||
:page-sizes="[10, 20, 30, 50]"
|
||||
:page-size="pageForm.pageSize"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
:total="pageForm.totalCount">
|
||||
</el-pagination>
|
||||
</el-row>
|
||||
</el-card>
|
||||
|
||||
<template #view>
|
||||
<div style="width: 80%; margin: 0 auto">
|
||||
<vi-title title="总结详情"></vi-title>
|
||||
<el-descriptions :column="2" border class="table_fixed">
|
||||
<el-descriptions-item label="年度">
|
||||
{{viewData.year}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="所属工会">
|
||||
{{viewData.name}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="总结类型">
|
||||
{{viewData.typename}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="上传人">
|
||||
{{viewData.username}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="上传时间" :span="2">
|
||||
{{viewData.ctime}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="附件">
|
||||
<file-upload v-if="viewData.files&&viewData.files.length"
|
||||
:files="JSON.parse(viewData.files)"
|
||||
:view="true"></file-upload>
|
||||
<span v-else>暂无</span>
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</div>
|
||||
</template>
|
||||
</guava>
|
||||
|
||||
</div>
|
||||
|
||||
<script>
|
||||
let vue = new Vue({
|
||||
el: "#app",
|
||||
components: {
|
||||
'file-upload': httpVueLoader('/components/plugins/FileUpload.vue'),
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
tableData: [],
|
||||
fileList: [],
|
||||
pageForm: {
|
||||
pageNumber: 1,
|
||||
pageSize: 10,
|
||||
totalCount: 0,
|
||||
pageOrderName: "",
|
||||
pageOrderBy: "",
|
||||
summaryFrom: '2',
|
||||
year: moment().format('YYYY')
|
||||
},
|
||||
formData: {},
|
||||
summaryType: [],
|
||||
unionOptions: [],
|
||||
viewData: {},
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
openView(row) {
|
||||
this.$refs.guava.view()
|
||||
this.viewData = row
|
||||
},
|
||||
dropdownCommand(command) {
|
||||
const {type, data} = command
|
||||
if (type == 'view') {
|
||||
this.openView(data)
|
||||
} else if (type == 'edit') {
|
||||
this.openEdit(data)
|
||||
} else if (type == 'delete') {
|
||||
this.doDelete(data.id)
|
||||
}
|
||||
},
|
||||
doDelete(id) {
|
||||
this.$confirm('确定要删除吗', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
}).then(() => {
|
||||
$.post(base + '/platform/activity/yearSummary/doDelete', {id: id}).then(res => {
|
||||
if (res.code === 0) {
|
||||
this.doSearch()
|
||||
this.$message.success(res.msg)
|
||||
}
|
||||
})
|
||||
}).catch(() => {
|
||||
})
|
||||
},
|
||||
doSearch() {
|
||||
this.pageForm.pageNumber = 1
|
||||
this.pageData()
|
||||
},
|
||||
pageOrder(column) {
|
||||
this.pageForm.pageOrderName = column.prop
|
||||
this.pageForm.pageOrderBy = column.order
|
||||
this.pageData()
|
||||
},
|
||||
pageNumberChange(val) {
|
||||
this.pageForm.pageNumber = val;
|
||||
this.pageData()
|
||||
},
|
||||
pageSizeChange(val) {
|
||||
this.pageForm.pageSize = val;
|
||||
this.pageData()
|
||||
},
|
||||
pageData() {
|
||||
$.post('/platform/activity/yearSummary/pageData', this.pageForm).then(res => {
|
||||
if (res.code === 0) {
|
||||
this.tableData = res.data.list
|
||||
this.pageForm.totalCount = res.data.totalCount
|
||||
}
|
||||
})
|
||||
},
|
||||
openEdit(row) {
|
||||
sublime.jumpPagePjax('/platform/activity/yearSummary/addUnionSummary?id=' + row.id)
|
||||
},
|
||||
},
|
||||
async created() {
|
||||
this.unionOptions = await getUnions()
|
||||
const isAdmin = "${@shiro.hasAnyRoles('sysadmin', 'A06')}" === 'true'
|
||||
if (!isAdmin) {
|
||||
const selfUnion = "${@shiro.getPrincipalProperty('union').getId()}";
|
||||
this.unionOptions = [this.unionOptions.find(x => x.id === selfUnion)]
|
||||
}
|
||||
this.summaryType = await getDictOptions('summaryType')
|
||||
this.pageData()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,443 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
<style>
|
||||
.el-divider {
|
||||
background-color: #409EFF !important;
|
||||
}
|
||||
|
||||
.el-divider__text {
|
||||
color: #409EFF !important;
|
||||
}
|
||||
|
||||
.el-timeline-item__timestamp {
|
||||
color: #409EFF;
|
||||
}
|
||||
</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.unionId" placeholder="请选择工会" filterable clearable
|
||||
style="width: 100%">
|
||||
<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-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"
|
||||
:sortable="column.sortable">
|
||||
|
||||
<template v-if="column.prop=='time'" scope="{row}">
|
||||
<span>
|
||||
{{moment(row.startTime).format('YYYY-MM-DD')}} - {{moment(row.endTime).format('YYYY-MM-DD')}}
|
||||
</span>
|
||||
</template>
|
||||
|
||||
<template v-else-if="column.prop=='type'" scope="{row}">
|
||||
<span v-if="row.type==40001">分工会活动计划</span>
|
||||
<span v-if="row.type==40003">社团活动计划</span>
|
||||
<span v-if="row.type==40003">校工会活动计划</span>
|
||||
</template>
|
||||
|
||||
<template v-else-if="column.prop=='tussueName'" scope="{row}">
|
||||
<span v-if="row.type==40002">{{row.unionname?row.unionname:'暂无'}}</span>
|
||||
<span v-if="row.type==40003">{{row.clubName?row.clubName:'暂无'}}</span>
|
||||
<span v-else>暂无</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:'view',row}">
|
||||
查看
|
||||
</el-dropdown-item>
|
||||
<!--# if(!@shiro.hasRole('A06')){ #-->
|
||||
<el-dropdown-item :command="{type:'export',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="operation">确 定</el-button>
|
||||
</template>
|
||||
|
||||
<template #edit>
|
||||
<vi-title title="填写活动信息"></vi-title>
|
||||
<el-form :model="formData" ref="addForm" :rules="formRules" label-width="100px" label-position="left"
|
||||
label-suffix=":" style="padding: 0 2%">
|
||||
|
||||
<el-form-item prop="name" label="活动名称">
|
||||
<el-input maxlength="50" placeholder="请填写活动名称" v-model="formData.name"
|
||||
type="text"></el-input>
|
||||
</el-form-item>
|
||||
|
||||
<!--<el-row :gutter="40">
|
||||
<el-col :span="12">
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item prop="type" label="活动类型">
|
||||
<el-radio-group v-model="formData.type">
|
||||
<el-radio label="1" border>分工会活动</el-radio>
|
||||
<el-radio label="2" border>社团活动</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>-->
|
||||
|
||||
<el-row :gutter="40">
|
||||
<el-col :span="12">
|
||||
<el-form-item prop="time" label="活动时间">
|
||||
<el-date-picker
|
||||
style="width: 100%"
|
||||
v-model="formData.time"
|
||||
type="daterange"
|
||||
value-format="yyyy-MM-dd"
|
||||
range-separator="-"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item prop="peopleNum" label="活动人数">
|
||||
<el-input maxlength="10" placeholder="请填写活动人数" v-model="formData.peopleNum"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="40">
|
||||
<el-col :span="12">
|
||||
<el-form-item prop="address" label="活动地址">
|
||||
<el-input maxlength="50" placeholder="请填写活动地址" v-model="formData.address"
|
||||
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">
|
||||
<el-tooltip class="item" effect="dark" content="点击添加活动人员" placement="top">
|
||||
<el-button icon="el-icon-plus" circle @click="openAddUser" type="primary"></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"
|
||||
v-for="column in userColumns"
|
||||
:label="column.label"
|
||||
:prop="column.prop"
|
||||
:sortable="column.sortable">
|
||||
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column prop="userOnline" align="center" header-align="center" label="操作"
|
||||
width="150px">
|
||||
<template scope="{row}">
|
||||
<el-button type="danger" icon="el-icon-delete" circle @click="delUser"></el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
</el-table>
|
||||
|
||||
<el-divider content-position="left">活动资料</el-divider>
|
||||
<file-upload :files.sync="formData.files"></file-upload>
|
||||
|
||||
</el-form>
|
||||
</template>
|
||||
|
||||
<template #view>
|
||||
<tissue-info ref="info"></tissue-info>
|
||||
</template>
|
||||
</guava>
|
||||
|
||||
<el-dialog title="添加人员" :visible.sync="dialogVisible" width="40%">
|
||||
|
||||
<el-form :model="formData" ref="form" :rules="formRules" label-width="100px">
|
||||
<el-form-item prop="userId" label="参加人员">
|
||||
<el-select v-model="formData.tissuePersonList" placeholder="请选择参加人员"
|
||||
multiple
|
||||
filterable
|
||||
remote
|
||||
reserve-keyword
|
||||
:remote-method="remoteMethod"
|
||||
:loading="selectLoading"
|
||||
style="width: 100%">
|
||||
<el-option
|
||||
v-for="item in userList"
|
||||
:key="item.userId"
|
||||
:label="item.userName+'-'+item.loginName+'-'+item.unitName"
|
||||
:value="item.userId">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</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 {
|
||||
selectLoading: false,
|
||||
userTabLoading: false,
|
||||
dialogVisible: false,
|
||||
userData: [],
|
||||
userList: [],
|
||||
unionList: [],
|
||||
formData: {
|
||||
tissuePersonList: []
|
||||
},
|
||||
tableColumns: [
|
||||
{prop: 'name', label: '活动名称'},
|
||||
{prop: 'address', label: '活动地点'},
|
||||
{prop: 'type', label: '活动类型'},
|
||||
{prop: 'tussueName', label: '所属组织'},
|
||||
{prop: 'time', label: '活动日期'},
|
||||
{prop: 'peopleNum', label: '活动人数'}
|
||||
],
|
||||
userColumns: [
|
||||
{prop: 'userName', label: '姓名'},
|
||||
{prop: 'loginName', label: '工号'},
|
||||
{prop: 'sex', label: '性别'},
|
||||
{prop: 'mobile', label: '联系方式'},
|
||||
{prop: 'unitName', label: '所属单位'},
|
||||
{prop: 'unionName', label: '所属工会'}
|
||||
],
|
||||
formRules: {
|
||||
name: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
address: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
peopleNum: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
time: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
type: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
}
|
||||
}
|
||||
},
|
||||
components: {
|
||||
'guava': httpVueLoader('/components/plugins/Guava.vue'),
|
||||
'file-upload': httpVueLoader('/components/plugins/FileUpload.vue'),
|
||||
'tissue-info': httpVueLoader('/components/activity/school/tissueInfo.vue')
|
||||
},
|
||||
methods: {
|
||||
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') {
|
||||
location.href = "/platform/activity/union/info/mange/export?id=" + row.id
|
||||
}
|
||||
},
|
||||
async remoteMethod(query) {
|
||||
if (query) {
|
||||
this.selectLoading = true;
|
||||
const {data} = await $.post(loc() + "/findUser", {serachWord: query})
|
||||
this.userList = data
|
||||
this.selectLoading = false;
|
||||
}
|
||||
},
|
||||
openAddUser() {
|
||||
this.formData.tissuePersonList = []
|
||||
this.dialogVisible = true
|
||||
},
|
||||
doAddUser() {
|
||||
this.formData.tissuePersonList = this.userList.filter(v => this.formData.tissuePersonList.some(x => v.userId === x))
|
||||
this.userData = this.userData.concat(this.formData.tissuePersonList)
|
||||
this.dialogVisible = false
|
||||
},
|
||||
delUser(row) {
|
||||
this.userData.splice(this.userData.indexOf(row.userId), 1)
|
||||
this.formData.tissuePersonList.splice(this.formData.tissuePersonList.indexOf(row.userId), 1)
|
||||
},
|
||||
openView(row) {
|
||||
const {id} = row
|
||||
this.$refs.info.getInfo(id)
|
||||
this.$refs.guava.view()
|
||||
},
|
||||
async openEdit(row) {
|
||||
const {id} = row
|
||||
const resp = await $.post(loc() + "/findOne", {id})
|
||||
if(resp.code===0){
|
||||
const data = resp.data
|
||||
data.type = data.type + ''
|
||||
data.files = JSON.parse(data.files)
|
||||
data.time = [data.startTime, data.endTime]
|
||||
this.userData = clone(data.tissuePersonList)
|
||||
this.formData = data
|
||||
}else{
|
||||
this.notifyWarning(resp.msg)
|
||||
}
|
||||
this.$refs.guava.edit()
|
||||
},
|
||||
async openAdd() {
|
||||
this.$refs.guava.edit()
|
||||
this.userData = []
|
||||
this.$nextTick(() => {
|
||||
this.formData = {
|
||||
name: '',
|
||||
time: '',
|
||||
peopleNum: '',
|
||||
address: '',
|
||||
files: [],
|
||||
type: "40002",
|
||||
tissuePersonList: []
|
||||
}
|
||||
if (this.$refs['addForm']) {
|
||||
this.$refs['addForm'].resetFields()
|
||||
}
|
||||
})
|
||||
},
|
||||
async operation() {
|
||||
let url = this.formData.id ? "/doEdit" : "/doAdd"
|
||||
this.$refs["addForm"].validate(async (valid) => {
|
||||
if (valid) {
|
||||
const loading = this.$loading({
|
||||
lock: true,
|
||||
text: '正在提交...',
|
||||
spinner: 'el-icon-loading',
|
||||
background: COVER_LAYER_COLOR
|
||||
});
|
||||
|
||||
const formData = JSON.parse(JSON.stringify(this.formData))
|
||||
|
||||
if (formData.time && formData.time.length) {
|
||||
formData.startTime = formData.time[0]
|
||||
formData.endTime = formData.time[1]
|
||||
formData.time = undefined
|
||||
}
|
||||
|
||||
const resp = await $.post(loc() + url, {tissue: JSON.stringify(formData),})
|
||||
|
||||
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 () => {
|
||||
this.$set(row, "loading", true)
|
||||
const resp = await $.post(loc() + "/doDelete", {id: id});
|
||||
this.$set(row, "loading", false)
|
||||
if(resp.code===0){
|
||||
this.pageData()
|
||||
}else{
|
||||
this.notifyWarning(resp.msg)
|
||||
}
|
||||
})
|
||||
},
|
||||
},
|
||||
async created() {
|
||||
this.pageData()
|
||||
this.unionList = await getUnions(null)
|
||||
}
|
||||
})
|
||||
</script>
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,341 @@
|
||||
<!--#
|
||||
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-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.tissueId" placeholder="请选择工会" filterable clearable
|
||||
style="width: 100%">
|
||||
<el-option
|
||||
v-for="item in unionList"
|
||||
:key="item.id"
|
||||
:label="item.unionname"
|
||||
:value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<template v-if="searchMore">
|
||||
<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>
|
||||
</template>
|
||||
|
||||
|
||||
<div class="search-query">
|
||||
<el-button type="primary" icon="el-icon-search" @click="pageData">搜索</el-button>
|
||||
<more v-model="searchMore"></more>
|
||||
</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"
|
||||
: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>
|
||||
|
||||
<template v-else-if="column.prop=='type'" scope="{row}">
|
||||
<span v-if="row.type==40001">分工会活动计划</span>
|
||||
<span v-if="row.type==40003">社团活动计划</span>
|
||||
<span v-if="row.type==40003">校工会活动计划</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:'view',row}">
|
||||
查看
|
||||
</el-dropdown-item>
|
||||
<!--# if(!@shiro.hasRole('A06')){ #-->
|
||||
<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="operation">确 定</el-button>
|
||||
</template>
|
||||
|
||||
<template #edit>
|
||||
<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="2" border>分工会活动计划</el-radio>
|
||||
<el-radio label="3" 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="eventId" label="活动项目">
|
||||
<el-select v-model="formData.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>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item prop="content" label="计划内容" class="is-required">
|
||||
<div id="content"></div>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</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 {
|
||||
unionList: [],
|
||||
eventList: [],
|
||||
flag: false,
|
||||
formData: {
|
||||
name: '',
|
||||
time: '',
|
||||
eventId: '',
|
||||
content: ''
|
||||
},
|
||||
tableColumns: [
|
||||
{prop: 'name', label: '计划名称'},
|
||||
{prop: 'time', label: '计划预计时间'},
|
||||
{prop: 'allName', label: '活动项目'},
|
||||
{prop: 'type', label: '类型'},
|
||||
{prop: 'carryOut', label: '计划状态'}
|
||||
],
|
||||
formRules: {
|
||||
type: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
name: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
time: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
eventId: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
content: [{validator: validContent, trigger: ['blur', 'change']}]
|
||||
},
|
||||
}
|
||||
},
|
||||
components: {
|
||||
'guava': httpVueLoader('/components/plugins/Guava.vue'),
|
||||
'plan-info': httpVueLoader('/components/activity/school/planInfo.vue'),
|
||||
},
|
||||
methods: {
|
||||
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)
|
||||
}
|
||||
},
|
||||
openView(row) {
|
||||
const {id} = row
|
||||
this.$refs.info.getInfo(id)
|
||||
this.$refs.guava.view()
|
||||
},
|
||||
async openEdit(row) {
|
||||
this.flag = false
|
||||
row.type = row.type + ''
|
||||
this.formData = row
|
||||
this.$refs.guava.edit()
|
||||
this.$nextTick(() => {
|
||||
this.initEditor()
|
||||
})
|
||||
},
|
||||
async openAdd() {
|
||||
this.formData = {}
|
||||
this.flag = false
|
||||
this.$refs.guava.edit()
|
||||
this.$nextTick(() => {
|
||||
this.initEditor()
|
||||
if (this.$refs['form']) {
|
||||
this.$refs['form'].resetFields()
|
||||
}
|
||||
|
||||
this.formData = {
|
||||
type: '2',
|
||||
name: '',
|
||||
time: '',
|
||||
eventId: '',
|
||||
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, {
|
||||
data: JSON.stringify(this.formData),
|
||||
})
|
||||
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)
|
||||
}
|
||||
})
|
||||
},
|
||||
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()
|
||||
this.unionList = await getUnions(null);
|
||||
}
|
||||
})
|
||||
</script>
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,152 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
|
||||
<style>
|
||||
.el-descriptions__table {
|
||||
table-layout: fixed !important;
|
||||
}
|
||||
|
||||
.el-descriptions-item__cell {
|
||||
text-align: center !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div id="app" v-cloak>
|
||||
<guava ref="guava">
|
||||
<el-card shadow="never">
|
||||
<!--#include("/platform/activity/union/addPlanCommon.html"){}#-->
|
||||
</el-card>
|
||||
</guava>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
let E = window.wangEditor
|
||||
const editors = {}
|
||||
var vue = new Vue({
|
||||
el: '#app',
|
||||
components: {
|
||||
'guava': httpVueLoader('/components/plugins/Guava.vue'),
|
||||
'plan-info': httpVueLoader('/components/activity/school/planInfo.vue'),
|
||||
},
|
||||
data() {
|
||||
let validContent = (rule, value, callback) => {
|
||||
if (!this.formData.content || !dd3s.html2txt(this.formData.content)) {
|
||||
callback(new Error('请填写计划内容'));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
};
|
||||
return {
|
||||
activityTypeList: [],
|
||||
eventList: [],
|
||||
formData: {
|
||||
type: '40003',
|
||||
name: '',
|
||||
time: '',
|
||||
event: '',
|
||||
content: ''
|
||||
},
|
||||
formRules: {
|
||||
type: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
name: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
time: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
money: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
event: [{required: true, message: '必填', trigger: ['blur']}],
|
||||
activityType: [{required: true, message: '必填', trigger: ['blur']}],
|
||||
content: [{validator: validContent, trigger: ['blur', 'change']}]
|
||||
},
|
||||
id: '',
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
cancel() {
|
||||
if (this.id) {
|
||||
sublime.jumpPagePjax('/platform/activity/plan/club')
|
||||
}
|
||||
},
|
||||
doHandle() {
|
||||
let url = this.formData.id ? "/doEdit" : "/doAdd"
|
||||
this.$refs["form"].validate(async (valid) => {
|
||||
if (valid) {
|
||||
|
||||
const resp = await $.post('/platform/activity/plan' + url, {
|
||||
id: this.formData.id,
|
||||
name: this.formData.name,
|
||||
time: this.formData.time,
|
||||
content: this.formData.content,
|
||||
money: this.formData.money,
|
||||
event: JSON.stringify(this.formData.event),
|
||||
type: '40003',
|
||||
activityType: this.formData.activityType,
|
||||
})
|
||||
|
||||
if (resp.code === 0) {
|
||||
this.$notify({
|
||||
title: '成功',
|
||||
message: resp.msg,
|
||||
type: 'success',
|
||||
duration: 500,
|
||||
onClose: () => {
|
||||
sublime.jumpPagePjax('/platform/activity/plan/club')
|
||||
}
|
||||
});
|
||||
}
|
||||
} else {
|
||||
this.$notify.error({title: '错误', message: '存在未填写的的必填项'});
|
||||
}
|
||||
});
|
||||
},
|
||||
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 getEvents() {
|
||||
const {code, data, msg} = await $.get("/platform/activity/common/getEvents")
|
||||
return data
|
||||
},
|
||||
async getActivityType() {
|
||||
const {code, data, msg} = await $.get("/platform/activity/common/getActivityType")
|
||||
return data
|
||||
},
|
||||
async initData() {
|
||||
const id = GetQueryString("id")
|
||||
this.id = id
|
||||
if (id) {
|
||||
const resp = await $.post('/platform/activity/plan/findOne', {id})
|
||||
if (resp.code === 0) {
|
||||
const cloneRow = clone(resp.data)
|
||||
cloneRow.event = JSON.parse(cloneRow.event)
|
||||
this.formData = cloneRow
|
||||
this.$nextTick(() => {
|
||||
this.initEditor()
|
||||
})
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
async created() {
|
||||
const self = this
|
||||
setTimeout(function () {
|
||||
self.initEditor()
|
||||
}, 100)
|
||||
//this.eventList = await this.getEvents()
|
||||
this.activityTypeList = await this.getActivityType()
|
||||
await this.initData()
|
||||
},
|
||||
})
|
||||
</script>
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,65 @@
|
||||
<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="2" border>分工会活动计划</el-radio>
|
||||
<el-radio label="3" 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-input maxlength="50" placeholder="请填写活动项目" v-model="formData.event"
|
||||
type="text"></el-input>–>
|
||||
<el-select v-model="formData.event" placeholder="请选择活动项目" filterable clearable 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="activityType" label="活动类型">
|
||||
<el-select v-model="formData.activityType" placeholder="请选择活动类型" filterable clearable
|
||||
style="width: 100%">
|
||||
<el-option
|
||||
v-for="item in activityTypeList"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item prop="money" label="预算费用" class="is-required">
|
||||
<el-input maxlength="50" placeholder="请填写整数或者小数" v-model="formData.money"
|
||||
type="number"></el-input>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item prop="content" label="计划内容" class="is-required">
|
||||
<div id="content"></div>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-row class="mt10" justify="end" type="flex">
|
||||
<el-button @click="cancel">取消</el-button>
|
||||
<el-button @click="doHandle" type="primary">提交</el-button>
|
||||
</el-row>
|
||||
@@ -0,0 +1,152 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
|
||||
<style>
|
||||
.el-descriptions__table {
|
||||
table-layout: fixed !important;
|
||||
}
|
||||
|
||||
.el-descriptions-item__cell {
|
||||
text-align: center !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div id="app" v-cloak>
|
||||
<guava ref="guava">
|
||||
<el-card shadow="never">
|
||||
<!--#include("/platform/activity/union/addPlanCommon.html"){}#-->
|
||||
</el-card>
|
||||
</guava>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
let E = window.wangEditor
|
||||
const editors = {}
|
||||
var vue = new Vue({
|
||||
el: '#app',
|
||||
components: {
|
||||
'guava': httpVueLoader('/components/plugins/Guava.vue'),
|
||||
'plan-info': httpVueLoader('/components/activity/school/planInfo.vue'),
|
||||
},
|
||||
data() {
|
||||
let validContent = (rule, value, callback) => {
|
||||
if (!this.formData.content || !dd3s.html2txt(this.formData.content)) {
|
||||
callback(new Error('请填写计划内容'));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
};
|
||||
return {
|
||||
activityTypeList: [],
|
||||
eventList: [],
|
||||
formData: {
|
||||
type: '40001',
|
||||
name: '',
|
||||
time: '',
|
||||
event: '',
|
||||
content: ''
|
||||
},
|
||||
formRules: {
|
||||
type: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
name: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
time: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
money: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
event: [{required: true, message: '必填', trigger: ['blur']}],
|
||||
activityType: [{required: true, message: '必填', trigger: ['blur']}],
|
||||
content: [{validator: validContent, trigger: ['blur', 'change']}]
|
||||
},
|
||||
id: '',
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
cancel() {
|
||||
if (this.id) {
|
||||
sublime.jumpPagePjax('/platform/activity/plan/school')
|
||||
}
|
||||
},
|
||||
doHandle() {
|
||||
let url = this.formData.id ? "/doEdit" : "/doAdd"
|
||||
this.$refs["form"].validate(async (valid) => {
|
||||
if (valid) {
|
||||
|
||||
const resp = await $.post('/platform/activity/plan' + url, {
|
||||
id: this.formData.id,
|
||||
name: this.formData.name,
|
||||
time: this.formData.time,
|
||||
content: this.formData.content,
|
||||
money: this.formData.money,
|
||||
event: JSON.stringify(this.formData.event),
|
||||
type: '40001',
|
||||
activityType: this.formData.activityType,
|
||||
})
|
||||
|
||||
if (resp.code === 0) {
|
||||
this.$notify({
|
||||
title: '成功',
|
||||
message: resp.msg,
|
||||
type: 'success',
|
||||
duration: 500,
|
||||
onClose: () => {
|
||||
sublime.jumpPagePjax('/platform/activity/plan/school')
|
||||
}
|
||||
});
|
||||
}
|
||||
} else {
|
||||
this.$notify.error({title: '错误', message: '存在未填写的的必填项'});
|
||||
}
|
||||
});
|
||||
},
|
||||
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 getEvents() {
|
||||
const {code, data, msg} = await $.get("/platform/activity/common/getEvents")
|
||||
return data
|
||||
},
|
||||
async getActivityType() {
|
||||
const {code, data, msg} = await $.get("/platform/activity/common/getActivityType")
|
||||
return data
|
||||
},
|
||||
async initData() {
|
||||
const id = GetQueryString("id")
|
||||
this.id = id
|
||||
if (id) {
|
||||
const resp = await $.post('/platform/activity/plan/findOne', {id})
|
||||
if (resp.code === 0) {
|
||||
const cloneRow = clone(resp.data)
|
||||
cloneRow.event = JSON.parse(cloneRow.event)
|
||||
this.formData = cloneRow
|
||||
this.$nextTick(() => {
|
||||
this.initEditor()
|
||||
})
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
async created() {
|
||||
const self = this
|
||||
setTimeout(function () {
|
||||
self.initEditor()
|
||||
}, 100)
|
||||
//this.eventList = await this.getEvents()
|
||||
this.activityTypeList = await this.getActivityType()
|
||||
await this.initData()
|
||||
},
|
||||
})
|
||||
</script>
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,152 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
|
||||
<style>
|
||||
.el-descriptions__table {
|
||||
table-layout: fixed !important;
|
||||
}
|
||||
|
||||
.el-descriptions-item__cell {
|
||||
text-align: center !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div id="app" v-cloak>
|
||||
<guava ref="guava">
|
||||
<el-card shadow="never">
|
||||
<!--#include("/platform/activity/union/addPlanCommon.html"){}#-->
|
||||
</el-card>
|
||||
</guava>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
let E = window.wangEditor
|
||||
const editors = {}
|
||||
var vue = new Vue({
|
||||
el: '#app',
|
||||
components: {
|
||||
'guava': httpVueLoader('/components/plugins/Guava.vue'),
|
||||
'plan-info': httpVueLoader('/components/activity/school/planInfo.vue'),
|
||||
},
|
||||
data() {
|
||||
let validContent = (rule, value, callback) => {
|
||||
if (!this.formData.content || !dd3s.html2txt(this.formData.content)) {
|
||||
callback(new Error('请填写计划内容'));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
};
|
||||
return {
|
||||
activityTypeList: [],
|
||||
eventList: [],
|
||||
formData: {
|
||||
type: '40002',
|
||||
name: '',
|
||||
time: '',
|
||||
event: '',
|
||||
content: ''
|
||||
},
|
||||
formRules: {
|
||||
type: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
name: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
time: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
money: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
event: [{required: true, message: '必填', trigger: ['blur']}],
|
||||
activityType: [{required: true, message: '必填', trigger: ['blur']}],
|
||||
content: [{validator: validContent, trigger: ['blur', 'change']}]
|
||||
},
|
||||
id: '',
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
cancel() {
|
||||
if (this.id) {
|
||||
sublime.jumpPagePjax('/platform/activity/plan/union')
|
||||
}
|
||||
},
|
||||
doHandle() {
|
||||
let url = this.formData.id ? "/doEdit" : "/doAdd"
|
||||
this.$refs["form"].validate(async (valid) => {
|
||||
if (valid) {
|
||||
|
||||
const resp = await $.post('/platform/activity/plan' + url, {
|
||||
id: this.formData.id,
|
||||
name: this.formData.name,
|
||||
time: this.formData.time,
|
||||
content: this.formData.content,
|
||||
money: this.formData.money,
|
||||
event: JSON.stringify(this.formData.event),
|
||||
type: '40002',
|
||||
activityType: this.formData.activityType,
|
||||
})
|
||||
|
||||
if (resp.code === 0) {
|
||||
this.$notify({
|
||||
title: '成功',
|
||||
message: resp.msg,
|
||||
type: 'success',
|
||||
duration: 500,
|
||||
onClose: () => {
|
||||
sublime.jumpPagePjax('/platform/activity/plan/union')
|
||||
}
|
||||
});
|
||||
}
|
||||
} else {
|
||||
this.$notify.error({title: '错误', message: '存在未填写的的必填项'});
|
||||
}
|
||||
});
|
||||
},
|
||||
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 getEvents() {
|
||||
const {code, data, msg} = await $.get("/platform/activity/common/getEvents")
|
||||
return data
|
||||
},
|
||||
async getActivityType() {
|
||||
const {code, data, msg} = await $.get("/platform/activity/common/getActivityType")
|
||||
return data
|
||||
},
|
||||
async initData() {
|
||||
const id = GetQueryString("id")
|
||||
this.id = id
|
||||
if (id) {
|
||||
const resp = await $.post('/platform/activity/plan/findOne', {id})
|
||||
if (resp.code === 0) {
|
||||
const cloneRow = clone(resp.data)
|
||||
cloneRow.event = JSON.parse(cloneRow.event)
|
||||
this.formData = cloneRow
|
||||
this.$nextTick(() => {
|
||||
this.initEditor()
|
||||
})
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
async created() {
|
||||
const self = this
|
||||
setTimeout(function () {
|
||||
self.initEditor()
|
||||
}, 100)
|
||||
//this.eventList = await this.getEvents()
|
||||
this.activityTypeList = await this.getActivityType()
|
||||
await this.initData()
|
||||
},
|
||||
})
|
||||
</script>
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,999 @@
|
||||
<style>
|
||||
.avatar-uploader .el-upload {
|
||||
border: 1px dashed #d9d9d9;
|
||||
border-radius: 6px;
|
||||
cursor: pointer;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.avatar-uploader .el-upload:hover {
|
||||
border-color: #409EFF;
|
||||
}
|
||||
|
||||
.avatar-uploader-icon {
|
||||
font-size: 28px;
|
||||
color: #8c939d;
|
||||
width: 178px;
|
||||
height: 178px;
|
||||
line-height: 178px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.avatar {
|
||||
width: 178px;
|
||||
height: 178px;
|
||||
display: block;
|
||||
}
|
||||
|
||||
#signMap .amap-icon img {
|
||||
position: absolute !important;
|
||||
width: 100% !important;
|
||||
height: 100% !important;
|
||||
top: 0 !important;
|
||||
left: 0 !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div id="app" v-cloak>
|
||||
<guava ref="guava">
|
||||
<el-card shadow="never" style="min-height: calc(100vh - 70px);position: relative">
|
||||
<el-form :model="formData" ref="addForm" :rules="formRules" label-width="130px"
|
||||
label-suffix=":">
|
||||
<el-tabs tab-position="top" v-model="activeName">
|
||||
<el-tab-pane label="活动基础信息" name="1">
|
||||
<vi-title title="填写活动信息"></vi-title>
|
||||
|
||||
<el-row :gutter="40">
|
||||
<el-col :xs="24" :lg="12" :xl="12">
|
||||
<el-form-item prop="name" label="活动名称">
|
||||
<el-input maxlength="50" placeholder="请填写活动名称"
|
||||
v-model="formData.name"
|
||||
type="text"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xs="24" :lg="12" :xl="12">
|
||||
<el-form-item prop="activityCode" label="活动编号">
|
||||
<el-input maxlength="50" disabled
|
||||
v-model="formData.activityCode"
|
||||
type="text"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :xs="24" :lg="12" :xl="12">
|
||||
<el-form-item prop="projectTypeCode" label="活动项目类型">
|
||||
<el-select v-model="formData.projectTypeCode"
|
||||
placeholder="请选择活动类型"
|
||||
style="width: 100%;">
|
||||
<el-option
|
||||
v-for="item in projectType"
|
||||
:key="item.id"
|
||||
:label="item.name+' ('+item.code+')'"
|
||||
:value="item.code">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :xs="24" :lg="12" :xl="12">
|
||||
<el-form-item prop="isEnrollSystem" label="是否用于报名">
|
||||
<el-radio-group v-model="formData.isEnrollSystem">
|
||||
<el-radio-button :label="true">活动报名</el-radio-button>
|
||||
<el-radio-button :label="false">活动管理</el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :xs="24" :lg="12" :xl="12">
|
||||
<el-form-item prop="address" label="活动地址">
|
||||
<el-input maxlength="50" placeholder="请填写活动地址"
|
||||
v-model="formData.address"
|
||||
type="text"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :xs="24" :lg="12" :xl="12">
|
||||
<el-form-item prop="userId" label="联系人">
|
||||
<el-select v-model="formData.userId" placeholder="请选择联系人"
|
||||
filterable
|
||||
remote
|
||||
clearable
|
||||
reserve-keyword
|
||||
:remote-method="remoteMethod"
|
||||
:loading="selectLoading"
|
||||
style="width: 100%" @change="userChang">
|
||||
<el-option
|
||||
v-for="item in userList"
|
||||
:key="item.userId"
|
||||
:label="item.userName+'-'+item.loginName+'-'+item.unitName"
|
||||
:value="item.userId">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xs="24" :lg="12" :xl="12">
|
||||
<el-form-item prop="mobile" label="联系方式">
|
||||
<el-input maxlength="50" placeholder="请填写联系方式"
|
||||
v-model="formData.mobile"
|
||||
type="text"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :xs="24" :lg="12" :xl="12" v-if="formData.isEnrollSystem">
|
||||
<el-form-item prop="plannedDate" label="活动计划时间">
|
||||
<!--<el-input maxlength="50" placeholder="活动计划时间"
|
||||
v-model="formData.plannedDate"></el-input>-->
|
||||
<el-date-picker
|
||||
style="width: 100%"
|
||||
v-model="formData.plannedDate"
|
||||
type="daterange"
|
||||
value-format="yyyy-MM-dd"
|
||||
range-separator="-"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期" @change="plannedDateChange">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :xs="24" :lg="12" :xl="12">
|
||||
<el-form-item prop="time" label="实际活动时间">
|
||||
<el-date-picker
|
||||
style="width: 100%"
|
||||
v-model="formData.time"
|
||||
type="daterange"
|
||||
value-format="yyyy-MM-dd"
|
||||
range-separator="-"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :xs="24" :lg="12" :xl="12">
|
||||
<el-form-item
|
||||
:rules="[{required:[1,2].includes(formData.signUpMethod),message:'请选择报名日期',trigger:['change','blur']}]"
|
||||
label="报名日期"
|
||||
prop="applyTime2">
|
||||
<el-date-picker
|
||||
style="width: 100%"
|
||||
v-model="formData.applyTime2"
|
||||
type="datetimerange"
|
||||
value-format="yyyy-MM-dd HH:mm"
|
||||
range-separator="-"
|
||||
start-placeholder="开始时间"
|
||||
end-placeholder="结束时间">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :xs="24" :lg="12" :xl="12" >
|
||||
<el-form-item prop="peopleNum" label="活动人数">
|
||||
<el-input-number maxlength="10" placeholder="请填写活动人数"
|
||||
:step="1"
|
||||
:precision="0"
|
||||
:disabled="[1,2].includes(formData.signUpMethod)"
|
||||
v-model.number="formData.peopleNum"></el-input-number>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :xs="24" :lg="12" :xl="12">
|
||||
<el-form-item prop="groupId" label="参加人员范围">
|
||||
<div style="display: flex; justify-content: space-between">
|
||||
<div style="width: 99%">
|
||||
<el-select prop="groupId" placeholder="参加人员范围"
|
||||
v-model="formData.groupId"
|
||||
style="width: 99%;"
|
||||
clearable
|
||||
filterable>
|
||||
<el-option v-for="item in activityGroupList"
|
||||
:label="item.groupName"
|
||||
:value="item.groupId"></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
<div>
|
||||
<el-button
|
||||
@click="$refs.drawerUserScope.userScopeDialog = true"
|
||||
type="primary">设置
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
|
||||
<el-col :lg="12" :xl="12" :xs="24" v-if="formData.isEnrollSystem">
|
||||
<el-form-item prop="signUpMethod" label="报名方式">
|
||||
<el-radio-group v-model="formData.signUpMethod"
|
||||
@change="signUpMethodChange">
|
||||
<!-- <el-radio :label="null">无需报名</el-radio>-->
|
||||
<el-radio :label="1">个人报名</el-radio>
|
||||
<el-radio :label="3">组队报名</el-radio>
|
||||
<el-radio :label="2" v-if="type===40001">分工会报名</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :lg="12" :xl="12" :xs="24">
|
||||
<el-form-item prop="xlFlag" label="活动提醒">
|
||||
<el-switch
|
||||
v-model="formData.xlFlag"
|
||||
active-color="#13ce66"
|
||||
inactive-color="#ff4949">
|
||||
</el-switch>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
|
||||
<el-col :xs="12" :lg="12" :xl="12"
|
||||
v-if="[1,2,3].includes(formData.signUpMethod)">
|
||||
<el-form-item prop="userNumberLimit" label="报名人数限制">
|
||||
<el-radio-group v-model="formData.userNumberLimit">
|
||||
<el-radio :label="1"
|
||||
:disabled="formData.signUpMethod===2">
|
||||
总人数限制
|
||||
</el-radio>
|
||||
<el-radio :label="2" v-if="type===40001">分工会人数限制
|
||||
</el-radio>
|
||||
<el-radio :label="null">不限制</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xs="12" :lg="12" :xl="12"
|
||||
v-if="[3].includes(formData.signUpMethod)">
|
||||
<el-form-item prop="totalUserNumberLimit" label="组队人数">
|
||||
<el-input-number v-model="formData.teamNum" :min="1"
|
||||
:max="2000"
|
||||
:precision="0"
|
||||
></el-input-number>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :xs="12" :lg="12" :xl="12"
|
||||
v-if="[1,2,3].includes(formData.signUpMethod) && formData.userNumberLimit===1">
|
||||
<el-form-item prop="totalUserNumberLimit" label="总人数限制">
|
||||
<el-input-number v-model="formData.totalUserNumberLimit"
|
||||
:min="1" :max="2000"
|
||||
:precision="0"
|
||||
></el-input-number>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="24"
|
||||
v-if="[1,2,3].includes(formData.signUpMethod) && formData.userNumberLimit===2">
|
||||
<el-form-item prop="unionUserNumberLimit" label="分工会人数限制">
|
||||
<vi-title2 title="分段设置">
|
||||
<template #func>
|
||||
<el-button size="small" type="primary" @click="unionLimitQuickSetting">
|
||||
应用分段设置
|
||||
</el-button>
|
||||
</template>
|
||||
</vi-title2>
|
||||
<el-row v-for="(item,index) in unionUserNumCalc" :gutter="20" class="mb5">
|
||||
<el-col :span="7">
|
||||
<el-input-number v-model="item.startNum" :precision="0" :step="1" :min="1"
|
||||
placeholder="请输入最小人数"
|
||||
style="width: 100%"></el-input-number>
|
||||
</el-col>
|
||||
<el-col :span="7">
|
||||
<el-input-number v-model="item.endNum" :precision="0" :step="1" :min="1"
|
||||
placeholder="请输入最大人数"
|
||||
style="width: 100%"></el-input-number>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-input-number v-model="item.resultNum" :precision="0" :step="1" :min="1"
|
||||
placeholder="请输入限制人数"
|
||||
style="width: 100%"></el-input-number>
|
||||
</el-col>
|
||||
<el-col :span="4" class="text-right">
|
||||
<el-button icon="el-icon-plus" @click="unionUserNumCalc.push({})"></el-button>
|
||||
<el-button icon="el-icon-minus" @click="unionUserNumCalc.splice(index,1)"
|
||||
:disabled="unionUserNumCalc.length===1"></el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row class="mt10">
|
||||
<div v-for="(item,index) in unionUserNumCalcTips" class="text-danger">
|
||||
<span class="mr10">({{index+1}}).</span> {{item}}
|
||||
</div>
|
||||
</el-row>
|
||||
|
||||
<vi-title2 title="比例设置" class="mt20">
|
||||
<template #func>
|
||||
一键比例:
|
||||
<el-input-number v-model="unionUserNumOneKeyRatio" :precision="0" :step="1" :min="0"
|
||||
placeholder="请输入一键比例"
|
||||
size="small"
|
||||
:max="100"></el-input-number>
|
||||
<el-button size="small" type="primary" @click="applyScaleSettings" class="ml5">应用比例设置
|
||||
</el-button>
|
||||
</template>
|
||||
</vi-title2>
|
||||
<el-table :data="formData.unionUserNumberLimit" max-height="500px">
|
||||
<el-table-column prop="unionname" label="分工会"></el-table-column>
|
||||
<el-table-column prop="teacherCount" label="人数"></el-table-column>
|
||||
<el-table-column prop="ratio" label="比例(%)">
|
||||
<template scope="{row}">
|
||||
<el-input-number v-model="row.ratio" :precision="0" :step="1" :min="0"
|
||||
:max="100"></el-input-number>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="limitNum" label="限制人数">
|
||||
<template scope="{row}">
|
||||
<el-input-number v-model="row.limitNum" :precision="0" :step="1" :min="0"
|
||||
:max="row.teacherCount"
|
||||
@change="calSummaryCount"></el-input-number>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<el-row class="mt20" justify="end" type="flex">
|
||||
<div class="text-danger"
|
||||
style="width: 100%;font-size: 18px;display: flex;align-items: center;font-weight: bold">
|
||||
限制总人数:{{summaryCount}}人
|
||||
</div>
|
||||
<!-- <el-button @click="clearUnionLimit" type="danger">清空分工会人数限制</el-button>
|
||||
<el-button @click="setUpUnionLimitDialog=false">取消</el-button>
|
||||
<el-button @click="doConfirmSetUpUnionLimit" type="primary">确定</el-button>-->
|
||||
</el-row>
|
||||
<!-- <el-table border stripe
|
||||
:data="formData.unionUserNumberLimit"
|
||||
size="small"
|
||||
height="500">
|
||||
<el-table-column type="index" label="序号"
|
||||
header-align="center" align="center"
|
||||
width="100">
|
||||
</el-table-column>
|
||||
<el-table-column label="分工会名称"
|
||||
prop="unionName"></el-table-column>
|
||||
<el-table-column label="分工会人数"
|
||||
prop="unionNum"></el-table-column>
|
||||
<el-table-column label="限制人数" prop="limitNum">
|
||||
<template slot-scope="{row}">
|
||||
<el-input-number v-model="row.limitNum" :min="1"
|
||||
:max="row.unionNum"
|
||||
:precision="0"
|
||||
></el-input-number>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>-->
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12" v-if="[1,2,3].includes(formData.signUpMethod)">
|
||||
<el-form-item label="是否需要签到">
|
||||
<el-radio-group v-model="formData.needSign"
|
||||
@change="(val)=>{formData.needSign?initMap():null}">
|
||||
<el-radio :label="true">需要</el-radio>
|
||||
<el-radio :label="false">不需要</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12" v-if="formData.needSign">
|
||||
<el-form-item label="签到半径(m)">
|
||||
<el-input-number v-model="formData.rangeMeter"
|
||||
@change="rangeMeterChange"
|
||||
:precision="0" :step="1"
|
||||
:min="50"
|
||||
:max="1000"></el-input-number>
|
||||
<!-- <el-button type="primary" @click="marker.setMap(null);">清除点位</el-button>-->
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
|
||||
<el-col :span="24" v-show="formData.needSign">
|
||||
<el-form-item label="活动签到点位">
|
||||
<el-card shadow="never">
|
||||
<div style="width: 100%;height: 300px"
|
||||
id="signMap"></div>
|
||||
</el-card>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
|
||||
<el-col :span="24">
|
||||
<el-form-item prop="activityContent" label="活动内容">
|
||||
<el-input
|
||||
type="textarea"
|
||||
:rows="7"
|
||||
placeholder="请输入活动内容"
|
||||
v-model="formData.activityContent">
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="24" v-if="!formData.isEnrollSystem">
|
||||
<el-form-item prop="activityExamineContent" label="活动考核内容">
|
||||
<el-input
|
||||
type="textarea"
|
||||
:rows="7"
|
||||
placeholder="请输入活动考核内容"
|
||||
v-model="formData.activityExamineContent">
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="24" v-if="formData.signUpMethod!=null">
|
||||
<el-form-item prop="cover" label="封面图">
|
||||
<el-upload
|
||||
class="avatar-uploader"
|
||||
:action="FILE_UPLOAD_ADDRESS"
|
||||
:show-file-list="false"
|
||||
:on-success="handleAvatarSuccess"
|
||||
:before-upload="beforeAvatarUpload">
|
||||
<img v-if="formData.cover"
|
||||
:src="FILE_DOMAIN + '/fileStreamPreview?id=' + formData.cover"
|
||||
class="avatar">
|
||||
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
|
||||
</el-upload>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
|
||||
</el-tab-pane>
|
||||
|
||||
<el-tab-pane label="活动费用" name="2" v-if="!formData.isEnrollSystem">
|
||||
<div style="display: flex;margin: 20px 0">
|
||||
<el-divider content-position="left">购置物品及价格</el-divider>
|
||||
|
||||
<div style="padding-left: 10px">
|
||||
<el-tooltip class="item" effect="dark" content="点击添加购置物品及价格"
|
||||
placement="top">
|
||||
<el-button icon="el-icon-plus" circle
|
||||
@click="formData.goods.push({})"
|
||||
type="primary"></el-button>
|
||||
</el-tooltip>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<el-form-item>
|
||||
<el-table :data="formData.goods" border size="mini" style="width: 100%"
|
||||
height="200">
|
||||
|
||||
<el-table-column sortable type="index" width="100" label="序号"
|
||||
align="center" header-align="center">
|
||||
</el-table-column>
|
||||
<el-table-column prop="name" label="物品名称" align="center"
|
||||
header-align="center">
|
||||
<template slot-scope="{row}">
|
||||
<el-input maxlength="50" placeholder="物品名称"
|
||||
v-model="row.name"
|
||||
type="text"></el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="price" label="预算费用" align="center"
|
||||
header-align="center">
|
||||
<template slot-scope="{row}">
|
||||
<el-input maxlength="50" placeholder="预算费用"
|
||||
v-model="row.price"
|
||||
type="number" @input="blur"></el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="actualPrice" label="实际费用" align="center"
|
||||
header-align="center">
|
||||
<template slot-scope="{row}">
|
||||
<el-input maxlength="50" placeholder="实际费用"
|
||||
v-model="row.actualPrice"
|
||||
type="number" @input="blur"></el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" fixed="right" align="center"
|
||||
header-align="center"
|
||||
width="80px"
|
||||
fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="danger" icon="el-icon-delete" circle
|
||||
:disabled="formData.goods.length==0"
|
||||
@click="delNotesItem(scope)"></el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-form-item>
|
||||
|
||||
<el-divider content-position="left" class="dia"><span
|
||||
style="color: #3ea1ec;">附件</span>
|
||||
</el-divider>
|
||||
<el-row :gutter="40">
|
||||
|
||||
<el-col :xs="24" :lg="12" :xl="12" class="mb25">
|
||||
<el-form-item prop="billFiles" label="发票">
|
||||
<file-upload :files.sync="formData.billFiles"
|
||||
card></file-upload>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xs="24" :lg="12" :xl="12" class="mb25">
|
||||
<el-form-item prop="photoFiles" label="照片">
|
||||
<file-upload :files.sync="formData.photoFiles"
|
||||
card></file-upload>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :xs="24" :lg="12" :xl="12">
|
||||
<el-form-item prop="otherFiles" label="其他">
|
||||
<file-upload :files.sync="formData.otherFiles"
|
||||
card></file-upload>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
</el-tab-pane>
|
||||
|
||||
<el-tab-pane label="活动人员信息" name="3" v-if="!formData.isEnrollSystem">
|
||||
<table-tool label="活动人员信息" :app="this">
|
||||
<template #func>
|
||||
<el-button icon="el-icon-plus" @click="openAddUser"
|
||||
type="primary">添加活动人员
|
||||
</el-button>
|
||||
</template>
|
||||
</table-tool>
|
||||
<el-table border stripe :data="userData" size="small"
|
||||
v-loading="userTabLoading" height="500">
|
||||
<el-table-column
|
||||
type="index" label="序号" header-align="center" align="center"
|
||||
width="100">
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column
|
||||
align="center"
|
||||
header-align="center"
|
||||
v-for="column in userColumns"
|
||||
:label="column.label"
|
||||
:prop="column.prop"
|
||||
:sortable="column.sortable">
|
||||
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column prop="userOnline" align="center" header-align="center"
|
||||
label="操作"
|
||||
width="150px">
|
||||
<template scope="{row}">
|
||||
<el-button type="danger" size="mini"
|
||||
@click="delUser(row)">删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
</el-table>
|
||||
</el-tab-pane>
|
||||
|
||||
<el-tab-pane label="活动总结" name="4" v-if="!formData.isEnrollSystem">
|
||||
<el-form-item prop="activitySummary" label="活动总结">
|
||||
<el-input
|
||||
:disabled="!formData.time || Date.now() < Date.parse(formData.time[1])"
|
||||
type="textarea"
|
||||
:rows="5"
|
||||
placeholder="请输入活动内容"
|
||||
v-model="formData.activitySummary">
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-alert
|
||||
class="mb20"
|
||||
style="margin-left: 130px"
|
||||
v-if="!formData.time || Date.now() < Date.parse(formData.time[1])"
|
||||
show-icon
|
||||
title="活动结束后可输入活动总结"
|
||||
type="info">
|
||||
</el-alert>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</el-form>
|
||||
<div style="padding: 20px;text-align: center;">
|
||||
<el-button type="primary" @click="operation" style="width: 300px">确 定</el-button>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
</guava>
|
||||
|
||||
<el-dialog title="添加人员" :visible.sync="dialogVisible" width="40%" :close-on-click-modal="false">
|
||||
|
||||
<el-form :model="formData" label-width="100px">
|
||||
<el-form-item prop="userId" label="参加人员">
|
||||
<el-select v-model="formData.tissuePersonList" placeholder="请选择参加人员"
|
||||
multiple
|
||||
filterable
|
||||
remote
|
||||
:remote-method="remoteMethod"
|
||||
:loading="selectLoading"
|
||||
style="width: 100%">
|
||||
<el-option
|
||||
v-for="item in userList"
|
||||
:disabled="userData.map(v=>v.userId).includes(item.userId)"
|
||||
:key="item.userId"
|
||||
:label="item.userName+'-'+item.loginName+'-'+item.unitName"
|
||||
:value="item.userId">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</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>
|
||||
|
||||
<drawer-user-scope
|
||||
@group_change="getActivityGroup"
|
||||
ref="drawerUserScope"
|
||||
:group_id.sync="formData.groupId"
|
||||
></drawer-user-scope>
|
||||
|
||||
</div>
|
||||
|
||||
<script>
|
||||
let marker = null
|
||||
let map = null
|
||||
let circle = null
|
||||
var vue = new Vue({
|
||||
el: '#app',
|
||||
mixins: [initTableMixins],
|
||||
data() {
|
||||
return {
|
||||
unionUserNumOneKeyRatio: null,
|
||||
summaryCount: 0,
|
||||
unionUserNumCalc: [{}],
|
||||
activeName: '1',
|
||||
actvivtyUrl: "/platform/activity/info/mange",
|
||||
selectLoading: false,
|
||||
userTabLoading: false,
|
||||
dialogVisible: false,
|
||||
userData: [],
|
||||
userList: [],
|
||||
unionList: [],
|
||||
projectType: [],
|
||||
pageForm: {
|
||||
type: type,
|
||||
year: new Date().getFullYear() + ''
|
||||
},
|
||||
formRules: {
|
||||
groupId: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
name: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
type: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
projectTypeCode: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
address: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
plannedDate: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
},
|
||||
userColumns: [
|
||||
{prop: 'userName', label: '姓名'},
|
||||
{prop: 'loginName', label: '工号'},
|
||||
{prop: 'sex', label: '性别'},
|
||||
{prop: 'mobile', label: '联系方式'},
|
||||
{prop: 'unitName', label: '所属单位'},
|
||||
{prop: 'unionName', label: '所属工会'}
|
||||
],
|
||||
/*ZXY - ADD*/
|
||||
activityGroupList: [],
|
||||
userScopeDialog: false
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
unionUserNumCalcTips() {
|
||||
return this.unionUserNumCalc.map(v => {
|
||||
return (v.startNum ? v.startNum : '?') + '-' + (v.endNum ? v.endNum : '?') + '人的分工会,限报' + (v.resultNum ? v.resultNum : '?') + '人'
|
||||
})
|
||||
},
|
||||
},
|
||||
components: {
|
||||
'drawer-user-scope': httpVueLoader('/components/plugins/DrawerUserScope.vue'),
|
||||
},
|
||||
methods: {
|
||||
//应用比例设置
|
||||
applyScaleSettings() {
|
||||
this.formData.unionUserNumberLimit.forEach(v => {
|
||||
v.limitNum = parseFloat((v.teacherCount * this.unionUserNumOneKeyRatio / 100).toFixed(0))
|
||||
if (v.ratio) {
|
||||
v.limitNum = parseFloat((v.teacherCount * v.ratio / 100).toFixed(0))
|
||||
}
|
||||
})
|
||||
this.calSummaryCount()
|
||||
},
|
||||
calSummaryCount() {
|
||||
const array = this.formData.unionUserNumberLimit
|
||||
if (array) {
|
||||
this.summaryCount = array.reduce((prev, curr) => {
|
||||
const value = Number(curr.limitNum);
|
||||
if (!isNaN(value)) {
|
||||
return prev + curr.limitNum;
|
||||
} else {
|
||||
return prev;
|
||||
}
|
||||
}, 0)
|
||||
}
|
||||
},
|
||||
unionLimitQuickSetting() {
|
||||
this.unionUserNumCalc.forEach((v, i) => {
|
||||
const startNum = v.startNum
|
||||
const endNum = v.endNum
|
||||
const resultNum = v.resultNum
|
||||
if (startNum > endNum) {
|
||||
this.$message.warning('第' + (i + 1) + '行设置错误')
|
||||
} else {
|
||||
this.formData.unionUserNumberLimit.forEach(x => {
|
||||
if (x.teacherCount >= startNum && x.teacherCount <= endNum) {
|
||||
x.limitNum = resultNum
|
||||
}
|
||||
})
|
||||
this.calSummaryCount()
|
||||
}
|
||||
})
|
||||
},
|
||||
beforeAvatarUpload(file) {
|
||||
const isLt4M = file.size / 1024 / 1024 / 1024 / 1024 < 2;
|
||||
if (!isLt4M) {
|
||||
this.$message.warning('上传头像图片大小不能超过 4MB!');
|
||||
}
|
||||
return isLt4M;
|
||||
},
|
||||
rangeMeterChange(val) {
|
||||
if (!marker || !this.formData.location || !Array.isArray(this.formData.location)) {
|
||||
return
|
||||
}
|
||||
const lng = parseFloat(this.formData.location[0])
|
||||
const lat = parseFloat(this.formData.location[1])
|
||||
if (circle) {
|
||||
map.remove(circle)
|
||||
circle = null
|
||||
}
|
||||
circle = new AMap.Circle({
|
||||
center: new AMap.LngLat(lng, lat), // 圆心位置
|
||||
radius: val, //半径
|
||||
strokeColor: "#F33", //线颜色
|
||||
strokeOpacity: 1, //线透明度
|
||||
strokeWeight: 1, //线粗细度
|
||||
fillColor: "#ee2200", //填充颜色
|
||||
fillOpacity: 0.35 //填充透明度
|
||||
})
|
||||
map.add(circle)
|
||||
map.setFitView()
|
||||
},
|
||||
|
||||
async handleAvatarSuccess(res, file) {
|
||||
this.$set(this.formData, 'cover', res.data.filepath)
|
||||
await this.$refs['addForm'].validate()
|
||||
},
|
||||
plannedDateChange(val) {
|
||||
this.$set(this.formData, "time", val)
|
||||
},
|
||||
userChang(val) {
|
||||
this.$set(this.formData, "mobile", val ? this.userList.find(v => v.userId === val).mobile : null)
|
||||
},
|
||||
delNotesItem(scope) {
|
||||
this.delNotesList.push(scope.row.id)
|
||||
this.formData.goods.splice(scope.$index, 1)
|
||||
},
|
||||
async remoteMethod(query) {
|
||||
if (query) {
|
||||
this.selectLoading = true;
|
||||
const {data} = await $.post(this.actvivtyUrl + "/findUser", {
|
||||
serachWord: query,
|
||||
activity_type: type
|
||||
})
|
||||
this.userList = data
|
||||
this.selectLoading = false;
|
||||
}
|
||||
},
|
||||
openAddUser() {
|
||||
this.formData.tissuePersonList = []
|
||||
this.dialogVisible = true
|
||||
},
|
||||
doAddUser() {
|
||||
this.formData.tissuePersonList = this.userList.filter(v => this.formData.tissuePersonList.some(x => v.userId === x))
|
||||
this.userData = this.userData.concat(this.formData.tissuePersonList)
|
||||
this.dialogVisible = false
|
||||
},
|
||||
async delUser(row) {
|
||||
this.userData.splice(this.userData.indexOf(row.userId), 1)
|
||||
this.formData.tissuePersonList.splice(this.formData.tissuePersonList.indexOf(row.userId), 1)
|
||||
|
||||
// const confirm = await this.$confirm('您确定要删除吗?', '提示', {
|
||||
// confirmButtonText: '确定',
|
||||
// cancelButtonText: '取消',
|
||||
// type: 'warning'
|
||||
// })
|
||||
// if (confirm === 'confirm') {
|
||||
// this.userData.splice(this.userData.indexOf(row.userId), 1)
|
||||
// this.formData.tissuePersonList.splice(this.formData.tissuePersonList.indexOf(row.userId), 1)
|
||||
// const resp = await $.post('/platform/activity/apply/doDeleteActivityRegister', {
|
||||
// activityId: row.tissueId,
|
||||
// userId: row.userId
|
||||
// })
|
||||
// }
|
||||
},
|
||||
async groupIdChange(val) {
|
||||
const resp = await $.get('/platform/activity/apply/getUnionData', {activityScopeGroupId: val})
|
||||
this.formData.unionUserNumberLimit = resp.data
|
||||
},
|
||||
|
||||
async operation() {
|
||||
if (this.formData.applyTime2 && this.formData.applyTime2.length > 0) {
|
||||
if (moment(this.formData.time[0]).valueOf() <= moment(this.formData.applyTime2[0]).valueOf()) {
|
||||
this.$notify.error({title: '错误', message: '活动时间必须晚于报名时间'});
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
let url = this.formData.id ? "/doEdit" : "/doAdd"
|
||||
this.$refs["addForm"].validate(async (valid) => {
|
||||
if (valid) {
|
||||
const loading = this.$loading({
|
||||
lock: true,
|
||||
text: '正在提交...',
|
||||
spinner: 'el-icon-loading',
|
||||
background: COVER_LAYER_COLOR
|
||||
});
|
||||
|
||||
const formData = JSON.parse(JSON.stringify(this.formData))
|
||||
formData.type = this.pageForm.type
|
||||
formData.apply_type = 1
|
||||
const {time, applyTime2, plannedDate} = formData
|
||||
if (applyTime2 && applyTime2.length) {
|
||||
formData.applyStartTime = applyTime2[0]
|
||||
formData.applyEndTime = applyTime2[1]
|
||||
formData.applyTime2 = undefined
|
||||
}
|
||||
if (time && time.length) {
|
||||
formData.startTime = formData.time[0]
|
||||
formData.endTime = formData.time[1]
|
||||
formData.time = undefined
|
||||
}
|
||||
if (plannedDate && plannedDate.length) {
|
||||
formData.startPlannedDate = formData.plannedDate[0]
|
||||
formData.endPlannedDate = formData.plannedDate[1]
|
||||
formData.plannedDate = undefined
|
||||
}
|
||||
|
||||
const resp = await $.post(this.actvivtyUrl + url, {tissue: JSON.stringify(formData)})
|
||||
loading.close()
|
||||
if (resp.code === 0) {
|
||||
if (type === 40002) {
|
||||
sublime.jumpPagePjax("/platform/activity/info/mange/union")
|
||||
} else if (type === 40003) {
|
||||
sublime.jumpPagePjax("/platform/activity/info/mange/club")
|
||||
} else {
|
||||
sublime.jumpPagePjax("/platform/activity/info/mange/school")
|
||||
}
|
||||
} else {
|
||||
this.notifyWarning(resp.msg)
|
||||
}
|
||||
} else {
|
||||
this.$notify.error({title: '错误', message: '存在未填写的的必填项'});
|
||||
}
|
||||
});
|
||||
},
|
||||
async init() {
|
||||
this.delNotesList = []
|
||||
this.formData = {
|
||||
time: [],
|
||||
applyTime2: [],
|
||||
plannedDate: [],
|
||||
goods: [],
|
||||
billFiles: [],
|
||||
photoFiles: [],
|
||||
otherFiles: [],
|
||||
tissuePersonList: [],
|
||||
unionUserNumberLimit: [],
|
||||
signUpMethod: null,
|
||||
rangerMeter: 100,
|
||||
isEnrollSystem: true,
|
||||
}
|
||||
const {data} = await $.get('/platform/activity/apply/generateActivityCode', {activity_type: type})
|
||||
this.$set(this.formData, 'activityCode', data)
|
||||
this.unionList = await getUnions(null)
|
||||
const resp = await $.get('/platform/activity/apply/getUnionData', {activityScopeGroupId: this.formData.groupId})
|
||||
this.formData.unionUserNumberLimit = resp.data
|
||||
await this.initMap()
|
||||
},
|
||||
async findOne(id) {
|
||||
const {data, code, msg} = await $.post(this.actvivtyUrl + "/findOne", {id})
|
||||
if (code === 0) {
|
||||
if (data.userId) {
|
||||
const user = await queryUserByIds([data.userId])
|
||||
await this.remoteMethod(user[0].loginname)
|
||||
}
|
||||
data.type = data.type + ''
|
||||
if (data.billFiles && data.billFiles.length > 0) data.billFiles = JSON.parse(data.billFiles)
|
||||
if (data.photoFiles && data.photoFiles.length > 0) data.photoFiles = JSON.parse(data.photoFiles)
|
||||
if (data.otherFiles && data.otherFiles.length > 0) data.otherFiles = JSON.parse(data.otherFiles)
|
||||
if (data.applyStartTime) data.applyTime2 = [data.applyStartTime, data.applyEndTime]
|
||||
if (data.startTime) data.time = [data.startTime, data.endTime]
|
||||
if (data.startPlannedDate) data.plannedDate = [data.startPlannedDate, data.endPlannedDate]
|
||||
this.userData = clone(data.tissuePersonList)
|
||||
data.unionUserNumberLimit = JSON.parse(data.unionUserNumberLimit)
|
||||
data.location = JSON.parse(data.location)
|
||||
this.formData = data
|
||||
if (!this.formData.unionUserNumberLimit) {
|
||||
const resp = await $.get('/platform/activity/apply/getUnionData', {activityScopeGroupId: this.formData.groupId})
|
||||
this.formData.unionUserNumberLimit = resp.data
|
||||
}
|
||||
if (this.formData.needSign) {
|
||||
await this.initMap()
|
||||
}
|
||||
} else {
|
||||
this.notifyWarning(msg)
|
||||
}
|
||||
},
|
||||
initMap() {
|
||||
this.$nextTick(() => {
|
||||
// if (map == null) {
|
||||
map = new AMap.Map("signMap", {
|
||||
resizeEnable: true,
|
||||
center: [118.640081, 32.082496],
|
||||
zoom: 16
|
||||
})
|
||||
// }
|
||||
|
||||
if (!this.formData.needSign) {
|
||||
return
|
||||
}
|
||||
|
||||
if (this.formData.location && Array.isArray(this.formData.location)) {
|
||||
const lng = parseFloat(this.formData.location[0])
|
||||
const lat = parseFloat(this.formData.location[1])
|
||||
if (marker) {
|
||||
map.remove(marker)
|
||||
marker = null
|
||||
}
|
||||
|
||||
marker = new AMap.Marker({
|
||||
position: [lng, lat],
|
||||
offset: new AMap.Pixel(-13, -30)
|
||||
})
|
||||
console.log(marker)
|
||||
map.add(marker)
|
||||
this.rangeMeterChange(this.formData.rangeMeter)
|
||||
}
|
||||
map.on('click', (e) => {
|
||||
if (!this.formData.rangeMeter) {
|
||||
this.$message.warning('请先设置签到半径')
|
||||
return
|
||||
}
|
||||
|
||||
if (marker) {
|
||||
map.remove(marker)
|
||||
}
|
||||
if (circle) {
|
||||
map.remove(circle)
|
||||
}
|
||||
marker = new AMap.Marker({
|
||||
position: [e.lnglat.getLng(), e.lnglat.getLat()],
|
||||
offset: new AMap.Pixel(-13, -30)
|
||||
})
|
||||
map.add(marker)
|
||||
this.formData.location = []
|
||||
this.formData.location.push(e.lnglat.getLng())
|
||||
this.formData.location.push(e.lnglat.getLat())
|
||||
this.rangeMeterChange(this.formData.rangeMeter)
|
||||
|
||||
});
|
||||
})
|
||||
},
|
||||
signUpMethodChange(val) {
|
||||
if (val == null) {
|
||||
this.$set(this.formData, 'userNumberLimit', null)
|
||||
this.$set(this.formData, 'needSign', false)
|
||||
this.$set(this.formData, 'rangeMeter', null)
|
||||
}
|
||||
},
|
||||
async getActivityGroup() {
|
||||
const resp = await $.get('/platform/activity/basic/scope/getActivityUserScopeGroup')
|
||||
this.activityGroupList = resp.data
|
||||
}
|
||||
},
|
||||
async created() {
|
||||
await this.getActivityGroup()
|
||||
const projectType = await getActivityTwoLevelType("50000")
|
||||
projectType.forEach(v => {
|
||||
if (v.code !== "50004") {
|
||||
this.projectType.push(v)
|
||||
}
|
||||
})
|
||||
const id = GetQueryString("id")
|
||||
id ? await this.findOne(id) : this.init()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
|
||||
<script>
|
||||
window.type = 40003
|
||||
</script>
|
||||
<!--#include("/platform/activity/union/layoutActivity.html"){}#-->
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,12 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
|
||||
<script>
|
||||
window.type = 40003
|
||||
</script>
|
||||
<!--#include("/platform/activity/union/applyActivity.html"){}#-->
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,20 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
<style>
|
||||
.el-descriptions__table {
|
||||
table-layout: fixed !important;
|
||||
}
|
||||
|
||||
.el-descriptions-item__cell {
|
||||
text-align: center !important;
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
window.type = 40003
|
||||
</script>
|
||||
<!--#include("/platform/activity/union/layoutAuditActivity.html"){}#-->
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,20 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
<style>
|
||||
.el-descriptions__table {
|
||||
table-layout: fixed !important;
|
||||
}
|
||||
|
||||
.el-descriptions-item__cell {
|
||||
text-align: center !important;
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
window.type = 40003
|
||||
</script>
|
||||
<!--#include("/platform/activity/union/layoutPlan.html"){}#-->
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,12 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
|
||||
<script>
|
||||
window.type = 40003
|
||||
</script>
|
||||
<!--#include("/platform/activity/union/layoutStatisticsActivity.html"){}#-->
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,367 @@
|
||||
<style>
|
||||
.el-divider {
|
||||
background-color: #409EFF !important;
|
||||
}
|
||||
|
||||
.el-divider__text {
|
||||
color: #409EFF !important;
|
||||
}
|
||||
|
||||
.el-timeline-item__timestamp {
|
||||
color: #409EFF;
|
||||
}
|
||||
</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" v-if="type==1">
|
||||
<div class="search-item-label">工会名称</div>
|
||||
<div class="search-item-option">
|
||||
<el-select v-model="pageForm.unionId" placeholder="请选择工会" filterable
|
||||
clearable
|
||||
style="width: 100%">
|
||||
<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-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"
|
||||
:width="column.width"
|
||||
show-overflow-tooltip
|
||||
:sortable="column.sortable">
|
||||
|
||||
<template v-if="column.prop=='time'" scope="{row}">
|
||||
<span>
|
||||
{{moment(row.startTime).format('YYYY-MM-DD')}} - {{moment(row.endTime).format('YYYY-MM-DD')}}
|
||||
</span>
|
||||
</template>
|
||||
<template scope="{row}" v-else-if="column.prop=='time2'">
|
||||
{{row.applyStartTime}}-{{row.applyEndTime}}
|
||||
</template>
|
||||
|
||||
<template v-else-if="column.prop=='projectTypeName'" scope="{row}">
|
||||
{{row.projectTypeName}}({{row.projectTypeCode}})
|
||||
</template>
|
||||
|
||||
<template v-else-if="column.prop=='tussueName'" scope="{row}">
|
||||
<span v-if="row.type==40002">{{row.unionname?row.unionname:'暂无'}}</span>
|
||||
<span v-if="row.type==40003">{{row.clubName?row.clubName:'暂无'}}</span>
|
||||
<span v-if="row.type==40001">校工会</span>
|
||||
</template>
|
||||
<template v-else-if="column.prop=='state'" scope="{row}">
|
||||
{{row.state===1?'未审核':row.state===2?'审核不通过':'审核通过'}}
|
||||
</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:'view',row}">
|
||||
查看
|
||||
</el-dropdown-item>
|
||||
|
||||
<el-dropdown-item :command="{type:'edit',row}"
|
||||
:disabled="row.projectTypeCode==50004">
|
||||
编辑
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item :command="{type:'delete',row}"
|
||||
:disabled="row.projectTypeCode==50004">
|
||||
删除
|
||||
</el-dropdown-item>
|
||||
<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:'export',row}">
|
||||
导出人员名单
|
||||
</el-dropdown-item>-->
|
||||
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<!--#include("/layouts/pagination.html"){}#-->
|
||||
</el-card>
|
||||
</template>
|
||||
|
||||
|
||||
<template #view>
|
||||
<tissue-info ref="info"></tissue-info>
|
||||
</template>
|
||||
</guava>
|
||||
|
||||
<send-msg ref="sendMsg" :url="url"></send-msg>
|
||||
|
||||
<open-qr-code ref="openQRCode" :url="url"></open-qr-code>
|
||||
|
||||
</div>
|
||||
|
||||
<script>
|
||||
var vue = new Vue({
|
||||
el: '#app',
|
||||
mixins: [initTableMixins],
|
||||
data() {
|
||||
return {
|
||||
actvivtyUrl: "/platform/activity/info/mange",
|
||||
selectLoading: false,
|
||||
userTabLoading: false,
|
||||
dialogVisible: false,
|
||||
url: "",
|
||||
userData: [],
|
||||
userList: [],
|
||||
unionList: [],
|
||||
pageForm: {
|
||||
type: type,
|
||||
year: new Date().getFullYear() + ''
|
||||
},
|
||||
formData: {
|
||||
tissuePersonList: []
|
||||
},
|
||||
tableColumns: [
|
||||
{prop: 'name', label: '活动名称'},
|
||||
{prop: 'address', label: '活动地点'},
|
||||
{prop: 'projectTypeName', label: '活动项目类型'},
|
||||
{prop: 'tussueName', label: '举办单位'},
|
||||
{prop: 'time', label: '活动日期'},
|
||||
{prop: 'time2', label: '报名日期', width: '300'},
|
||||
{prop: 'applyTime', label: '创建时间', sortable: true},
|
||||
{prop: 'state', label: '审核状态', sortable: true},
|
||||
|
||||
],
|
||||
userColumns: [
|
||||
{prop: 'userName', label: '姓名'},
|
||||
{prop: 'loginName', label: '工号'},
|
||||
{prop: 'sex', label: '性别'},
|
||||
{prop: 'mobile', label: '联系方式'},
|
||||
{prop: 'unitName', label: '所属单位'},
|
||||
{prop: 'unionName', label: '所属工会'}
|
||||
],
|
||||
formRules: {
|
||||
name: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
address: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
peopleNum: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
time: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
type: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
}
|
||||
}
|
||||
},
|
||||
components: {
|
||||
'guava': httpVueLoader('/components/plugins/Guava.vue'),
|
||||
'file-upload': httpVueLoader('/components/plugins/FileUpload.vue'),
|
||||
'tissue-info': httpVueLoader('/components/activity/school/tissueInfo.vue'),
|
||||
'send-msg': httpVueLoader('/components/plugins/SendMsgByGroupId.vue'),
|
||||
'open-qr-code': httpVueLoader('/components/plugins/OpenQRCode.vue'),
|
||||
},
|
||||
methods: {
|
||||
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 === 'sendMsg') {
|
||||
this.sendMsg(row)
|
||||
} else if (type === 'openCode') {
|
||||
this.openCode(row)
|
||||
} else if (type === 'export') {
|
||||
location.href = "/platform/activity/info/mange/export?id=" + row.id
|
||||
}
|
||||
},
|
||||
openCode(row) {
|
||||
this.$refs.openQRCode.openCode("/mobile/activity/unionActivity/goReg?id=" + row.id + "&signUpMethod=" + row.signUpMethod)
|
||||
},
|
||||
sendMsg(row) {
|
||||
this.url = `<a href="` + (APP_DOMAIN + "/mobile/activity/unionActivity/goReg?id=" + row.id + "&signUpMethod=" + row.signUpMethod) + `">点击参与</a>`
|
||||
this.$refs.sendMsg.openDialog(row.groupId)
|
||||
},
|
||||
async remoteMethod(query) {
|
||||
if (query) {
|
||||
this.selectLoading = true;
|
||||
const {data} = await $.post(this.actvivtyUrl + "/findUser", {serachWord: query})
|
||||
this.userList = data
|
||||
this.selectLoading = false;
|
||||
}
|
||||
},
|
||||
openAddUser() {
|
||||
this.formData.tissuePersonList = []
|
||||
this.dialogVisible = true
|
||||
},
|
||||
doAddUser() {
|
||||
this.formData.tissuePersonList = this.userList.filter(v => this.formData.tissuePersonList.some(x => v.userId === x))
|
||||
this.userData = this.userData.concat(this.formData.tissuePersonList)
|
||||
this.dialogVisible = false
|
||||
},
|
||||
delUser(row) {
|
||||
this.userData.splice(this.userData.indexOf(row.userId), 1)
|
||||
this.formData.tissuePersonList.splice(this.formData.tissuePersonList.indexOf(row.userId), 1)
|
||||
},
|
||||
openView(row) {
|
||||
const {id} = row
|
||||
this.$refs.info.getInfo(id)
|
||||
this.$refs.guava.view()
|
||||
},
|
||||
async openEdit(row) {
|
||||
const {id, type} = row
|
||||
if (type == 40002) {
|
||||
sublime.jumpPagePjax("/platform/activity/apply/union?id=" + id)
|
||||
} else if (type == 40003) {
|
||||
sublime.jumpPagePjax("/platform/activity/apply/club?id=" + id)
|
||||
} else {
|
||||
sublime.jumpPagePjax("/platform/activity/apply/school?id=" + id)
|
||||
}
|
||||
/*this.$refs.guava.edit()*/
|
||||
},
|
||||
async openAdd() {
|
||||
this.$refs.guava.edit()
|
||||
this.userData = []
|
||||
this.$nextTick(() => {
|
||||
this.formData = {
|
||||
name: '',
|
||||
time: '',
|
||||
peopleNum: '',
|
||||
address: '',
|
||||
files: [],
|
||||
type: "40002",
|
||||
tissuePersonList: []
|
||||
}
|
||||
if (this.$refs['addForm']) {
|
||||
this.$refs['addForm'].resetFields()
|
||||
}
|
||||
})
|
||||
},
|
||||
async operation() {
|
||||
let url = this.formData.id ? "/doEdit" : "/doAdd"
|
||||
this.$refs["addForm"].validate(async (valid) => {
|
||||
if (valid) {
|
||||
const loading = this.$loading({
|
||||
lock: true,
|
||||
text: '正在提交...',
|
||||
spinner: 'el-icon-loading',
|
||||
background: COVER_LAYER_COLOR
|
||||
});
|
||||
|
||||
const formData = JSON.parse(JSON.stringify(this.formData))
|
||||
formData.type = this.pageForm.type
|
||||
if (formData.time && formData.time.length) {
|
||||
formData.startTime = formData.time[0]
|
||||
formData.endTime = formData.time[1]
|
||||
formData.time = undefined
|
||||
}
|
||||
|
||||
const resp = await $.post(this.actvivtyUrl + url, {tissue: JSON.stringify(formData),})
|
||||
if (resp.code === 0) {
|
||||
this.pageData()
|
||||
this.$refs.guava.index()
|
||||
this.notifySuccess(resp.msg)
|
||||
} else {
|
||||
this.notifyError(resp.msg)
|
||||
}
|
||||
} else {
|
||||
this.$notify.error({title: '错误', message: '存在未填写的的必填项'});
|
||||
}
|
||||
});
|
||||
},
|
||||
doDelete(row) {
|
||||
const {id} = row
|
||||
this.$confirm('确定要删除该活动吗?', '提示', {type: 'warning'}).then(async () => {
|
||||
this.$set(row, "loading", true)
|
||||
const resp = await $.post(this.actvivtyUrl + "/doDelete", {id: id});
|
||||
if (resp.code === 0) {
|
||||
this.pageData()
|
||||
this.$refs.guava.index()
|
||||
this.notifySuccess(resp.msg)
|
||||
} else {
|
||||
this.notifyError(resp.msg)
|
||||
}
|
||||
this.$set(row, "loading", false)
|
||||
})
|
||||
},
|
||||
pageData() {
|
||||
sublime.showLoadingbar();
|
||||
this.tableLoading = true
|
||||
$.post("/platform/activity/info/mange/pageData", this.pageForm, (data) => {
|
||||
sublime.closeLoadingbar();
|
||||
this.tableLoading = false
|
||||
if (data.code === 0) {
|
||||
this.tableData = data.data.list;
|
||||
this.pageForm.totalCount = data.data.totalCount;
|
||||
} else {
|
||||
this.$message.error(data.msg);
|
||||
}
|
||||
}, "json");
|
||||
}
|
||||
},
|
||||
async created() {
|
||||
this.pageData()
|
||||
this.unionList = await getUnions(null)
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
@@ -0,0 +1,281 @@
|
||||
<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" v-if="type==40002">
|
||||
<div class="search-item-label">工会名称</div>
|
||||
<div class="search-item-option">
|
||||
<el-select v-model="pageForm.unionId" placeholder="请选择工会" filterable
|
||||
clearable
|
||||
style="width: 100%">
|
||||
<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-search" @click="pageData">搜索
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
|
||||
<el-card shadow="never" class="mt10">
|
||||
<table-tool label="活动列表" :app="this">
|
||||
<template #func>
|
||||
<el-radio-group @change="doSearch" size="small" v-model="pageForm.state">
|
||||
<el-radio-button :label="i.code" v-for="i in auditList">{{i.name}}
|
||||
</el-radio-button>
|
||||
</el-radio-group>
|
||||
</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"
|
||||
:sortable="column.sortable">
|
||||
|
||||
<template v-if="column.prop=='time'" scope="{row}">
|
||||
<span>
|
||||
{{moment(row.startTime).format('YYYY-MM-DD')}} - {{moment(row.endTime).format('YYYY-MM-DD')}}
|
||||
</span>
|
||||
</template>
|
||||
|
||||
<template v-else-if="column.prop=='projectTypeName'" scope="{row}">
|
||||
{{row.projectTypeName}}({{row.projectTypeCode}})
|
||||
</template>
|
||||
|
||||
<template v-else-if="column.prop=='tussueName'" scope="{row}">
|
||||
<span v-if="row.type==40002">{{row.unionname?row.unionname:'暂无'}}</span>
|
||||
<span v-if="row.type==40003">{{row.clubName?row.clubName:'暂无'}}</span>
|
||||
<span v-if="row.type==40001">校工会</span>
|
||||
</template>
|
||||
|
||||
<template v-else-if="column.prop=='state'" scope="{row}">
|
||||
{{row.state===1?'未审核':row.state===2?'审核不通过':'审核通过'}}
|
||||
</template>
|
||||
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column prop="userOnline" align="center" header-align="center"
|
||||
label="操作" width="150px">
|
||||
<template scope="{row}">
|
||||
<el-button size="mini" :loading="row.loading" @click="openView(row)">
|
||||
查看
|
||||
</el-button>
|
||||
<el-button size="mini" :loading="row.loading" type="primary"
|
||||
@click="openAudit(row)"
|
||||
v-if="row.state===1">
|
||||
审核
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--#include("/layouts/pagination.html"){}#-->
|
||||
</el-card>
|
||||
</template>
|
||||
|
||||
<template #view>
|
||||
<tissue-info ref="info"></tissue-info>
|
||||
</template>
|
||||
|
||||
<template #edit>
|
||||
<tissue-info ref="editInfo" :handle="true" label="校工会审核">
|
||||
<template #handle>
|
||||
<el-form :model="formData" label-position="right"
|
||||
style="padding: 20px 0"
|
||||
label-width="120px">
|
||||
<el-form-item label="审核信息 " label-width="135px" class="view-header">
|
||||
</el-form-item>
|
||||
|
||||
|
||||
<el-row gutter="20">
|
||||
<el-col :span="8">
|
||||
<el-form-item prop="username" label="审核人">
|
||||
<el-input v-model="formData.username"
|
||||
disabled></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item prop="time" label="审核时间">
|
||||
<el-input v-model="formData.auditTime" disabled></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="24">
|
||||
<el-form-item prop="idea" label="审核意见">
|
||||
<el-input type="textarea" v-model="formData.auditOpinion"
|
||||
rows="4" maxlength="500"
|
||||
placeholder="请填写您的审核意见"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
|
||||
</el-form>
|
||||
|
||||
|
||||
<div style="float: right;margin: 20px 0">
|
||||
<el-button type="danger" @click="doReview(false)" :disabled="subDis"
|
||||
:loading="subLoading1">拒
|
||||
绝
|
||||
</el-button>
|
||||
<el-button type="success" @click="doReview(true)" :disabled="subDis"
|
||||
:loading="subLoading2">通
|
||||
过
|
||||
</el-button>
|
||||
</div>
|
||||
|
||||
</template>
|
||||
</tissue-info>
|
||||
</template>
|
||||
|
||||
</guava>
|
||||
</div>
|
||||
|
||||
|
||||
<script>
|
||||
var vue = new Vue({
|
||||
el: '#app',
|
||||
mixins: [initTableMixins],
|
||||
data() {
|
||||
return {
|
||||
auditList: [{code: true, name: "已审核"}, {code: false, name: "未审核"}],
|
||||
selectLoading: false,
|
||||
userTabLoading: false,
|
||||
dialogVisible: false,
|
||||
userData: [],
|
||||
userList: [],
|
||||
unionList: [],
|
||||
subDis: false,
|
||||
subLoading1: false,
|
||||
subLoading2: false,
|
||||
pageForm: {
|
||||
state: false,
|
||||
type: type,
|
||||
year: new Date().getFullYear() + ''
|
||||
},
|
||||
tableColumns: [
|
||||
{prop: 'name', label: '活动名称'},
|
||||
{prop: 'address', label: '活动地点'},
|
||||
{prop: 'projectTypeName', label: '活动项目类型'},
|
||||
{prop: 'tussueName', label: '举办单位'},
|
||||
{prop: 'time', label: '活动日期'},
|
||||
{prop: 'applyTime', label: '创建时间', sortable: true},
|
||||
{prop: 'state', label: '审核状态', sortable: true},
|
||||
|
||||
],
|
||||
userColumns: [
|
||||
{prop: 'userName', label: '姓名'},
|
||||
{prop: 'loginName', label: '工号'},
|
||||
{prop: 'sex', label: '性别'},
|
||||
{prop: 'mobile', label: '联系方式'},
|
||||
{prop: 'unitName', label: '所属单位'},
|
||||
{prop: 'unionName', label: '所属工会'}
|
||||
],
|
||||
}
|
||||
},
|
||||
components: {
|
||||
'guava': httpVueLoader('/components/plugins/Guava.vue'),
|
||||
'file-upload': httpVueLoader('/components/plugins/FileUpload.vue'),
|
||||
'tissue-info': httpVueLoader('/components/activity/school/tissueInfo.vue')
|
||||
},
|
||||
methods: {
|
||||
openAudit(row) {
|
||||
this.$refs.editInfo.getInfo(row.id)
|
||||
this.$refs.guava.edit()
|
||||
this.formData = {
|
||||
id: row.id,
|
||||
username: "${@shiro.getPrincipalProperty('username')}",
|
||||
auditTime: moment().format('YYYY-MM-DD'),
|
||||
}
|
||||
},
|
||||
async doReview(flag) {
|
||||
const confirm = await this.$confirm('确定要审核' + (flag ? '通过' : '拒绝') + '吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
})
|
||||
if (confirm === "confirm") {
|
||||
this.formData.flag = flag
|
||||
this.subDis = true
|
||||
flag ? this.subLoading2 = true : this.subLoading1 = true
|
||||
const resp = await $.post("/platform/activity/audit/doReview", this.formData)
|
||||
if (resp.code === 0) {
|
||||
this.pageData()
|
||||
this.$refs.guava.index()
|
||||
this.notifySuccess(resp.msg)
|
||||
} else {
|
||||
this.notifyError(resp.msg)
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
openView(row) {
|
||||
const {id} = row
|
||||
this.$refs.info.getInfo(id)
|
||||
this.$refs.guava.view()
|
||||
},
|
||||
pageData() {
|
||||
sublime.showLoadingbar();
|
||||
this.tableLoading = true
|
||||
$.post("/platform/activity/audit/pageData", this.pageForm, (data) => {
|
||||
sublime.closeLoadingbar();
|
||||
this.tableLoading = false
|
||||
if (data.code === 0) {
|
||||
this.tableData = data.data.list;
|
||||
this.pageForm.totalCount = data.data.totalCount;
|
||||
} else {
|
||||
this.$message.error(data.msg);
|
||||
}
|
||||
}, "json");
|
||||
}
|
||||
},
|
||||
async created() {
|
||||
this.unionList = await getUnions(null)
|
||||
this.pageData()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
@@ -0,0 +1,406 @@
|
||||
<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 v-if="window.type === 40002" class="search-item">
|
||||
<div class="search-item-label">工会名称</div>
|
||||
<div class="search-item-option">
|
||||
<el-select v-model="pageForm.tissueId" placeholder="请选择工会" filterable clearable
|
||||
style="width: 100%">
|
||||
<el-option
|
||||
v-for="item in unionList"
|
||||
:key="item.id"
|
||||
:label="item.unionname"
|
||||
:value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div v-if="window.type === 40003" class="search-item">
|
||||
<div class="search-item-label">社团</div>
|
||||
<div class="search-item-option">
|
||||
<el-select v-model="pageForm.tissueId" placeholder="请选择社团(社团)" filterable clearable
|
||||
style="width: 100%">
|
||||
<el-option
|
||||
v-for="item in clubList"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- <template v-if="searchMore">
|
||||
<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>
|
||||
</template>-->
|
||||
|
||||
|
||||
<div class="search-query">
|
||||
<el-button type="primary" icon="el-icon-search" @click="pageData">搜索</el-button>
|
||||
<!-- <more v-model="searchMore"></more>-->
|
||||
</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">
|
||||
|
||||
<el-table-column align="center" header-align="center" type="index" :index="indexMethod" label="序号"
|
||||
width="80px"></el-table-column>
|
||||
|
||||
<el-table-column prop="year" label="年度"></el-table-column>
|
||||
|
||||
<el-table-column v-if="window.type === 40002" prop="unionname" label="所属工会" show-overflow-tooltip>
|
||||
<template scope="{row}">
|
||||
<span>{{unionList.find(x => x.id == row.tissueId) === undefined ? '' : unionList.find(x => x.id == row.tissueId).unionname}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column v-if="window.type === 40003" prop="clubname" label="社团" show-overflow-tooltip>
|
||||
<template scope="{row}">
|
||||
<span>{{clubList.find(x => x.id == row.tissueId) === undefined ? '' : clubList.find(x => x.id == row.tissueId).name}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column prop="name" label="计划名称" show-overflow-tooltip></el-table-column>
|
||||
<!--<el-table-column prop="allName" label="活动项目" show-overflow-tooltip>
|
||||
</el-table-column>-->
|
||||
<el-table-column prop="activityTypeName" label="活动类型" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column prop="time" label="计划预计时间" sortable></el-table-column>
|
||||
<el-table-column prop="money" label="预算费用"></el-table-column>
|
||||
<!--<el-table-column prop="carryOut" label="计划状态">
|
||||
<template 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:'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>
|
||||
<el-button type="primary" @click="operation">确 定</el-button>
|
||||
</template>
|
||||
|
||||
<template #edit>
|
||||
<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="2" border>分工会活动计划</el-radio>
|
||||
<el-radio label="3" 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-input maxlength="50" placeholder="请填写活动项目" v-model="formData.event"
|
||||
type="text"></el-input>-->
|
||||
<el-select v-model="formData.event" placeholder="请选择活动项目" filterable clearable 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>
|
||||
</el-form>
|
||||
</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 {
|
||||
clubList: [],
|
||||
planUrl: "/platform/activity/plan",
|
||||
unionList: [],
|
||||
eventList: [],
|
||||
flag: false,
|
||||
pageForm: {
|
||||
type: type,
|
||||
year: new Date().getFullYear() + ''
|
||||
},
|
||||
formData: {
|
||||
name: '',
|
||||
time: '',
|
||||
event: '',
|
||||
content: ''
|
||||
},
|
||||
tableColumns: [
|
||||
{prop: 'name', label: '计划名称'},
|
||||
{prop: 'time', label: '计划预计时间'},
|
||||
{prop: 'allName', label: '活动项目'},
|
||||
{prop: 'carryOut', label: '计划状态'}
|
||||
],
|
||||
formRules: {
|
||||
type: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
name: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
time: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
event: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
content: [{validator: validContent, trigger: ['blur', 'change']}]
|
||||
},
|
||||
}
|
||||
},
|
||||
components: {
|
||||
'guava': httpVueLoader('/components/plugins/Guava.vue'),
|
||||
'plan-info': httpVueLoader('/components/activity/school/planInfo.vue'),
|
||||
},
|
||||
methods: {
|
||||
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)
|
||||
}
|
||||
},
|
||||
openView(row) {
|
||||
const {id} = row
|
||||
this.$refs.info.getInfo(id)
|
||||
this.$refs.guava.view()
|
||||
},
|
||||
async openEdit(row) {
|
||||
|
||||
if (window.type === 40002) {
|
||||
sublime.jumpPagePjax('/platform/activity/plan/addUnionPlan?id=' + row.id)
|
||||
} else if (window.type === 40003) {
|
||||
sublime.jumpPagePjax('/platform/activity/plan/addClubPlan?id=' + row.id)
|
||||
} else if (window.type === 40001) {
|
||||
sublime.jumpPagePjax('/platform/activity/plan/addSchoolPlan?id=' + row.id)
|
||||
}
|
||||
},
|
||||
async openAdd() {
|
||||
this.formData = {}
|
||||
this.flag = false
|
||||
this.$refs.guava.edit()
|
||||
this.$nextTick(() => {
|
||||
this.initEditor()
|
||||
if (this.$refs['form']) {
|
||||
this.$refs['form'].resetFields()
|
||||
}
|
||||
|
||||
this.formData = {
|
||||
type: '40003',
|
||||
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
|
||||
});
|
||||
|
||||
this.formData.type = this.pageForm.type
|
||||
|
||||
const resp = await $.post(this.planUrl + url, {
|
||||
id: this.formData.id,
|
||||
name: this.formData.name,
|
||||
time: this.formData.time,
|
||||
content: this.formData.content,
|
||||
event: JSON.stringify(this.formData.event),
|
||||
type: this.pageForm.type,
|
||||
})
|
||||
if (resp.code === 0) {
|
||||
this.pageData()
|
||||
this.$refs.guava.index()
|
||||
this.notifySuccess(resp.msg)
|
||||
} else {
|
||||
this.notifyError(resp.msg)
|
||||
}
|
||||
loading.close()
|
||||
|
||||
} else {
|
||||
this.$notify.error({title: '错误', message: '存在未填写的的必填项'});
|
||||
}
|
||||
});
|
||||
},
|
||||
doDelete(row) {
|
||||
const {id} = row
|
||||
this.$confirm('确定要删除该计划吗?', '提示', {type: 'warning'}).then(async () => {
|
||||
const resp = await $.post(this.planUrl + "/doDelete", {id: id});
|
||||
if (resp.code === 0) {
|
||||
this.pageData()
|
||||
this.$refs.guava.index()
|
||||
this.notifySuccess(resp.msg)
|
||||
} else {
|
||||
this.notifyError(resp.msg)
|
||||
}
|
||||
})
|
||||
},
|
||||
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])
|
||||
}
|
||||
})
|
||||
},
|
||||
pageData() {
|
||||
sublime.showLoadingbar();
|
||||
this.tableLoading = true
|
||||
$.post("/platform/activity/plan/pageData", this.pageForm, (data) => {
|
||||
sublime.closeLoadingbar();
|
||||
this.tableLoading = false
|
||||
if (data.code === 0) {
|
||||
this.tableData = data.data.list;
|
||||
this.pageForm.totalCount = data.data.totalCount;
|
||||
} else {
|
||||
this.$message.error(data.msg);
|
||||
}
|
||||
}, "json");
|
||||
},
|
||||
async getMyClub() {
|
||||
return await $.post('/platform/activity/yearSummary/getMyClub')
|
||||
}
|
||||
},
|
||||
async created() {
|
||||
this.pageData()
|
||||
this.eventList = await activity.getEvents()
|
||||
this.unionList = await getUnions(null);
|
||||
this.clubList = await getClubs()
|
||||
const isAdmin = "${@shiro.hasAnyRoles('sysadmin', 'A06')}" === 'true'
|
||||
if (!isAdmin) {
|
||||
const selfUnion = "${@shiro.getPrincipalProperty('union').getId()}";
|
||||
this.unionList = [this.unionList.find(x => x.id === selfUnion)]
|
||||
|
||||
const clubs = await this.getMyClub()
|
||||
let clubArray = []
|
||||
for (let c of Array.from(clubs)) {
|
||||
const cl = this.clubList.find(x => x.id === c)
|
||||
if (cl) {
|
||||
clubArray.push(cl)
|
||||
}
|
||||
}
|
||||
this.clubList = clubArray
|
||||
}
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
@@ -0,0 +1,178 @@
|
||||
<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
|
||||
@change="getActivityByYearOrType"
|
||||
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-select v-model="pageForm.activityId" placeholder="请选择活动" filterable
|
||||
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>
|
||||
|
||||
<div class="search-item" v-if="type==40002||type==40001">
|
||||
<div class="search-item-label">工会名称</div>
|
||||
<div class="search-item-option">
|
||||
<el-select v-model="pageForm.unionId" placeholder="请选择工会" filterable
|
||||
clearable
|
||||
style="width: 100%">
|
||||
<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-item">
|
||||
<div class="search-item-label">姓名/工号</div>
|
||||
<div class="search-item-option">
|
||||
<el-input placeholder="请输入姓名/工号" clearable
|
||||
v-model="pageForm.searchKeyword"
|
||||
@keyup.enter.native="doSearch">
|
||||
<el-select v-model="pageForm.searchName" slot="prepend"
|
||||
placeholder="姓名/工号"
|
||||
style="width: 80px;">
|
||||
<el-option label="姓名" value="u.username"></el-option>
|
||||
<el-option label="工号" value="u.loginanme"></el-option>
|
||||
</el-select>
|
||||
</el-input>
|
||||
</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">
|
||||
<template #func>
|
||||
<el-button icon="el-icon-s-promotion" type="primary" @click="doExport" size="medium">导出
|
||||
</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"
|
||||
sortable>
|
||||
</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 {
|
||||
unionList: {},
|
||||
activityList: {},
|
||||
pageForm: {
|
||||
unionId: '',
|
||||
searchName: "u.username",
|
||||
type: type,
|
||||
year: new Date().getFullYear() + ''
|
||||
},
|
||||
tableColumns: [
|
||||
{prop: 'username', label: '姓名'},
|
||||
{prop: 'loginname', label: '工号'},
|
||||
{prop: 'sex', label: '性别'},
|
||||
{prop: 'mobile', label: '联系方式'},
|
||||
{prop: 'unitname', label: '所属单位'},
|
||||
{prop: 'unionname', label: '所属工会'},
|
||||
{prop: 'applyDateTime', label: '报名时间'},
|
||||
// {prop: 'notes', label: '备注'},
|
||||
],
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async doExport() {
|
||||
const {activityId, unionId} = this.pageForm
|
||||
window.open("/platform/activity/info/mange/doExportUser?id=" + activityId +
|
||||
"&unionId=" + unionId)
|
||||
},
|
||||
pageData() {
|
||||
sublime.showLoadingbar();
|
||||
this.tableLoading = true
|
||||
$.post("/platform/activity/user/statistics/pageData", this.pageForm, (data) => {
|
||||
sublime.closeLoadingbar();
|
||||
this.tableLoading = false
|
||||
if (data.code === 0) {
|
||||
this.tableData = data.data.list;
|
||||
this.pageForm.totalCount = data.data.totalCount;
|
||||
} else {
|
||||
this.notifyError(data.msg)
|
||||
}
|
||||
}, "json");
|
||||
},
|
||||
async getActivityByYearOrType() {
|
||||
const resp = await $.get("/platform/activity/user/statistics/getActivityByYearOrType", {
|
||||
type: this.pageForm.type,
|
||||
year: this.pageForm.year,
|
||||
})
|
||||
if (resp.code === 0) {
|
||||
this.activityList = resp.data
|
||||
if (resp.data && resp.data.length > 0) {
|
||||
this.$set(this.pageForm, "activityId", resp.data[0].id)
|
||||
} else {
|
||||
this.$set(this.pageForm, "activityId", null)
|
||||
}
|
||||
this.pageData()
|
||||
}
|
||||
},
|
||||
},
|
||||
async created() {
|
||||
await this.getActivityByYearOrType()
|
||||
this.unionList = await getUnions(null)
|
||||
|
||||
}
|
||||
})
|
||||
</script>
|
||||
@@ -0,0 +1,12 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
|
||||
<script>
|
||||
window.type = 40001
|
||||
</script>
|
||||
<!--#include("/platform/activity/union/layoutActivity.html"){}#-->
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,12 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
|
||||
<script>
|
||||
window.type = 40001
|
||||
</script>
|
||||
<!--#include("/platform/activity/union/applyActivity.html"){}#-->
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,20 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
<style>
|
||||
.el-descriptions__table {
|
||||
table-layout: fixed !important;
|
||||
}
|
||||
|
||||
.el-descriptions-item__cell {
|
||||
text-align: center !important;
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
window.type = 40001
|
||||
</script>
|
||||
<!--#include("/platform/activity/union/layoutPlan.html"){}#-->
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,12 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
|
||||
<script>
|
||||
window.type = 40001
|
||||
</script>
|
||||
<!--#include("/platform/activity/union/layoutStatisticsActivity.html"){}#-->
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,12 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
|
||||
<script>
|
||||
window.type = 40002
|
||||
</script>
|
||||
<!--#include("/platform/activity/union/layoutActivity.html"){}#-->
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,12 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
|
||||
<script>
|
||||
window.type = 40002
|
||||
</script>
|
||||
<!--#include("/platform/activity/union/applyActivity.html"){}#-->
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,20 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
<style>
|
||||
.el-descriptions__table {
|
||||
table-layout: fixed !important;
|
||||
}
|
||||
|
||||
.el-descriptions-item__cell {
|
||||
text-align: center !important;
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
window.type = 40002
|
||||
</script>
|
||||
<!--#include("/platform/activity/union/layoutAuditActivity.html"){}#-->
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,20 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
<style>
|
||||
.el-descriptions__table {
|
||||
table-layout: fixed !important;
|
||||
}
|
||||
|
||||
.el-descriptions-item__cell {
|
||||
text-align: center !important;
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
window.type = 40002
|
||||
</script>
|
||||
<!--#include("/platform/activity/union/layoutPlan.html"){}#-->
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,12 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
|
||||
<script>
|
||||
window.type = 40002
|
||||
</script>
|
||||
<!--#include("/platform/activity/union/layoutStatisticsActivity.html"){}#-->
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,338 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
<style>
|
||||
.el-tabs__content {
|
||||
padding-top: 20px;
|
||||
}
|
||||
|
||||
.el-dialog__body div div {
|
||||
color: #ff0000;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.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:not(:last-child,:first-child) {*/
|
||||
/* height: 70px;*/
|
||||
/*}*/
|
||||
|
||||
.query-row-title {
|
||||
width: 120px;
|
||||
}
|
||||
|
||||
.bottom {
|
||||
margin-top: 13px;
|
||||
line-height: 12px;
|
||||
}
|
||||
|
||||
.button {
|
||||
padding: 0;
|
||||
float: right;
|
||||
}
|
||||
|
||||
.image {
|
||||
margin: 10px;
|
||||
width: 100px;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.clearfix:before,
|
||||
.clearfix:after {
|
||||
display: table;
|
||||
content: "";
|
||||
}
|
||||
|
||||
.time {
|
||||
font-size: 16px;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.clearfix:after {
|
||||
clear: both
|
||||
}
|
||||
|
||||
</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"
|
||||
style="width: 100%"
|
||||
@change="doSearch"
|
||||
value-format="yyyy"
|
||||
placeholder="请选择">
|
||||
</el-date-picker>
|
||||
</div>
|
||||
</div>
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">项目名称:</div>
|
||||
<div class="search-item-option">
|
||||
<div class="search-item-option">
|
||||
<el-select v-model="pageForm.projectId" placeholder="请选择项目名称"
|
||||
style="width: 100%;"
|
||||
clearable
|
||||
@change="doSearch();"
|
||||
filterable="true">
|
||||
<el-option v-for="o in projectList"
|
||||
:label="o.projectName"
|
||||
:value="o.id"></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">货物名称:</div>
|
||||
<div class="search-item-option">
|
||||
<el-input placeholder="请输入内容" clearable v-model="pageForm.goodsName"
|
||||
@keyup.enter.native="doSearch" style="width:100%"></el-input>
|
||||
</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" 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">
|
||||
<el-tag
|
||||
style="margin-right: 10px;cursor: pointer"
|
||||
v-for="item in typeList"
|
||||
:key="item.id"
|
||||
:type="item.typeName"
|
||||
:effect="pageForm.types.includes(item.id)?'dark':'plain'"
|
||||
@click="checkType(item.id)">
|
||||
{{ item.typeName }}
|
||||
</el-tag>
|
||||
|
||||
<el-link type="danger" v-if="typeList.length&&pageForm.types.length"
|
||||
:underline="false"
|
||||
@click="pageForm.types=[];doSearch()">清空
|
||||
</el-link>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-card>
|
||||
|
||||
<el-card shadow="never" class="mt10">
|
||||
<template>
|
||||
<vi-title2 title="货物列表">
|
||||
<!--<template #func>
|
||||
<el-button @click="openAdd" size="medium" type="primary">添加货物</el-button>
|
||||
</template>-->
|
||||
</vi-title2>
|
||||
</template>
|
||||
<el-table :data="tableData" style="width: 100%" row-key="id"
|
||||
@sort-change="pageOrder" :size="tableSize"
|
||||
v-loading="tableLoading" ref="table" 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"
|
||||
show-overflow-tooltip
|
||||
:sortable="column.sortable"
|
||||
:label="column.label"
|
||||
:prop="column.prop" :width="column.width" min-width="100px">
|
||||
<template v-if="column.prop==='imgUrl'" scope="{row}">
|
||||
<el-image
|
||||
:src="CREATE_PREVIEW_URL(row.imgUrl)"
|
||||
@click="preview(row.imgUrl,row.imgUrl)"
|
||||
fit="cover"
|
||||
v-if="row.imgUrl"
|
||||
style="width: 50px; height: 50px;"></el-image>
|
||||
<div v-else>暂无</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="userOnline" align="center" header-align="center"
|
||||
label="操作" width="100px">
|
||||
<template scope="{row}">
|
||||
<el-button size="mini" @click="showInfo(row)">查看</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--#include("/layouts/pagination.html"){}#-->
|
||||
<!--<div class="right">
|
||||
<vi-title2 title="货物列表">
|
||||
<!–<template #func>
|
||||
<el-button @click="openAdd" size="medium" type="primary">添加货物</el-button>
|
||||
</template>–>
|
||||
</vi-title2>
|
||||
</div>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="4" v-for="(o, index) in tableData" :key="o"
|
||||
:offset="index > 0 ? tableData.length : 0">
|
||||
<el-card :body-style="{ padding: '0px' }"
|
||||
style="height: 200px;width: 300px;margin: 10px auto;padding: 10px">
|
||||
<div style="display: flex">
|
||||
<div>
|
||||
<el-image :src="CREATE_PREVIEW_URL(o.imgUrl)"
|
||||
@click="preview(o.imgUrl,o.imgUrl)"
|
||||
fit="cover"
|
||||
v-if="o.imgUrl"
|
||||
class="image"></el-image>
|
||||
</div>
|
||||
<div>
|
||||
<h4>{{o.goodsName}}</h4>
|
||||
<h5>¥{{o.goodsPrice}}</h5>
|
||||
</div>
|
||||
</div>
|
||||
<div style="padding: 14px;">
|
||||
<!–<span>{{o.goodsName}}</span>–>
|
||||
<div style="margin-top: 10px">
|
||||
<span class="time">厂商:{{ o.manufacturer }}</span>
|
||||
<el-button type="text" style="font-size: 16px" @click="showInfo(o.id)"
|
||||
class="button">详情
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
</el-row>-->
|
||||
</el-card>
|
||||
</template>
|
||||
|
||||
<template #view>
|
||||
<el-descriptions :column="4" border class="table_fixed">
|
||||
<template>
|
||||
<el-descriptions-item :span="2" label="货物名称">
|
||||
{{viewData.goodsName}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item :span="2" label="货物价格">
|
||||
¥{{viewData.goodsPrice}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item :span="2" label="货物类别">
|
||||
{{viewData.typeId}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item :span="2" label="厂商">
|
||||
{{viewData.manufacturer}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item :span="4" label="货物详情">
|
||||
<span v-html="viewData.description"></span>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item :span="2" label="货物图片">
|
||||
<el-image
|
||||
:src="CREATE_PREVIEW_URL(viewData.imgUrl)"
|
||||
@click="preview(viewData.imgUrl,viewData.imgUrl)"
|
||||
fit="cover"
|
||||
v-if="viewData.imgUrl"
|
||||
style="width: 100px; height: 100px;"></el-image>
|
||||
<div v-else>暂无</div>
|
||||
</el-descriptions-item>
|
||||
</template>
|
||||
</el-descriptions>
|
||||
</template>
|
||||
</guava>
|
||||
</div>
|
||||
<script>
|
||||
var vue = new Vue({
|
||||
el: '#app',
|
||||
mixins: [initTableMixins],
|
||||
data() {
|
||||
return {
|
||||
tableColumns: [
|
||||
{prop: 'goodsName', label: '货物名称'},
|
||||
{prop: 'imgUrl', label: '图片'},
|
||||
{prop: 'goodsPrice', label: '单价'},
|
||||
{prop: 'typeName', label: '类别'},
|
||||
{prop: 'manufacturer', label: '厂商'},
|
||||
],
|
||||
pageForm: {
|
||||
year: moment().format('YYYY'),
|
||||
types: [],
|
||||
},
|
||||
projectList: [],
|
||||
typeList: [],
|
||||
viewData: {},
|
||||
formData: {
|
||||
benefitingExhibits: [],
|
||||
},
|
||||
formRules: {
|
||||
projectName: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
benefitingExhibits: [{
|
||||
required: true,
|
||||
message: '必填',
|
||||
trigger: ['blur', 'change']
|
||||
}],
|
||||
},
|
||||
projectInfo:{},
|
||||
}
|
||||
},
|
||||
components: {},
|
||||
methods: {
|
||||
pageData() {
|
||||
sublime.showLoadingbar();
|
||||
const pageForm = clone(this.pageForm)
|
||||
pageForm.types = JSON.stringify(pageForm.types)
|
||||
|
||||
$.post(loc() + "/pageData", pageForm, (data) => {
|
||||
sublime.closeLoadingbar();
|
||||
if (data.code === 0) {
|
||||
this.tableData = data.data.list;
|
||||
this.pageForm.totalCount = data.data.totalCount;
|
||||
} else {
|
||||
this.$message.error(data.msg);
|
||||
}
|
||||
}, "json");
|
||||
},
|
||||
showInfo(id) {
|
||||
this.viewData = this.tableData.find(v => v.id = id);
|
||||
const obj = this.typeList.find(v=> v.id=this.viewData.typeId)
|
||||
this.viewData.typeId = obj.typeName
|
||||
this.$refs.guava.view()
|
||||
},
|
||||
checkType(id) {
|
||||
let idx = this.pageForm.types.indexOf(id)
|
||||
if (idx !== -1) {
|
||||
this.pageForm.types.splice(idx, 1)
|
||||
} else {
|
||||
this.pageForm.types.push(id)
|
||||
}
|
||||
this.doSearch();
|
||||
},
|
||||
async getAllProject() {
|
||||
const resp = await $.get('/platform/benefiting/manage/getAll')
|
||||
this.projectList = resp.data
|
||||
this.pageForm.projectId = this.projectList[0].id
|
||||
},
|
||||
async getAllType() {
|
||||
const resp = await $.get('/platform/benefiting/type/findAllType')
|
||||
if (resp.code === 0) {
|
||||
this.typeList = resp.data;
|
||||
}
|
||||
},
|
||||
async openAdd() {
|
||||
window.location.href='/platform/benefiting/manage'
|
||||
},
|
||||
},
|
||||
async created() {
|
||||
this.pageData();
|
||||
await this.getAllProject();
|
||||
await this.getAllType();
|
||||
},
|
||||
});
|
||||
</script>
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,425 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
<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"
|
||||
style="width: 100%"
|
||||
@change="doSearch"
|
||||
value-format="yyyy"
|
||||
placeholder="请选择">
|
||||
</el-date-picker>
|
||||
</div>
|
||||
</div>
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">项目名称:</div>
|
||||
<div class="search-item-option">
|
||||
<el-input placeholder="请输入内容" clearable v-model="pageForm.projectName"
|
||||
@keyup.enter.native="doSearch" style="width:100%"></el-input>
|
||||
</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">
|
||||
<template #func>
|
||||
<el-button type="primary" size="small" icon="el-icon-plus"
|
||||
@click="openAdd">新建惠民项目</el-button>
|
||||
</template>
|
||||
</table-tool>
|
||||
<el-table :data="tableData" style="width: 100%" row-key="id"
|
||||
@sort-change="pageOrder" :size="tableSize"
|
||||
v-loading="tableLoading" ref="table" 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"
|
||||
show-overflow-tooltip
|
||||
:sortable="column.sortable"
|
||||
:label="column.label"
|
||||
:prop="column.prop" :width="column.width" min-width="100px">
|
||||
</el-table-column>
|
||||
<el-table-column prop="userOnline" align="center" header-align="center"
|
||||
label="操作" width="300px">
|
||||
<template scope="{row}">
|
||||
<el-button size="mini" :loading="row.loading" @click="openView(row)">查看</el-button>
|
||||
<el-button size="mini" :loading="row.loading" type="primary" @click="openEdit(row)">编辑</el-button>
|
||||
<el-button size="mini" :loading="row.loading" type="danger" @click="doDelete(row.id)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--#include("/layouts/pagination.html"){}#-->
|
||||
</el-card>
|
||||
</template>
|
||||
|
||||
<template #edit>
|
||||
<el-form :model="formData" ref="form" :rules="formRules" label-width="120px"
|
||||
v-loading="formLoading">
|
||||
<vi-title title="惠民项目信息"></vi-title>
|
||||
|
||||
<el-form-item prop="name" label="项目名称">
|
||||
<el-input v-model="formData.projectName" placeholder="项目名称" maxlength="100"></el-input>
|
||||
</el-form-item>
|
||||
<el-row>
|
||||
<!--<el-col span="12">
|
||||
<el-form-item prop="createTime" label="创建时间">
|
||||
<el-date-picker
|
||||
v-model="formData.createTime"
|
||||
type="datetime"
|
||||
placeholder="选择日期时间">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>-->
|
||||
<el-col span="24">
|
||||
<el-form-item label="货物列表" prop="benefitingExhibits">
|
||||
<el-card class="item" shadow="hover">
|
||||
<div class="s-options-list" style="margin-top: 10px;">
|
||||
<el-table :data="formData.benefitingExhibits" border>
|
||||
<el-table-column
|
||||
align="center"
|
||||
header-align="center"
|
||||
label="排序编号">
|
||||
<template slot-scope="{row}">
|
||||
<el-input v-model="row.sortNum" autosize
|
||||
class="text-input" clearable
|
||||
data-type="option"
|
||||
></el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
align="center"
|
||||
header-align="center"
|
||||
label="货物名称">
|
||||
<template slot-scope="{row}">
|
||||
|
||||
<el-input v-model="row.goodsName" autosize
|
||||
class="text-input" clearable
|
||||
data-type="option"
|
||||
></el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
align="center"
|
||||
header-align="center"
|
||||
label="货物价格">
|
||||
<template slot-scope="{row}">
|
||||
<el-input v-model="row.goodsPrice" autosize
|
||||
class="text-input" clearable
|
||||
data-type="option"
|
||||
></el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column
|
||||
align="center"
|
||||
header-align="center"
|
||||
label="货物类别">
|
||||
<template slot-scope="{row}">
|
||||
<el-select filterable clearable v-model="row.typeId"
|
||||
placeholder="请选择类别">
|
||||
<el-option v-for="item in typeList"
|
||||
:key="item.id"
|
||||
:label="item.typeName"
|
||||
:value="item.id"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column
|
||||
align="center"
|
||||
header-align="center"
|
||||
label="厂商">
|
||||
<template slot-scope="{row}">
|
||||
<el-input v-model="row.manufacturer" autosize
|
||||
class="text-input" clearable
|
||||
data-type="option"
|
||||
></el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column
|
||||
align="center"
|
||||
header-align="center"
|
||||
label="图片" width="130px">
|
||||
<template slot-scope="{row,$index}">
|
||||
<image-Upload ref="imageUpload" :height="100"
|
||||
:width="100" :limit="1"
|
||||
:file-type="['png','jpg']"
|
||||
:file-size="10"
|
||||
v-model="row.imgUrl"></image-Upload>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center"
|
||||
header-align="center"
|
||||
label="详情">
|
||||
<template slot-scope="{row,$index}">
|
||||
<el-link type="primary"
|
||||
@click="openDescRichText(row.description,$index)">
|
||||
货物详情
|
||||
</el-link>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column
|
||||
align="center"
|
||||
header-align="center"
|
||||
label="操作"
|
||||
width="100px">
|
||||
<template slot-scope="{row,$index}">
|
||||
<div class="option-delete">
|
||||
<el-button circle
|
||||
icon="el-icon-delete"
|
||||
size="mini" type="danger"
|
||||
@click="deleteRow(row,$index)"></el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<div class="s-operation">
|
||||
<el-button size="small" type="primary"
|
||||
@click="formData.benefitingExhibits.push({goodsId:'',goodsName:'货物'+(formData.benefitingExhibits.length+1),sortNum:formData.benefitingExhibits.length+1,imgUrl:null})">
|
||||
添加货物
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
</el-form-item>
|
||||
<el-form-item label="项目封面" prop="cover">
|
||||
<image-Upload ref="imageUpload" :height="200"
|
||||
:width="200" :limit="1"
|
||||
:file-type="['png','jpg']"
|
||||
:file-size="10"
|
||||
v-model="formData.cover"></image-Upload>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<el-button @click="doAdd" type="primary" style="float: right">
|
||||
提交
|
||||
</el-button>
|
||||
</template>
|
||||
|
||||
|
||||
<template #view>
|
||||
<el-descriptions :column="6" border class="table_fixed">
|
||||
<el-descriptions-item :span="3" label="项目名称">
|
||||
{{viewData.projectName}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item :span="3" label="选择时间">
|
||||
{{viewData.createTime}}
|
||||
</el-descriptions-item>
|
||||
<template v-for="i in viewData.benefitingExhibits">
|
||||
<el-descriptions-item label="货物名称">
|
||||
{{i.goodsName}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="货物价格">
|
||||
{{i.goodsPrice}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="货物类别">
|
||||
{{i.typeId}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="厂商">
|
||||
{{i.manufacturer}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="货物详情">
|
||||
<span v-html="i.description"></span>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="货物图片">
|
||||
<el-image
|
||||
:src="CREATE_PREVIEW_URL(i.imgUrl)"
|
||||
@click="preview(i.imgUrl,i.imgUrl)"
|
||||
fit="cover"
|
||||
v-if="i.imgUrl"
|
||||
style="width: 100px; height: 100px;"></el-image>
|
||||
<div v-else>暂无</div>
|
||||
</el-descriptions-item>
|
||||
</template>
|
||||
|
||||
</el-descriptions>
|
||||
</template>
|
||||
|
||||
</guava>
|
||||
|
||||
<el-dialog
|
||||
:close-on-click-modal="false"
|
||||
:visible.sync="richTextDialog"
|
||||
title="货物详情"
|
||||
:append-to-body="true"
|
||||
width="60%">
|
||||
<div id="descRichText">
|
||||
</div>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="richTextDialog = false">取 消</el-button>
|
||||
<el-button type="primary" @click="getRichText">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</div>
|
||||
<script>
|
||||
var vue = new Vue({
|
||||
el: '#app',
|
||||
mixins: [initTableMixins],
|
||||
data() {
|
||||
return{
|
||||
pageForm:{
|
||||
year:moment().format('YYYY'),
|
||||
},
|
||||
tableColumns:[
|
||||
{prop: 'year', label: '年度'},
|
||||
{prop: 'projectName', label: '项目名称'},
|
||||
{prop: 'createTime', label: '创建时间'},
|
||||
],
|
||||
formData:{
|
||||
benefitingExhibits:[],
|
||||
},
|
||||
typeList:[],
|
||||
subjectIndex: null,
|
||||
richTextDialog: false,
|
||||
deleteRowIds: [],
|
||||
formRules: {
|
||||
projectName: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
cover: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
benefitingExhibits: [{
|
||||
required: true,
|
||||
message: '必填',
|
||||
trigger: ['blur', 'change']
|
||||
}],
|
||||
},
|
||||
viewData:{},
|
||||
}
|
||||
},
|
||||
methods:{
|
||||
openAdd(){
|
||||
this.formData = {
|
||||
projectName: null,
|
||||
createdTime: null,
|
||||
benefitingExhibits: [
|
||||
{
|
||||
goodsName: '货物1',
|
||||
goodsId: '',
|
||||
typeId: '',
|
||||
goodsPrice: '',
|
||||
manufacturer: '',
|
||||
sortNum: '1',
|
||||
imgUrl: ''
|
||||
}
|
||||
]
|
||||
}
|
||||
if (this.$refs.form) this.$refs.form.resetFields();
|
||||
this.$refs.guava.edit()
|
||||
},
|
||||
async openEdit(row) {
|
||||
this.formData = await this.findOne(row.id)
|
||||
this.$refs.guava.edit()
|
||||
},
|
||||
async openView(row) {
|
||||
this.viewData = await this.findOne(row.id)
|
||||
const self = this;
|
||||
this.viewData.benefitingExhibits.forEach(v=>{
|
||||
const obj = self.typeList.find(o => o.id=v.typeId)
|
||||
v.typeId = obj.typeName;
|
||||
})
|
||||
this.$refs.guava.view()
|
||||
},
|
||||
async findOne(id) {
|
||||
const resp = await $.post(loc() + "/findOne", {id: id})
|
||||
if (resp.code === 0) {
|
||||
return resp.data
|
||||
} else {
|
||||
this.notifyError("查询失败")
|
||||
}
|
||||
},
|
||||
async doDelete(id) {
|
||||
const confirm = await this.$confirm('确定要删除该项目吗?', '提示', {type: 'warning'})
|
||||
if (confirm) {
|
||||
const resp = await $.post(loc() + "/doDelete", {id})
|
||||
if (resp.code === 0) {
|
||||
this.pageData()
|
||||
this.notifySuccess(resp.msg)
|
||||
} else {
|
||||
this.notifyWarning(resp.msg)
|
||||
}
|
||||
}
|
||||
},
|
||||
async doAdd(){
|
||||
const formValid = await this.$refs["form"].validate()
|
||||
if (formValid) {
|
||||
const loading = this.$loading({
|
||||
lock: true,
|
||||
text: '数据保存中请稍后',
|
||||
spinner: 'el-icon-loading',
|
||||
background: 'rgba(0, 0, 0, 0.7)'
|
||||
});
|
||||
const formData = clone(this.formData)
|
||||
formData.benefitingExhibits = JSON.stringify(this.formData.benefitingExhibits)
|
||||
formData.deleteRowIds = JSON.stringify(this.deleteRowIds)
|
||||
const resp = await $.post(loc() + "/doAdd", formData)
|
||||
loading.close()
|
||||
if (resp.code === 0) {
|
||||
this.pageData()
|
||||
this.$refs.guava.index()
|
||||
this.deleteRowIds = []
|
||||
this.notifySuccess(resp.msg)
|
||||
} else {
|
||||
this.notifyWarning(resp.msg)
|
||||
}
|
||||
}
|
||||
},
|
||||
deleteRow(row, index) {
|
||||
this.formData.benefitingExhibits.splice(index, 1)
|
||||
if (row.id) this.deleteRowIds.push(row.id)
|
||||
},
|
||||
openDescRichText(richText, sIdx) {
|
||||
this.richTextDialog = true
|
||||
this.subjectIndex = sIdx
|
||||
this.$nextTick(() => {
|
||||
$("#descRichText").html("")
|
||||
descRichTextEditor = new wangEditor("#descRichText")
|
||||
descRichTextEditor.config.onchange = (html) => {
|
||||
richText = (html ? html : "")
|
||||
}
|
||||
descRichTextEditor.config.uploadImgShowBase64 = true
|
||||
descRichTextEditor.create()
|
||||
if (richText) {
|
||||
descRichTextEditor.txt.html(richText)
|
||||
}
|
||||
})
|
||||
},
|
||||
getRichText() {
|
||||
this.formData.benefitingExhibits[this.subjectIndex].description = descRichTextEditor.txt.html()
|
||||
this.richTextDialog = false
|
||||
},
|
||||
async getAllType(){
|
||||
const resp = await $.get('/platform/benefiting/type/findAllType')
|
||||
if (resp.code === 0){
|
||||
this.typeList = resp.data;
|
||||
}
|
||||
},
|
||||
},
|
||||
async created(){
|
||||
this.pageData();
|
||||
await this.getAllType();
|
||||
},
|
||||
});
|
||||
</script>
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,164 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
<div id="app" v-cloak>
|
||||
<guava ref="guava">
|
||||
<el-card shadow="never">
|
||||
<div class="search">
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">类别名称:</div>
|
||||
<div class="search-item-option">
|
||||
<el-input @keyup.enter.native="doSearch" clearable
|
||||
placeholder="请输入类别名称"
|
||||
style="width: 100%"
|
||||
v-model="pageForm.typeName">
|
||||
</el-input>
|
||||
</div>
|
||||
</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">
|
||||
<table-tool :app="this" label="类别列表">
|
||||
<template #func>
|
||||
<el-button @click="openAdd" size="medium" type="primary">新建类别</el-button>
|
||||
</template>
|
||||
</table-tool>
|
||||
|
||||
<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
|
||||
:label="column.label"
|
||||
:prop="column.prop"
|
||||
:width="column.width"
|
||||
:sortable="column.sortable"
|
||||
align="center"
|
||||
header-align="center"
|
||||
show-overflow-tooltip
|
||||
v-for="column in tableColumns"
|
||||
>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="250px">
|
||||
<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="doDelete(row)" size="mini" type="danger">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--#include("/layouts/pagination.html"){}#-->
|
||||
</el-card>
|
||||
</guava>
|
||||
|
||||
<el-dialog :title="title" :visible.sync="dialogVisible" :close-on-click-modal="false" width="40%">
|
||||
<el-form :model="formData" ref="addForm" :rules="formRules"
|
||||
label-width="100px">
|
||||
<el-form-item label="类别编码" prop="typeCode">
|
||||
<el-input type="text" v-model="formData.typeCode" maxlength="50" placeholder="请填写类别编码"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="排序编号" prop="sortNum">
|
||||
<el-input type="text" v-model="formData.sortNum" maxlength="50" placeholder="请填写排序编号"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="类别名称" prop="typeName">
|
||||
<el-input type="text" v-model="formData.typeName" maxlength="50" placeholder="请填写类别名称"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" :disabled="subDis" @click="operation">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
|
||||
</div>
|
||||
<script>
|
||||
var vue = new Vue({
|
||||
el: '#app',
|
||||
mixins: [initTableMixins],
|
||||
data() {
|
||||
return{
|
||||
pageForm:{},
|
||||
title:'',
|
||||
dialogVisible:false,
|
||||
subDis: false,
|
||||
tableColumns: [
|
||||
{label: '类别编码', prop: 'typeCode', sortable: true},
|
||||
{label: '排序编号', prop: 'sortNum', sortable: true},
|
||||
{label: '类别名称', prop: 'typeName', sortable: true},
|
||||
],
|
||||
formData:{},
|
||||
formRules: {
|
||||
typeName: [{required: true, message: '必选', trigger: ['blur', 'change']}],
|
||||
typeCode: [{required: true, message: '必选', trigger: ['blur', 'change']}],
|
||||
sortNum: [{required: false, message: '必选', trigger: ['blur', 'change']}],
|
||||
},
|
||||
}
|
||||
},
|
||||
methods:{
|
||||
openAdd() {
|
||||
this.title = "添加类别"
|
||||
this.formData = {}
|
||||
this.dialogVisible = true;
|
||||
if (this.$refs['addForm']) {
|
||||
this.$refs['addForm'].resetFields()
|
||||
}
|
||||
},
|
||||
openEdit(data) {
|
||||
this.title = "编辑类别"
|
||||
this.formData = data
|
||||
this.dialogVisible = true;
|
||||
},
|
||||
async operation() {
|
||||
let method = this.formData.id ? "/doEdit" : "/doAdd"
|
||||
this.$refs["addForm"].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() + method, this.formData)
|
||||
|
||||
if(resp.code===0){
|
||||
this.dialogVisible = false
|
||||
this.$notify.success(resp.msg)
|
||||
this.pageData()
|
||||
}else{
|
||||
this.$notify.warning(resp.msg)
|
||||
}
|
||||
loading.close()
|
||||
}
|
||||
});
|
||||
},
|
||||
async doDelete(row) {
|
||||
this.$confirm('确定要删除吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
callback: async (a, b) => {
|
||||
if ("confirm" === a) {
|
||||
const resp = await $.get(loc() + "/doDelete", {id: row.id})
|
||||
if(resp.code===0){
|
||||
this.notifySuccess(resp.msg)
|
||||
this.pageData()
|
||||
}else{
|
||||
this.notifyWarning(resp.msg)
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
},
|
||||
async created(){
|
||||
this.pageData();
|
||||
},
|
||||
});
|
||||
</script>
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,439 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
|
||||
|
||||
<style>
|
||||
.box {
|
||||
width: 500px;
|
||||
height: 100px;
|
||||
margin: 150px auto 0;
|
||||
}
|
||||
|
||||
.inp {
|
||||
width: 300px !important;
|
||||
margin-right: 20px;
|
||||
}
|
||||
|
||||
|
||||
</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-input placeholder="请输入祝福名称" v-model="pageForm.blessingName" clearable>
|
||||
<template slot="prepend">祝福名称</template>
|
||||
</el-input>
|
||||
</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="mt20">
|
||||
|
||||
|
||||
<table-tool label="祝福列表" :app="this">
|
||||
<template #func>
|
||||
<el-button icon="el-icon-s-promotion" type="primary" size="small"
|
||||
@click="openAdd">新建祝福
|
||||
</el-button>
|
||||
</template>
|
||||
</table-tool>
|
||||
|
||||
<el-table :data="tableData" style="width: 100%" row-key="id" @sort-change="pageOrder"
|
||||
ref="table"
|
||||
: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"
|
||||
show-overflow-tooltip
|
||||
:label="column.label"
|
||||
:prop="column.prop"
|
||||
:sortable="column.sortable"
|
||||
>
|
||||
<template v-if="column.prop==='blessingMode'" scope="{row:{blessingMode}}">
|
||||
{{blessingMode=='birthday'?'生日祝福':'其它祝福'}}
|
||||
</template>
|
||||
<template v-else-if="column.prop==='isSend'" scope="{row:{isSend}}">
|
||||
{{isSend=='2'?'任务已完成':isSend=='1'?'进行中':'未开启'}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" header-align="center" label="操作" fixed="right" width="300px">
|
||||
<template scope="{row}">
|
||||
|
||||
<el-button type="primary" @click="openView(row)" size="mini">
|
||||
查看
|
||||
</el-button>
|
||||
<el-button type="primary" @click="openEdit(row)" size="mini" :disabled="row.isSend!=0">
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button type="danger" @click="doDelete(row)" size="mini">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--#include("/layouts/pagination.html"){}#-->
|
||||
|
||||
</el-card>
|
||||
</template>
|
||||
|
||||
<template #edit>
|
||||
<el-form :model="formData" ref="addForm" :rules="formRules" label-width="150px"
|
||||
style="width: 50%;margin: auto">
|
||||
|
||||
<el-row gutter="20">
|
||||
<el-col :span="24">
|
||||
<el-form-item prop="blessingName" label="祝福名称">
|
||||
<el-input v-model="formData.blessingName" style="width: 100%"
|
||||
type="text"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item prop="blessingMode" label="祝福模式">
|
||||
<el-select v-model="formData.blessingMode" placeholder="请选择祝福模式" filterable clearable
|
||||
style="width: 100%">
|
||||
<el-option label="生日祝福(定时发送)" value="birthday"></el-option>
|
||||
<el-option label="其它祝福(即时发送)" value="other"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item prop="activityGroupId" label="发送人员范围">
|
||||
<div style="display: flex; justify-content: space-between">
|
||||
<div style="width: 99%">
|
||||
<el-select @change="changeActivity" clearable filterable placeholder="请选择可报名人员范围"
|
||||
style="width: 99%" v-model="formData.activityGroupId">
|
||||
<el-option :key="item.groupId"
|
||||
:label="item.groupName"
|
||||
:value="item.groupId"
|
||||
v-for="item in activityGroupList"></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
<div>
|
||||
<el-button
|
||||
@click="$refs.drawerUserScope.userScopeDialog = true"
|
||||
type="primary">设置
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
|
||||
<el-col :span="24">
|
||||
<el-form-item label="发送方式" prop="sendTypes">
|
||||
<el-checkbox-group v-model="formData.sendTypes" size="medium">
|
||||
<el-checkbox border label="msg" disabled>短信发送</el-checkbox>
|
||||
<el-checkbox border label="WeChat">微信发送</el-checkbox>
|
||||
</el-checkbox-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24" v-if="formData.blessingMode==='birthday'">
|
||||
<el-form-item label="发送日期和时间" prop="blessingCron">
|
||||
<el-input v-for="a in cronExecuteDate" :value="a" readonly></el-input>
|
||||
<el-button type="primary" @click="showDialog">设置日期和时间</el-button>
|
||||
<sapn style="color: red" v-if="cronExecuteDate.length>2">只展示最近五次执行时间</sapn>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24" v-if="formData.blessingMode==='birthday'">
|
||||
<el-form-item prop="isSend" label="是否启动定时发送">
|
||||
<el-switch
|
||||
v-model="formData.isSend"
|
||||
active-color="#13ce66"
|
||||
active-value="1"
|
||||
inactive-value="0"
|
||||
inactive-color="#ff4949">
|
||||
</el-switch>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item prop="blessingContent" label="祝福内容">
|
||||
<el-input v-model="formData.blessingContent" style="width: 100%"
|
||||
type="textarea" rows="4"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
<el-form-item>
|
||||
<el-row style="float: right">
|
||||
<el-button type="primary" @click="formData.id?doEdit():doAdd()">
|
||||
<span v-if="formData.blessingMode==='birthday'">创建祝福计划</span>
|
||||
<span v-else>发送</span>
|
||||
</el-button>
|
||||
</el-row>
|
||||
</el-form-item>
|
||||
|
||||
</el-form>
|
||||
|
||||
|
||||
</template>
|
||||
|
||||
<template #view>
|
||||
|
||||
<el-form label-suffix=":" label-width="140px" label-position="left" style="width: 50%;margin: auto">
|
||||
|
||||
<el-row gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="祝福名称">
|
||||
<el-input readonly :value="viewData.blessingName"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="发送范围">
|
||||
<el-input readonly :value="viewData.groupName"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="祝福模式">
|
||||
<el-input readonly :value="viewData.blessingMode==='other'?'其它祝福':'生日祝福'"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="是否发送">
|
||||
<el-input readonly
|
||||
:value="viewData.isSend==='0'?'未开启':viewData.isSend==='1'?'进行中':'任务已完成'"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="最近五次执行时间">
|
||||
<el-input readonly v-for="a in viewData.blessingDate" :value="a"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="祝福内容">
|
||||
<el-input style="width: 100%" readonly :value="viewData.blessingContent" rows="4"
|
||||
type="textarea"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
|
||||
</template>
|
||||
</guava>
|
||||
|
||||
<el-dialog title="生成发送日期和时间" :visible.sync="showCron">
|
||||
<vcron :expression="formData.blessingCron"
|
||||
@hide="showCron=false"
|
||||
@fill="crontabFill"
|
||||
ref="cron"></vcron>
|
||||
</el-dialog>
|
||||
|
||||
<drawer-user-scope
|
||||
@group_change="getActivityGroup"
|
||||
ref="drawerUserScope"
|
||||
:group_id.sync="formData.groupId"
|
||||
></drawer-user-scope>
|
||||
|
||||
</div>
|
||||
<script>
|
||||
var vue = new Vue({
|
||||
el: '#app',
|
||||
mixins: [initTableMixins],
|
||||
data() {
|
||||
return {
|
||||
userScopeDialog: false,
|
||||
userDataScopeDialog: false,
|
||||
cronExecuteDate: [],
|
||||
viewData: {},
|
||||
formData: {
|
||||
sendTypes: ['WeChat'],
|
||||
blessingCron: ''
|
||||
},
|
||||
pageForm: {
|
||||
blessingName: ''
|
||||
},
|
||||
activityGroupList: [],
|
||||
dialogVisible: false,
|
||||
tableColumns: [
|
||||
{prop: 'blessingName', label: '祝福名称'},
|
||||
{prop: 'groupName', label: '发送范围'},
|
||||
{prop: 'blessingMode', label: '祝福模式'},
|
||||
{prop: 'sendTypesName', label: '发送方式',},
|
||||
{prop: 'isSend', label: '是否发送',},
|
||||
],
|
||||
formRules: {
|
||||
blessingName: [{required: true, message: '请填写祝福名称', trigger: ['blur', 'change']}],
|
||||
activityGroupId: [{required: true, message: '请选择发送范围', trigger: ['blur', 'change']}],
|
||||
blessingMode: [{required: true, message: '请选择祝福模式', trigger: ['blur', 'change']}],
|
||||
sendTypes: [{required: true, message: '请选择发送方式', trigger: ['blur', 'change']}],
|
||||
blessingContent: [{required: true, message: '请填写祝福内容', trigger: ['blur', 'change']}],
|
||||
},
|
||||
showCron: false,
|
||||
}
|
||||
},
|
||||
components: {
|
||||
"vcron": vcrontab.default,
|
||||
'drawer-user-scope': httpVueLoader('/components/plugins/DrawerUserScope.vue'),
|
||||
},
|
||||
watch: {
|
||||
'formData.activityGroupId': {
|
||||
async handler(newVal, oldVal) {
|
||||
this.activityGroupList = await getActivityGroup()
|
||||
this.userScopeDialog = false
|
||||
},
|
||||
deep: true
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
changeActivity(val) {
|
||||
if (val) {
|
||||
const group = this.activityGroupList.find(v => v.groupId === val)
|
||||
this.$set(this.formData, "activityGroupName", group.groupName)
|
||||
} else {
|
||||
this.$set(this.formData, "activityGroupName", "全部教职工")
|
||||
}
|
||||
},
|
||||
async openView(row) {
|
||||
const {data} = await $.post(loc() + '/findOne', {id: row.id})
|
||||
this.viewData = row
|
||||
this.viewData.blessingDate = data.blessingDate
|
||||
this.$refs.guava.view()
|
||||
|
||||
},
|
||||
async openEdit(row) {
|
||||
|
||||
const {data} = await $.post(loc() + '/findOne', {id: row.id})
|
||||
this.$set(this, "formData", data)
|
||||
this.$refs.guava.edit()
|
||||
if (this.$refs['addForm']) {
|
||||
this.$refs['addForm'].resetFields()
|
||||
}
|
||||
|
||||
},
|
||||
async doDelete(row) {
|
||||
const confirm = await this.$confirm('确定要删除吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
})
|
||||
if (confirm === "confirm") {
|
||||
const data = await $.post('/platform/blessing/applyList/doDelete', {id: row.id})
|
||||
if (data.code == 0) {
|
||||
this.$message.success(data.msg);
|
||||
this.$refs.guava.index()
|
||||
this.doSearch()
|
||||
} else {
|
||||
this.$message.error(data.msg);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
},
|
||||
async doEdit() {
|
||||
this.$refs["addForm"].validate(async valid => {
|
||||
if (valid) {
|
||||
const confirm = await this.$confirm('确定要修改吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
})
|
||||
if (confirm === "confirm") {
|
||||
const data = await $.post(loc() + '/doEdit', {Blessing: JSON.stringify(this.formData)})
|
||||
if (data.code == 0) {
|
||||
this.$message.success(data.msg);
|
||||
this.$refs.guava.index()
|
||||
if (this.$refs['addForm']) {
|
||||
this.$refs['addForm'].resetFields()
|
||||
}
|
||||
this.doSearch()
|
||||
} else {
|
||||
this.$message.error(data.msg);
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
doAdd() {
|
||||
this.$refs["addForm"].validate(async valid => {
|
||||
if (valid) {
|
||||
|
||||
const confirm = await this.$confirm('确定要' + (this.formData.blessingMode === 'birthday' ? '创建祝福计划' : '发送祝福') + '吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
})
|
||||
if (confirm === "confirm") {
|
||||
const data = await $.post(loc() + '/doAdd', {Blessing: JSON.stringify(this.formData)})
|
||||
if (data.code === 0) {
|
||||
this.$message.success(data.msg);
|
||||
window.location.reload();
|
||||
} else {
|
||||
this.$message.error(data.msg);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
async getActivityGroup() {
|
||||
const {data} = await $.get('/platform/activity/basic/scope/getActivityUserScopeGroup')
|
||||
this.activityGroupList = data
|
||||
},
|
||||
openAdd() {
|
||||
this.$refs.guava.edit()
|
||||
this.formData = {
|
||||
isSend: 0,
|
||||
sendTypes: ["WeChat"],
|
||||
blessingCron: ''
|
||||
}
|
||||
},
|
||||
crontabFill(value) {
|
||||
this.$set(this.formData, 'blessingCron', value)
|
||||
this.cronExecuteDate = this.$refs.cron.cronExecuteDate
|
||||
},
|
||||
showDialog() {
|
||||
this.expression = this.input
|
||||
this.showCron = true
|
||||
},
|
||||
pageData() {
|
||||
sublime.showLoadingbar();
|
||||
this.tableLoading = true
|
||||
$.post(loc() + "/pageData", this.pageForm, (data) => {
|
||||
sublime.closeLoadingbar();
|
||||
this.tableLoading = false
|
||||
if (data.code == 0) {
|
||||
data.data.list.forEach(v => {
|
||||
const a = JSON.parse(v.sendTypes).map(z => {
|
||||
if (z == "msg") {
|
||||
return "短信"
|
||||
} else {
|
||||
return "微信"
|
||||
}
|
||||
|
||||
})
|
||||
v.sendTypesName = a.toString()
|
||||
})
|
||||
this.tableData = data.data.list;
|
||||
this.pageForm.totalCount = data.data.totalCount;
|
||||
} else {
|
||||
this.$message.error(data.msg);
|
||||
}
|
||||
}, "json");
|
||||
}
|
||||
},
|
||||
async created() {
|
||||
await this.getActivityGroup()
|
||||
this.pageData()
|
||||
}
|
||||
})
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
|
||||
@@ -0,0 +1,223 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
|
||||
<style>
|
||||
.box {
|
||||
width: 500px;
|
||||
height: 100px;
|
||||
margin: 150px auto 0;
|
||||
}
|
||||
|
||||
.inp {
|
||||
width: 300px !important;
|
||||
margin-right: 20px;
|
||||
}
|
||||
</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-input placeholder="请输入祝福名称" v-model="pageForm.blessingName" clearable>
|
||||
<template slot="prepend">祝福名称</template>
|
||||
</el-input>
|
||||
</div>
|
||||
</div>
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">职工信息:</div>
|
||||
<div class="search-item-option">
|
||||
<el-input placeholder="请输入内容" clearable v-model="pageForm.searchKeyword"
|
||||
style="width: 100%"
|
||||
@keyup.enter.native="doSearch">
|
||||
<el-select v-model="pageForm.searchName" slot="prepend" placeholder="查询类型"
|
||||
style="width: 80px;">
|
||||
<el-option label="姓名" value="username"></el-option>
|
||||
<el-option label="工号" value="loginname"></el-option>
|
||||
</el-select>
|
||||
</el-input>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="search-item"
|
||||
v-if="${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')||@shiro.hasRole('H03')}">
|
||||
<div class="search-item-label">所属工会:</div>
|
||||
<div class="search-item-option">
|
||||
<el-select placeholder="所属工会" v-model="pageForm.unionId" style="width: 100%;"
|
||||
clearable="true"
|
||||
@change="flushUnits" @clear="flushUnits"
|
||||
filterable="true">
|
||||
<el-option v-for="item in unions" :label="item.unionname" :value="item.id"></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">所属单位:</div>
|
||||
<div class="search-item-option">
|
||||
<el-select placeholder="所属单位" v-model="pageForm.unitId" style="width: 100%;"
|
||||
clearable="true"
|
||||
filterable="true">
|
||||
<el-option v-for="item in units" :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-date-picker
|
||||
v-model="pageForm.data"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
placeholder="选择日期"
|
||||
style="width: 100%">
|
||||
</el-date-picker>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<template v-if="searchMore">
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">人员类型:</div>
|
||||
<div class="search-item-option">
|
||||
<dict-select v-model="pageForm.personType" style="width: 100%" clearable
|
||||
placeholder="人员类型"
|
||||
code="UserType"></dict-select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">在职状态:</div>
|
||||
<div class="search-item-option">
|
||||
<dict-select v-model="pageForm.userState" style="width: 100%" clearable
|
||||
placeholder="在职状态"
|
||||
code="UserState"></dict-select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">性  别:</div>
|
||||
<div class="search-item-option">
|
||||
<el-select v-model="pageForm.sex" style="width: 100%" clearable
|
||||
placeholder="请选择">
|
||||
<el-option v-for="sex in sexOptions" :label="sex" :value="sex"></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<div class="search-query">
|
||||
<el-button type="primary" icon="el-icon-search" @click="doSearch">搜索</el-button>
|
||||
|
||||
<more v-model="searchMore"></more>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
<el-card shadow="never" class="mt20">
|
||||
|
||||
|
||||
<table-tool label="用户列表" :app="this">
|
||||
<template #func>
|
||||
|
||||
</template>
|
||||
</table-tool>
|
||||
|
||||
<el-table :data="tableData" style="width: 100%" row-key="id" @sort-change="pageOrder"
|
||||
ref="table"
|
||||
: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"
|
||||
show-overflow-tooltip
|
||||
:label="column.label"
|
||||
:prop="column.prop"
|
||||
:sortable="column.sortable"
|
||||
>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--#include("/layouts/pagination.html"){}#-->
|
||||
|
||||
</el-card>
|
||||
</template>
|
||||
|
||||
</guava>
|
||||
|
||||
|
||||
</div>
|
||||
<script>
|
||||
var vue = new Vue({
|
||||
el: '#app',
|
||||
mixins: [initTableMixins],
|
||||
components: {
|
||||
"vcron": vcrontab.default,
|
||||
'dict-select': httpVueLoader('/components/plugins/DictSelect.vue?v=1.0.0'),
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
pageForm: {
|
||||
data: moment().format('YYYY-MM-DD'),
|
||||
searchName: "username",
|
||||
blessingName: ''
|
||||
},
|
||||
sexOptions: ['男', '女'],
|
||||
unions: [],
|
||||
units: [],
|
||||
activityGroupList: [],
|
||||
dialogVisible: false,
|
||||
tableColumns: [
|
||||
{prop: 'blessingName', label: '祝福名称'},
|
||||
{prop: 'loginname', label: '工号'},
|
||||
{prop: 'username', label: '姓名'},
|
||||
{prop: 'sex', label: '性别'},
|
||||
{prop: 'personType', label: '人员类型', sortable: true},
|
||||
{prop: 'userState', label: '在职状态', sortable: true},
|
||||
{prop: 'unionname', label: '所属工会', sortable: true},
|
||||
{prop: 'unitname', label: '所属单位', sortable: true},
|
||||
{prop: 'birthday', label: '出生日期', sortable: true},
|
||||
{prop: 'applyDate', label: '发送时间', sortable: true},
|
||||
],
|
||||
formRules: {},
|
||||
showCron: false,
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
||||
|
||||
async getActivityGroup() {
|
||||
const {data} = await $.get('/platform/activity/basic/scope/getActivityUserScopeGroup')
|
||||
this.activityGroupList = data
|
||||
},
|
||||
async flushUnits() {
|
||||
this.$set(this.pageForm, "unitId", "")
|
||||
if ("${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')||@shiro.hasRole('H03')}" === 'true') {
|
||||
this.units = await getUnits(this.pageForm.unionId)
|
||||
} else {
|
||||
this.units = await getUnits("${@shiro.getPrincipalProperty('unit').getUnionid()}")
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
async created() {
|
||||
await this.getActivityGroup()
|
||||
this.pageData()
|
||||
this.unions = await getUnions()
|
||||
this.flushUnits()
|
||||
}
|
||||
})
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
|
||||
@@ -0,0 +1,327 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
|
||||
<style>
|
||||
.el-upload__tip {
|
||||
margin-top: 0px;
|
||||
color: #c33714;
|
||||
|
||||
}
|
||||
</style>
|
||||
|
||||
<div id="app">
|
||||
<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 placeholder="请输入礼物名称" v-model="pageForm.giftName" clearable
|
||||
@keyup.enter.native="doSearch">
|
||||
</el-input>
|
||||
</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="mt20">
|
||||
|
||||
<table-tool label="礼物列表" :app="this">
|
||||
<template #func>
|
||||
<el-button icon="el-icon-s-promotion" type="primary" size="small"
|
||||
@click="openAdd">新建礼物
|
||||
</el-button>
|
||||
</template>
|
||||
</table-tool>
|
||||
|
||||
<el-table :data="tableData" style="width: 100%" row-key="id" @sort-change="pageOrder"
|
||||
ref="table"
|
||||
: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"
|
||||
show-overflow-tooltip
|
||||
:label="column.label"
|
||||
:prop="column.prop"
|
||||
:sortable="column.sortable"
|
||||
>
|
||||
<template v-if="column.prop === 'files'" scope="{row}">
|
||||
<el-image v-if="row.files"
|
||||
style="width: 50px; height: 50px"
|
||||
:preview-src-list="srcList"
|
||||
@click="showImage(APP_DOMAIN+FILE_STREAM_PREVIEW_ADDRESS + '?id=' + row.files[0].id)"
|
||||
:src="APP_DOMAIN+FILE_STREAM_PREVIEW_ADDRESS + '?id=' + row.files[0].id">
|
||||
</el-image>
|
||||
<div v-else>暂无</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" header-align="center" label="操作" fixed="right" width="300px">
|
||||
<template scope="scope">
|
||||
<el-button size="mini" @click="openView(scope.row)">查看</el-button>
|
||||
<el-button size="mini" type="primary" @click="openEdit(scope.row)">编辑</el-button>
|
||||
<el-button size="mini" type="danger" @click="doDelete(scope.row)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--#include("/layouts/pagination.html"){}#-->
|
||||
|
||||
</el-card>
|
||||
</template>
|
||||
|
||||
<template #edit>
|
||||
<template>
|
||||
<div v-if="formData.id==null || formData.id==''">
|
||||
<vi-title title="新建礼物信息"></vi-title>
|
||||
</div>
|
||||
<div v-else>
|
||||
<vi-title title="修改礼物信息"></vi-title>
|
||||
</div>
|
||||
</template>
|
||||
<template>
|
||||
<el-form :model="formData" :rules="formRules" label-width="120px" ref="addForm">
|
||||
<el-row gutter="20" type="flex">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="创建人" prop="username">
|
||||
<el-input readonly type="text" v-model="formData.username"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="创建时间" prop="createDate">
|
||||
<el-input readonly type="text" v-model="formData.createDate"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row gutter="20" type="flex">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="礼物名称" prop="giftName">
|
||||
<el-input maxlength="100" placeholder="礼物名称"
|
||||
v-model="formData.giftName"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="显示顺序" prop="sortField">
|
||||
<el-input maxlength="100" placeholder="请输入显示顺序"
|
||||
v-model="formData.sortField"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-form-item label="图片上传" prop="files">
|
||||
<file-upload :files.sync="formData.files" card :max="1"
|
||||
:type="['jpg','jpeg','png','JPG','JPEG','PNG']">
|
||||
</file-upload>
|
||||
<div class="el-upload__tip">请上传一张jpg/png/jpeg等格式,且不大于2M的照片</div>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item>
|
||||
<el-row class="pull-right offscreen-right mt5">
|
||||
<el-button @click="doSubmit" type="primary">提交</el-button>
|
||||
</el-row>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</template>
|
||||
</template>
|
||||
|
||||
<template #view>
|
||||
<div style="margin-left: 100px;margin-right: 100px">
|
||||
<el-descriptions class="margin-top" title="礼物信息" :column="2" size="" border>
|
||||
<el-descriptions-item>
|
||||
<template slot="label">
|
||||
创建人
|
||||
</template>
|
||||
{{viewData.username}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item>
|
||||
<template slot="label">
|
||||
创建时间
|
||||
</template>
|
||||
{{viewData.createDate}}
|
||||
</el-descriptions-item>
|
||||
|
||||
<el-descriptions-item>
|
||||
<template slot="label">
|
||||
礼物名称
|
||||
</template>
|
||||
{{viewData.giftName}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item>
|
||||
<template slot="label">
|
||||
显示顺序
|
||||
</template>
|
||||
{{viewData.sortField}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item>
|
||||
<template slot="label">
|
||||
礼物图片
|
||||
</template>
|
||||
<file-upload :files="viewData.files" view></file-upload>
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
</guava>
|
||||
</div>
|
||||
<script>
|
||||
new Vue({
|
||||
el: '#app',
|
||||
mixins: [initTableMixins],
|
||||
data() {
|
||||
return {
|
||||
srcList: [],
|
||||
tableData: [],
|
||||
viewData: {},
|
||||
formData: {
|
||||
files: '',
|
||||
},
|
||||
pageForm: {
|
||||
giftName: '',
|
||||
},
|
||||
tableColumns: [
|
||||
{prop: 'giftName', label: '礼物名称', sortable: true},
|
||||
{prop: 'files', label: '礼物图片'},
|
||||
{prop: 'username', label: '创建人', sortable: true},
|
||||
{prop: 'createDate', label: '创建时间', sortable: true},
|
||||
{prop: 'sortField', label: '排序字段', sortable: true},
|
||||
],
|
||||
formRules: {
|
||||
username: [{required: true, message: '请填写创建人', trigger: ['blur', 'change']}],
|
||||
createDate: [{required: true, message: '请填写创建时间', trigger: ['blur', 'change']}],
|
||||
giftName: [{required: true, message: '请填写礼物名称', trigger: ['blur', 'change']}],
|
||||
files: [{required: true, message: '请选择图片', trigger: ['blur', 'change']}],
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
showImage(data) {
|
||||
this.srcList = [];
|
||||
this.srcList.push(data)
|
||||
},
|
||||
doSearch() {
|
||||
this.pageData();
|
||||
},
|
||||
openView(data) {
|
||||
if (!(typeof data.files == 'object')) {
|
||||
data.files = JSON.parse(data.files)
|
||||
}
|
||||
this.viewData = data
|
||||
this.$refs.guava.view()
|
||||
},
|
||||
openAdd() {
|
||||
this.reset();
|
||||
this.$refs.guava.edit()
|
||||
},
|
||||
openEdit(data) {
|
||||
if (this.$refs["addForm"]) {
|
||||
this.$refs["addForm"].resetFields()
|
||||
}
|
||||
if (!(typeof data.files == 'object')) {
|
||||
data.files = JSON.parse(data.files)
|
||||
}
|
||||
this.formData = data
|
||||
this.$refs.guava.edit()
|
||||
},
|
||||
async doDelete(row) {
|
||||
const confirm = await this.$confirm('确定要删除吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
})
|
||||
if (confirm === "confirm") {
|
||||
const data = await $.post('/platform/blessing/giftList/doDelete', {id: row.id})
|
||||
if (data.code === 0) {
|
||||
this.$message.success(data.msg);
|
||||
|
||||
this.doSearch()
|
||||
} else {
|
||||
this.$message.error(data.msg);
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
async doSubmit() {
|
||||
const valid = await this.$refs["addForm"].validate()
|
||||
if (valid) {
|
||||
const confirm = await this.$confirm('确定提交?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'info',
|
||||
})
|
||||
if ("confirm" === confirm) {
|
||||
let data = clone(this.formData)
|
||||
if (data.files) {
|
||||
data.files = JSON.stringify(data.files)
|
||||
}
|
||||
const resp = await $.post(loc() + '/doSubmit', data)
|
||||
if (resp.code === 0) {
|
||||
this.pageData()
|
||||
this.reset();
|
||||
this.$refs.guava.index();
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
pageData() {
|
||||
sublime.showLoadingbar();
|
||||
this.tableLoading = true
|
||||
$.post(loc() + "/pageData", this.pageForm, (data) => {
|
||||
sublime.closeLoadingbar();
|
||||
this.tableLoading = false
|
||||
if (data.code === 0) {
|
||||
data.data.list.forEach(v => {
|
||||
if (!(typeof v.files == 'object')) {
|
||||
v.files = JSON.parse(v.files)
|
||||
}
|
||||
})
|
||||
this.tableData = data.data.list;
|
||||
this.pageForm.totalCount = data.data.totalCount;
|
||||
} else {
|
||||
this.$message.error(data.msg);
|
||||
}
|
||||
}, "json");
|
||||
},
|
||||
initData() {
|
||||
this.formData = {
|
||||
username: '${@shiro.getPrincipalProperty("username")}',
|
||||
createBy: '${@shiro.getPrincipalProperty("id")}',
|
||||
createDate: moment().format('YYYY-MM-DD HH:mm:ss'),
|
||||
}
|
||||
},
|
||||
reset() {
|
||||
this.formData = {
|
||||
id: '',
|
||||
username: '${@shiro.getPrincipalProperty("username")}',
|
||||
createBy: '${@shiro.getPrincipalProperty("id")}',
|
||||
createDate: moment().format('YYYY-MM-DD HH:mm:ss'),
|
||||
files: '',
|
||||
sortField: '',
|
||||
fileName: '',
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.showImage();
|
||||
this.pageData();
|
||||
this.initData();
|
||||
},
|
||||
components: {
|
||||
'guava': httpVueLoader('/components/plugins/Guava.vue?v=1.0.0'),
|
||||
'file-upload': httpVueLoader('/components/plugins/FileUpload.vue'),
|
||||
},
|
||||
})
|
||||
</script>
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
|
||||
@@ -0,0 +1,526 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
<style>
|
||||
.el-collapse-item__arrow {
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
.top_block {
|
||||
width: 100%;
|
||||
padding: 30px 80px;
|
||||
}
|
||||
|
||||
.tr {
|
||||
text-align: right;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.tl {
|
||||
text-align: left;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.top_title {
|
||||
font-size: 14px;
|
||||
color: #808492;
|
||||
}
|
||||
|
||||
.fs18 {
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
.fs26 {
|
||||
font-size: 26px;
|
||||
}
|
||||
|
||||
.fs20 {
|
||||
font-size: 20px;
|
||||
}
|
||||
|
||||
.title {
|
||||
font-size: 18px;
|
||||
height: 36px;
|
||||
line-height: 36px;
|
||||
}
|
||||
|
||||
.none-data {
|
||||
min-height: 300px;
|
||||
background: url("/none.png") no-repeat center center;
|
||||
background-size: 360px 260px;
|
||||
}
|
||||
|
||||
.none-data-title {
|
||||
position: absolute;
|
||||
display: block;
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
bottom: 20%;
|
||||
left: 0;
|
||||
color: rgb(160, 160, 160);
|
||||
}
|
||||
|
||||
.item-title {
|
||||
color: rgb(160, 160, 160);
|
||||
}
|
||||
|
||||
.item-content {
|
||||
color: rgb(100, 100, 100);
|
||||
}
|
||||
|
||||
.mb20 {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.item-type {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
text-align: center;
|
||||
height: 100px;
|
||||
line-height: 100px;
|
||||
}
|
||||
|
||||
.el-collapse, .el-collapse-item__header, .el-collapse-item__wrap {
|
||||
border: none;
|
||||
}
|
||||
|
||||
.el-collapse-item__content {
|
||||
padding-bottom: 0;
|
||||
}
|
||||
|
||||
.status {
|
||||
text-align: center;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
margin: auto;
|
||||
height: 90px;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.status-icon {
|
||||
width: 60px;
|
||||
height: 60px;
|
||||
}
|
||||
|
||||
.status-name {
|
||||
height: 30px;
|
||||
line-height: 30px;
|
||||
font-size: 12px;
|
||||
color: rgb(180, 180, 180);
|
||||
}
|
||||
|
||||
.chartTitle {
|
||||
font-size: 14px;
|
||||
color: #808492;
|
||||
margin: 20px 0;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div id="app" v-cloak>
|
||||
<div class="p10">
|
||||
<el-card shadow="never">
|
||||
<el-row style="border-bottom: 10px solid rgb(240,240,240);padding: 20px;">
|
||||
<template v-if="hasChangeUserRole=='true'">
|
||||
<div class="btn-group tool-button">
|
||||
<span style="font-weight: bold">查找用户:</span>
|
||||
</div>
|
||||
<div class="btn-group tool-button">
|
||||
<el-select
|
||||
style="width: 300px"
|
||||
v-model="userid"
|
||||
filterable
|
||||
remote
|
||||
reserve-keyword
|
||||
placeholder="请输入姓名或工号进行查询"
|
||||
:remote-method="remoteMethod"
|
||||
:loading="search_user_loading" @change="userChange">
|
||||
<el-option
|
||||
v-for="item in userOptions"
|
||||
:key="item.id"
|
||||
:label="item.username+'('+item.loginname+')'"
|
||||
:value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
</template>
|
||||
<!-- <div class="btn-group tool-button">-->
|
||||
<!-- <el-date-picker-->
|
||||
<!-- @change="queryAll"-->
|
||||
<!-- v-model="dateRange"-->
|
||||
<!-- type="daterange"-->
|
||||
<!-- value-format="yyyy-MM-dd"-->
|
||||
<!-- range-separator="至"-->
|
||||
<!-- start-placeholder="开始日期"-->
|
||||
<!-- end-placeholder="结束日期">-->
|
||||
<!-- </el-date-picker>-->
|
||||
<!-- <!– <el-button type="primary" @click="" icon="el-icon-search"></el-button>–>-->
|
||||
<!-- </div>-->
|
||||
<div class="pull-right offscreen-right mt5">
|
||||
<div class="btn-group tool-button mt5">
|
||||
<span style="font-weight: bold">{{user.sex?user.sex:''}}{{user.unitname?' / '+user.unitname:''}} {{user.unionname?' / '+user.unionname:''}}</span>
|
||||
</div>
|
||||
</div>
|
||||
</el-row>
|
||||
<div class="top_block" style="border-bottom: 10px solid rgb(240,240,240);" v-loading="top_block_loading">
|
||||
<el-row style="height: 40px">
|
||||
<el-col offset="4" class="tr" :span="3">
|
||||
<span class="top_title">职工慰问申请数</span>
|
||||
</el-col>
|
||||
<el-col :span="3" class="tr">
|
||||
<span class="top_title">困难帮扶申请数</span>
|
||||
</el-col>
|
||||
<!-- <el-col :span="3" class="tr">-->
|
||||
<!-- <span class="top_title">子女入学登记数</span>-->
|
||||
<!-- </el-col>-->
|
||||
<el-col :span="3" class="tr">
|
||||
<span class="top_title">撰写提案数</span>
|
||||
</el-col>
|
||||
<el-col :span="3" class="tr">
|
||||
<span class="top_title">参与活动数</span>
|
||||
</el-col>
|
||||
<el-col :span="3" class="tr">
|
||||
<span class="top_title">经费报销次数</span>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
|
||||
<el-row style="height: 60px;line-height: 60px">
|
||||
<el-col class="tl" :span="4">
|
||||
<span class="top_title">今年</span>
|
||||
</el-col>
|
||||
<el-col class="tr" :span="3">
|
||||
<span class="fs26" style="color: #409EFF;">{{numData.now_year.zgww?numData.now_year.zgww:0}}</span>
|
||||
</el-col>
|
||||
<el-col class="tr" :span="3">
|
||||
<span class="fs26" style="color: #409EFF;">{{numData.now_year.knbf?numData.now_year.knbf:0}}</span>
|
||||
</el-col>
|
||||
<!-- <el-col class="tr" :span="3">-->
|
||||
<!-- <span class="fs26" style="color: #409EFF;">{{numData.now_year.znrx?numData.now_year.znrx:0}}</span>-->
|
||||
<!-- </el-col>-->
|
||||
<el-col class="tr" :span="3">
|
||||
<span class="fs26" style="color: #409EFF;">{{numData.now_year.ta?numData.now_year.ta:0}}</span>
|
||||
</el-col>
|
||||
<el-col class="tr" :span="3">
|
||||
<span class="fs26" style="color: #409EFF;">{{numData.now_year.hd?numData.now_year.hd:0}}</span>
|
||||
</el-col>
|
||||
<el-col class="tr" :span="3">
|
||||
<span class="fs26" style="color: #409EFF;">{{numData.now_year.jfbx?numData.now_year.jfbx:0}}</span>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row style="height: 40px;line-height: 40px">
|
||||
<el-col class="tl" :span="4">
|
||||
<span class="top_title">全部</span>
|
||||
</el-col>
|
||||
<el-col class="tr" :span="3">
|
||||
<span class="fs18">{{numData.all.zgww?numData.all.zgww:0}}</span>
|
||||
</el-col>
|
||||
<el-col class="tr" :span="3">
|
||||
<span class="fs18">{{numData.all.knbf?numData.all.knbf:0}}</span>
|
||||
</el-col>
|
||||
<el-col class="tr" :span="3">
|
||||
<span class="fs18">{{numData.all.znrx?numData.all.znrx:0}}</span>
|
||||
</el-col>
|
||||
<el-col class="tr" :span="3">
|
||||
<span class="fs18">{{numData.all.ta?numData.all.ta:0}}</span>
|
||||
</el-col>
|
||||
<el-col class="tr" :span="3">
|
||||
<span class="fs18">{{numData.all.hd?numData.all.hd:0}}</span>
|
||||
</el-col>
|
||||
<el-col class="tr" :span="3">
|
||||
<span class="fs18">{{numData.all.jfbx?numData.all.jfbx:0}}</span>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
|
||||
<el-row style="height: 500px;border-bottom: 10px solid rgb(240,240,240);padding: 20px 30px;padding-top: 10px;"
|
||||
v-loading="chart_one_loading">
|
||||
<div style="position: absolute;top: 25px;right: 40px;z-index: 999">
|
||||
<el-date-picker
|
||||
class="year"
|
||||
style="width: 120px;"
|
||||
size="mini"
|
||||
v-model="numYear.startYear"
|
||||
type="year" :clearable="false"
|
||||
value-format="yyyy"
|
||||
@change="if(numYear.endYear){getNumByYear();}"
|
||||
placeholder="选择年">
|
||||
</el-date-picker>
|
||||
-
|
||||
<el-date-picker
|
||||
class="year"
|
||||
style="width: 120px;"
|
||||
size="mini"
|
||||
v-model="numYear.endYear"
|
||||
type="year" :clearable="false"
|
||||
value-format="yyyy"
|
||||
@change="if(numYear.startYear){getNumByYear();}"
|
||||
placeholder="选择年">
|
||||
</el-date-picker>
|
||||
</div>
|
||||
<div class="chartTitle">职工动态曲线</div>
|
||||
<div id="chart_one" style="width: 100%;height:85%;margin-top: 40px"></div>
|
||||
</el-row>
|
||||
|
||||
|
||||
<el-card class="box-card">
|
||||
<div slot="header" class="clearfix" style="position: relative">
|
||||
<span class="title">职工动态时间线</span>
|
||||
<el-select v-model="type" @change="timeLine" placeholder="请选择" style="float: right; padding: 0;">
|
||||
<el-option v-for="(v,k) in typeObj" :key="k" :label="v.name" :value="k"></el-option>
|
||||
</el-select>
|
||||
<div style="float: right; padding: 0;margin-right: 10px">
|
||||
<el-date-picker
|
||||
@change="timeLine"
|
||||
v-model="dateRange"
|
||||
type="daterange"
|
||||
value-format="yyyy-MM-dd"
|
||||
range-separator="-"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期">
|
||||
</el-date-picker>
|
||||
</div>
|
||||
</div>
|
||||
<div class="text item" v-loading="timeline_loading">
|
||||
<el-timeline v-if="list.length">
|
||||
<el-timeline-item v-for="item in list" :color="typeObj[item.type]['color']"
|
||||
:timestamp="item.time"
|
||||
placement="top">
|
||||
<el-card shadow="hover">
|
||||
<el-collapse>
|
||||
<el-collapse-item name="1">
|
||||
<template slot="title">
|
||||
<div :style="'color:'+ typeObj[item.type].color">
|
||||
<i :class="typeObj[item.type].icon"></i> {{typeObj[item.type].name}}
|
||||
</div>
|
||||
</template>
|
||||
</el-collapse-item>
|
||||
</el-collapse>
|
||||
</el-card>
|
||||
</el-timeline-item>
|
||||
</el-timeline>
|
||||
|
||||
<el-row v-else class="none-data">
|
||||
<span class="none-data-title">暂无数据</span>
|
||||
</el-row>
|
||||
</div>
|
||||
</el-card>
|
||||
</el-card>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
var vue = new Vue({
|
||||
el: '#app',
|
||||
data: () => {
|
||||
return {
|
||||
hasChangeUserRole: "${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')||@shiro.hasRole('H04')}",
|
||||
dateRange: [],
|
||||
type: 'all',
|
||||
chart_one_loading: false,
|
||||
top_block_loading: false,
|
||||
search_user_loading: false,
|
||||
timeline_loading: false,
|
||||
userid: '',
|
||||
yearnum: 10,
|
||||
typeObj: {
|
||||
all: {
|
||||
name: '全部',
|
||||
color: ''
|
||||
},
|
||||
zgww: {
|
||||
name: '职工慰问',
|
||||
color: '#5B8FF9',
|
||||
icon: 'fa fa-bed'
|
||||
},
|
||||
knbf: {
|
||||
name: '困难帮扶',
|
||||
color: '#5AD8A6',
|
||||
icon: 'fa fa-handshake-o'
|
||||
},
|
||||
znrx: {
|
||||
name: '子女入学',
|
||||
color: '#F6BD16',
|
||||
icon: 'fa fa-graduation-cap'
|
||||
},
|
||||
ta: {
|
||||
name: '撰写提案',
|
||||
color: "#E8684A",
|
||||
icon: 'fa fa-lightbulb-o'
|
||||
},
|
||||
xhd: {
|
||||
name: '校工会活动',
|
||||
color: "#6DC8EC",
|
||||
icon: 'el-icon-basketball'
|
||||
},
|
||||
fhhd: {
|
||||
name: '分工会活动',
|
||||
color: "#6DC8EC",
|
||||
icon: 'el-icon-basketball'
|
||||
},
|
||||
sthd: {
|
||||
name: '社团活动',
|
||||
color: "#6DC8EC",
|
||||
icon: 'el-icon-basketball'
|
||||
},
|
||||
yybx: {
|
||||
name: '经费报销',
|
||||
color: "#9270CA",
|
||||
icon: 'fa fa-money'
|
||||
},
|
||||
},
|
||||
numData: {
|
||||
now_year: {},
|
||||
all: {},
|
||||
},
|
||||
userOptions: [],
|
||||
user: {},
|
||||
list: [],
|
||||
desc: true,
|
||||
numYear: {
|
||||
startYear: new Date().getFullYear() - 9 + '',
|
||||
endYear: new Date().getFullYear() + '',
|
||||
},
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
timeLine() {
|
||||
this.timeline_loading = true
|
||||
$.post("/platform/caredata/staff/timeLine", {
|
||||
userid: this.userid,
|
||||
type: this.type,
|
||||
desc: this.desc,
|
||||
startTime: this.dateRange && this.dateRange.length ? this.dateRange[0] : '',
|
||||
endTime: this.dateRange && this.dateRange.length ? this.dateRange[1] : '',
|
||||
}, (res) => {
|
||||
if (res.code == 0) {
|
||||
let {data} = res
|
||||
this.list = data
|
||||
}
|
||||
this.timeline_loading = false
|
||||
}, "json");
|
||||
},
|
||||
userChange(id) {
|
||||
this.queryAll()
|
||||
this.user = this.userOptions.find(v => v.id == id)
|
||||
},
|
||||
queryAll() {
|
||||
this.getNumByYear()
|
||||
this.getYearNumAndAllNum()
|
||||
this.timeLine()
|
||||
},
|
||||
remoteMethod(str) {
|
||||
this.search_user_loading = true
|
||||
$.get("/platform/caredata/staff/queryUser", {
|
||||
key: str,
|
||||
}, (res) => {
|
||||
if (res.code == 0) {
|
||||
let {list} = res.data
|
||||
this.userOptions = list
|
||||
}
|
||||
this.search_user_loading = false
|
||||
}, "json");
|
||||
},
|
||||
getNumByYear() {
|
||||
this.chart_one_loading = true
|
||||
|
||||
let container = document.getElementById('chart_one');
|
||||
container.innerHTML = ''
|
||||
|
||||
const config = {
|
||||
"title": {
|
||||
"visible": true,
|
||||
"text": "职工动态曲线"
|
||||
},
|
||||
"description": {
|
||||
"visible": true,
|
||||
"text": "单位(条)"
|
||||
},
|
||||
"legend": {
|
||||
"position": "top-right",
|
||||
"flipPage": false
|
||||
},
|
||||
"point": {
|
||||
"visible": true
|
||||
},
|
||||
"smooth": true,
|
||||
"forceFit": false,
|
||||
"width": $('#chart_one').width(),
|
||||
"height": $('#chart_one').height(),
|
||||
"xField": "year",
|
||||
"yField": "value",
|
||||
"stackField": "type",
|
||||
|
||||
}
|
||||
let plot
|
||||
|
||||
if (this.userid) {
|
||||
$.post("/platform/caredata/staff/getNumByYear", {
|
||||
userid: this.userid,
|
||||
yearnum: this.yearnum,
|
||||
startYear: this.numYear.startYear,
|
||||
endYear: this.numYear.endYear,
|
||||
}, (res) => {
|
||||
if (res.code == 0) {
|
||||
let {data} = res
|
||||
|
||||
plot = new G2Plot.Area(container, {
|
||||
data,
|
||||
...config,
|
||||
});
|
||||
|
||||
plot.render();
|
||||
|
||||
this.chart_one_loading = false
|
||||
}
|
||||
}, "json");
|
||||
} else {
|
||||
let data = []
|
||||
let year = new Date().getFullYear()
|
||||
for (let i = year - this.yearnum + 1; i <= year; i++) {
|
||||
for (let k in this.typeObj) {
|
||||
data.push({
|
||||
type: this.typeObj[k]['name'],
|
||||
value: 0,
|
||||
year: i
|
||||
})
|
||||
}
|
||||
}
|
||||
plot = new G2Plot.StackArea(container, {data, ...config,});
|
||||
plot.render();
|
||||
this.chart_one_loading = false
|
||||
}
|
||||
},
|
||||
getYearNumAndAllNum() {
|
||||
this.top_block_loading = true
|
||||
$.post("/platform/caredata/staff/getYearNumAndAllNum", {
|
||||
userid: this.userid,
|
||||
}, (res) => {
|
||||
if (res.code == 0) {
|
||||
let {data} = res
|
||||
this.numData = data
|
||||
}
|
||||
this.top_block_loading = false
|
||||
}, "json");
|
||||
},
|
||||
},
|
||||
created: function () {
|
||||
$.get("/platform/caredata/staff/initUser", (res) => {
|
||||
if (res.code == 0) {
|
||||
this.userOptions = [res.data]
|
||||
this.userid = this.userOptions[0].id
|
||||
this.userChange(this.userOptions[0].id)
|
||||
}
|
||||
}, "json");
|
||||
},
|
||||
mounted: function () {
|
||||
|
||||
}
|
||||
})
|
||||
</script>
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,266 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
|
||||
|
||||
<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="选择年" @change="doSearch">
|
||||
</el-date-picker>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
|
||||
<el-card shadow="never" class="mt20">
|
||||
|
||||
|
||||
<table-tool label="计划列表" :app="this">
|
||||
<template #func>
|
||||
<el-button icon="el-icon-s-promotion" type="primary" size="small"
|
||||
@click="openAdd">新建计划
|
||||
</el-button>
|
||||
</template>
|
||||
</table-tool>
|
||||
|
||||
<el-table :data="tableData" style="width: 100%" row-key="id"
|
||||
@sort-change="pageOrder"
|
||||
v-loading="tableLoading" ref="table"
|
||||
:size="tableSize" class="vi-table">
|
||||
|
||||
<el-table-column align="center" header-align="center" width="80px" label="序号"
|
||||
type="index">
|
||||
<template scope="scope">
|
||||
<span>{{scope.$index+(pageForm.pageNumber - 1) * pageForm.pageSize + 1}} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column
|
||||
align="center"
|
||||
header-align="center"
|
||||
v-for="column in tableColumns"
|
||||
show-overflow-tooltip
|
||||
:label="column.label"
|
||||
:prop="column.prop"
|
||||
:sortable="column.sortable"
|
||||
>
|
||||
<template v-if="column.prop=='planDateTime'" scope="{row}">
|
||||
{{row.startDateTime}}-{{row.endDateTime}}
|
||||
</template>
|
||||
<template v-else-if="column.prop=='planType'" scope="{row}">
|
||||
{{row.planType===1?'保育费':'其它'}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column prop="userOnline" align="center" header-align="center"
|
||||
label="操作"
|
||||
width="300px">
|
||||
<template slot-scope="{row}">
|
||||
<el-button size="mini" @click="openView(row)">
|
||||
查看
|
||||
</el-button>
|
||||
<el-button size="mini" type="primary" @click="openEdit(row)">
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button size="mini" type="danger" @click="doDelete(row.id)">
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--#include("/layouts/pagination.html"){}#-->
|
||||
|
||||
</el-card>
|
||||
|
||||
|
||||
</template>
|
||||
|
||||
|
||||
<el-dialog
|
||||
title="计划信息"
|
||||
:close-on-click-modal="false"
|
||||
:visible.sync="dialogVisible"
|
||||
width="40%">
|
||||
|
||||
<el-form :model="formData" ref="form" :rules="formRules" label-width="110px">
|
||||
<el-row gutter="60">
|
||||
|
||||
<el-col :span="24">
|
||||
<el-form-item label="年度" prop="year">
|
||||
<el-date-picker
|
||||
:disabled="formData.isView"
|
||||
v-model="formData.year"
|
||||
type="year"
|
||||
value-format="yyyy" style="width: 100%"
|
||||
placeholder="选择年" @change="yearChange">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="24">
|
||||
<el-form-item label="计划名称" prop="planName">
|
||||
<el-input maxlength="100" placeholder="计划名称"
|
||||
:disabled="formData.isView"
|
||||
v-model="formData.planName" style="width: 100%;"
|
||||
auto-complete="off" tabindex="4" type="text"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="24">
|
||||
<el-form-item label="计划类型" prop="planType">
|
||||
<el-radio v-model="formData.planType" :label="1"
|
||||
:disabled="formData.isView"
|
||||
style="margin-right: 60px;" border>保育费
|
||||
</el-radio>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="24">
|
||||
<el-form-item label="计划报销对象" prop="sex">
|
||||
<el-radio v-model="formData.sex" label="男" style="margin-right: 60px;"
|
||||
:disabled="formData.isView"
|
||||
border>男
|
||||
</el-radio>
|
||||
<el-radio v-model="formData.sex" label="女" style="margin-right: 60px;"
|
||||
:disabled="formData.isView"
|
||||
border>女
|
||||
</el-radio>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="24">
|
||||
<el-form-item label="计划报销时间" prop="planDateTime">
|
||||
<el-date-picker
|
||||
:disabled="formData.isView"
|
||||
v-model="formData.planDateTime"
|
||||
type="datetimerange"
|
||||
value-format="yyyy-MM-dd HH:mm:ss"
|
||||
range-separator="至"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
</el-form>
|
||||
|
||||
<span slot="footer" class="dialog-footer" >
|
||||
<el-button type="primary" plain @click="dialogVisible=false">关闭</el-button>
|
||||
<el-button type="primary" @click="doSubmit" v-if="!formData.isView">提交</el-button>
|
||||
</span>
|
||||
|
||||
</el-dialog>
|
||||
|
||||
|
||||
</guava>
|
||||
</div>
|
||||
|
||||
|
||||
<script>
|
||||
var vue = new Vue({
|
||||
el: '#app',
|
||||
mixins: [initTableMixins],
|
||||
data() {
|
||||
return {
|
||||
pageForm: {
|
||||
year: moment().format('YYYY')
|
||||
},
|
||||
dialogVisible: false,
|
||||
tableColumns: [
|
||||
{prop: 'year', label: '计划年度'},
|
||||
{prop: 'planName', label: '计划名称'},
|
||||
{prop: 'planType', label: '计划类型'},
|
||||
{prop: 'sex', label: '计划报销对象'},
|
||||
{prop: 'planDateTime', label: '计划报销时间'},
|
||||
{prop: 'createDateTime', label: '计划创建时间', sortable: true},
|
||||
],
|
||||
formRules: {
|
||||
sex: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
year: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
planName: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
planType: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
planDateTime: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
},
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
yearChange(val) {
|
||||
this.$set(this.formData, "sex", val % 2 === 0 ? "男" : "女")
|
||||
},
|
||||
async doDelete(id) {
|
||||
const confirm = await this.$confirm('您确定要删除吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
})
|
||||
if (confirm === 'confirm') {
|
||||
const resp = await $.post(loc() + '/doDelete', {id: id})
|
||||
if (resp.code === 0) {
|
||||
this.notifySuccess(resp.msg)
|
||||
this.doSearch()
|
||||
}
|
||||
}
|
||||
},
|
||||
openEdit(row) {
|
||||
row.isView = false
|
||||
row.year = row.year + ""
|
||||
row.planDateTime = [row.startDateTime, row.endDateTime]
|
||||
this.formData = row
|
||||
this.dialogVisible = true
|
||||
},
|
||||
openView(row) {
|
||||
row.isView = true
|
||||
row.year = row.year + ""
|
||||
row.planDateTime = [row.startDateTime, row.endDateTime]
|
||||
this.formData = row
|
||||
this.dialogVisible = true
|
||||
},
|
||||
openAdd() {
|
||||
this.formData={}
|
||||
this.$set(this.formData, "year", moment().format('YYYY'))
|
||||
this.yearChange(moment().format('YYYY'))
|
||||
this.dialogVisible = true
|
||||
if (this.$refs["form"])
|
||||
this.$refs["form"].resetFields();
|
||||
},
|
||||
doSubmit() {
|
||||
this.$refs["form"].validate(async (valid) => {
|
||||
if (valid) {
|
||||
const formData = clone(this.formData)
|
||||
formData.startDateTime = formData.planDateTime[0]
|
||||
formData.endDateTime = formData.planDateTime[1]
|
||||
const refs = await $.post(loc() + "/doSubmit", formData)
|
||||
if (refs.code === 0) {
|
||||
this.doSearch()
|
||||
this.dialogVisible = false
|
||||
this.notifySuccess(refs.msg);
|
||||
} else {
|
||||
this.notifyWarning(refs.msg)
|
||||
}
|
||||
|
||||
}
|
||||
})
|
||||
},
|
||||
},
|
||||
async created() {
|
||||
this.pageData()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,493 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
|
||||
|
||||
<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
|
||||
@change="doSearch();getPlan()"
|
||||
placeholder="选择年"
|
||||
style="width: 100%" type="year"
|
||||
v-model="pageForm.year" value-format="yyyy">
|
||||
</el-date-picker>
|
||||
</div>
|
||||
</div>
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">所属工会:</div>
|
||||
<div class="search-item-option">
|
||||
<el-select clearable filterable
|
||||
placeholder="所属工会"
|
||||
style="width: 100%;"
|
||||
v-model="pageForm.unionId">
|
||||
<el-option :label="item.unionname" :value="item.id"
|
||||
v-for="item in unions"></el-option>
|
||||
</el-select>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">计划列表:</div>
|
||||
<div class="search-item-option">
|
||||
<el-select clearable placeholder="请选择计划" v-model="pageForm.planId">
|
||||
<el-option
|
||||
|
||||
:key="item.id"
|
||||
:label="item.planName"
|
||||
:value="item.id"
|
||||
v-for="item in planOptions">
|
||||
</el-option>
|
||||
</el-select>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="search-query">
|
||||
<el-button @click="doSearch" icon="el-icon-search" type="primary">搜索
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
|
||||
<el-card class="mt20" shadow="never">
|
||||
<table-tool :app="this" label="审核列表">
|
||||
<template #func>
|
||||
<el-button @click="exportXlsx" size="small"
|
||||
type="primary">导出分工会汇总表
|
||||
</el-button>
|
||||
<el-button @click="doExport" size="small"
|
||||
type="primary">导出人员汇总名单
|
||||
</el-button>
|
||||
</template>
|
||||
</table-tool>
|
||||
|
||||
<el-table :data="tableData" :size="tableSize" :summary-method="getSummaries"
|
||||
@sort-change="pageOrder"
|
||||
class="vi-table"
|
||||
ref="table"
|
||||
row-key="id" show-summary
|
||||
style="width: 100%" v-loading="tableLoading">
|
||||
|
||||
<el-table-column align="center" header-align="center" label="序号" type="index"
|
||||
width="80px">
|
||||
<template scope="scope">
|
||||
<span>{{scope.$index+(pageForm.pageNumber - 1) * pageForm.pageSize + 1}} </span>
|
||||
</template>
|
||||
</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 tableColumns"
|
||||
>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column align="center" header-align="center" label="操作"
|
||||
prop="userOnline"
|
||||
width="300px">
|
||||
<template slot-scope="{row}">
|
||||
<el-button @click="openView(row)" size="mini" type="primary">
|
||||
查看
|
||||
</el-button>
|
||||
<el-button @click="exportByUnion(row)" size="small" type="primary">
|
||||
导出
|
||||
</el-button>
|
||||
<!-- <el-button size="mini" type="primary" @click="openEdit(row)"
|
||||
:disabled="row.userFalseNum==0">
|
||||
审核
|
||||
</el-button>
|
||||
<el-button size="mini" type="primary" @click="openSubmit(row)"
|
||||
v-if="row.userFalseNum==0&&row.submitNum!=0">
|
||||
提交
|
||||
</el-button>-->
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
|
||||
</el-card>
|
||||
|
||||
|
||||
</template>
|
||||
|
||||
<el-drawer
|
||||
:append-to-body="true" :visible.sync="userDrawer"
|
||||
:with-header="false"
|
||||
size="78%"
|
||||
title="">
|
||||
|
||||
<template>
|
||||
<info ref="info"></info>
|
||||
</template>
|
||||
|
||||
</el-drawer>
|
||||
|
||||
<el-drawer
|
||||
:append-to-body="true"
|
||||
:before-close="handleClose" :visible.sync="doSubmitDrawer"
|
||||
:with-header="false"
|
||||
size="50%"
|
||||
title="">
|
||||
|
||||
<template>
|
||||
<el-form :model="formData" :rules="formRules" label-position="right"
|
||||
label-width="120px"
|
||||
ref="form"
|
||||
style="padding: 20px 0">
|
||||
<vi-title title="提交信息"></vi-title>
|
||||
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="提交人员" prop="username">
|
||||
<el-input disabled
|
||||
v-model="formData.username"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="提交时间" prop="auditTime">
|
||||
<el-input disabled v-model="formData.auditTime"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
<el-form-item label="提交意见" prop="auditOpinion">
|
||||
<el-input maxlength="500" placeholder="请填写您的提交意见" rows="4"
|
||||
type="textarea"
|
||||
v-model="formData.auditOpinion"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="签  字" prop="auditSign">
|
||||
<sign :qz.sync="formData.auditSign"></sign>
|
||||
</el-form-item>
|
||||
|
||||
</el-form>
|
||||
<div style="float: right;margin: 20px 0">
|
||||
<!-- <el-button @click="doReview(1)">拒绝</el-button>-->
|
||||
<!-- <el-button type="danger" @click="doReview(2)">退回修改</el-button>-->
|
||||
<el-button @click="doSubmit(3)" type="primary">通过</el-button>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
</el-drawer>
|
||||
|
||||
|
||||
<template #edit>
|
||||
<el-table :data="userTableData" :size="tableSize"
|
||||
@selection-change="handleSelectionChange"
|
||||
@sort-change="pageOrder"
|
||||
class="vi-table"
|
||||
ref="userTable"
|
||||
row-key="id"
|
||||
style="width: 100%" v-loading="tableLoading">
|
||||
|
||||
<el-table-column align="center" header-align="center" label="序号" type="index"
|
||||
width="80px">
|
||||
<template scope="scope">
|
||||
<span>{{scope.$index+(pageForm.pageNumber - 1) * pageForm.pageSize + 1}} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column
|
||||
:reserve-selection="true"
|
||||
type="selection"
|
||||
width="55">
|
||||
</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 userTableColumns"
|
||||
>
|
||||
<template scope="{row}" v-if="column.prop=='planDateTime'">
|
||||
{{row.startDateTime}}-{{row.endDateTime}}
|
||||
</template>
|
||||
<template scope="{row}" v-else-if="column.prop=='planType'">
|
||||
{{row.planType===1?'保育费':'其它'}}
|
||||
</template>
|
||||
<template scope="{row}" v-else-if="column.prop==='state'">
|
||||
<span :style="'color:'+row.stateColor">{{row.stateName}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column align="center" header-align="center" label="操作"
|
||||
prop="userOnline"
|
||||
width="300px">
|
||||
<template slot-scope="{row}">
|
||||
<el-button @click="openUserView(row)" size="mini">
|
||||
查看
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-row class="el-pagination-container" style="margin-bottom: 0px">
|
||||
<el-pagination
|
||||
:current-page="userPageForm.pageNumber"
|
||||
:page-size="userPageForm.pageSize"
|
||||
:page-sizes="[5,10, 20, 30, 50]"
|
||||
:total="userPageForm.totalCount"
|
||||
@current-change="userPageNumberChange"
|
||||
@size-change="userPageSizeChange"
|
||||
layout="total, sizes, prev, pager, next">
|
||||
</el-pagination>
|
||||
</el-row>
|
||||
|
||||
<div style="float: right;margin: 20px 0">
|
||||
<el-button @click="doUserReview(1)">拒绝</el-button>
|
||||
<!-- <el-button type="danger" @click="doReview(2)">退回修改</el-button>-->
|
||||
<el-button @click="doUserReview(3)" type="primary">通过</el-button>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<template #view>
|
||||
<school-info :plan_id="pageForm.planId" :state="6056" :union_id="pageForm.union_id"
|
||||
:year="pageForm.year"
|
||||
ref="schoolInfo"></school-info>
|
||||
</template>
|
||||
|
||||
</guava>
|
||||
</div>
|
||||
|
||||
|
||||
<script>
|
||||
const vue = new Vue({
|
||||
el: '#app',
|
||||
mixins: [initTableMixins],
|
||||
data() {
|
||||
return {
|
||||
planOptions: [],
|
||||
selection: [],
|
||||
doSubmitDrawer: false,
|
||||
userDrawer: false,
|
||||
userPageForm: {
|
||||
searchName: "",
|
||||
searchKeyword: "",
|
||||
pageNumber: 1,
|
||||
pageSize: 10,
|
||||
totalCount: 0,
|
||||
pageOrderName: "",
|
||||
pageOrderBy: ""
|
||||
},
|
||||
userTableData: [],
|
||||
unions: [],
|
||||
planList: [],
|
||||
pageForm: {
|
||||
union_id: '',
|
||||
year: moment().format('YYYY')
|
||||
},
|
||||
userTableColumns: [
|
||||
{prop: 'loginName', label: '工号'},
|
||||
{prop: 'userName', label: '姓名'},
|
||||
{prop: 'unitName', label: '单位'},
|
||||
{prop: 'unionName', label: '工会'},
|
||||
{prop: 'money', label: '报销金额', sortable: true},
|
||||
{prop: 'applyDateTime', label: '报销申请时间'},
|
||||
// {prop: 'state', label: '报销状态', sortable: true},
|
||||
],
|
||||
tableColumns: [
|
||||
{prop: 'unioncode', label: '工会编码'},
|
||||
{prop: 'unionname', label: '工会名称'},
|
||||
// {prop: 'userFalseNum', label: '未审核总人数'},
|
||||
// {prop: 'userFalseMoney', label: '未审核总金额'},
|
||||
{prop: 'userTrueNum', label: '上报总人数', sortable: true},
|
||||
{prop: 'userTrueMoney', label: '上报总金额'},
|
||||
|
||||
],
|
||||
formRules: {
|
||||
money: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
files: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
}
|
||||
}
|
||||
},
|
||||
components: {
|
||||
'info': httpVueLoader('/components/childcareFees/info.vue?v=' + new Date().getTime()),
|
||||
'school-info': httpVueLoader('/components/childcareFees/schoolInfo.vue?v=' + new Date().getTime()),
|
||||
},
|
||||
methods: {
|
||||
async doExport() {
|
||||
window.open("/platform/childcareFees/schoolAudit/doExport?planId=" + this.pageForm.planId)
|
||||
},
|
||||
exportXlsx() {
|
||||
window.open('/platform/childcareFees/schoolAudit/exportXlsx?planId=' + this.pageForm.planId)
|
||||
},
|
||||
exportByUnion(row) {
|
||||
window.open('/platform/childcareFees/schoolAudit/exportByUnion?planId=' + this.pageForm.planId + "&unionId=" + row.id)
|
||||
},
|
||||
getSummaries(param) {
|
||||
const {columns, data} = param;
|
||||
const sums = [];
|
||||
columns.forEach((column, index) => {
|
||||
if (index === 0) {
|
||||
sums[index] = '合计';
|
||||
return;
|
||||
}
|
||||
const values = data.map(item => Number(item[column.property]));
|
||||
if ([3, 4].includes(index)) {
|
||||
sums[index] = values.reduce((prev, curr) => {
|
||||
const value = Number(curr);
|
||||
if (!isNaN(value)) {
|
||||
return prev + curr;
|
||||
} else {
|
||||
return prev;
|
||||
}
|
||||
}, 0);
|
||||
if (index === 4) {
|
||||
sums[index] += ' 元';
|
||||
} else {
|
||||
sums[index] += '';
|
||||
}
|
||||
|
||||
} else {
|
||||
sums[index] = '';
|
||||
}
|
||||
});
|
||||
|
||||
return sums;
|
||||
},
|
||||
async getPlan() {
|
||||
const resp = await $.post('/platform/childcareFees/applyPlan/getPlan', {year: this.pageForm.year})
|
||||
this.planOptions = resp.data
|
||||
},
|
||||
handleClose(done) {
|
||||
this.$confirm('确认关闭?')
|
||||
.then(_ => {
|
||||
done();
|
||||
})
|
||||
.catch(_ => {
|
||||
});
|
||||
},
|
||||
async openSubmit(row) {
|
||||
this.formData = {
|
||||
unionId: row.id,
|
||||
year: this.pageForm.year,
|
||||
username: "${@shiro.getPrincipalProperty('username')}",
|
||||
auditTime: moment().format('YYYY-MM-DD'),
|
||||
auditOpinion: "同意",
|
||||
}
|
||||
this.doSubmitDrawer = true
|
||||
},
|
||||
async doSubmit(flag) {
|
||||
const confirm = await this.$confirm('您确定要提交吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
})
|
||||
if (confirm === 'confirm') {
|
||||
this.formData.flag = flag
|
||||
const resp = await $.post(loc() + '/doSubmit', this.formData)
|
||||
if (resp.code === 0) {
|
||||
this.notifySuccess(resp.msg)
|
||||
this.doSearch()
|
||||
this.doSubmitDrawer = false
|
||||
}
|
||||
}
|
||||
},
|
||||
async doUserReview(flag) {
|
||||
if (this.selection && this.selection.length === 0) {
|
||||
this.notifyWarning("请在左侧勾选所有需要提交的名单")
|
||||
return
|
||||
}
|
||||
const confirm = await this.$confirm('您确定要提交吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
})
|
||||
if (confirm === 'confirm') {
|
||||
this.formData.flag = flag
|
||||
this.formData.ids = JSON.stringify(this.selection)
|
||||
const resp = await $.post(loc() + '/doUserReview', this.formData)
|
||||
if (resp.code === 0) {
|
||||
this.notifySuccess(resp.msg)
|
||||
this.doSearch()
|
||||
this.userFalseNumPageData();
|
||||
this.$refs.userTable.clearSelection();
|
||||
}
|
||||
}
|
||||
},
|
||||
handleSelectionChange(val) {
|
||||
this.selection = val.map(v => v.id);
|
||||
},
|
||||
userPageSizeChange(val) {
|
||||
this.userPageForm.pageSize = val;
|
||||
this.userFalseNumPageData();
|
||||
},
|
||||
userPageNumberChange(val) {
|
||||
this.userPageForm.pageNumber = val;
|
||||
this.userFalseNumPageData();
|
||||
},
|
||||
userFalseNumPageData() {
|
||||
sublime.showLoadingbar();
|
||||
this.tableLoading = true
|
||||
this.userPageForm.state = 6056
|
||||
$.post(loc() + "/userFalseNumPageData", this.userPageForm, (data) => {
|
||||
sublime.closeLoadingbar();
|
||||
this.tableLoading = false
|
||||
if (data.code == 0) {
|
||||
this.userTableData = data.data.list;
|
||||
this.userPageForm.totalCount = data.data.totalCount;
|
||||
} else {
|
||||
this.$message.error(data.msg);
|
||||
}
|
||||
}, "json");
|
||||
},
|
||||
openView(row) {
|
||||
this.pageForm.union_id = row.id
|
||||
this.$refs.guava.view()
|
||||
this.$nextTick(() => {
|
||||
this.$refs.schoolInfo.userTrueNumPageData()
|
||||
})
|
||||
|
||||
// this.$refs.schoolInfo.userFalseNumPageData()
|
||||
|
||||
},
|
||||
openUserView(row) {
|
||||
this.userDrawer = true
|
||||
setTimeout(() => {
|
||||
this.$refs.info.getInfo(row.id)
|
||||
}, 300)
|
||||
|
||||
|
||||
},
|
||||
openEdit(row) {
|
||||
|
||||
this.$refs.userTable.clearSelection();
|
||||
this.userPageForm.unionId = row.id
|
||||
this.userPageForm.year = this.pageForm.year
|
||||
this.userFalseNumPageData()
|
||||
this.$refs.guava.edit()
|
||||
},
|
||||
|
||||
},
|
||||
async created() {
|
||||
await this.getPlan()
|
||||
if (this.planOptions && this.planOptions.length > 0) {
|
||||
this.$set(this.pageForm, "planId", this.planOptions[0].id)
|
||||
}
|
||||
this.unions = await getUnions()
|
||||
this.pageData()
|
||||
}
|
||||
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,438 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
|
||||
|
||||
<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="选择年" @change="doSearch();getPlan()">
|
||||
</el-date-picker>
|
||||
</div>
|
||||
</div>
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">所属工会:</div>
|
||||
<div class="search-item-option">
|
||||
<el-select placeholder="所属工会" v-model="pageForm.unionId"
|
||||
style="width: 100%;"
|
||||
clearable
|
||||
filterable>
|
||||
<el-option v-for="item in unions" :label="item.unionname"
|
||||
:value="item.id"></el-option>
|
||||
</el-select>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">计划列表:</div>
|
||||
<div class="search-item-option">
|
||||
<el-select v-model="pageForm.planId" clearable placeholder="请选择计划">
|
||||
<el-option
|
||||
|
||||
v-for="item in planOptions"
|
||||
:key="item.id"
|
||||
:label="item.planName"
|
||||
: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="mt20">
|
||||
<table-tool label="审核列表" :app="this">
|
||||
|
||||
</table-tool>
|
||||
|
||||
<el-table :data="tableData" style="width: 100%" row-key="id"
|
||||
@sort-change="pageOrder"
|
||||
v-loading="tableLoading" ref="table"
|
||||
:size="tableSize" class="vi-table">
|
||||
|
||||
<el-table-column align="center" header-align="center" width="80px" label="序号"
|
||||
type="index">
|
||||
<template scope="scope">
|
||||
<span>{{scope.$index+(pageForm.pageNumber - 1) * pageForm.pageSize + 1}} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column
|
||||
align="center"
|
||||
header-align="center"
|
||||
v-for="column in tableColumns"
|
||||
show-overflow-tooltip
|
||||
:label="column.label"
|
||||
:prop="column.prop"
|
||||
:sortable="column.sortable"
|
||||
>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column prop="userOnline" align="center" header-align="center"
|
||||
label="操作"
|
||||
width="300px">
|
||||
<template slot-scope="{row}">
|
||||
<el-button size="mini" @click="openView(row)">
|
||||
查看
|
||||
</el-button>
|
||||
<el-button size="mini" type="primary" @click="openEdit(row)"
|
||||
:disabled="row.userFalseNum==0">
|
||||
审核
|
||||
</el-button>
|
||||
<el-button size="mini" type="primary" @click="openSubmit(row)"
|
||||
v-if="row.userFalseNum==0&&row.submitNum!=0">
|
||||
提交
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--#include("/layouts/pagination.html"){}#-->
|
||||
|
||||
|
||||
</el-card>
|
||||
|
||||
|
||||
</template>
|
||||
|
||||
<el-drawer
|
||||
title="" size="78%"
|
||||
:visible.sync="userDrawer"
|
||||
:append-to-body="true"
|
||||
:with-header="false">
|
||||
|
||||
<template>
|
||||
<info ref="info"></info>
|
||||
</template>
|
||||
|
||||
</el-drawer>
|
||||
|
||||
<el-drawer
|
||||
:before-close="handleClose"
|
||||
title="" size="50%"
|
||||
:visible.sync="doSubmitDrawer"
|
||||
:append-to-body="true"
|
||||
:with-header="false">
|
||||
|
||||
<template>
|
||||
<el-form :model="formData" ref="form" :rules="formRules" label-position="right"
|
||||
style="padding: 20px 0"
|
||||
label-width="120px">
|
||||
<vi-title title="提交信息"></vi-title>
|
||||
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item prop="username" label="提交人员">
|
||||
<el-input v-model="formData.username"
|
||||
disabled></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item prop="auditTime" label="提交时间">
|
||||
<el-input v-model="formData.auditTime" disabled></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
<el-form-item prop="auditOpinion" label="提交意见">
|
||||
<el-input type="textarea" v-model="formData.auditOpinion" rows="4"
|
||||
maxlength="500"
|
||||
placeholder="请填写您的提交意见"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="auditSign" label="签  字">
|
||||
<sign :qz.sync="formData.auditSign"></sign>
|
||||
</el-form-item>
|
||||
|
||||
</el-form>
|
||||
<div style="float: right;margin: 20px 0">
|
||||
<!-- <el-button @click="doReview(1)">拒绝</el-button>-->
|
||||
<!-- <el-button type="danger" @click="doReview(2)">退回修改</el-button>-->
|
||||
<el-button type="primary" @click="doSubmit(3)">通过</el-button>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
</el-drawer>
|
||||
|
||||
|
||||
<template #edit>
|
||||
<el-table :data="userTableData" style="width: 100%" row-key="id"
|
||||
@sort-change="pageOrder"
|
||||
@selection-change="handleSelectionChange"
|
||||
v-loading="tableLoading" ref="userTable"
|
||||
:size="tableSize" class="vi-table">
|
||||
|
||||
<el-table-column align="center" header-align="center" width="80px" label="序号"
|
||||
type="index">
|
||||
<template scope="scope">
|
||||
<span>{{scope.$index+(pageForm.pageNumber - 1) * pageForm.pageSize + 1}} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column
|
||||
:reserve-selection="true"
|
||||
type="selection"
|
||||
width="55">
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column
|
||||
align="center"
|
||||
header-align="center"
|
||||
v-for="column in userTableColumns"
|
||||
show-overflow-tooltip
|
||||
:label="column.label"
|
||||
:prop="column.prop"
|
||||
:sortable="column.sortable"
|
||||
>
|
||||
<template v-if="column.prop=='planDateTime'" scope="{row}">
|
||||
{{row.startDateTime}}-{{row.endDateTime}}
|
||||
</template>
|
||||
<template v-else-if="column.prop=='planType'" scope="{row}">
|
||||
{{row.planType===1?'保育费':'其它'}}
|
||||
</template>
|
||||
<template scope="{row}" v-else-if="column.prop==='state'">
|
||||
<span :style="'color:'+row.stateColor">{{row.stateName}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column prop="userOnline" align="center" header-align="center"
|
||||
label="操作"
|
||||
width="300px">
|
||||
<template slot-scope="{row}">
|
||||
<el-button size="mini" @click="openUserView(row)">
|
||||
查看
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-row class="el-pagination-container" style="margin-bottom: 0px">
|
||||
<el-pagination
|
||||
@size-change="userPageSizeChange"
|
||||
@current-change="userPageNumberChange"
|
||||
:current-page="userPageForm.pageNumber"
|
||||
:page-sizes="[5,10, 20, 30, 50]"
|
||||
:page-size="userPageForm.pageSize"
|
||||
layout="total, sizes, prev, pager, next"
|
||||
:total="userPageForm.totalCount">
|
||||
</el-pagination>
|
||||
</el-row>
|
||||
|
||||
<div style="float: right;margin: 20px 0">
|
||||
<el-button @click="doUserReview(1)">拒绝</el-button>
|
||||
<!-- <el-button type="danger" @click="doReview(2)">退回修改</el-button>-->
|
||||
<el-button type="primary" @click="doUserReview(3)">通过</el-button>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<template #view>
|
||||
<school-info ref="schoolInfo" :union_id="pageForm.union_id" :year="pageForm.year"
|
||||
:plan_id="pageForm.planId"
|
||||
:state="6062"></school-info>
|
||||
</template>
|
||||
|
||||
</guava>
|
||||
</div>
|
||||
|
||||
|
||||
<script>
|
||||
var vue = new Vue({
|
||||
el: '#app',
|
||||
mixins: [initTableMixins],
|
||||
data() {
|
||||
return {
|
||||
planOptions: [],
|
||||
selection: [],
|
||||
doSubmitDrawer: false,
|
||||
userDrawer: false,
|
||||
userPageForm: {
|
||||
searchName: "",
|
||||
searchKeyword: "",
|
||||
pageNumber: 1,
|
||||
pageSize: 10,
|
||||
totalCount: 0,
|
||||
pageOrderName: "",
|
||||
pageOrderBy: ""
|
||||
},
|
||||
userTableData: [],
|
||||
unions: [],
|
||||
planList: [],
|
||||
pageForm: {
|
||||
union_id: '',
|
||||
year: moment().format('YYYY')
|
||||
},
|
||||
userTableColumns: [
|
||||
{prop: 'loginName', label: '工号'},
|
||||
{prop: 'userName', label: '姓名'},
|
||||
{prop: 'unitName', label: '单位'},
|
||||
{prop: 'unionName', label: '工会'},
|
||||
{prop: 'money', label: '报销金额', sortable: true},
|
||||
{prop: 'applyDateTime', label: '报销申请时间'},
|
||||
{prop: 'state', label: '报销状态', sortable: true},
|
||||
],
|
||||
tableColumns: [
|
||||
{prop: 'unioncode', label: '工会编码'},
|
||||
{prop: 'unionname', label: '工会名称'},
|
||||
{prop: 'userFalseNum', label: '未审核总人数'},
|
||||
{prop: 'userFalseMoney', label: '未审核总金额'},
|
||||
{prop: 'userTrueNum', label: '已通过总人数', sortable: true},
|
||||
{prop: 'userTrueMoney', label: '已通过总金额'},
|
||||
|
||||
],
|
||||
formRules: {
|
||||
money: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
files: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
}
|
||||
}
|
||||
},
|
||||
components: {
|
||||
'info': httpVueLoader('/components/childcareFees/info.vue?v=' + new Date().getTime()),
|
||||
'school-info': httpVueLoader('/components/childcareFees/schoolInfo.vue?v=' + new Date().getTime()),
|
||||
},
|
||||
methods: {
|
||||
async getPlan() {
|
||||
const resp = await $.post('/platform/childcareFees/applyPlan/getPlan', {year: this.pageForm.year})
|
||||
this.planOptions = resp.data
|
||||
},
|
||||
handleClose(done) {
|
||||
this.$confirm('确认关闭?')
|
||||
.then(_ => {
|
||||
done();
|
||||
})
|
||||
.catch(_ => {
|
||||
});
|
||||
},
|
||||
async openSubmit(row) {
|
||||
this.formData = {
|
||||
unionId: row.id,
|
||||
year: this.pageForm.year,
|
||||
username: "${@shiro.getPrincipalProperty('username')}",
|
||||
auditTime: moment().format('YYYY-MM-DD'),
|
||||
auditOpinion: "同意",
|
||||
}
|
||||
this.doSubmitDrawer = true
|
||||
},
|
||||
async doSubmit(flag) {
|
||||
const confirm = await this.$confirm('您确定要提交吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
})
|
||||
if (confirm === 'confirm') {
|
||||
this.formData.flag = flag
|
||||
const resp = await $.post(loc() + '/doSubmit', this.formData)
|
||||
if (resp.code === 0) {
|
||||
this.notifySuccess(resp.msg)
|
||||
this.doSearch()
|
||||
this.doSubmitDrawer = false
|
||||
}
|
||||
}
|
||||
},
|
||||
async doUserReview(flag) {
|
||||
if (this.selection && this.selection.length === 0) {
|
||||
this.notifyWarning("请在左侧勾选所有需要提交的名单")
|
||||
return
|
||||
}
|
||||
const confirm = await this.$confirm('您确定要提交吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
})
|
||||
if (confirm === 'confirm') {
|
||||
this.formData.flag = flag
|
||||
this.formData.ids = JSON.stringify(this.selection)
|
||||
const resp = await $.post(loc() + '/doUserReview', this.formData)
|
||||
if (resp.code === 0) {
|
||||
this.notifySuccess(resp.msg)
|
||||
this.doSearch()
|
||||
this.userFalseNumPageData();
|
||||
this.$refs.userTable.clearSelection();
|
||||
}
|
||||
}
|
||||
},
|
||||
handleSelectionChange(val) {
|
||||
this.selection = val.map(v => v.id);
|
||||
},
|
||||
userPageSizeChange(val) {
|
||||
this.userPageForm.pageSize = val;
|
||||
this.userFalseNumPageData();
|
||||
},
|
||||
userPageNumberChange(val) {
|
||||
this.userPageForm.pageNumber = val;
|
||||
this.userFalseNumPageData();
|
||||
},
|
||||
userFalseNumPageData() {
|
||||
sublime.showLoadingbar();
|
||||
this.tableLoading = true
|
||||
this.userPageForm.state = 6062
|
||||
$.post(loc() + "/userFalseNumPageData", this.userPageForm, (data) => {
|
||||
sublime.closeLoadingbar();
|
||||
this.tableLoading = false
|
||||
if (data.code == 0) {
|
||||
this.userTableData = data.data.list;
|
||||
this.userPageForm.totalCount = data.data.totalCount;
|
||||
} else {
|
||||
this.$message.error(data.msg);
|
||||
}
|
||||
}, "json");
|
||||
},
|
||||
openView(row) {
|
||||
this.pageForm.union_id = row.id
|
||||
setTimeout(() => {
|
||||
this.$refs.guava.view()
|
||||
this.$refs.schoolInfo.userTrueNumPageData()
|
||||
this.$refs.schoolInfo.userFalseNumPageData()
|
||||
}, 300)
|
||||
|
||||
|
||||
},
|
||||
openUserView(row) {
|
||||
this.userDrawer = true
|
||||
setTimeout(() => {
|
||||
this.$refs.info.getInfo(row.id)
|
||||
}, 300)
|
||||
|
||||
|
||||
},
|
||||
openEdit(row) {
|
||||
this.$refs.userTable.clearSelection();
|
||||
this.userPageForm.unionId = row.id
|
||||
this.userPageForm.year = this.pageForm.year
|
||||
this.userFalseNumPageData()
|
||||
this.$refs.guava.edit()
|
||||
},
|
||||
|
||||
},
|
||||
async created() {
|
||||
await this.getPlan()
|
||||
if (this.planOptions && this.planOptions.length > 0) {
|
||||
this.$set(this.pageForm, "planId", this.planOptions[0].id)
|
||||
}
|
||||
this.unions = await getUnions()
|
||||
this.pageData()
|
||||
}
|
||||
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,325 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
|
||||
<style>
|
||||
.el-transfer-panel {
|
||||
text-align: left;
|
||||
width: calc(50% - 91px);
|
||||
height: 53vh;
|
||||
}
|
||||
|
||||
.el-transfer-panel__list.is-filterable {
|
||||
height: calc(50vh - 110px);
|
||||
}
|
||||
|
||||
.transfer {
|
||||
display: flex;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
align-items: center;
|
||||
padding: 0 10px;
|
||||
}
|
||||
|
||||
.transfer .el-checkbox {
|
||||
display: inline-block !important;
|
||||
margin: 0 10px !important;
|
||||
}
|
||||
|
||||
</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
|
||||
@change="getPlan"
|
||||
placeholder="选择年"
|
||||
style="width: 100%" type="year"
|
||||
v-model="pageForm.year" value-format="yyyy">
|
||||
</el-date-picker>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
|
||||
<el-card class="mt20" shadow="never">
|
||||
|
||||
<table-tool :app="this" label="填报列表">
|
||||
<template #func>
|
||||
|
||||
</template>
|
||||
</table-tool>
|
||||
|
||||
<el-table :data="planList" :size="tableSize" class="vi-table"
|
||||
ref="table" row-key="id"
|
||||
style="width: 100%" v-loading="tableLoading">
|
||||
|
||||
<el-table-column align="center" header-align="center" label="序号" type="index"
|
||||
width="80px">
|
||||
<template scope="scope">
|
||||
<span>{{scope.$index+(pageForm.pageNumber - 1) * pageForm.pageSize + 1}} </span>
|
||||
</template>
|
||||
</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 tableColumns"
|
||||
>
|
||||
<template scope="{row}" v-if="column.prop=='planDateTime'">
|
||||
{{row.startDateTime}}-{{row.endDateTime}}
|
||||
</template>
|
||||
<template scope="{row}" v-else-if="column.prop=='planType'">
|
||||
{{row.planType===1?'保育费':'其它'}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column align="center" header-align="center" label="操作"
|
||||
prop="userOnline"
|
||||
width="300px">
|
||||
<template slot-scope="{row}">
|
||||
<el-button @click="openView(row)" size="mini" type="primary">
|
||||
查看
|
||||
</el-button>
|
||||
<el-button @click="openEdit(row)"
|
||||
size="mini" type="primary"
|
||||
v-if="moment().unix()>moment(row.startDateTime).unix()
|
||||
&&moment().unix()<moment(row.endDateTime).unix()">
|
||||
上报
|
||||
</el-button>
|
||||
<el-button @click="exportByUnion(row)" size="small" type="primary">
|
||||
导出
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
</el-card>
|
||||
</template>
|
||||
|
||||
|
||||
<template #edit>
|
||||
<el-form :model="formData" :rules="formRules" label-width="86px" ref="form">
|
||||
<el-row gutter="60">
|
||||
<el-col :span="24">
|
||||
<el-form-item>
|
||||
<el-card shadow="never">
|
||||
<el-transfer
|
||||
:data="leftData"
|
||||
:filter-method="filterMethod"
|
||||
:props="{key: 'loginName',label: 'names'}"
|
||||
:titles="['可报人员名单', '当前选择']"
|
||||
filterable
|
||||
ref="transfer"
|
||||
v-model="rightData">
|
||||
<template #left-footer>
|
||||
<div></div>
|
||||
</template>
|
||||
</el-transfer>
|
||||
</el-card>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item>
|
||||
<el-card class="mt10" shadow="never">
|
||||
<el-table :data="escalationTableData" max-height="500px" >
|
||||
<el-table-column
|
||||
align="center" header-align="center" label="序号"
|
||||
type="index"
|
||||
width="100">
|
||||
</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="loginName"></el-table-column>
|
||||
|
||||
<el-table-column align="center" header-align="center" label="单位"
|
||||
prop="unitname"
|
||||
sortable></el-table-column>
|
||||
|
||||
<el-table-column align="center" header-align="center"
|
||||
label="报销金额(元)"
|
||||
prop="money"
|
||||
sortable>
|
||||
<template scope="{$index,row}">
|
||||
<el-input-number
|
||||
step-strictly
|
||||
:max="10000"
|
||||
:step="100"
|
||||
:precision="0"
|
||||
:min="1" style="width: 100%;"
|
||||
v-model="row.money"></el-input-number>
|
||||
</template>
|
||||
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column align="center" header-align="center" label="操作"
|
||||
sortable>
|
||||
<template scope="{$index,row}">
|
||||
<el-button @click="rightData.splice($index,1)"
|
||||
size="mini"
|
||||
type="danger">删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-card>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
|
||||
<el-col :span="24">
|
||||
<el-form-item label="签字" prop="sign">
|
||||
<sign :qz.sync="formData.sign" prefix="sign"></sign>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<el-row class="mt10 text-right">
|
||||
<el-button @click="doAdd" class="mt10" type="primary" v-loading="submitLoading">
|
||||
提交
|
||||
</el-button>
|
||||
</el-row>
|
||||
</template>
|
||||
|
||||
<template #view>
|
||||
<school-info :plan_id="planId" :state="6056" :union_id="pageForm.union_id"
|
||||
:year="pageForm.year"
|
||||
ref="schoolInfo"></school-info>
|
||||
</template>
|
||||
|
||||
|
||||
</guava>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
const vue = new Vue({
|
||||
el: '#app',
|
||||
mixins: [initTableMixins],
|
||||
data() {
|
||||
return {
|
||||
planList: [],
|
||||
pageForm: {
|
||||
union_id:"${@shiro.getPrincipalProperty('unit').getUnionid()}",
|
||||
year: moment().format('YYYY')
|
||||
},
|
||||
tableColumns: [
|
||||
{prop: 'year', label: '计划年度'},
|
||||
{prop: 'planName', label: '计划名称'},
|
||||
{prop: 'planType', label: '计划类型'},
|
||||
{prop: 'sex', label: '计划报销对象'},
|
||||
{prop: 'planDateTime', label: '计划报销时间'},
|
||||
],
|
||||
leftData: [],
|
||||
rightData: [],
|
||||
planId: "",
|
||||
formRules: {
|
||||
sign: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
escalationTableData() {
|
||||
return this.leftData.filter(v => this.rightData.includes(v.loginName))
|
||||
}
|
||||
},
|
||||
components: {
|
||||
'school-info': httpVueLoader('/components/childcareFees/schoolInfo.vue?v=' + new Date().getTime()),
|
||||
},
|
||||
methods: {
|
||||
exportByUnion(row) {
|
||||
window.open('/platform/childcareFees/schoolAudit/exportByUnion?planId=' + row.id)
|
||||
},
|
||||
filterMethod(query, item) {
|
||||
return item.userName.indexOf(query) > -1;
|
||||
},
|
||||
async getPlan() {
|
||||
const resp = await $.post('/platform/childcareFees/applyPlan/getPlan', {year: this.pageForm.year})
|
||||
this.planList = resp.data
|
||||
},
|
||||
openView() {
|
||||
this.$refs.guava.view()
|
||||
this.$nextTick(()=>{
|
||||
this.$refs.schoolInfo.userTrueNumPageData()
|
||||
})
|
||||
},
|
||||
doAdd() {
|
||||
this.$refs["form"].validate(async (valid) => {
|
||||
if (valid) {
|
||||
this.$confirm('您确定要提交吗?如需修改请在规定时间内进行修改!', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(async () => {
|
||||
if (this.rightData && this.rightData.length === 0) {
|
||||
this.notifyWarning("请选择需要上报的教职工")
|
||||
return
|
||||
}
|
||||
let userList = this.escalationTableData
|
||||
const moneys = userList.map(u => u.money)
|
||||
if (moneys.includes(0)) {
|
||||
this.notifyWarning("请填写报销金额")
|
||||
return
|
||||
}
|
||||
const {code, msg} = await $.post(loc() + '/doAdd', {
|
||||
userList: JSON.stringify(userList),
|
||||
planId: this.planId,
|
||||
sign: this.formData.sign
|
||||
})
|
||||
if (code === 0) {
|
||||
this.notifySuccess(msg)
|
||||
this.$refs.guava.index()
|
||||
} else {
|
||||
this.notifyWarning(msg)
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
},
|
||||
async openEdit(row) {
|
||||
this.planId = row.id
|
||||
this.$refs.guava.edit()
|
||||
const {data} = await $.get(loc() + '/selfUnionUsers', {planId: row.id})
|
||||
|
||||
const {data: rightData} = await $.get(loc() + '/getReportedUser', {
|
||||
planId: row.id
|
||||
})
|
||||
const rightLoginNameData = rightData.map(r => r.loginName)
|
||||
data.map(l => {
|
||||
const right = rightData.find(r => r.loginName === l.loginName)
|
||||
if (right) {
|
||||
l.money = right.money
|
||||
} else {
|
||||
l.money = 0
|
||||
}
|
||||
})
|
||||
this.leftData = data
|
||||
this.rightData = rightLoginNameData
|
||||
},
|
||||
|
||||
},
|
||||
async created() {
|
||||
this.getPlan()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,317 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
|
||||
|
||||
<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="选择年" @change="doSearch();getPlan()">
|
||||
</el-date-picker>
|
||||
</div>
|
||||
</div>
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">姓名/工号:</div>
|
||||
<div class="search-item-option">
|
||||
<el-input placeholder="请输入姓名/工号" clearable
|
||||
v-model="pageForm.searchKeyword"
|
||||
@keyup.enter.native="doSearch">
|
||||
<el-select v-model="pageForm.searchName" slot="prepend"
|
||||
placeholder="姓名/工号"
|
||||
style="width: 80px;">
|
||||
<el-option label="姓名" value="app.userName"></el-option>
|
||||
<el-option label="工号" value="app.loginName"></el-option>
|
||||
</el-select>
|
||||
</el-input>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">计划列表:</div>
|
||||
<div class="search-item-option">
|
||||
<el-select v-model="pageForm.planId" clearable placeholder="请选择计划">
|
||||
<el-option
|
||||
|
||||
v-for="item in planOptions"
|
||||
:key="item.id"
|
||||
:label="item.planName"
|
||||
: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="mt20">
|
||||
<table-tool label="审核列表" :app="this">
|
||||
<template #func>
|
||||
<span style="color: red;margin-right: 10px">温馨提示:如您已全部审核完成可点击已审核提交名单到校工会</span>
|
||||
<el-radio-group v-model="pageForm.isAudit" @change="doSearch" size="medium">
|
||||
<el-radio-button label="">全部</el-radio-button>
|
||||
<el-radio-button :label="true">已审核</el-radio-button>
|
||||
<el-radio-button :label="false">未审核</el-radio-button>
|
||||
</el-radio-group>
|
||||
<el-button type="primary" icon="el-icon-check" @click="doSchool"
|
||||
class="ml10"
|
||||
size="medium" v-if="pageForm.isAudit==true">提交到校工会
|
||||
</el-button>
|
||||
<el-button type="primary" icon="el-icon-s-promotion" @click="doExport"
|
||||
class="ml10"
|
||||
size="medium">导出报销表
|
||||
</el-button>
|
||||
|
||||
</template>
|
||||
</table-tool>
|
||||
|
||||
<el-table :data="tableData" style="width: 100%" row-key="id"
|
||||
@sort-change="pageOrder"
|
||||
@selection-change="handleSelectionChange"
|
||||
v-loading="tableLoading" ref="table"
|
||||
:size="tableSize" class="vi-table">
|
||||
|
||||
<el-table-column align="center" header-align="center" width="80px" label="序号"
|
||||
type="index">
|
||||
<template scope="scope">
|
||||
<span>{{scope.$index+(pageForm.pageNumber - 1) * pageForm.pageSize + 1}} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column
|
||||
:reserve-selection="true"
|
||||
:selectable="(row)=>{return row.state==6051}"
|
||||
type="selection"
|
||||
width="55">
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column
|
||||
align="center"
|
||||
header-align="center"
|
||||
v-for="column in tableColumns"
|
||||
show-overflow-tooltip
|
||||
:label="column.label"
|
||||
:prop="column.prop"
|
||||
:sortable="column.sortable"
|
||||
>
|
||||
<template v-if="column.prop=='planDateTime'" scope="{row}">
|
||||
{{row.startDateTime}}-{{row.endDateTime}}
|
||||
</template>
|
||||
<template v-else-if="column.prop=='planType'" scope="{row}">
|
||||
{{row.planType===1?'保育费':'其它'}}
|
||||
</template>
|
||||
<template scope="{row}" v-else-if="column.prop==='state'">
|
||||
<span :style="'color:'+row.stateColor">{{row.stateName}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column prop="userOnline" align="center" header-align="center"
|
||||
label="操作"
|
||||
width="300px">
|
||||
<template slot-scope="{row}">
|
||||
<el-button size="mini" @click="openView(row)">
|
||||
查看
|
||||
</el-button>
|
||||
<el-button size="mini" type="primary" @click="openEdit(row)"
|
||||
:disabled="row.state!=6050">
|
||||
审核
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--#include("/layouts/pagination.html"){}#-->
|
||||
|
||||
|
||||
</el-card>
|
||||
</template>
|
||||
|
||||
<template #view>
|
||||
<info ref="info"></info>
|
||||
</template>
|
||||
|
||||
<template #edit>
|
||||
<info ref="edit" label="分工会审核" handle>
|
||||
<template #handle>
|
||||
<el-form :model="formData" ref="form" :rules="formRules" label-position="right"
|
||||
style="padding: 20px 0"
|
||||
label-width="120px">
|
||||
<vi-title title="审核信息"></vi-title>
|
||||
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item prop="username" label="审核人员">
|
||||
<el-input v-model="formData.username"
|
||||
disabled></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item prop="auditTime" label="审核时间">
|
||||
<el-input v-model="formData.auditTime" disabled></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
<el-form-item prop="auditOpinion" label="审核意见">
|
||||
<el-input type="textarea" v-model="formData.auditOpinion" rows="4"
|
||||
maxlength="500"
|
||||
placeholder="请填写您的审核意见"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="auditSign" label="签  字">
|
||||
<sign :qz.sync="formData.auditSign"></sign>
|
||||
</el-form-item>
|
||||
|
||||
</el-form>
|
||||
<div style="float: right;margin: 20px 0">
|
||||
<el-button @click="doReview(1)">拒绝</el-button>
|
||||
<el-button type="danger" @click="doReview(2)">退回修改</el-button>
|
||||
<el-button type="primary" @click="doReview(3)">通过</el-button>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
</info>
|
||||
</template>
|
||||
|
||||
|
||||
</guava>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
var vue = new Vue({
|
||||
el: '#app',
|
||||
mixins: [initTableMixins],
|
||||
data() {
|
||||
return {
|
||||
planOptions: [],
|
||||
isDoSchool: 0,
|
||||
selection: [],
|
||||
planList: [],
|
||||
pageForm: {
|
||||
searchName: "app.userName",
|
||||
isAudit: 'false',
|
||||
year: moment().format('YYYY')
|
||||
},
|
||||
tableColumns: [
|
||||
{prop: 'loginName', label: '工号'},
|
||||
{prop: 'userName', label: '姓名'},
|
||||
{prop: 'unitName', label: '单位'},
|
||||
{prop: 'unionName', label: '工会'},
|
||||
{prop: 'money', label: '报销金额', sortable: true},
|
||||
{prop: 'applyDateTime', label: '报销申请时间'},
|
||||
{prop: 'state', label: '报销状态', sortable: true},
|
||||
],
|
||||
formRules: {
|
||||
money: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
files: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
}
|
||||
}
|
||||
},
|
||||
components: {
|
||||
'info': httpVueLoader('/components/childcareFees/info.vue?v=' + new Date().getTime()),
|
||||
},
|
||||
methods: {
|
||||
doExport() {
|
||||
const {year, planId} = this.pageForm
|
||||
if (!planId) {
|
||||
this.notifyWarning("请选择需要导出的计划");
|
||||
return
|
||||
}
|
||||
window.open(loc() + "/doExport?year=" + year + "&planId=" + planId)
|
||||
},
|
||||
async getIsDoSchool() {
|
||||
const resp = await $.post(loc() + '/getIsDoSchool', {year: this.pageForm.year})
|
||||
this.isDoSchool = resp.data
|
||||
},
|
||||
async getPlan() {
|
||||
const resp = await $.post('/platform/childcareFees/applyPlan/getPlan', {year: this.pageForm.year})
|
||||
this.planOptions = resp.data
|
||||
},
|
||||
async doSchool() {
|
||||
await this.getIsDoSchool()
|
||||
if (this.isDoSchool > 0) {
|
||||
this.notifyWarning("您已提交到校工会暂不能在提交")
|
||||
return
|
||||
}
|
||||
if (this.selection && this.selection.length === 0) {
|
||||
this.notifyWarning("请在左侧勾选所有需要提交到校工会的名单")
|
||||
return
|
||||
}
|
||||
const confirm = await this.$confirm('请确保本工会人员已全部通过审核,提交校工会后暂不能修改人员!', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
})
|
||||
if (confirm === 'confirm') {
|
||||
const resp = await $.post(loc() + '/doSchool', {ids: JSON.stringify(this.selection)})
|
||||
if (resp.code === 0) {
|
||||
this.notifySuccess(resp.msg)
|
||||
this.doSearch()
|
||||
this.$refs.table.clearSelection();
|
||||
}
|
||||
}
|
||||
},
|
||||
handleSelectionChange(val) {
|
||||
this.selection = val.map(v => v.id);
|
||||
},
|
||||
openView(row) {
|
||||
this.$refs.info.getInfo(row.id)
|
||||
this.$refs.guava.view()
|
||||
},
|
||||
openEdit(row) {
|
||||
this.formData = {
|
||||
id: row.id,
|
||||
username: "${@shiro.getPrincipalProperty('username')}",
|
||||
auditTime: moment().format('YYYY-MM-DD'),
|
||||
auditOpinion: "同意",
|
||||
}
|
||||
this.$refs.edit.getInfo(row.id)
|
||||
this.$refs.guava.edit()
|
||||
},
|
||||
async doReview(flag) {
|
||||
const confirm = await this.$confirm('您确定要提交吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
})
|
||||
if (confirm === 'confirm') {
|
||||
this.formData.flag = flag
|
||||
const resp = await $.post(loc() + '/doReview', this.formData)
|
||||
if (resp.code === 0) {
|
||||
this.notifySuccess(resp.msg)
|
||||
this.doSearch()
|
||||
this.$refs.guava.index()
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
async created() {
|
||||
await this.getPlan()
|
||||
if (this.planOptions && this.planOptions.length > 0) {
|
||||
this.$set(this.pageForm, "planId", this.planOptions[0].id)
|
||||
}
|
||||
this.pageData()
|
||||
}
|
||||
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,300 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
|
||||
|
||||
<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="选择年" @change="doSearch">
|
||||
</el-date-picker>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
|
||||
<el-card shadow="never" class="mt20">
|
||||
|
||||
<table-tool label="填报列表" :app="this">
|
||||
<template #func>
|
||||
<el-button icon="el-icon-s-promotion" type="primary" size="small"
|
||||
@click="openAdd">填报保育费
|
||||
</el-button>
|
||||
</template>
|
||||
</table-tool>
|
||||
|
||||
<el-table :data="tableData" style="width: 100%" row-key="id"
|
||||
@sort-change="pageOrder"
|
||||
v-loading="tableLoading" ref="table"
|
||||
:size="tableSize" class="vi-table">
|
||||
|
||||
<el-table-column align="center" header-align="center" width="80px" label="序号"
|
||||
type="index">
|
||||
<template scope="scope">
|
||||
<span>{{scope.$index+(pageForm.pageNumber - 1) * pageForm.pageSize + 1}} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column
|
||||
align="center"
|
||||
header-align="center"
|
||||
v-for="column in tableColumns"
|
||||
show-overflow-tooltip
|
||||
:label="column.label"
|
||||
:prop="column.prop"
|
||||
:sortable="column.sortable"
|
||||
>
|
||||
<template v-if="column.prop=='planDateTime'" scope="{row}">
|
||||
{{row.startDateTime}}-{{row.endDateTime}}
|
||||
</template>
|
||||
<template v-else-if="column.prop=='planType'" scope="{row}">
|
||||
{{row.planType===1?'保育费':'其它'}}
|
||||
</template>
|
||||
<template scope="{row}" v-else-if="column.prop==='state'">
|
||||
<span :style="'color:'+row.stateColor">{{row.stateName}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column prop="userOnline" align="center" header-align="center"
|
||||
label="操作"
|
||||
width="300px">
|
||||
<template slot-scope="{row}">
|
||||
<el-button size="mini" @click="openView(row)">
|
||||
查看
|
||||
</el-button>
|
||||
<el-button size="mini" type="primary" @click="openEdit(row)"
|
||||
:disabled="![6050,6054].includes(row.state)">
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button size="mini" type="danger" @click="doDelete(row.id)"
|
||||
:disabled="row.state!=6050">
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--#include("/layouts/pagination.html"){}#-->
|
||||
|
||||
</el-card>
|
||||
</template>
|
||||
|
||||
|
||||
<template #edit>
|
||||
<div style="margin-bottom: 50px">
|
||||
<h3 style="color: rgb(24, 103, 176);margin: 0;text-align: center">填写填报信息</h3>
|
||||
</div>
|
||||
|
||||
<el-form :model="formData" ref="form" :rules="formRules" label-width="86px">
|
||||
<el-row gutter="60">
|
||||
<el-col :span="24">
|
||||
<el-form-item label="填报类型" prop="planType">
|
||||
<el-radio v-for="i in planList" v-model="formData.planId"
|
||||
:label="i.id"
|
||||
style="margin-right: 60px;" border>
|
||||
{{i.planType===1?'保育费':'暂无'}}
|
||||
</el-radio>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="工  号">
|
||||
<el-input maxlength="100" placeholder="工号"
|
||||
disabled
|
||||
v-model="formData.loginName" style="width: 100%;"
|
||||
auto-complete="off" tabindex="4" type="text"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="职工姓名">
|
||||
<el-input maxlength="100" placeholder="职工姓名"
|
||||
disabled
|
||||
v-model="formData.userName" style="width: 100%;"
|
||||
auto-complete="off" tabindex="4" type="text"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="单  位">
|
||||
<el-input maxlength="100" placeholder="所属单位"
|
||||
disabled
|
||||
v-model="formData.unitName" style="width: 100%;"
|
||||
auto-complete="off" tabindex="4" type="text"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="基层工会">
|
||||
<el-input maxlength="100" placeholder="所属基层工会"
|
||||
disabled
|
||||
v-model="formData.unionName" style="width: 100%;"
|
||||
auto-complete="off" tabindex="4" type="text"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="报销金额" prop="money">
|
||||
<el-input maxlength="100" placeholder="报销金额"
|
||||
v-model="formData.money" style="width: 100%;"
|
||||
auto-complete="off" tabindex="4" type="text"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item prop="files" label="报销附件">
|
||||
<file-upload :files.sync="formData.files"
|
||||
card></file-upload>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="签字" prop="sign">
|
||||
<sign :qz.sync="formData.sign" prefix="sign"></sign>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
</el-form>
|
||||
|
||||
<div style="float: right;margin: 20px 0">
|
||||
<el-button type="primary" @click="doSubmit">提 交</el-button>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<template #view>
|
||||
<info ref="info"></info>
|
||||
</template>
|
||||
|
||||
|
||||
</guava>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
var vue = new Vue({
|
||||
el: '#app',
|
||||
mixins: [initTableMixins],
|
||||
data() {
|
||||
return {
|
||||
planList: [],
|
||||
pageForm: {
|
||||
year: moment().format('YYYY')
|
||||
},
|
||||
tableColumns: [
|
||||
{prop: 'loginName', label: '工号'},
|
||||
{prop: 'userName', label: '姓名'},
|
||||
{prop: 'unitName', label: '单位'},
|
||||
{prop: 'unionName', label: '工会'},
|
||||
{prop: 'money', label: '报销金额', sortable: true},
|
||||
{prop: 'applyDateTime', label: '报销申请时间'},
|
||||
{prop: 'state', label: '报销状态', sortable: true},
|
||||
],
|
||||
formRules: {
|
||||
money: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
files: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
}
|
||||
}
|
||||
},
|
||||
components: {
|
||||
'info': httpVueLoader('/components/childcareFees/info.vue?v=' + new Date().getTime()),
|
||||
},
|
||||
methods: {
|
||||
async getPlan() {
|
||||
const resp = await $.post('/platform/childcareFees/applyPlan/getPlan', {year: this.pageForm.year})
|
||||
this.planList = resp.data
|
||||
},
|
||||
openView(row) {
|
||||
this.$refs.info.getInfo(row.id)
|
||||
this.$refs.guava.view()
|
||||
},
|
||||
async openAdd() {
|
||||
this.formData = {money: 0, files: null}
|
||||
await this.getPlan()
|
||||
const sex = "${@shiro.getPrincipalProperty('sex')}"
|
||||
const now = moment().format("YYYY-MM-DD HH:mm:ss")
|
||||
if (!sex) {
|
||||
this.notifyWarning("系统中暂无您的性别请联系管理员")
|
||||
return
|
||||
}
|
||||
const sexPlanList = this.planList.filter(v => v.sex === sex && v.startDateTime < now && v.endDateTime > now)
|
||||
if (sexPlanList && sexPlanList.length === 0) {
|
||||
this.notifyWarning("您不在此次填报计划内,请联系管理员")
|
||||
return
|
||||
}
|
||||
const planList = sexPlanList.filter(v => v.startDateTime < now && v.endDateTime > now)
|
||||
if (sexPlanList && sexPlanList.length === 0) {
|
||||
this.notifyWarning("还未到填报时间暂时无法填报,请联系管理员")
|
||||
return
|
||||
}
|
||||
if (planList && planList.length === 1) {
|
||||
this.$set(this.formData, "planId", planList[0].id)
|
||||
}
|
||||
|
||||
this.planList = planList
|
||||
|
||||
this.$set(this.formData, 'loginName', "${@shiro.getPrincipalProperty('loginname')}")
|
||||
this.$set(this.formData, 'userName', '${@shiro.getPrincipalProperty("username")}')
|
||||
this.$set(this.formData, 'unitName', '${@shiro.getPrincipalProperty("unit").getName()}')
|
||||
this.$set(this.formData, 'unionName', '${@shiro.getPrincipalProperty("union").getUnionname()}')
|
||||
this.$refs.guava.edit()
|
||||
if (this.$refs["form"])
|
||||
this.$refs["form"].resetFields();
|
||||
},
|
||||
async doDelete(id) {
|
||||
const confirm = await this.$confirm('您确定要删除吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
})
|
||||
if (confirm === 'confirm') {
|
||||
const resp = await $.post(loc() + '/doDelete', {id: id})
|
||||
if (resp.code === 0) {
|
||||
this.notifySuccess(resp.msg)
|
||||
this.doSearch()
|
||||
}
|
||||
}
|
||||
},
|
||||
async openEdit(row) {
|
||||
await this.getPlan()
|
||||
const now = moment().format("YYYY-MM-DD HH:mm:ss")
|
||||
const planList = this.planList.filter(v => v.startDateTime < now && v.endDateTime > now)
|
||||
if (this.planList && this.planList.length === 0) {
|
||||
this.notifyWarning("还未到填报时间暂时无法填报,请联系管理员")
|
||||
return
|
||||
}
|
||||
row.files = JSON.parse(row.files)
|
||||
row.sign = row.signData
|
||||
this.formData = row
|
||||
this.planList = planList
|
||||
this.$refs.guava.edit()
|
||||
},
|
||||
doSubmit() {
|
||||
this.$refs["form"].validate(async (valid) => {
|
||||
if (valid) {
|
||||
const formData = clone(this.formData)
|
||||
formData.files = JSON.stringify(formData.files)
|
||||
const refs = await $.post(loc() + "/doSubmit", formData)
|
||||
if (refs.code === 0) {
|
||||
this.doSearch()
|
||||
this.$refs.guava.index()
|
||||
this.notifySuccess(refs.msg);
|
||||
} else {
|
||||
this.notifyWarning(refs.msg)
|
||||
}
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
async created() {
|
||||
this.pageData()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,609 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
<style>
|
||||
.left_aside {
|
||||
width: 200px;
|
||||
background-color: #eaecf6;
|
||||
height: 500px;
|
||||
}
|
||||
|
||||
.left_tree {
|
||||
margin-top: 10px;
|
||||
margin-left: 10px;
|
||||
background-color: #eaecf6;
|
||||
}
|
||||
|
||||
.note {
|
||||
width: 100%;
|
||||
height: 320px;
|
||||
}
|
||||
|
||||
.el-upload input[type=file] {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.avatar-uploader .el-upload {
|
||||
border: 1px dashed #d9d9d9;
|
||||
border-radius: 6px;
|
||||
cursor: pointer;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.avatar-uploader .el-upload:hover {
|
||||
border-color: #409EFF;
|
||||
}
|
||||
|
||||
.avatar-uploader-icon {
|
||||
font-size: 28px;
|
||||
color: #8c939d;
|
||||
width: 128px;
|
||||
height: 128px;
|
||||
line-height: 128px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.avatar {
|
||||
width: 128px;
|
||||
height: 128px;
|
||||
display: block;
|
||||
}
|
||||
</style>
|
||||
<link href="${base!}/assets/platform/plugins/umeditor/themes/default/css/umeditor.min.css" type="text/css"
|
||||
rel="stylesheet">
|
||||
<script src="${base!}/assets/platform/plugins/umeditor/umeditor.config.js"></script>
|
||||
<script src="${base!}/assets/platform/plugins/umeditor/umeditor.js"></script>
|
||||
<div id="app" v-cloak>
|
||||
<el-row class="header navbar bg-white shadow">
|
||||
<div class="btn-group tool-button mt5">
|
||||
<span>站点:</span>
|
||||
<el-select size="medium" v-model="site.id" placeholder="请选择" @change="siteChange">
|
||||
<el-option
|
||||
v-for="item in sites"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
<el-button size="medium" @click="openAdd">
|
||||
<i class="ti-plus"></i>
|
||||
新建文章
|
||||
</el-button>
|
||||
</div>
|
||||
<div class="btn-group tool-button mt5">
|
||||
<el-input placeholder="请输入标题" v-model="pageForm.searchKeyword" @keyup.enter.native="doSearch">
|
||||
<el-button slot="append" icon="el-icon-search" @click="doSearch"></el-button>
|
||||
</el-input>
|
||||
</div>
|
||||
<div class="pull-right offscreen-right mt5">
|
||||
<el-button size="medium" @click="delMore" type="danger" :disabled="selectData.length==0">
|
||||
<i class="el-icon-delete"></i>
|
||||
删除
|
||||
</el-button>
|
||||
</div>
|
||||
</el-row>
|
||||
<el-row style="padding-top: 50px;">
|
||||
<section class="el-container">
|
||||
<aside class="el-aside left_aside">
|
||||
<el-tree
|
||||
@node-click="treeClick"
|
||||
class="left_tree"
|
||||
:data="channelData"
|
||||
node-key="id"
|
||||
:props="defaultProps">
|
||||
</el-tree>
|
||||
</aside>
|
||||
<main class="el-main">
|
||||
<el-breadcrumb separator-class="el-icon-arrow-right">
|
||||
<el-breadcrumb-item>{{site.site_name}}</el-breadcrumb-item>
|
||||
<el-breadcrumb-item>{{pageForm.channelName||'所有栏目'}}</el-breadcrumb-item>
|
||||
</el-breadcrumb>
|
||||
<el-row style="margin-top: 5px;">
|
||||
<el-table
|
||||
:data="tableData"
|
||||
@sort-change='pageOrder'
|
||||
size="small"
|
||||
header-align="center"
|
||||
style="width: 100%"
|
||||
@selection-change="handleSelectionChange"
|
||||
:default-sort="{prop: 'publishAt', order: 'descending'}"
|
||||
>
|
||||
<el-table-column
|
||||
type="selection"
|
||||
width="35">
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="文章标题" header-align="left" prop="title"
|
||||
:show-overflow-tooltip="true">
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column sortable label="发布时间" header-align="center" prop="publishAt"
|
||||
width="240">
|
||||
<template slot-scope="scope">
|
||||
{{formatAt(scope.row.publishAt)}} - {{formatAt(scope.row.endAt)}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="发布状态" header-align="center" align="center" prop="disabled"
|
||||
width="120">
|
||||
<template slot-scope="scope">
|
||||
<i v-if="scope.row.disabled" class="fa fa-circle text-danger ml5"></i>
|
||||
<i v-if="!scope.row.disabled" class="fa fa-circle text-success ml5"></i>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column
|
||||
prop="id"
|
||||
label="操作"
|
||||
width="120">
|
||||
<template slot-scope="scope">
|
||||
<el-dropdown @command="dropdownCommand">
|
||||
<el-button size="mini">
|
||||
<i class="ti-settings"></i>
|
||||
<span class="ti-angle-down"></span>
|
||||
</el-button>
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-item :command="{type:'view',id:scope.row.id}">
|
||||
预览
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item divided
|
||||
:command="{type:'enable',id:scope.row.id,row:scope.row}">
|
||||
启用
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item :command="{type:'disable',id:scope.row.id,row:scope.row}">
|
||||
禁用
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item divided :command="{type:'edit',id:scope.row.id}">
|
||||
修改
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item
|
||||
:command="{type:'delete',id:scope.row.id,title:scope.row.title}">
|
||||
删除
|
||||
</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-row>
|
||||
<el-row class="el-pagination-container">
|
||||
<el-pagination
|
||||
@size-change="pageSizeChange"
|
||||
@current-change="pageNumberChange"
|
||||
:current-page="pageForm.pageNumber"
|
||||
:page-sizes="[10, 20, 30, 50]"
|
||||
:page-size="pageForm.pageSize"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
:total="pageForm.totalCount">
|
||||
</el-pagination>
|
||||
</el-row>
|
||||
</main>
|
||||
</section>
|
||||
</el-row>
|
||||
|
||||
<el-dialog
|
||||
:title="dialogTitle"
|
||||
:visible.sync="dialogVisible"
|
||||
width="60%">
|
||||
<el-form :model="formData" ref="dialogForm" :rules="formRules" size="small" label-width="80px">
|
||||
<el-form-item prop="title" label="文章标题">
|
||||
<el-input maxlength="255" placeholder="文章标题"
|
||||
v-model="formData.title"
|
||||
auto-complete="off" tabindex="1" type="text"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="author" label="文章作者">
|
||||
<el-input maxlength="50" placeholder="文章作者"
|
||||
v-model="formData.author"
|
||||
auto-complete="off" tabindex="1" type="text"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="info" label="文章简介">
|
||||
<el-input type="textarea" v-model="formData.info"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="url" label="URL">
|
||||
<el-input maxlength="50" placeholder="URL"
|
||||
v-model="formData.url"
|
||||
auto-complete="off" tabindex="2" type="text"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="publishAt" label="发布时间">
|
||||
<el-date-picker
|
||||
format="yyyy-MM-dd HH:mm:ss"
|
||||
value-format="timestamp"
|
||||
v-model="formData.time"
|
||||
type="datetimerange"
|
||||
range-separator="至"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item prop="disabled" label="发布状态">
|
||||
<el-switch
|
||||
v-model="formData.disabled"
|
||||
active-color="#ff4949"
|
||||
inactive-color="#13ce66">
|
||||
</el-switch>
|
||||
</el-form-item>
|
||||
<el-form-item prop="picurl" label="标题图">
|
||||
<el-upload
|
||||
class="avatar-uploader"
|
||||
tabindex="5"
|
||||
action="${base}/open/file/upload/image"
|
||||
name="Filedata"
|
||||
:show-file-list="false"
|
||||
:on-success="function(resp,file,fileList){return handlePicSuccess(resp,file,fileList,'picurl')}">
|
||||
|
||||
<img v-if="formData.picurl" :src="'${AppFileDomain!}'+formData.picurl" class="avatar">
|
||||
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
|
||||
</el-upload>
|
||||
</el-form-item>
|
||||
<el-form-item prop="content" label="文章内容">
|
||||
<!--一个页面中不能出现两个umeditor对象,所以新建和修改用同一个dialog来做吧-->
|
||||
<script type="text/plain" id="content" class="note"></script>
|
||||
<!---->
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogVisible = false"> 取 消 </el-button>
|
||||
<el-button type="primary" @click="doSave"> 确 定 </el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog
|
||||
title="预览文章"
|
||||
:visible.sync="viewDialogVisible"
|
||||
width="60%">
|
||||
<el-row style="text-align: center">
|
||||
<h4>{{formData.title}}</h4>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<span>作者:{{formData.author}}</span>
|
||||
<span>发布时间:{{formatAt(formData.publishAt)}} - {{formatAt(formData.endAt)}}</span>
|
||||
</el-row>
|
||||
<el-row style="margin-top: 5px !important;margin-bottom: 5px !important;border-bottom: 1px solid #DDD;">
|
||||
</el-row>
|
||||
<el-row>
|
||||
<span v-html="formData.content"></span>
|
||||
</el-row>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="viewDialogVisible = false"> 关 闭 </el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</div>
|
||||
<script>
|
||||
new Vue({
|
||||
el: "#app",
|
||||
data: function () {
|
||||
var sites = [];
|
||||
<!--#for(o in siteList){#-->
|
||||
sites.push({value: "${o.id!}", label: "${o.site_name!}"});
|
||||
<!--#}#-->
|
||||
var site = {id: "", site_name: ""};
|
||||
<!--#if(!isEmpty(site)){#-->
|
||||
site = {id: "${site.id}", site_name: "${site.site_name}"};
|
||||
<!--#}#-->
|
||||
return {
|
||||
dialogVisible: false,
|
||||
viewDialogVisible: false,
|
||||
dialogTitle: "新建文章",
|
||||
sites: sites,
|
||||
site: site,
|
||||
selectData: [],
|
||||
pageForm: {
|
||||
siteId: site.id,
|
||||
channelId: "",
|
||||
channelName: "",
|
||||
searchKeyword: "",
|
||||
pageNumber: 1,
|
||||
pageSize: 10,
|
||||
totalCount: 0,
|
||||
pageOrderName: "publishAt",
|
||||
pageOrderBy: "descending"
|
||||
},
|
||||
channelData: [],
|
||||
defaultProps: {
|
||||
children: 'children',
|
||||
label: 'label'
|
||||
},
|
||||
tableData: [],
|
||||
formData: {
|
||||
id: "",
|
||||
},
|
||||
formRules: {
|
||||
title: [
|
||||
{required: true, message: '标题', trigger: 'blur'}
|
||||
],
|
||||
info: [
|
||||
{required: false, message: '请输入文章作者', trigger: 'blur'},
|
||||
{min: 0, max: 500, message: '长度500个字符以内', trigger: 'blur'}
|
||||
]
|
||||
},
|
||||
action: "add"
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
siteChange: function (val) {
|
||||
window.location.href = "${base}/platform/cms/article/" + val;
|
||||
},
|
||||
channelLoad: function () {
|
||||
var self = this;
|
||||
$.post(base + "/platform/cms/article/tree/" + self.site.id, {}, function (data) {
|
||||
if (data.code == 0) {
|
||||
self.channelData = data.data;
|
||||
}
|
||||
}, "json");
|
||||
},
|
||||
openAdd: function () {
|
||||
var self = this;
|
||||
if (typeof(self.pageForm.channelId) == "undefined" || self.pageForm.channelId == "" || self.pageForm.channelId == "root") {
|
||||
self.$message({
|
||||
message: "请在左侧选定一个栏目",
|
||||
type: 'error'
|
||||
});
|
||||
return false;
|
||||
}
|
||||
self.dialogVisible = true;
|
||||
self.dialogTitle = "新建文章";
|
||||
self.action = "add";
|
||||
self.formData = {
|
||||
id: "",
|
||||
author: "${@shiro.getPrincipalProperty('username')}",
|
||||
time: [
|
||||
moment().format("x"),
|
||||
moment("2099-12-31 23:59:59").format("x")
|
||||
]
|
||||
};//打开新增窗口,表单先清空
|
||||
if (self.$refs["dialogForm"])
|
||||
self.$refs["dialogForm"].resetFields();
|
||||
UM.getEditor("content");
|
||||
setTimeout(function () {
|
||||
UM.getEditor("content").setContent("", false);
|
||||
}, 200);
|
||||
},
|
||||
doSave: function () {
|
||||
if ("add" == this.action) {
|
||||
this.doAdd();
|
||||
}
|
||||
if ("edit" == this.action) {
|
||||
this.doEdit();
|
||||
}
|
||||
},
|
||||
doAdd: function () {
|
||||
var self = this;
|
||||
var url = base + "/platform/cms/article/addDo/" + self.site.id;
|
||||
self.$refs["dialogForm"].validate(function (valid) {
|
||||
if (valid) {//表单验证通过
|
||||
self.formData.content = UM.getEditor("content").getContent();
|
||||
self.formData.siteid = self.site.id;
|
||||
self.formData.channelId = self.pageForm.channelId;
|
||||
self.formData.time_param = JSON.stringify(self.formData.time);
|
||||
$.post(url, self.formData, function (data) {
|
||||
if (data.code == 0) {
|
||||
self.$message({
|
||||
message: data.msg,
|
||||
type: 'success'
|
||||
});
|
||||
self.dialogVisible = false;
|
||||
self.pageData();
|
||||
} else {
|
||||
self.$message({
|
||||
message: data.msg,
|
||||
type: 'error'
|
||||
});
|
||||
}
|
||||
}, "json");
|
||||
}
|
||||
});
|
||||
},
|
||||
doEdit: function () {
|
||||
var self = this;
|
||||
var url = base + "/platform/cms/article/editDo";
|
||||
self.$refs["dialogForm"].validate(function (valid) {
|
||||
if (valid) {//表单验证通过
|
||||
self.formData.content = UM.getEditor("content").getContent();
|
||||
self.formData.time_param = JSON.stringify(self.formData.time);
|
||||
$.post(url, self.formData, function (data) {
|
||||
if (data.code == 0) {
|
||||
self.$message({
|
||||
message: data.msg,
|
||||
type: 'success'
|
||||
});
|
||||
self.dialogVisible = false;
|
||||
self.pageData();
|
||||
} else {
|
||||
self.$message({
|
||||
message: data.msg,
|
||||
type: 'error'
|
||||
});
|
||||
}
|
||||
}, "json");
|
||||
}
|
||||
});
|
||||
},
|
||||
delMore: function () {
|
||||
var self = this;
|
||||
if (self.selectData.length == 0) {
|
||||
self.$message({
|
||||
message: "请选择消息",
|
||||
type: 'warning'
|
||||
});
|
||||
return false;
|
||||
}
|
||||
var ids = [];
|
||||
self.selectData.forEach(function (val) {
|
||||
ids.push(val.id);
|
||||
});
|
||||
self.$confirm('您确定要删除选中的 ' + ids.length + ' 条消息? ', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
callback: function (a, b) {
|
||||
if ("confirm" == a) {//确认后再执行
|
||||
$.post(base + "/platform/cms/article/delete", {ids: ids.toString()}, function (data) {
|
||||
if (data.code == 0) {
|
||||
self.$message({
|
||||
message: data.msg,
|
||||
type: 'success'
|
||||
});
|
||||
self.pageData();
|
||||
} else {
|
||||
self.$message({
|
||||
message: data.msg,
|
||||
type: 'error'
|
||||
});
|
||||
}
|
||||
}, "json");
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
pageOrder: function (column) {//按字段排序
|
||||
this.pageForm.pageOrderName = column.prop;
|
||||
this.pageForm.pageOrderBy = column.order;
|
||||
this.pageData();
|
||||
},
|
||||
pageNumberChange: function (val) {//页码更新操作
|
||||
this.pageForm.pageNumber = val;
|
||||
this.pageData();
|
||||
},
|
||||
pageSizeChange: function (val) {//分页大小更新操作
|
||||
this.pageForm.pageSize = val;
|
||||
this.pageData();
|
||||
},
|
||||
pageData: function () {//加载分页数据
|
||||
var self = this;
|
||||
sublime.showLoadingbar();//显示loading
|
||||
$.post(base + "/platform/cms/article/data/" + self.site.id, self.pageForm, function (data) {
|
||||
sublime.closeLoadingbar();//关闭loading
|
||||
if (data.code == 0) {
|
||||
self.tableData = data.data.list;
|
||||
self.pageForm.totalCount = data.data.totalCount;
|
||||
} else {
|
||||
self.$message({
|
||||
message: data.msg,
|
||||
type: 'error'
|
||||
});
|
||||
}
|
||||
}, "json");
|
||||
},
|
||||
formatAt: function (val) {
|
||||
if (val > 0)
|
||||
return moment(val * 1000).format("YYYY-MM-DD HH:mm");
|
||||
return "";
|
||||
},
|
||||
handleSelectionChange: function (val) {
|
||||
this.selectData = val;
|
||||
},
|
||||
doSearch: function () {
|
||||
this.pageData();
|
||||
},
|
||||
treeClick: function (data, node, obj) {
|
||||
this.pageForm.channelId = data.id;
|
||||
this.pageForm.channelName = data.name;
|
||||
this.pageData();
|
||||
},
|
||||
handlePicSuccess: function (response, file, fileList, attrName) {
|
||||
if (response.code == 0) {
|
||||
// 对象属性直接赋值不会触发试图更新,采用 Vue.set 、this.$set或者Object.assign({},this.obj)创建新对象
|
||||
// 或者也可以定义一个 refresh 属性 ,当数据发生改变时,该属性同时变化,也会触发视图更新
|
||||
// this.formData.site_logo =response.data;
|
||||
this.$set(this.formData, attrName, response.data);
|
||||
} else {
|
||||
this.$set(this.formData, attrName, "");
|
||||
}
|
||||
},
|
||||
dropdownCommand: function (command) {//监听下拉框事件
|
||||
var self = this;
|
||||
if ("edit" == command.type) {
|
||||
$.post(base + "/platform/cms/article/edit/" + command.id, {}, function (data) {
|
||||
if (data.code == 0) {
|
||||
self.formData = data.data;//加载后台表单数据
|
||||
self.formData.time = [
|
||||
self.formData.publishAt * 1000,
|
||||
self.formData.endAt * 1000
|
||||
];
|
||||
self.dialogVisible = true;//打开编辑窗口
|
||||
self.dialogTitle = "修改文章";
|
||||
self.action = "edit";
|
||||
UM.getEditor("content");
|
||||
setTimeout(function () {
|
||||
UM.getEditor("content").setContent("" + self.formData.content, false);
|
||||
}, 200);
|
||||
} else {
|
||||
self.$message({
|
||||
message: data.msg,
|
||||
type: 'error'
|
||||
});
|
||||
}
|
||||
}, "json");
|
||||
}
|
||||
if ("view" == command.type) {
|
||||
$.post(base + "/platform/cms/article/edit/" + command.id, {}, function (data) {
|
||||
if (data.code == 0) {
|
||||
self.formData = data.data;//加载后台表单数据
|
||||
self.viewDialogVisible = true;//打开编辑窗口
|
||||
} else {
|
||||
self.$message({
|
||||
message: data.msg,
|
||||
type: 'error'
|
||||
});
|
||||
}
|
||||
}, "json");
|
||||
}
|
||||
if ("enable" == command.type || "disable" == command.type) {
|
||||
$.post(base + "/platform/cms/article/" + command.type + "/" + command.id, {}, function (data) {
|
||||
if (data.code == 0) {
|
||||
self.$message({
|
||||
message: data.msg,
|
||||
type: 'success'
|
||||
});
|
||||
if ("disable" == command.type) {
|
||||
command.row.disabled = true;
|
||||
}
|
||||
if ("enable" == command.type) {
|
||||
command.row.disabled = false;
|
||||
}
|
||||
} else {
|
||||
self.$message({
|
||||
message: data.msg,
|
||||
type: 'error'
|
||||
});
|
||||
}
|
||||
}, "json");
|
||||
}
|
||||
if ("delete" == command.type) {
|
||||
self.$confirm('此操作将删除文章: ' + command.title, '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
callback: function (a, b) {
|
||||
if ("confirm" == a) {//确认后再执行
|
||||
$.post(base + "/platform/cms/article/delete/" + command.id, {}, function (data) {
|
||||
if (data.code == 0) {
|
||||
self.$message({
|
||||
message: data.msg,
|
||||
type: 'success'
|
||||
});
|
||||
self.doSearch();
|
||||
} else {
|
||||
self.$message({
|
||||
message: data.msg,
|
||||
type: 'error'
|
||||
});
|
||||
}
|
||||
}, "json");
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
created: function () {
|
||||
this.channelLoad();
|
||||
this.pageData();
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,542 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
<div id="app" v-cloak>
|
||||
<el-row class="header navbar bg-white shadow">
|
||||
<div class="btn-group tool-button mt5">
|
||||
|
||||
<span>站点:</span>
|
||||
<el-select size="medium" v-model="site.id" placeholder="请选择" @change="siteChange">
|
||||
<el-option
|
||||
v-for="item in sites"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
<el-button size="medium" @click="openAdd">
|
||||
<i class="ti-plus"></i>
|
||||
新建栏目
|
||||
</el-button>
|
||||
</div>
|
||||
<div class="pull-right offscreen-right mt5">
|
||||
<el-button size="medium" @click="openSort">
|
||||
排序
|
||||
</el-button>
|
||||
</div>
|
||||
</el-row>
|
||||
<el-row class="el-table-container">
|
||||
<el-table :key="tableKey" :data="tableData" style="width: 100%" size="small"
|
||||
:highlight-current-row="true" row-key="id" lazy
|
||||
:load="loadChild">
|
||||
<el-table-column label="栏目名称" header-align="center" prop="name"
|
||||
width="200" :show-overflow-tooltip="true" align="left">
|
||||
</el-table-column>
|
||||
|
||||
|
||||
<el-table-column label="栏目标识" header-align="center" prop="code"
|
||||
:show-overflow-tooltip="true">
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="URL" header-align="center" prop="url"
|
||||
:show-overflow-tooltip="true">
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="栏目类型" header-align="center" prop="type"
|
||||
:show-overflow-tooltip="true" align="center">
|
||||
<template slot-scope="scope">
|
||||
<i v-if="scope.row.type=='article'">文章</i>
|
||||
<i v-if="scope.row.type=='photo'">相册</i>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
|
||||
<el-table-column label="启用状态" header-align="center" prop="disabled" align="center"
|
||||
:show-overflow-tooltip="true">
|
||||
<template slot-scope="scope">
|
||||
<i v-if="scope.row.disabled"
|
||||
class="fa fa-circle text-danger ml5"></i>
|
||||
<i v-if="!scope.row.disabled"
|
||||
class="fa fa-circle text-success ml5"></i>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="操作" header-align="center" prop="id"
|
||||
:show-overflow-tooltip="true" align="center" width="120">
|
||||
<template slot-scope="scope">
|
||||
<el-dropdown @command="dropdownCommand">
|
||||
<el-button size="mini">
|
||||
<i class="ti-settings"></i>
|
||||
<span class="ti-angle-down"></span>
|
||||
</el-button>
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-item :command="{type:'add',id:scope.row.id,name:scope.row.name}">
|
||||
添加子栏目
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item divided
|
||||
:command="{type:'enable',id:scope.row.id,name:scope.row.name,row:scope.row}">
|
||||
启用
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item
|
||||
:command="{type:'disable',id:scope.row.id,name:scope.row.name,row:scope.row}">
|
||||
禁用
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item divided
|
||||
:command="{type:'edit',id:scope.row.id,name:scope.row.name}">
|
||||
修改
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item :command="{type:'delete',id:scope.row.id,name:scope.row.name}"
|
||||
v-if="scope.row.path!='0001'">
|
||||
删除
|
||||
</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-row>
|
||||
|
||||
|
||||
<el-dialog
|
||||
title="新建栏目"
|
||||
:visible.sync="addDialogVisible"
|
||||
width="50%">
|
||||
<el-form :model="formData" ref="addForm" :rules="formRules" size="small" label-width="80px">
|
||||
<el-form-item prop="siteId" label="所属站点">
|
||||
<span>{{site.site_name}}</span>
|
||||
</el-form-item>
|
||||
<el-form-item prop="parentId" label="上级栏目" label-width="80px">
|
||||
<el-cascader v-if="!isAddFromSub"
|
||||
style="width: 100%"
|
||||
:options="menuOptions" :props="props" v-model="parentMenu"
|
||||
tabindex="1"
|
||||
placeholder="不选择则为顶级"
|
||||
></el-cascader>
|
||||
<el-input v-if="isAddFromSub" type="text" v-model="formData.parentName" :disabled="true"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="name" label="栏目名称">
|
||||
<el-input maxlength="100" placeholder="栏目名称"
|
||||
v-model="formData.name"
|
||||
auto-complete="off" tabindex="3" type="text"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="code" label="栏目标识">
|
||||
<el-input maxlength="100" placeholder="栏目标识"
|
||||
v-model="formData.code"
|
||||
auto-complete="off" tabindex="4" type="text"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="type" label="栏目类型">
|
||||
<el-radio-group v-model="formData.type">
|
||||
<el-radio label="article">文章</el-radio>
|
||||
<el-radio label="photo">相册</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item prop="url" label="URL">
|
||||
<el-input maxlength="100" placeholder="URL"
|
||||
v-model="formData.url"
|
||||
auto-complete="off" tabindex="6" type="text"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="target" label="打开方式">
|
||||
<el-radio-group v-model="formData.target">
|
||||
<el-radio label="_blank">新页面</el-radio>
|
||||
<el-radio label="_self">本页面</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item prop="disabled" label="启用状态">
|
||||
<el-switch
|
||||
v-model="formData.disabled"
|
||||
active-color="#ff4949"
|
||||
inactive-color="#13ce66">
|
||||
</el-switch>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="addDialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="doAdd">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog
|
||||
title="修改栏目"
|
||||
:visible.sync="editDialogVisible"
|
||||
width="50%">
|
||||
<el-form :model="formData" ref="editForm" :rules="formRules" size="small" label-width="80px">
|
||||
<el-form-item label="所属站点" label-width="80px">
|
||||
{{formData.siteName}}
|
||||
</el-form-item>
|
||||
<el-form-item prop="parentId" label="上级栏目" label-width="80px">
|
||||
<el-input type="text" v-model="formData.parentName" :disabled="true"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="name" label="栏目名称">
|
||||
<el-input maxlength="100" placeholder="栏目名称"
|
||||
v-model="formData.name"
|
||||
auto-complete="off" tabindex="3" type="text"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="code" label="栏目标识">
|
||||
<el-input maxlength="100" placeholder="栏目标识"
|
||||
v-model="formData.code"
|
||||
auto-complete="off" tabindex="4" type="text"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="type" label="栏目类型">
|
||||
<el-radio-group v-model="formData.type">
|
||||
<el-radio label="article">文章</el-radio>
|
||||
<el-radio label="photo">相册</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item prop="url" label="URL">
|
||||
<el-input maxlength="100" placeholder="URL"
|
||||
v-model="formData.url"
|
||||
auto-complete="off" tabindex="6" type="text"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="target" label="打开方式">
|
||||
<el-radio-group v-model="formData.target">
|
||||
<el-radio label="_blank">新页面</el-radio>
|
||||
<el-radio label="_self">本页面</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item prop="disabled" label="启用状态">
|
||||
<el-switch
|
||||
v-model="formData.disabled"
|
||||
active-color="#ff4949"
|
||||
inactive-color="#13ce66">
|
||||
</el-switch>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="editDialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="doEdit">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
<el-dialog
|
||||
title="菜单排序"
|
||||
:visible.sync="sortDialogVisible"
|
||||
width="50%">
|
||||
<el-tree
|
||||
ref="sortMenuTree"
|
||||
:data="sortMenuData"
|
||||
draggable
|
||||
:allow-drop="sortAllowDrop"
|
||||
node-key="id"
|
||||
:props="defaultProps"
|
||||
>
|
||||
<span class="custom-tree-node" slot-scope="scope">
|
||||
<span>{{ scope.node.label }}</span>
|
||||
</span>
|
||||
</el-tree>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="sortDialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="doSort">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</div>
|
||||
<script>
|
||||
new Vue({
|
||||
el: "#app",
|
||||
data: function () {
|
||||
var sites = [];
|
||||
<!--#for(o in siteList){#-->
|
||||
sites.push({value: "${o.id!}", label: "${o.site_name!}"});
|
||||
<!--#}#-->
|
||||
var site = {id: "", site_name: ""};
|
||||
<!--#if(!isEmpty(site)){#-->
|
||||
site = {id: "${site.id}", site_name: "${site.site_name}"};
|
||||
<!--#}#-->
|
||||
return {
|
||||
addDialogVisible: false,
|
||||
editDialogVisible: false,
|
||||
sortDialogVisible: false,
|
||||
isAddFromSub: false,
|
||||
sites: sites,
|
||||
site: site,
|
||||
tableData: [],//后台取出的数据
|
||||
tableKey:"",
|
||||
formData: {
|
||||
id: "",
|
||||
parentId: "",
|
||||
parentName: "",
|
||||
type: "article",
|
||||
target: "_blank"
|
||||
},
|
||||
formRules: {
|
||||
name: [
|
||||
{required: true, message: '栏目名称', trigger: 'blur'}
|
||||
],
|
||||
code: [
|
||||
{required: true, message: '栏目标识', trigger: ['blur', 'change']}
|
||||
]
|
||||
},
|
||||
menuOptions: [],
|
||||
parentMenu: [],
|
||||
sortMenuData: [],
|
||||
defaultProps: {
|
||||
children: 'children',
|
||||
label: 'label'
|
||||
},
|
||||
props: {
|
||||
lazy: true,
|
||||
checkStrictly:true,
|
||||
multiple:false,
|
||||
lazyLoad: function (node, resolve) {
|
||||
var url = base + "/platform/cms/channel/tree/" + site.id;
|
||||
$.post(url, {pid: node.value}, function (data) {
|
||||
if (data.code == 0) {
|
||||
resolve(data.data);
|
||||
}
|
||||
}, "json");
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
//验证动态添加行数据
|
||||
validateMenu: function (rule, value, callback) {
|
||||
if (value.name == '') {
|
||||
callback(new Error('权限名称不能为空'));
|
||||
} else if (value.permission == '') {
|
||||
callback(new Error('权限标识不能为空'));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
},
|
||||
formRadioChange: function (val) {
|
||||
this.formData.children = val;
|
||||
if ("true" == val) {
|
||||
this.formData.buttons = [{
|
||||
name: '',
|
||||
permission: '',
|
||||
key: Date.now()
|
||||
}];
|
||||
} else {
|
||||
this.formData.buttons = [];
|
||||
}
|
||||
},
|
||||
formRemoveMenu: function (menu) {
|
||||
var index = this.formData.buttons.indexOf(menu);
|
||||
if (index !== -1) {
|
||||
this.formData.buttons.splice(index, 1);
|
||||
}
|
||||
},
|
||||
formAddMenu: function () {
|
||||
this.formData.buttons.push({
|
||||
name: '',
|
||||
permission: '',
|
||||
key: Date.now()
|
||||
});
|
||||
},
|
||||
//排序树加载
|
||||
sortMenuLoad: function () {
|
||||
var self = this;
|
||||
$.post(base + "/platform/cms/channel/sort/" + self.site.id, {}, function (data) {
|
||||
if (data.code == 0) {
|
||||
self.sortMenuData = data.data;
|
||||
}
|
||||
}, "json");
|
||||
},
|
||||
//排序树控制不可跨级拖拽
|
||||
sortAllowDrop: function (moveNode, inNode, type) {
|
||||
if (moveNode.data.parentId == inNode.data.parentId) {
|
||||
return type == 'prev';
|
||||
}
|
||||
},
|
||||
//打开排序功能
|
||||
openSort: function () {
|
||||
this.sortDialogVisible = true;
|
||||
this.sortMenuLoad();
|
||||
},
|
||||
//递归获取所有的ID值
|
||||
getTreeIds: function (ids, data) {
|
||||
var self = this;
|
||||
data.forEach(function (obj) {
|
||||
ids.push(obj.id);
|
||||
if (obj.children && obj.children.length > 0) {
|
||||
self.getTreeIds(ids, obj.children);
|
||||
}
|
||||
});
|
||||
},
|
||||
//提交排序后的数据
|
||||
doSort: function () {
|
||||
var self = this;
|
||||
var ids = [];
|
||||
self.getTreeIds(ids, self.sortMenuData);
|
||||
$.post(base + "/platform/cms/channel/sortDo/" + self.site.id, {ids: ids.toString()}, function (data) {
|
||||
if (data.code == 0) {
|
||||
self.$message({
|
||||
message: data.msg,
|
||||
type: 'success'
|
||||
});
|
||||
self.sortDialogVisible = false;
|
||||
self.initTreeTable();
|
||||
} else {
|
||||
self.$message({
|
||||
message: data.msg,
|
||||
type: 'error'
|
||||
});
|
||||
}
|
||||
}, "json");
|
||||
},
|
||||
openAdd: function () {
|
||||
var self = this;
|
||||
self.isAddFromSub = false;
|
||||
self.addDialogVisible = true;
|
||||
self.parentMenu = [];
|
||||
self.menuOptions=[];
|
||||
//表单还原为初始值
|
||||
self.formData = {
|
||||
id: "",
|
||||
parentId: "",
|
||||
parentName: "",
|
||||
type: "article",
|
||||
target: "_blank",
|
||||
};
|
||||
if (this.$refs["addForm"])
|
||||
this.$refs["addForm"].resetFields();
|
||||
},
|
||||
doAdd: function () {
|
||||
var self = this;
|
||||
var url = base + "/platform/cms/channel/addDo";
|
||||
self.$refs["addForm"].validate(function (valid) {
|
||||
if (valid) {//表单验证通过
|
||||
if (!self.isAddFromSub) {//如果不是添加子菜单,则从级联选择框取父节点ID
|
||||
self.formData.parentId = self.parentMenu[self.parentMenu.length - 1] || "";
|
||||
}
|
||||
self.formData.siteId = self.site.id;
|
||||
$.post(url, self.formData, function (data) {
|
||||
if (data.code == 0) {
|
||||
self.$message({
|
||||
message: data.msg,
|
||||
type: 'success'
|
||||
});
|
||||
self.addDialogVisible = false;
|
||||
self.initTreeTable();
|
||||
} else {
|
||||
self.$message({
|
||||
message: data.msg,
|
||||
type: 'error'
|
||||
});
|
||||
}
|
||||
}, "json");
|
||||
}
|
||||
});
|
||||
},
|
||||
doEdit: function () {
|
||||
var self = this;
|
||||
var url = base + "/platform/cms/channel/editDo";
|
||||
self.$refs["editForm"].validate(function (valid) {
|
||||
if (valid) {//表单验证通过
|
||||
$.post(url, self.formData, function (data) {
|
||||
if (data.code == 0) {
|
||||
self.$message({
|
||||
message: data.msg,
|
||||
type: 'success'
|
||||
});
|
||||
self.editDialogVisible = false;
|
||||
self.initTreeTable();
|
||||
} else {
|
||||
self.$message({
|
||||
message: data.msg,
|
||||
type: 'error'
|
||||
});
|
||||
}
|
||||
}, "json");
|
||||
}
|
||||
});
|
||||
},
|
||||
initTreeTable: function () {
|
||||
var self = this;
|
||||
var url = base + "/platform/cms/channel/child/" + self.site.id;
|
||||
$.post(url, {pid: ""}, function (data) {
|
||||
if (data.code == 0) {
|
||||
self.tableData = data.data;
|
||||
self.tableKey=+new Date();
|
||||
}
|
||||
}, "json");
|
||||
|
||||
},
|
||||
loadChild: function (tree, treeNode, resolve) {
|
||||
var self = this;
|
||||
var url = base + "/platform/cms/channel/child/" + self.site.id;
|
||||
$.post(url, {pid: tree.id}, function (data) {
|
||||
if (data.code == 0) {
|
||||
resolve(data.data);
|
||||
}
|
||||
}, "json");
|
||||
},
|
||||
dropdownCommand: function (command) {//监听下拉框事件
|
||||
var self = this;
|
||||
if ("add" == command.type) {
|
||||
self.openAdd();
|
||||
self.formData.parentId = command.id;
|
||||
self.formData.parentName = command.name;
|
||||
self.isAddFromSub = true;
|
||||
}
|
||||
if ("edit" == command.type) {
|
||||
$.post(base + "/platform/cms/channel/edit/" + command.id, {}, function (data) {
|
||||
if (data.code == 0) {
|
||||
self.formData = data.data;//加载后台表单数据
|
||||
self.editDialogVisible = true;//打开编辑窗口
|
||||
} else {
|
||||
self.$message({
|
||||
message: data.msg,
|
||||
type: 'error'
|
||||
});
|
||||
}
|
||||
}, "json");
|
||||
}
|
||||
if ("enable" == command.type || "disable" == command.type) {
|
||||
$.post(base + "/platform/cms/channel/" + command.type + "/" + command.id, {}, function (data) {
|
||||
if (data.code == 0) {
|
||||
self.$message({
|
||||
message: data.msg,
|
||||
type: 'success'
|
||||
});
|
||||
if ("disable" == command.type) {
|
||||
command.row.disabled = true;
|
||||
}
|
||||
if ("enable" == command.type) {
|
||||
command.row.disabled = false;
|
||||
}
|
||||
} else {
|
||||
self.$message({
|
||||
message: data.msg,
|
||||
type: 'error'
|
||||
});
|
||||
}
|
||||
}, "json");
|
||||
}
|
||||
if ("delete" == command.type) {
|
||||
self.$confirm('此操作将删除栏目 ' + command.name, '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
callback: function (a, b) {
|
||||
if ("confirm" == a) {//确认后再执行
|
||||
$.post(base + "/platform/cms/channel/delete/" + command.id, {}, function (data) {
|
||||
if (data.code == 0) {
|
||||
self.$message({
|
||||
message: data.msg,
|
||||
type: 'success'
|
||||
});
|
||||
self.initTreeTable();
|
||||
} else {
|
||||
self.$message({
|
||||
message: data.msg,
|
||||
type: 'error'
|
||||
});
|
||||
}
|
||||
}, "json");
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
siteChange: function (val) {
|
||||
window.location.href="${base}/platform/cms/channel/"+val;
|
||||
}
|
||||
},
|
||||
created: function () {
|
||||
this.initTreeTable();
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,338 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
<div id="app" v-cloak>
|
||||
<el-row class="header navbar bg-white shadow">
|
||||
<div class="btn-group tool-button mt5">
|
||||
<el-button size="medium" @click="openAdd">
|
||||
<i class="ti-plus"></i>
|
||||
新建分类
|
||||
</el-button>
|
||||
</div>
|
||||
<div class="pull-right offscreen-right mt5">
|
||||
<el-button size="medium" @click="delMore" type="danger" :disabled="selectData.length==0">
|
||||
<i class="el-icon-delete"></i>
|
||||
删除
|
||||
</el-button>
|
||||
</div>
|
||||
</el-row>
|
||||
<el-row class="el-table-container">
|
||||
<el-table
|
||||
:data="tableData"
|
||||
@sort-change='pageOrder'
|
||||
size="small"
|
||||
header-align="center"
|
||||
style="width: 100%"
|
||||
@selection-change="handleSelectionChange"
|
||||
:default-sort="{prop: 'opAt', order: 'descending'}"
|
||||
>
|
||||
<el-table-column
|
||||
type="selection"
|
||||
width="35">
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="分类名称" header-align="left" prop="name"
|
||||
:show-overflow-tooltip="true">
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="分类标识" header-align="left" prop="code"
|
||||
:show-overflow-tooltip="true">
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column sortable label="创建时间" header-align="center" align="center" prop="opAt">
|
||||
<template slot-scope="scope">
|
||||
{{formatAt(scope.row.opAt)}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column
|
||||
prop="id"
|
||||
label="操作"
|
||||
width="120">
|
||||
<template slot-scope="scope">
|
||||
<el-dropdown @command="dropdownCommand">
|
||||
<el-button size="mini">
|
||||
<i class="ti-settings"></i>
|
||||
<span class="ti-angle-down"></span>
|
||||
</el-button>
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-item :command="{type:'edit',id:scope.row.id}">
|
||||
修改
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item
|
||||
:command="{type:'delete',id:scope.row.id,name:scope.row.name}">
|
||||
删除
|
||||
</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-row>
|
||||
<el-row class="el-pagination-container">
|
||||
<el-pagination
|
||||
@size-change="pageSizeChange"
|
||||
@current-change="pageNumberChange"
|
||||
:current-page="pageForm.pageNumber"
|
||||
:page-sizes="[10, 20, 30, 50]"
|
||||
:page-size="pageForm.pageSize"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
:total="pageForm.totalCount">
|
||||
</el-pagination>
|
||||
</el-row>
|
||||
|
||||
<el-dialog
|
||||
title="新建分类"
|
||||
:visible.sync="addDialogVisible"
|
||||
width="40%">
|
||||
<el-form :model="formData" ref="addForm" :rules="formRules" size="small" label-width="80px">
|
||||
<el-form-item prop="name" label="分类名称">
|
||||
<el-input maxlength="100" placeholder="分类名称"
|
||||
v-model="formData.name"
|
||||
auto-complete="off" tabindex="1" type="text"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="code" label="分类标识">
|
||||
<el-input maxlength="100" placeholder="分类标识"
|
||||
v-model="formData.code"
|
||||
auto-complete="off" tabindex="2" type="text"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="addDialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="doAdd">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog
|
||||
title="修改分类"
|
||||
:visible.sync="editDialogVisible"
|
||||
width="40%">
|
||||
<el-form :model="formData" ref="editForm" :rules="formRules" size="small" label-width="80px">
|
||||
<el-form-item prop="name" label="分类名称">
|
||||
<el-input maxlength="100" placeholder="分类名称"
|
||||
v-model="formData.name"
|
||||
auto-complete="off" tabindex="1" type="text"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="code" label="分类标识">
|
||||
<el-input maxlength="100" placeholder="分类标识"
|
||||
v-model="formData.code"
|
||||
auto-complete="off" tabindex="2" type="text"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="editDialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="doEdit">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</div>
|
||||
<script>
|
||||
new Vue({
|
||||
el: "#app",
|
||||
data: function () {
|
||||
return {
|
||||
addDialogVisible: false,
|
||||
editDialogVisible: false,
|
||||
selectData: [],
|
||||
pageForm: {
|
||||
searchName: "",
|
||||
searchKeyword: "",
|
||||
pageNumber: 1,
|
||||
pageSize: 10,
|
||||
totalCount: 0,
|
||||
pageOrderName: "opAt",
|
||||
pageOrderBy: "descending"
|
||||
},
|
||||
tableData: [],
|
||||
formData: {
|
||||
id: "",
|
||||
},
|
||||
formRules: {
|
||||
name: [
|
||||
{required: true, message: '分类名称', trigger: 'blur'}
|
||||
],
|
||||
code: [
|
||||
{required: true, message: '分类标识', trigger: 'blur'}
|
||||
]
|
||||
},
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
pageOrder: function (column) {//按字段排序
|
||||
this.pageForm.pageOrderName = column.prop;
|
||||
this.pageForm.pageOrderBy = column.order;
|
||||
this.pageData();
|
||||
},
|
||||
pageNumberChange: function (val) {//页码更新操作
|
||||
this.pageForm.pageNumber = val;
|
||||
this.pageData();
|
||||
},
|
||||
pageSizeChange: function (val) {//分页大小更新操作
|
||||
this.pageForm.pageSize = val;
|
||||
this.pageData();
|
||||
},
|
||||
pageData: function () {//加载分页数据
|
||||
var self = this;
|
||||
sublime.showLoadingbar();//显示loading
|
||||
$.post(base + "/platform/cms/link/class/data", self.pageForm, function (data) {
|
||||
sublime.closeLoadingbar();//关闭loading
|
||||
if (data.code == 0) {
|
||||
self.tableData = data.data.list;
|
||||
self.pageForm.totalCount = data.data.totalCount;
|
||||
} else {
|
||||
self.$message({
|
||||
message: data.msg,
|
||||
type: 'error'
|
||||
});
|
||||
}
|
||||
}, "json");
|
||||
},
|
||||
formatAt: function (val) {
|
||||
if (val > 0)
|
||||
return moment(val * 1000).format("YYYY-MM-DD HH:mm");
|
||||
return "";
|
||||
},
|
||||
handleSelectionChange: function (val) {
|
||||
this.selectData = val;
|
||||
},
|
||||
openAdd: function () {
|
||||
var self = this;
|
||||
self.addDialogVisible = true;
|
||||
self.formData = {
|
||||
id: ""
|
||||
};//打开新增窗口,表单先清空
|
||||
if (self.$refs["addForm"])
|
||||
self.$refs["addForm"].resetFields();
|
||||
},
|
||||
doAdd: function () {
|
||||
var self = this;
|
||||
var url = base + "/platform/cms/link/class/addDo";
|
||||
self.$refs["addForm"].validate(function (valid) {
|
||||
if (valid) {//表单验证通过
|
||||
$.post(url, self.formData, function (data) {
|
||||
if (data.code == 0) {
|
||||
self.$message({
|
||||
message: data.msg,
|
||||
type: 'success'
|
||||
});
|
||||
self.addDialogVisible = false;
|
||||
self.pageData();
|
||||
} else {
|
||||
self.$message({
|
||||
message: data.msg,
|
||||
type: 'error'
|
||||
});
|
||||
}
|
||||
}, "json");
|
||||
}
|
||||
});
|
||||
},
|
||||
doEdit: function () {
|
||||
var self = this;
|
||||
var url = base + "/platform/cms/link/class/editDo";
|
||||
self.$refs["editForm"].validate(function (valid) {
|
||||
if (valid) {//表单验证通过
|
||||
$.post(url, self.formData, function (data) {
|
||||
if (data.code == 0) {
|
||||
self.$message({
|
||||
message: data.msg,
|
||||
type: 'success'
|
||||
});
|
||||
self.editDialogVisible = false;
|
||||
self.pageData();
|
||||
} else {
|
||||
self.$message({
|
||||
message: data.msg,
|
||||
type: 'error'
|
||||
});
|
||||
}
|
||||
}, "json");
|
||||
}
|
||||
});
|
||||
},
|
||||
delMore: function () {
|
||||
var self = this;
|
||||
if (self.selectData.length == 0) {
|
||||
self.$message({
|
||||
message: "请选择消息",
|
||||
type: 'warning'
|
||||
});
|
||||
return false;
|
||||
}
|
||||
var ids = [];
|
||||
self.selectData.forEach(function (val) {
|
||||
ids.push(val.id);
|
||||
});
|
||||
self.$confirm('您确定要删除选中的 ' + ids.length + ' 条数据? ', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
callback: function (a, b) {
|
||||
if ("confirm" == a) {//确认后再执行
|
||||
$.post(base + "/platform/cms/link/class/delete", {ids: ids.toString()}, function (data) {
|
||||
if (data.code == 0) {
|
||||
self.$message({
|
||||
message: data.msg,
|
||||
type: 'success'
|
||||
});
|
||||
self.pageData();
|
||||
} else {
|
||||
self.$message({
|
||||
message: data.msg,
|
||||
type: 'error'
|
||||
});
|
||||
}
|
||||
}, "json");
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
dropdownCommand: function (command) {//监听下拉框事件
|
||||
var self = this;
|
||||
if ("edit" == command.type) {
|
||||
$.post(base + "/platform/cms/link/class/edit/" + command.id, {}, function (data) {
|
||||
if (data.code == 0) {
|
||||
self.formData = data.data;//加载后台表单数据
|
||||
self.editDialogVisible = true;//打开编辑窗口
|
||||
} else {
|
||||
self.$message({
|
||||
message: data.msg,
|
||||
type: 'error'
|
||||
});
|
||||
}
|
||||
}, "json");
|
||||
}
|
||||
if ("delete" == command.type) {
|
||||
self.$confirm('此操作将删除: ' + command.name, '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
callback: function (a, b) {
|
||||
if ("confirm" == a) {//确认后再执行
|
||||
$.post(base + "/platform/cms/link/class/delete/" + command.id, {}, function (data) {
|
||||
if (data.code == 0) {
|
||||
self.$message({
|
||||
message: data.msg,
|
||||
type: 'success'
|
||||
});
|
||||
self.pageData();
|
||||
} else {
|
||||
self.$message({
|
||||
message: data.msg,
|
||||
type: 'error'
|
||||
});
|
||||
}
|
||||
}, "json");
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
created: function () {
|
||||
this.pageData();
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,467 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
<style>
|
||||
.el-upload input[type=file] {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.avatar-uploader .el-upload {
|
||||
border: 1px dashed #d9d9d9;
|
||||
border-radius: 6px;
|
||||
cursor: pointer;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.avatar-uploader .el-upload:hover {
|
||||
border-color: #409EFF;
|
||||
}
|
||||
|
||||
.avatar-uploader-icon {
|
||||
font-size: 28px;
|
||||
color: #8c939d;
|
||||
width: 128px;
|
||||
height: 128px;
|
||||
line-height: 128px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.avatar {
|
||||
width: 128px;
|
||||
height: 128px;
|
||||
display: block;
|
||||
}
|
||||
</style>
|
||||
<div id="app" v-cloak>
|
||||
<el-row class="header navbar bg-white shadow">
|
||||
<div class="btn-group tool-button mt5">
|
||||
<span>分类:</span>
|
||||
<el-select size="medium" v-model="pageForm.classId" placeholder="请选择" @change="change">
|
||||
<el-option
|
||||
v-for="item in classs"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
<el-button size="medium" @click="openAdd">
|
||||
<i class="ti-plus"></i>
|
||||
新建链接
|
||||
</el-button>
|
||||
</div>
|
||||
<div class="pull-right offscreen-right mt5">
|
||||
<el-button size="medium" @click="delMore" type="danger" :disabled="selectData.length==0">
|
||||
<i class="el-icon-delete"></i>
|
||||
删除
|
||||
</el-button>
|
||||
</div>
|
||||
</el-row>
|
||||
<el-row class="el-table-container">
|
||||
<el-table
|
||||
:data="tableData"
|
||||
@sort-change='pageOrder'
|
||||
size="small"
|
||||
header-align="center"
|
||||
style="width: 100%"
|
||||
@selection-change="handleSelectionChange"
|
||||
:default-sort="{prop: 'opAt', order: 'descending'}"
|
||||
>
|
||||
<el-table-column
|
||||
type="selection"
|
||||
width="35">
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="链接名称" header-align="left" prop="name"
|
||||
:show-overflow-tooltip="true">
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="链接类型" header-align="left" prop="type"
|
||||
:show-overflow-tooltip="true">
|
||||
<template slot-scope="scope">
|
||||
<span v-if="'txt'==scope.row.type">文字</span>
|
||||
<span v-if="'img'==scope.row.type">图片</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="链接地址" header-align="left" prop="url"
|
||||
:show-overflow-tooltip="true">
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="打开方式" header-align="left" prop="target"
|
||||
:show-overflow-tooltip="true">
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column sortable label="创建时间" header-align="center" align="center" prop="opAt">
|
||||
<template slot-scope="scope">
|
||||
{{formatAt(scope.row.opAt)}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column
|
||||
prop="id"
|
||||
label="操作"
|
||||
width="120">
|
||||
<template slot-scope="scope">
|
||||
<el-dropdown @command="dropdownCommand">
|
||||
<el-button size="mini">
|
||||
<i class="ti-settings"></i>
|
||||
<span class="ti-angle-down"></span>
|
||||
</el-button>
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-item :command="{type:'edit',id:scope.row.id}">
|
||||
修改
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item
|
||||
:command="{type:'delete',id:scope.row.id,name:scope.row.name}">
|
||||
删除
|
||||
</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-row>
|
||||
<el-row class="el-pagination-container">
|
||||
<el-pagination
|
||||
@size-change="pageSizeChange"
|
||||
@current-change="pageNumberChange"
|
||||
:current-page="pageForm.pageNumber"
|
||||
:page-sizes="[10, 20, 30, 50]"
|
||||
:page-size="pageForm.pageSize"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
:total="pageForm.totalCount">
|
||||
</el-pagination>
|
||||
</el-row>
|
||||
|
||||
<el-dialog
|
||||
title="新建链接"
|
||||
:visible.sync="addDialogVisible"
|
||||
width="40%">
|
||||
<el-form :model="formData" ref="addForm" :rules="formRules" size="small" label-width="80px">
|
||||
<el-form-item prop="classId" label="所属分类">
|
||||
<span>{{pageForm.className}}</span>
|
||||
</el-form-item>
|
||||
<el-form-item prop="name" label="链接名称">
|
||||
<el-input maxlength="100" placeholder="链接名称"
|
||||
v-model="formData.name"
|
||||
auto-complete="off" tabindex="1" type="text"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="type" label="链接类型">
|
||||
<el-radio-group v-model="formData.type" @change="typeChange">
|
||||
<el-radio label="txt">文字</el-radio>
|
||||
<el-radio label="img">图片</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="链接图片" v-if="'img'==formData.type">
|
||||
<el-upload
|
||||
class="avatar-uploader"
|
||||
tabindex="5"
|
||||
action="${base}/open/file/upload/image"
|
||||
name="Filedata"
|
||||
:show-file-list="false"
|
||||
:on-success="function(resp,file,fileList){return handleLogoSuccess(resp,file,fileList,'picurl')}">
|
||||
|
||||
<img v-if="formData.picurl" :src="'${AppFileDomain!}'+formData.picurl" class="avatar">
|
||||
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
|
||||
</el-upload>
|
||||
</el-form-item>
|
||||
<el-form-item prop="url" label="链接地址">
|
||||
<el-input maxlength="100" placeholder="链接地址"
|
||||
v-model="formData.url"
|
||||
auto-complete="off" tabindex="2" type="text"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="target" label="打开方式">
|
||||
<el-radio-group v-model="formData.target">
|
||||
<el-radio label="_blank">新页面</el-radio>
|
||||
<el-radio label="_self">本页面</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="addDialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="doAdd">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog
|
||||
title="修改链接"
|
||||
:visible.sync="editDialogVisible"
|
||||
width="40%">
|
||||
<el-form :model="formData" ref="editForm" :rules="formRules" size="small" label-width="80px">
|
||||
<el-form-item prop="name" label="链接名称">
|
||||
<el-input maxlength="100" placeholder="链接名称"
|
||||
v-model="formData.name"
|
||||
auto-complete="off" tabindex="1" type="text"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="type" label="链接类型">
|
||||
<el-radio-group v-model="formData.type" @change="typeChange">
|
||||
<el-radio label="txt">文字</el-radio>
|
||||
<el-radio label="img">图片</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="链接图片" v-if="'img'==formData.type">
|
||||
<el-upload
|
||||
class="avatar-uploader"
|
||||
tabindex="5"
|
||||
action="${base}/open/file/upload/image"
|
||||
name="Filedata"
|
||||
:show-file-list="false"
|
||||
:on-success="function(resp,file,fileList){return handleLogoSuccess(resp,file,fileList,'picurl')}">
|
||||
|
||||
<img v-if="formData.picurl" :src="'${AppFileDomain!}'+formData.picurl" class="avatar">
|
||||
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
|
||||
</el-upload>
|
||||
</el-form-item>
|
||||
<el-form-item prop="url" label="链接地址">
|
||||
<el-input maxlength="100" placeholder="链接地址"
|
||||
v-model="formData.url"
|
||||
auto-complete="off" tabindex="2" type="text"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="target" label="打开方式">
|
||||
<el-radio-group v-model="formData.target">
|
||||
<el-radio label="_blank">新页面</el-radio>
|
||||
<el-radio label="_self">本页面</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="editDialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="doEdit">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</div>
|
||||
<script>
|
||||
new Vue({
|
||||
el: "#app",
|
||||
data: function () {
|
||||
var classs = [];
|
||||
<!--#for(o in list){#-->
|
||||
classs.push({value: "${o.id!}", label: "${o.name!}"});
|
||||
<!--#}#-->
|
||||
return {
|
||||
classs: classs,
|
||||
addDialogVisible: false,
|
||||
editDialogVisible: false,
|
||||
selectData: [],
|
||||
pageForm: {
|
||||
searchName: "",
|
||||
searchKeyword: "",
|
||||
pageNumber: 1,
|
||||
pageSize: 10,
|
||||
totalCount: 0,
|
||||
pageOrderName: "opAt",
|
||||
pageOrderBy: "descending",
|
||||
classId: "${classObj.id!}",
|
||||
className: "${classObj.name!}"
|
||||
},
|
||||
tableData: [],
|
||||
formData: {},
|
||||
formRules: {
|
||||
name: [
|
||||
{required: true, message: '分类名称', trigger: 'blur'}
|
||||
]
|
||||
},
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
pageOrder: function (column) {//按字段排序
|
||||
this.pageForm.pageOrderName = column.prop;
|
||||
this.pageForm.pageOrderBy = column.order;
|
||||
this.pageData();
|
||||
},
|
||||
pageNumberChange: function (val) {//页码更新操作
|
||||
this.pageForm.pageNumber = val;
|
||||
this.pageData();
|
||||
},
|
||||
pageSizeChange: function (val) {//分页大小更新操作
|
||||
this.pageForm.pageSize = val;
|
||||
this.pageData();
|
||||
},
|
||||
pageData: function () {//加载分页数据
|
||||
var self = this;
|
||||
sublime.showLoadingbar();//显示loading
|
||||
$.post(base + "/platform/cms/link/link/data", self.pageForm, function (data) {
|
||||
sublime.closeLoadingbar();//关闭loading
|
||||
if (data.code == 0) {
|
||||
self.tableData = data.data.list;
|
||||
self.pageForm.totalCount = data.data.totalCount;
|
||||
} else {
|
||||
self.$message({
|
||||
message: data.msg,
|
||||
type: 'error'
|
||||
});
|
||||
}
|
||||
}, "json");
|
||||
},
|
||||
formatAt: function (val) {
|
||||
if (val > 0)
|
||||
return moment(val * 1000).format("YYYY-MM-DD HH:mm");
|
||||
return "";
|
||||
},
|
||||
handleSelectionChange: function (val) {
|
||||
this.selectData = val;
|
||||
},
|
||||
openAdd: function () {
|
||||
var self = this;
|
||||
self.addDialogVisible = true;
|
||||
self.formData = {
|
||||
id: "",
|
||||
target: "_blank",
|
||||
url: "javascript:void(0);",
|
||||
type: "txt",
|
||||
classId: "${classObj.id!}"
|
||||
};//打开新增窗口,表单先清空
|
||||
if (self.$refs["addForm"])
|
||||
self.$refs["addForm"].resetFields();
|
||||
},
|
||||
doAdd: function () {
|
||||
var self = this;
|
||||
var url = base + "/platform/cms/link/link/addDo";
|
||||
self.$refs["addForm"].validate(function (valid) {
|
||||
if (valid) {//表单验证通过
|
||||
$.post(url, self.formData, function (data) {
|
||||
if (data.code == 0) {
|
||||
self.$message({
|
||||
message: data.msg,
|
||||
type: 'success'
|
||||
});
|
||||
self.addDialogVisible = false;
|
||||
self.pageData();
|
||||
} else {
|
||||
self.$message({
|
||||
message: data.msg,
|
||||
type: 'error'
|
||||
});
|
||||
}
|
||||
}, "json");
|
||||
}
|
||||
});
|
||||
},
|
||||
doEdit: function () {
|
||||
var self = this;
|
||||
var url = base + "/platform/cms/link/link/editDo";
|
||||
self.$refs["editForm"].validate(function (valid) {
|
||||
if (valid) {//表单验证通过
|
||||
$.post(url, self.formData, function (data) {
|
||||
if (data.code == 0) {
|
||||
self.$message({
|
||||
message: data.msg,
|
||||
type: 'success'
|
||||
});
|
||||
self.editDialogVisible = false;
|
||||
self.pageData();
|
||||
} else {
|
||||
self.$message({
|
||||
message: data.msg,
|
||||
type: 'error'
|
||||
});
|
||||
}
|
||||
}, "json");
|
||||
}
|
||||
});
|
||||
},
|
||||
delMore: function () {
|
||||
var self = this;
|
||||
if (self.selectData.length == 0) {
|
||||
self.$message({
|
||||
message: "请选择消息",
|
||||
type: 'warning'
|
||||
});
|
||||
return false;
|
||||
}
|
||||
var ids = [];
|
||||
self.selectData.forEach(function (val) {
|
||||
ids.push(val.id);
|
||||
});
|
||||
self.$confirm('您确定要删除选中的 ' + ids.length + ' 条数据? ', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
callback: function (a, b) {
|
||||
if ("confirm" == a) {//确认后再执行
|
||||
$.post(base + "/platform/cms/link/link/delete", {ids: ids.toString()}, function (data) {
|
||||
if (data.code == 0) {
|
||||
self.$message({
|
||||
message: data.msg,
|
||||
type: 'success'
|
||||
});
|
||||
self.pageData();
|
||||
} else {
|
||||
self.$message({
|
||||
message: data.msg,
|
||||
type: 'error'
|
||||
});
|
||||
}
|
||||
}, "json");
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
dropdownCommand: function (command) {//监听下拉框事件
|
||||
var self = this;
|
||||
if ("edit" == command.type) {
|
||||
$.post(base + "/platform/cms/link/link/edit/" + command.id, {}, function (data) {
|
||||
if (data.code == 0) {
|
||||
self.formData = data.data;//加载后台表单数据
|
||||
self.editDialogVisible = true;//打开编辑窗口
|
||||
} else {
|
||||
self.$message({
|
||||
message: data.msg,
|
||||
type: 'error'
|
||||
});
|
||||
}
|
||||
}, "json");
|
||||
}
|
||||
if ("delete" == command.type) {
|
||||
self.$confirm('此操作将删除: ' + command.name, '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
callback: function (a, b) {
|
||||
if ("confirm" == a) {//确认后再执行
|
||||
$.post(base + "/platform/cms/link/link/delete/" + command.id, {}, function (data) {
|
||||
if (data.code == 0) {
|
||||
self.$message({
|
||||
message: data.msg,
|
||||
type: 'success'
|
||||
});
|
||||
self.pageData();
|
||||
} else {
|
||||
self.$message({
|
||||
message: data.msg,
|
||||
type: 'error'
|
||||
});
|
||||
}
|
||||
}, "json");
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
handleLogoSuccess: function (response, file, fileList, attrName) {
|
||||
if (response.code == 0) {
|
||||
// 对象属性直接赋值不会触发试图更新,采用 Vue.set 、this.$set或者Object.assign({},this.obj)创建新对象
|
||||
// 或者也可以定义一个 refresh 属性 ,当数据发生改变时,该属性同时变化,也会触发视图更新
|
||||
this.$set(this.formData, attrName, response.data);
|
||||
} else {
|
||||
this.$set(this.formData, attrName, "");
|
||||
}
|
||||
},
|
||||
typeChange: function (val) {
|
||||
if ("txt" == val) {//类型变化了要清除数据
|
||||
this.formData.picurl = "";
|
||||
}
|
||||
},
|
||||
change: function (val) {
|
||||
window.location.href = "${base}/platform/cms/link/link/" + val;
|
||||
}
|
||||
},
|
||||
created: function () {
|
||||
this.pageData();
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,583 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
<style>
|
||||
.el-upload input[type=file] {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.avatar-uploader .el-upload {
|
||||
border: 1px dashed #d9d9d9;
|
||||
border-radius: 6px;
|
||||
cursor: pointer;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.avatar-uploader .el-upload:hover {
|
||||
border-color: #409EFF;
|
||||
}
|
||||
|
||||
.avatar-uploader-icon {
|
||||
font-size: 28px;
|
||||
color: #8c939d;
|
||||
width: 128px;
|
||||
height: 128px;
|
||||
line-height: 128px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.avatar {
|
||||
width: 128px;
|
||||
height: 128px;
|
||||
display: block;
|
||||
}
|
||||
</style>
|
||||
<div id="app" v-cloak>
|
||||
<el-row class="header navbar bg-white shadow">
|
||||
<div class="btn-group tool-button mt5">
|
||||
<el-button size="medium" @click="openAdd"><i class="ti-plus"></i> 添加站点</el-button>
|
||||
</div>
|
||||
</el-row>
|
||||
<!-- 数据表格 -->
|
||||
<el-row class="el-table-container">
|
||||
<el-table
|
||||
:data="tableData"
|
||||
@sort-change='pageOrder'
|
||||
size="small"
|
||||
style="width: 100%">
|
||||
<el-table-column
|
||||
sortable
|
||||
prop="id"
|
||||
label="站点编码"
|
||||
width="200">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="site_name"
|
||||
label="站点名称"
|
||||
width="200">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="site_domain"
|
||||
label="域名地址">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="1"
|
||||
label="操作"
|
||||
width="120">
|
||||
<template scope="scope">
|
||||
<el-dropdown @command="dropdownCommand">
|
||||
<el-button size="mini">
|
||||
<i class="ti-settings"></i>
|
||||
<span class="ti-angle-down"></span>
|
||||
</el-button>
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-item :command="{type:'edit',id:scope.row.id}">
|
||||
修改
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item :command="{type:'delete',id:scope.row.id,name:scope.row.site_name}">
|
||||
删除
|
||||
</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-row>
|
||||
<el-row class="el-pagination-container">
|
||||
<el-pagination
|
||||
@size-change="pageSizeChange"
|
||||
@current-change="pageNumberChange"
|
||||
:current-page="pageForm.pageNumber"
|
||||
:page-sizes="[10, 20, 30, 50]"
|
||||
:page-size="pageForm.pageSize"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
:total="pageForm.totalCount">
|
||||
</el-pagination>
|
||||
</el-row>
|
||||
<!-- 弹出框 -->
|
||||
<!-- 新增 -->
|
||||
<el-dialog
|
||||
title="新增站点"
|
||||
:visible.sync="addDialogVisible"
|
||||
width="50%">
|
||||
<el-form :model="formData" ref="addForm" :rules="formRules" size="small" label-width="100px">
|
||||
<el-tabs v-model="activeName" type="card">
|
||||
<el-tab-pane label="基本信息" name="base">
|
||||
<el-form-item prop="id" label="站点编码">
|
||||
<el-input maxlength="100" placeholder="站点编码"
|
||||
v-model="formData.id"
|
||||
auto-complete="off" tabindex="1" type="text"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="site_name" label="站点名称">
|
||||
<el-input maxlength="100" placeholder="站点名称"
|
||||
v-model="formData.site_name"
|
||||
auto-complete="off" tabindex="2" type="text"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="site_domain" label="域名地址">
|
||||
<el-input placeholder="http://"
|
||||
v-model="formData.site_domain"
|
||||
auto-complete="off" tabindex="3" type="text"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="site_icp" label="备案号">
|
||||
<el-input maxlength="100" placeholder="备案号"
|
||||
v-model="formData.site_icp"
|
||||
auto-complete="off" tabindex="4" type="text"></el-input>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="PC版Logo">
|
||||
<el-upload
|
||||
class="avatar-uploader"
|
||||
tabindex="5"
|
||||
action="${base}/open/file/upload/image"
|
||||
name="Filedata"
|
||||
:show-file-list="false"
|
||||
:on-success="function(resp,file,fileList){return handleLogoSuccess(resp,file,fileList,'site_logo')}">
|
||||
|
||||
<img v-if="formData.site_logo" :src="'${AppFileDomain!}'+formData.site_logo" class="avatar">
|
||||
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
|
||||
</el-upload>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="手机版Logo">
|
||||
<el-upload
|
||||
class="avatar-uploader"
|
||||
tabindex="6"
|
||||
action="${base}/open/file/upload/image"
|
||||
name="Filedata"
|
||||
:show-file-list="false"
|
||||
:on-success="function(resp,file,fileList){return handleLogoSuccess(resp,file,fileList,'site_wap_logo')}">
|
||||
|
||||
<img v-if="formData.site_wap_logo" :src="'${AppFileDomain!}'+formData.site_wap_logo" class="avatar">
|
||||
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
|
||||
</el-upload>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item prop="footer_content" label="底部信息">
|
||||
<el-input maxlength="100" placeholder="底部信息"
|
||||
v-model="formData.footer_content"
|
||||
auto-complete="off" tabindex="7" type="textarea"></el-input>
|
||||
</el-form-item>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="联系方式" name="contact">
|
||||
<el-form-item prop="site_qq" label="客服QQ">
|
||||
<el-input maxlength="100" placeholder="客服QQ"
|
||||
v-model="formData.site_qq"
|
||||
auto-complete="off" tabindex="1" type="text"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="site_email" label="网站邮箱">
|
||||
<el-input maxlength="100" placeholder="网站邮箱"
|
||||
v-model="formData.site_email"
|
||||
auto-complete="off" tabindex="2" type="text"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="site_tel" label="客服电话">
|
||||
<el-input maxlength="100" placeholder="客服电话"
|
||||
v-model="formData.site_tel"
|
||||
auto-complete="off" tabindex="3" type="text"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="weibo_name" label="微博名称">
|
||||
<el-input maxlength="100" placeholder="微博名称"
|
||||
v-model="formData.weibo_name"
|
||||
auto-complete="off" tabindex="4" type="text"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="weibo_url" label="微博地址">
|
||||
<el-input maxlength="100" placeholder="微博地址"
|
||||
v-model="formData.weibo_url"
|
||||
auto-complete="off" tabindex="5" type="text"></el-input>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="微博二维码">
|
||||
<el-upload
|
||||
class="avatar-uploader"
|
||||
tabindex="5"
|
||||
action="${base}/open/file/upload/image"
|
||||
name="Filedata"
|
||||
:show-file-list="false"
|
||||
:on-success="function(resp,file,fileList){return handleLogoSuccess(resp,file,fileList,'weibo_qrcode')}">
|
||||
|
||||
<img v-if="formData.weibo_qrcode" :src="'${AppFileDomain!}'+formData.weibo_qrcode" class="avatar">
|
||||
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
|
||||
<div class="el-upload__tip" slot="tip">请上传您的微博二维码</div>
|
||||
</el-upload>
|
||||
</el-form-item>
|
||||
<el-form-item prop="wechat_name" label="微信名称">
|
||||
<el-input maxlength="100" placeholder="微信名称"
|
||||
v-model="formData.wechat_name"
|
||||
auto-complete="off" tabindex="6" type="text"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="wechat_id" label="微信帐号">
|
||||
<el-input maxlength="100" placeholder="微信帐号"
|
||||
v-model="formData.wechat_id"
|
||||
auto-complete="off" tabindex="7" type="text"></el-input>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="微信二维码">
|
||||
<el-upload
|
||||
class="avatar-uploader"
|
||||
tabindex="5"
|
||||
action="${base}/open/file/upload/image"
|
||||
name="Filedata"
|
||||
:show-file-list="false"
|
||||
:on-success="function(resp,file,fileList){return handleLogoSuccess(resp,file,fileList,'wechat_qrcode')}">
|
||||
|
||||
<img v-if="formData.wechat_qrcode" :src="'${AppFileDomain!}'+formData.wechat_qrcode" class="avatar">
|
||||
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
|
||||
<div class="el-upload__tip" slot="tip">请上传您的微信二维码</div>
|
||||
</el-upload>
|
||||
</el-form-item>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="SEO优化" name="seo">
|
||||
<el-form-item prop="seo_keywords" label="网页关键词">
|
||||
<el-input maxlength="100" placeholder="网页关键词"
|
||||
v-model="formData.seo_keywords"
|
||||
auto-complete="off" tabindex="1" type="text"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="seo_description" label="网页描述">
|
||||
<el-input maxlength="100" placeholder="网页描述"
|
||||
v-model="formData.seo_description"
|
||||
auto-complete="off" tabindex="2" type="textarea" maxlength="120"></el-input>
|
||||
</el-form-item>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="addDialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="doAdd">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 修改 -->
|
||||
<el-dialog
|
||||
title="修改站点"
|
||||
:visible.sync="editDialogVisible"
|
||||
width="50%">
|
||||
<el-form :model="formData" ref="editForm" :rules="formRules" size="small" label-width="100px">
|
||||
<el-tabs v-model="activeName" type="card">
|
||||
<el-tab-pane label="基本信息" name="base">
|
||||
<el-form-item prop="id" label="站点编码">
|
||||
<el-input maxlength="100" placeholder="站点编码"
|
||||
v-model="formData.id"
|
||||
auto-complete="off" tabindex="1" type="text"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="site_name" label="站点名称">
|
||||
<el-input maxlength="100" placeholder="站点名称"
|
||||
v-model="formData.site_name"
|
||||
auto-complete="off" tabindex="2" type="text"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="site_domain" label="域名地址">
|
||||
<el-input placeholder="http://"
|
||||
v-model="formData.site_domain"
|
||||
auto-complete="off" tabindex="3" type="text"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="site_icp" label="备案号">
|
||||
<el-input maxlength="100" placeholder="备案号"
|
||||
v-model="formData.site_icp"
|
||||
auto-complete="off" tabindex="4" type="text"></el-input>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="LOGO">
|
||||
<el-upload
|
||||
class="avatar-uploader"
|
||||
tabindex="5"
|
||||
action="${base}/open/file/upload/image"
|
||||
name="Filedata"
|
||||
:show-file-list="false"
|
||||
:on-success="function(resp,file,fileList){return handleLogoSuccess(resp,file,fileList,'site_logo')}">
|
||||
|
||||
<img v-if="formData.site_logo" :src="'${AppFileDomain!}'+formData.site_logo" class="avatar">
|
||||
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
|
||||
</el-upload>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="手机版Logo">
|
||||
<el-upload
|
||||
class="avatar-uploader"
|
||||
tabindex="6"
|
||||
action="${base}/open/file/upload/image"
|
||||
name="Filedata"
|
||||
:show-file-list="false"
|
||||
:on-success="function(resp,file,fileList){return handleLogoSuccess(resp,file,fileList,'site_wap_logo')}">
|
||||
|
||||
<img v-if="formData.site_wap_logo" :src="'${AppFileDomain!}'+formData.site_wap_logo" class="avatar">
|
||||
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
|
||||
</el-upload>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item prop="footer_content" label="底部信息">
|
||||
<el-input maxlength="100" placeholder="底部信息"
|
||||
v-model="formData.footer_content"
|
||||
auto-complete="off" tabindex="7" type="textarea"></el-input>
|
||||
</el-form-item>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="联系方式" name="contact">
|
||||
<el-form-item prop="site_qq" label="客服QQ">
|
||||
<el-input maxlength="100" placeholder="客服QQ"
|
||||
v-model="formData.site_qq"
|
||||
auto-complete="off" tabindex="1" type="text"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="site_email" label="网站邮箱">
|
||||
<el-input maxlength="100" placeholder="网站邮箱"
|
||||
v-model="formData.site_email"
|
||||
auto-complete="off" tabindex="2" type="text"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="site_tel" label="客服电话">
|
||||
<el-input maxlength="100" placeholder="客服电话"
|
||||
v-model="formData.site_tel"
|
||||
auto-complete="off" tabindex="3" type="text"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="weibo_name" label="微博名称">
|
||||
<el-input maxlength="100" placeholder="微博名称"
|
||||
v-model="formData.weibo_name"
|
||||
auto-complete="off" tabindex="4" type="text"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="weibo_url" label="微博地址">
|
||||
<el-input maxlength="100" placeholder="微博地址"
|
||||
v-model="formData.weibo_url"
|
||||
auto-complete="off" tabindex="5" type="text"></el-input>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="微博二维码">
|
||||
<el-upload
|
||||
class="avatar-uploader"
|
||||
tabindex="5"
|
||||
action="${base}/open/file/upload/image"
|
||||
name="Filedata"
|
||||
:show-file-list="false"
|
||||
:on-success="function(resp,file,fileList){return handleLogoSuccess(resp,file,fileList,'weibo_qrcode')}">
|
||||
|
||||
<img v-if="formData.weibo_qrcode" :src="'${AppFileDomain!}'+formData.weibo_qrcode" class="avatar">
|
||||
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
|
||||
<div class="el-upload__tip" slot="tip">请上传您的微博二维码</div>
|
||||
</el-upload>
|
||||
</el-form-item>
|
||||
<el-form-item prop="wechat_name" label="微信名称">
|
||||
<el-input maxlength="100" placeholder="微信名称"
|
||||
v-model="formData.wechat_name"
|
||||
auto-complete="off" tabindex="6" type="text"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="wechat_id" label="微信帐号">
|
||||
<el-input maxlength="100" placeholder="微信帐号"
|
||||
v-model="formData.wechat_id"
|
||||
auto-complete="off" tabindex="7" type="text"></el-input>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="微信二维码">
|
||||
<el-upload
|
||||
class="avatar-uploader"
|
||||
tabindex="5"
|
||||
action="${base}/open/file/upload/image"
|
||||
name="Filedata"
|
||||
:show-file-list="false"
|
||||
:on-success="function(resp,file,fileList){return handleLogoSuccess(resp,file,fileList,'wechat_qrcode')}">
|
||||
|
||||
<img v-if="formData.wechat_qrcode" :src="'${AppFileDomain!}'+formData.wechat_qrcode" class="avatar">
|
||||
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
|
||||
<div class="el-upload__tip" slot="tip">请上传您的微信二维码</div>
|
||||
</el-upload>
|
||||
</el-form-item>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="SEO优化" name="seo">
|
||||
<el-form-item prop="seo_keywords" label="网页关键词">
|
||||
<el-input maxlength="100" placeholder="网页关键词"
|
||||
v-model="formData.seo_keywords"
|
||||
auto-complete="off" tabindex="1" type="text"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="seo_description" label="网页描述">
|
||||
<el-input maxlength="100" placeholder="网页描述"
|
||||
v-model="formData.seo_description"
|
||||
auto-complete="off" tabindex="2" type="textarea" maxlength="120"></el-input>
|
||||
</el-form-item>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="editDialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="doEdit">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</div>
|
||||
<script>
|
||||
new Vue({
|
||||
el: "#app",
|
||||
data: function () {
|
||||
return {
|
||||
addDialogVisible: false,
|
||||
editDialogVisible: false,
|
||||
tableData: [],
|
||||
pageForm: {
|
||||
siteName: "",
|
||||
siteDomain: "",
|
||||
pageSize: 10,
|
||||
pageNumber: 1,
|
||||
pageOrderName: "",
|
||||
pageOrderBy: "",
|
||||
totalCount: 0
|
||||
},
|
||||
activeName: "base",
|
||||
formData: {
|
||||
id: "",
|
||||
site_name: "",
|
||||
site_domain: "",
|
||||
site_logo: ""
|
||||
},
|
||||
imageUrl: "",
|
||||
formRules: {
|
||||
id: [
|
||||
{required: true, message: '请输入站点编码', trigger: 'blur'},
|
||||
],
|
||||
site_name: [
|
||||
{required: true, message: '请输入站点名', trigger: 'blur'},
|
||||
],
|
||||
site_email: [
|
||||
{type: "email", message: '请输入正确的邮箱地址', trigger: 'blur'},
|
||||
],
|
||||
seo_description: [
|
||||
{max: 120, message: '描述请不要超过 120 个字符', trigger: 'blur'},
|
||||
],
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
openAdd: function () {
|
||||
this.addDialogVisible = true;
|
||||
this.formData = {};//打开新增窗口,表单先清空
|
||||
},
|
||||
doAdd: function () {
|
||||
var self = this;
|
||||
var url = base + "/platform/cms/site/addDo";
|
||||
self.$refs["addForm"].validate(function (valid) {
|
||||
if (valid) {//表单验证通过
|
||||
$.post(url, self.formData, function (data) {
|
||||
if (data.code == 0) {
|
||||
self.$message({
|
||||
message: data.msg,
|
||||
type: 'success'
|
||||
});
|
||||
self.addDialogVisible = false;
|
||||
self.activeName = "base";
|
||||
self.pageData();//重新加载分页数据
|
||||
} else {
|
||||
self.$message({
|
||||
message: data.msg,
|
||||
type: 'error'
|
||||
});
|
||||
}
|
||||
}, "json");
|
||||
}
|
||||
});
|
||||
},
|
||||
doEdit: function () {
|
||||
var self = this;
|
||||
var url = base + "/platform/cms/site/editDo";
|
||||
self.$refs["editForm"].validate(function (valid) {
|
||||
if (valid) {
|
||||
$.post(url, self.formData, function (data) {
|
||||
if (data.code == 0) {
|
||||
self.$message({
|
||||
message: data.msg,
|
||||
type: 'success'
|
||||
});
|
||||
self.editDialogVisible = false;
|
||||
self.activeName = "base";
|
||||
self.pageData();//重新加载分页数据
|
||||
} else {
|
||||
self.$message({
|
||||
message: data.msg,
|
||||
type: 'error'
|
||||
});
|
||||
}
|
||||
}, "json");
|
||||
}
|
||||
});
|
||||
},
|
||||
pageOrder: function (column) {//按字段排序
|
||||
this.pageForm.pageOrderName = column.prop;
|
||||
this.pageForm.pageOrderBy = column.order;
|
||||
this.pageData();
|
||||
},
|
||||
pageNumberChange: function (val) {//页码更新操作
|
||||
this.pageForm.pageNumber = val;
|
||||
this.pageData();
|
||||
},
|
||||
pageSizeChange: function (val) {//分页大小更新操作
|
||||
this.pageForm.pageSize = val;
|
||||
this.pageData();
|
||||
},
|
||||
beforeImageUpload: function (file) {
|
||||
|
||||
},
|
||||
handleLogoSuccess: function (response, file, fileList, attrName) {
|
||||
if (response.code == 0) {
|
||||
// 对象属性直接赋值不会触发试图更新,采用 Vue.set 、this.$set或者Object.assign({},this.obj)创建新对象
|
||||
// 或者也可以定义一个 refresh 属性 ,当数据发生改变时,该属性同时变化,也会触发视图更新
|
||||
// this.formData.site_logo =response.data;
|
||||
this.$set(this.formData, attrName, response.data);
|
||||
} else {
|
||||
this.$set(this.formData, attrName, "");
|
||||
}
|
||||
},
|
||||
pageData:function() {//加载分页数据
|
||||
var self = this;
|
||||
sublime.showLoadingbar();//显示loading
|
||||
$.post(base + "/platform/cms/site/data", self.pageForm, function (data) {
|
||||
sublime.closeLoadingbar();//关闭loading
|
||||
if (data.code == 0) {
|
||||
self.tableData = data.data.list;
|
||||
self.pageForm.totalCount = data.data.totalCount;
|
||||
} else {
|
||||
self.$message({
|
||||
message: data.msg,
|
||||
type: 'error'
|
||||
});
|
||||
}
|
||||
}, "json");
|
||||
},
|
||||
dropdownCommand: function (command) {//监听下拉框事件
|
||||
var self = this;
|
||||
if ("edit" == command.type) {
|
||||
$.post(base + "/platform/cms/site/edit/" + command.id, {}, function (data) {
|
||||
if (data.code == 0) {
|
||||
self.formData = data.data;//加载后台表单数据
|
||||
self.editDialogVisible = true;//打开编辑窗口
|
||||
} else {
|
||||
self.$message({
|
||||
message: data.msg,
|
||||
type: 'error'
|
||||
});
|
||||
}
|
||||
}, "json");
|
||||
}
|
||||
if ("delete" == command.type) {
|
||||
self.$confirm('此操作将删除站点 ' + command.name, '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
callback: function (a, b) {
|
||||
if ("confirm" == a) {//确认后再执行
|
||||
$.post(base + "/platform/cms/site/delete/" + command.id, {}, function (data) {
|
||||
if (data.code == 0) {
|
||||
self.$message({
|
||||
message: data.msg,
|
||||
type: 'success'
|
||||
});
|
||||
self.pageData();
|
||||
} else {
|
||||
self.$message({
|
||||
message: data.msg,
|
||||
type: 'error'
|
||||
});
|
||||
}
|
||||
}, "json");
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
created: function () {
|
||||
this.pageData();
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<!--#}#-->
|
||||
@@ -0,0 +1,159 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<!-- 在 head 标签中添加 meta 标签,并设置 viewport-fit=cover 值 -->
|
||||
<meta name="viewport"
|
||||
content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, viewport-fit=cover">
|
||||
<title>签字</title>
|
||||
<!-- 引入样式文件 -->
|
||||
<!--<link rel="stylesheet" href="https://cdn.staticfile.org/vant/2.12.5/index.min.css">
|
||||
<link rel="stylesheet" href="https://res.wx.qq.com/open/libs/weui/2.2.0/weui.min.css">-->
|
||||
<link rel="stylesheet" href="${base!}/assets/mobile/css/cdn.staticfile.org_vant_2.12.25_index.min.css"/>
|
||||
<!-- <link rel="stylesheet" href="${base!}/assets/platform/plugins/vant/index.min.css"/>-->
|
||||
<!-- 引入 Vue 和 Vant 的 JS 文件 -->
|
||||
<script src="${base!}/assets/platform/plugins/vue/vue.min.js"></script>
|
||||
<script src="${base!}/assets/mobile/js/cdn.staticfile.org_vant_2.12.25_vant.min.js"></script>
|
||||
<script src="/assets/platform/plugins/jquery/jquery-1.11.1.min.js"></script>
|
||||
<script src="/assets/platform/plugins/moment/moment.min.js"></script>
|
||||
<script src="/assets/platform/js/signature.min.js"></script>
|
||||
</head>
|
||||
<style>
|
||||
[v-clock] {
|
||||
display: none
|
||||
}
|
||||
</style>
|
||||
<body style="height: 100%;width: 100%">
|
||||
<div v-clock id="app" style="height: 100%;width: 100%">
|
||||
<van-row style="margin-top: 10vh;text-align: center">
|
||||
<h3 style="color: #1989fa">提示:请在下方区域签字!</h3>
|
||||
</van-row>
|
||||
<van-row style="margin-top: 20px">
|
||||
<canvas id="canvas" style="border: rgb(220,220,220) 1px solid"></canvas>
|
||||
</van-row>
|
||||
<van-row style="margin-top: 20px">
|
||||
<van-col span="24" style="text-align: center">
|
||||
<van-row type="flex" justify="space-around">
|
||||
<van-col span="11">
|
||||
<van-button @click="reset" type="default" size="large">清 空</van-button>
|
||||
</van-col>
|
||||
<van-col span="11">
|
||||
<van-button type="info" @click="doSub" size="large" :disabled="subDis">提 交</van-button>
|
||||
</van-col>
|
||||
</van-row>
|
||||
</van-col>
|
||||
</van-row>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
document.body.addEventListener('touchmove', function (e) {
|
||||
e.preventDefault(); //阻止默认的处理方式(阻止下拉滑动的效果)
|
||||
}, {passive: false}); //passive 参数不能省略,用来兼容ios和android
|
||||
|
||||
function getQueryVariable(variable) {
|
||||
var query = window.location.search.substring(1);
|
||||
var vars = query.split("&");
|
||||
for (var i = 0; i < vars.length; i++) {
|
||||
var pair = vars[i].split("=");
|
||||
if (pair[0] == variable) {
|
||||
return pair[1];
|
||||
}
|
||||
}
|
||||
return '';
|
||||
}
|
||||
|
||||
var qmoption = {
|
||||
el: '#canvas',
|
||||
lineWidth: 4,
|
||||
lineColor: '#000',
|
||||
overflow: false,
|
||||
background: '#fff'
|
||||
}
|
||||
var qm
|
||||
|
||||
var
|
||||
vue = new Vue({
|
||||
el: "#app",
|
||||
data: function () {
|
||||
return {
|
||||
prefix: '',
|
||||
id: '',
|
||||
base64: '',
|
||||
subDis: false,
|
||||
isNull: function (val) {
|
||||
if (val === null || val === undefined || val === '') {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
},
|
||||
}
|
||||
},
|
||||
filters: {
|
||||
none2str: function (value) {
|
||||
if (vue.isNull(value)) {
|
||||
return '暂无'
|
||||
}
|
||||
return value
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
reset() {
|
||||
qm.reset()
|
||||
},
|
||||
doSub() {
|
||||
qm.getContentBase64(false, (val) => {
|
||||
this.base64 = val
|
||||
})
|
||||
|
||||
$.post("/signature/doSub", {
|
||||
prefix: this.prefix,
|
||||
id: this.id,
|
||||
base64: this.base64
|
||||
}, (data) => {
|
||||
if (data.code == 0) {
|
||||
this.$notify({
|
||||
message: data.msg,
|
||||
type: 'success'
|
||||
});
|
||||
this.subDis = true
|
||||
setTimeout(() => {
|
||||
window.close()
|
||||
}, 1000)
|
||||
} else {
|
||||
this.$notify({
|
||||
message: data.msg,
|
||||
type: 'danger'
|
||||
});
|
||||
}
|
||||
}, "json");
|
||||
}
|
||||
},
|
||||
mounted: () => {
|
||||
canvas = document.getElementById("canvas");
|
||||
if (canvas.width < window.innerWidth) {
|
||||
canvas.width = window.innerWidth;
|
||||
}
|
||||
|
||||
if (canvas.height < window.innerHeight) {
|
||||
canvas.height = window.innerHeight * 0.5;
|
||||
}
|
||||
|
||||
qm = new Signature(qmoption);
|
||||
qm.create();
|
||||
},
|
||||
created: function () {
|
||||
if (this.isNull(getQueryVariable("id")) || this.isNull(getQueryVariable("prefix"))) {
|
||||
this.$notify({
|
||||
message: '缺少参数!',
|
||||
type: 'danger'
|
||||
});
|
||||
this.subDis = true
|
||||
}
|
||||
this.id = getQueryVariable("id")
|
||||
this.prefix = getQueryVariable("prefix")
|
||||
}
|
||||
})
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,365 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
|
||||
<style>
|
||||
.avatar-uploader .el-upload {
|
||||
border: 1px dashed #d9d9d9;
|
||||
border-radius: 6px;
|
||||
cursor: pointer;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.avatar-uploader .el-upload:hover {
|
||||
border-color: #409EFF;
|
||||
}
|
||||
|
||||
.avatar-uploader-icon {
|
||||
font-size: 28px;
|
||||
color: #8c939d;
|
||||
width: 178px;
|
||||
height: 178px;
|
||||
line-height: 178px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.avatar {
|
||||
width: 178px;
|
||||
height: 178px;
|
||||
display: block;
|
||||
}
|
||||
</style>
|
||||
<div id="app" v-cloak>
|
||||
<guava>
|
||||
<el-card shadow="never">
|
||||
<div class="btn-group tool-button">
|
||||
<el-input placeholder="请输入项目名称" clearable v-model="pageForm.contributionName"
|
||||
@keyup.enter.native="doSearch">
|
||||
<template slot="prepend">项目名称</template>
|
||||
</el-input>
|
||||
</div>
|
||||
<div class="btn-group tool-button">
|
||||
<el-button type="primary" icon="el-icon-search" @click="doSearch"></el-button>
|
||||
</div>
|
||||
|
||||
<div class="pull-right offscreen-right">
|
||||
<el-button type="primary" icon="el-icon-plus" @click="openAdd">添加项目</el-button>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<el-card shadow="never" class="mt20">
|
||||
<el-table :data="tableData" style="width: 100%" row-key="id" @sort-change="pageOrder"
|
||||
>
|
||||
<el-table-column align="center" header-align="center" label="序号" width="120px">
|
||||
<template scope="scope">
|
||||
<span>{{scope.$index+(pageForm.pageNumber - 1) * pageForm.pageSize + 1}} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
align="center"
|
||||
header-align="center"
|
||||
v-for="column in tableColumns"
|
||||
show-overflow-tooltip
|
||||
:label="column.label"
|
||||
:prop="column.prop"
|
||||
sortable
|
||||
>
|
||||
<template scope="{row}" v-if="column.prop=='contributionTypeName'">
|
||||
{{row.typeName?row.typeName:'暂无'}}
|
||||
</template>
|
||||
<template scope="{row}" v-else-if="column.prop=='isContributionEnable'">
|
||||
<el-switch @change="switchChange(row)" v-model="row.isContributionEnable"
|
||||
active-color="#13ce66"
|
||||
inactive-color="#ff4949"></el-switch>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" header-align="center" label="操作" fixed="right"
|
||||
width="300px">
|
||||
<template slot-scope="{row}">
|
||||
<el-button size="mini" @click="openView(row,false)">查看
|
||||
</el-button>
|
||||
<el-button size="mini" type="primary" @click="openEdit(row,true)">编辑
|
||||
</el-button>
|
||||
<el-button type="danger" size="mini" @click="doDelete(row.id)">删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--#include("/layouts/pagination.html"){}#-->
|
||||
</el-card>
|
||||
</guava>
|
||||
|
||||
<el-dialog :title="title" :visible.sync="DialogVisible" :close-on-click-modal="false"
|
||||
width="60%">
|
||||
<el-form :model="formData" ref="addForm" :rules="formRules"
|
||||
label-width="100px">
|
||||
<el-form-item label="项目名称" prop="contributionName">
|
||||
<el-input type="text" v-model="formData.contributionName" maxlength="50"
|
||||
placeholder="请填写项目名称" :readonly="!isView"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="所属捐款专题" prop="contributionTypeCode">
|
||||
<el-select placeholder="所属捐款专题" v-model="formData.contributionTypeCode"
|
||||
style="width: 100%;"
|
||||
clearable="true"
|
||||
filterable="true"
|
||||
:disabled="!isView">
|
||||
<el-option v-for="item in contributionTypes"
|
||||
:label="item.typeName+'('+item.typeCode+')'"
|
||||
:value="item.typeCode"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="捐款时间" prop="contributionTime">
|
||||
<el-date-picker
|
||||
:readonly="!isView"
|
||||
style="width: 100%;"
|
||||
v-model="formData.contributionTime"
|
||||
type="datetimerange"
|
||||
value-format="yyyy-MM-dd HH:mm:ss"
|
||||
range-separator="至"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="捐款模式" prop="contributionMode">
|
||||
<el-radio-group v-model="formData.contributionMode" :disabled="!isView">
|
||||
<el-radio-button label="sdc">水滴筹</el-radio-button>
|
||||
<el-radio-button label="yrj">一日捐</el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="捐款链接" prop="contributionUrl"
|
||||
v-if="formData.contributionMode==='sdc'">
|
||||
<el-input type="text" v-model="formData.contributionUrl" maxlength="50"
|
||||
placeholder="请填写捐款链接" :readonly="!isView"></el-input>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="是否开启" prop="isContributionEnable">
|
||||
<el-switch v-model="formData.isContributionEnable" active-color="#13ce66"
|
||||
inactive-color="#ff4949" :readonly="!isView"></el-switch>
|
||||
</el-form-item>
|
||||
<el-form-item label="项目介绍" prop="contributionIntroduce">
|
||||
<div id="contributionIntroduceEditor"></div>
|
||||
</el-form-item>
|
||||
<el-form-item label="封面图" prop="contributionFiles">
|
||||
<file-upload v-if="!isView"
|
||||
:files="formData.contributionFiles"
|
||||
:view="true"></file-upload>
|
||||
<file-upload :max="1" :files.sync="formData.contributionFiles" v-else>
|
||||
<template #el-upload__tip>
|
||||
<div class="el-upload__tip" slot="tip">
|
||||
图片类请上传jpg/png/jpeg等格式上传数量为1个
|
||||
</div>
|
||||
</template>
|
||||
</file-upload>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="DialogVisible = false" v-if="!isView">取 消</el-button>
|
||||
<el-button type="primary" :disabled="subDis" @click="operation"
|
||||
v-if="isView">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
let E = window.wangEditor
|
||||
let contributionIntroduceEditor = null
|
||||
var vue = new Vue({
|
||||
el: '#app',
|
||||
mixins: [initTableMixins],
|
||||
data() {
|
||||
return {
|
||||
contributionTypes: [],
|
||||
isView: true,
|
||||
title: "",
|
||||
subDis: false,
|
||||
DialogVisible: false,
|
||||
imageUrl: '',
|
||||
pageForm: {},
|
||||
tableColumns: [
|
||||
{prop: 'contributionName', label: '项目名称'},
|
||||
{prop: 'contributionTypeName', label: '所属专题'},
|
||||
{prop: 'contributionCreationDate', label: '创建时间'},
|
||||
{prop: 'isContributionEnable', label: '是否开启'}
|
||||
],
|
||||
formRules: {
|
||||
contributionName: [{
|
||||
required: true,
|
||||
message: '必填',
|
||||
trigger: ['blur', 'change']
|
||||
}],
|
||||
contributionIntroduce: [{
|
||||
required: true,
|
||||
message: '必填',
|
||||
trigger: ['blur', 'change']
|
||||
}],
|
||||
contributionFiles: [{
|
||||
required: true,
|
||||
message: '必选',
|
||||
trigger: ['blur', 'change']
|
||||
}],
|
||||
isContributionEnable: [{
|
||||
required: true,
|
||||
message: '必选',
|
||||
trigger: ['blur', 'change']
|
||||
}],
|
||||
contributionTime: [{
|
||||
required: true,
|
||||
message: '必选',
|
||||
trigger: ['blur', 'change']
|
||||
}],
|
||||
contributionMode: [{
|
||||
required: true,
|
||||
message: '必选',
|
||||
trigger: ['blur', 'change']
|
||||
}],
|
||||
},
|
||||
}
|
||||
},
|
||||
components: {},
|
||||
methods: {
|
||||
async handleAvatarSuccess(res, file) {
|
||||
this.$set(this.formData, 'contributionFiles', res.data.filepath)
|
||||
},
|
||||
beforeAvatarUpload(file) {
|
||||
const isJPEG = file.type === 'image/jpeg';
|
||||
const isJPG = file.type === 'image/jpg';
|
||||
const isPNG = file.type === 'image/png';
|
||||
const IsSVG = file.type === 'image/svg';
|
||||
const isLt2M = file.size / 1024 / 1024 < 2;
|
||||
if (!(isJPEG || isPNG)) {
|
||||
this.$message.error('上传头像图片只能是 isJPG 格式!');
|
||||
}
|
||||
if (!isLt2M) {
|
||||
this.$message.error('上传头像图片大小不能超过 2MB!');
|
||||
}
|
||||
return (isJPEG || isPNG) && isLt2M;
|
||||
},
|
||||
openView(data, flag) {
|
||||
this.isView = flag
|
||||
this.title = "查看项目"
|
||||
data.contributionTime = [data.contributionStartTime, data.contributionEndTime]
|
||||
const formData = clone(data)
|
||||
this.formData = formData
|
||||
this.formData.contributionFiles = JSON.parse(this.formData.contributionFiles)
|
||||
this.$nextTick(() => {
|
||||
$("#contributionIntroduceEditor").html("")
|
||||
contributionIntroduceEditor = new E("#contributionIntroduceEditor")
|
||||
contributionIntroduceEditor.config.onchange = (html) => {
|
||||
this.formData.contributionIntroduce = html
|
||||
}
|
||||
contributionIntroduceEditor.config.uploadImgShowBase64 = true // 使用 base64 保存图片
|
||||
contributionIntroduceEditor.create()
|
||||
contributionIntroduceEditor.txt.html(this.formData.contributionIntroduce)
|
||||
})
|
||||
this.DialogVisible = true;
|
||||
if (this.$refs['addForm']) {
|
||||
this.$refs['addForm'].resetFields()
|
||||
}
|
||||
},
|
||||
openEdit(data, flag) {
|
||||
this.isView = flag
|
||||
this.title = "编辑项目"
|
||||
data.contributionTime = [data.contributionStartTime, data.contributionEndTime]
|
||||
const formData = clone(data)
|
||||
this.formData = formData
|
||||
this.formData.contributionFiles = JSON.parse(this.formData.contributionFiles)
|
||||
this.$nextTick(() => {
|
||||
$("#contributionIntroduceEditor").html("")
|
||||
contributionIntroduceEditor = new E("#contributionIntroduceEditor")
|
||||
contributionIntroduceEditor.config.onchange = (html) => {
|
||||
this.formData.contributionIntroduce = html
|
||||
}
|
||||
contributionIntroduceEditor.config.uploadImgShowBase64 = true // 使用 base64 保存图片
|
||||
contributionIntroduceEditor.create()
|
||||
contributionIntroduceEditor.txt.html(this.formData.contributionIntroduce)
|
||||
})
|
||||
this.DialogVisible = true;
|
||||
if (this.$refs['addForm']) {
|
||||
this.$refs['addForm'].resetFields()
|
||||
}
|
||||
},
|
||||
openAdd() {
|
||||
this.title = "添加项目"
|
||||
this.formData = {
|
||||
isContributionEnable: false
|
||||
}
|
||||
this.DialogVisible = true;
|
||||
if (this.$refs['addForm']) {
|
||||
this.$refs['addForm'].resetFields()
|
||||
}
|
||||
this.$nextTick(() => {
|
||||
$("#contributionIntroduceEditor").html("")
|
||||
contributionIntroduceEditor = new E("#contributionIntroduceEditor")
|
||||
contributionIntroduceEditor.config.onchange = (html) => {
|
||||
this.formData.contributionIntroduce = html
|
||||
}
|
||||
contributionIntroduceEditor.config.uploadImgShowBase64 = true // 使用 base64 保存图片
|
||||
contributionIntroduceEditor.create()
|
||||
})
|
||||
},
|
||||
async switchChange(data) {
|
||||
this.formData = data
|
||||
const resp = await $.post(loc() + "/doEdit", {contribution: JSON.stringify(this.formData)})
|
||||
if(resp.code===0){
|
||||
this.notifySuccess(resp.msg)
|
||||
this.pageData()
|
||||
}else{
|
||||
this.notifyWarning(resp.msg)
|
||||
}
|
||||
},
|
||||
async operation() {
|
||||
let method = this.formData.id ? "/doEdit" : "/doAdd"
|
||||
this.$refs["addForm"].validate(async (valid) => {
|
||||
if (valid) {
|
||||
const loading = this.$loading({
|
||||
lock: true,
|
||||
text: '正在提交...',
|
||||
spinner: 'el-icon-loading',
|
||||
background: COVER_LAYER_COLOR
|
||||
});
|
||||
this.formData.contributionStartTime = this.formData.contributionTime[0]
|
||||
this.formData.contributionEndTime = this.formData.contributionTime[1]
|
||||
const resp = await $.post(loc() + method, {
|
||||
contribution: JSON.stringify(this.formData)
|
||||
})
|
||||
loading.close()
|
||||
if(resp.code===0){
|
||||
this.DialogVisible = false;
|
||||
this.pageData();
|
||||
}else{
|
||||
this.notifyWarning(resp.msg)
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
async doDelete(id) {
|
||||
let self = this
|
||||
this.$confirm('确定要删除吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
callback: async (a, b) => {
|
||||
if ("confirm" === a) {
|
||||
const resp = await $.get(loc() + "/doDelete", {id: id})
|
||||
if(resp.code===0){
|
||||
this.notifySuccess(resp.msg)
|
||||
self.pageData()
|
||||
}else{
|
||||
this.notifyWarning(resp.msg)
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
},
|
||||
async created() {
|
||||
this.contributionTypes = await contribution.getContributionType()
|
||||
this.pageData()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,248 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
|
||||
<style>
|
||||
.avatar-uploader .el-upload {
|
||||
border: 1px dashed #d9d9d9;
|
||||
border-radius: 6px;
|
||||
cursor: pointer;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.avatar-uploader .el-upload:hover {
|
||||
border-color: #409EFF;
|
||||
}
|
||||
|
||||
.avatar-uploader-icon {
|
||||
font-size: 28px;
|
||||
color: #8c939d;
|
||||
width: 178px;
|
||||
height: 178px;
|
||||
line-height: 178px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.avatar {
|
||||
width: 178px;
|
||||
height: 178px;
|
||||
display: block;
|
||||
}
|
||||
</style>
|
||||
<div id="app" v-cloak>
|
||||
<guava>
|
||||
<el-card shadow="never">
|
||||
<div class="btn-group tool-button">
|
||||
<el-input placeholder="请输入内容" clearable v-model="pageForm.searchKeyword"
|
||||
@keyup.enter.native="doSearch">
|
||||
<el-select v-model="pageForm.searchName" slot="prepend" placeholder="查询类型"
|
||||
style="width: 80px;">
|
||||
<el-option label="名称" value="typeName"></el-option>
|
||||
<el-option label="编码" value="typeCode"></el-option>
|
||||
</el-select>
|
||||
</el-input>
|
||||
</div>
|
||||
<div class="btn-group tool-button">
|
||||
<el-button type="primary" icon="el-icon-search" @click="doSearch"></el-button>
|
||||
</div>
|
||||
|
||||
<div class="pull-right offscreen-right">
|
||||
<el-button type="primary" icon="el-icon-plus" @click="openAdd">添加类型</el-button>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<el-card shadow="never" class="mt20">
|
||||
<el-table :data="tableData" style="width: 100%" row-key="id" @sort-change="pageOrder"
|
||||
>
|
||||
<el-table-column align="center" header-align="center" label="序号" width="120px">
|
||||
<template scope="scope">
|
||||
<span>{{scope.$index+(pageForm.pageNumber - 1) * pageForm.pageSize + 1}} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
align="center"
|
||||
header-align="center"
|
||||
v-for="column in tableColumns"
|
||||
show-overflow-tooltip
|
||||
:label="column.label"
|
||||
:prop="column.prop"
|
||||
sortable
|
||||
></el-table-column>
|
||||
<el-table-column align="center" header-align="center" label="操作" fixed="right"
|
||||
width="300px">
|
||||
<template slot-scope="{row}">
|
||||
<el-button size="mini" @click="openView(row,true)">查看
|
||||
</el-button>
|
||||
<el-button size="mini" type="primary" @click="openEdit(row,false)">编辑
|
||||
</el-button>
|
||||
<el-button type="danger" size="mini" @click="doDelete(row.id)">删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--#include("/layouts/pagination.html"){}#-->
|
||||
</el-card>
|
||||
</guava>
|
||||
|
||||
<el-dialog :title="title" :visible.sync="DialogVisible" :close-on-click-modal="false"
|
||||
width="40%">
|
||||
<el-form :model="formData" ref="addForm" :rules="formRules"
|
||||
label-width="100px">
|
||||
<el-form-item label="专题编号" prop="typeCode">
|
||||
<el-input type="text" v-model="formData.typeCode" maxlength="50"
|
||||
placeholder="请填写专题编号"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="专题名称" prop="typeName">
|
||||
<el-input type="text" v-model="formData.typeName" maxlength="50"
|
||||
placeholder="请填写专题名称"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="专题介绍" prop="contributionTypeIntroduce">
|
||||
<el-input type="textarea" v-model="formData.contributionTypeIntroduce" :rows="4"
|
||||
placeholder="请填写专题介绍"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="封面图" prop="contributionTypeFiles">
|
||||
<file-upload :files.sync="formData.contributionTypeFiles" :max="1"
|
||||
:type="['jpg','jpeg','png','JPG','JPEG','PNG']" :view="isView">
|
||||
<template #el-upload__tip>
|
||||
<div class="el-upload__tip" slot="tip">请上传jpg/png/jpeg/JPG/PNG/JPEG等格式</div>
|
||||
</template>
|
||||
</file-upload>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="DialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" :disabled="subDis" @click="operation"
|
||||
v-if="!isView">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
var vue = new Vue({
|
||||
el: '#app',
|
||||
mixins: [initTableMixins],
|
||||
data() {
|
||||
return {
|
||||
isView: false,
|
||||
title: "",
|
||||
subDis: false,
|
||||
DialogVisible: false,
|
||||
imageUrl: '',
|
||||
pageForm: {
|
||||
searchName: 'typeName'
|
||||
},
|
||||
tableColumns: [
|
||||
{prop: 'typeCode', label: '专题编号'},
|
||||
{prop: 'typeName', label: '专题名称'}
|
||||
],
|
||||
formRules: {
|
||||
typeName: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
typeCode: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
contributionTypeIntroduce: [{
|
||||
required: true,
|
||||
message: '必填',
|
||||
trigger: ['blur', 'change']
|
||||
}],
|
||||
contributionTypeFiles: [{
|
||||
required: true,
|
||||
message: '必选',
|
||||
trigger: ['blur', 'change']
|
||||
}],
|
||||
},
|
||||
}
|
||||
},
|
||||
components: {},
|
||||
methods: {
|
||||
async handleAvatarSuccess(res, file) {
|
||||
this.$set(this.formData, 'contributionTypeFiles', res.data.filepath)
|
||||
},
|
||||
beforeAvatarUpload(file) {
|
||||
/* const isJPEG = file.type === 'image/jpeg';
|
||||
const isJPG = file.type === 'image/jpg';
|
||||
const isPNG = file.type === 'image/png';
|
||||
const IsSVG = file.type === 'image/svg';
|
||||
const isLt2M = file.size / 1024 / 1024 < 2;
|
||||
|
||||
/!* if (!isPNG) {
|
||||
this.$message.error('上传头像图片只能是 PNG格式!');
|
||||
}*!/
|
||||
if (!isLt2M) {
|
||||
this.$message.error('上传头像图片大小不能超过 2MB!');
|
||||
}
|
||||
return isLt2M;*/
|
||||
},
|
||||
openView(data, flag) {
|
||||
this.isView = flag
|
||||
this.title = "查看类型"
|
||||
this.formData = data
|
||||
this.DialogVisible = true;
|
||||
},
|
||||
openEdit(data, flag) {
|
||||
this.isView = flag
|
||||
this.title = "编辑类型"
|
||||
this.formData = data
|
||||
this.DialogVisible = true;
|
||||
},
|
||||
openAdd() {
|
||||
this.isView = false
|
||||
this.title = "添加类型"
|
||||
this.formData = {}
|
||||
this.DialogVisible = true;
|
||||
if (this.$refs['addForm']) {
|
||||
this.$refs['addForm'].resetFields()
|
||||
}
|
||||
},
|
||||
async operation() {
|
||||
let method = this.formData.id ? "/doEdit" : "/doAdd"
|
||||
this.$refs["addForm"].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() + method, {
|
||||
data: JSON.stringify(this.formData)
|
||||
})
|
||||
loading.close()
|
||||
if(resp.code===0){
|
||||
this.notifySuccess(resp.msg)
|
||||
this.DialogVisible = false;
|
||||
this.pageData();
|
||||
}else{
|
||||
this.notifyWarning(resp.msg)
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
async doDelete(id) {
|
||||
let self = this
|
||||
this.$confirm('确定要删除吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
callback: async (a, b) => {
|
||||
if ("confirm" === a) {
|
||||
const resp = await $.get(loc() + "/doDelete", {id: id})
|
||||
if(resp.code===0){
|
||||
self.notifySuccess(resp.msg)
|
||||
self.pageData()
|
||||
}else{
|
||||
this.notifyWarning(resp.msg)
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
},
|
||||
async created() {
|
||||
this.pageData()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,238 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
|
||||
<div id="app" v-cloak>
|
||||
<guava>
|
||||
<el-card shadow="never">
|
||||
<div class="btn-group tool-button">
|
||||
<el-select placeholder="捐款项目" v-model="pageForm.contributionName"
|
||||
style="width: 100%;"
|
||||
clearable="true"
|
||||
filterable="true">
|
||||
<el-option v-for="item in contributionOption" :label="item.contributionName"
|
||||
:value="item.contributionName"></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
<div class="btn-group tool-button">
|
||||
<el-select placeholder="所属工会" v-model="pageForm.unionId" style="width: 100%;"
|
||||
clearable="true"
|
||||
@change="flushUnits" @clear="flushUnits"
|
||||
|
||||
v-if="${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')||@shiro.hasRole('H03')}"
|
||||
|
||||
filterable="true">
|
||||
<el-option v-for="item in unions" :label="item.unionname"
|
||||
:value="item.id"></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
|
||||
<div class="btn-group tool-button">
|
||||
<el-select placeholder="所属单位" v-model="pageForm.unitId" style="width: 100%;"
|
||||
clearable="true"
|
||||
filterable="true">
|
||||
<el-option v-for="item in units" :label="item.name"
|
||||
:value="item.id"></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
<div class="btn-group tool-button">
|
||||
<el-select placeholder="捐款方式" v-model="pageForm.payMode" style="width: 100%;"
|
||||
clearable="true"
|
||||
filterable="true">
|
||||
<el-option label="微信" value="WeChat"></el-option>
|
||||
<el-option label="支付宝" value="Alipay"></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
<div class="btn-group tool-button">
|
||||
<el-button type="primary" icon="el-icon-search" @click="doSearch"></el-button>
|
||||
</div>
|
||||
<div class="pull-right offscreen-right">
|
||||
<el-button type="primary" icon="el-icon-search" @click="doExport">导出</el-button>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
|
||||
<el-card shadow="never" class="mt20">
|
||||
<table-tool label="捐款列表" :app="this">
|
||||
|
||||
</table-tool>
|
||||
<el-table :data="tableData" style="width: 100%" row-key="id" @sort-change="pageOrder"
|
||||
:size="tableSize"
|
||||
show-summary :summary-method="getSummaries">
|
||||
<el-table-column align="center" header-align="center" label="序号" width="120px">
|
||||
<template scope="scope">
|
||||
<span>{{scope.$index+(pageForm.pageNumber - 1) * pageForm.pageSize + 1}} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
align="center"
|
||||
header-align="center"
|
||||
v-for="column in tableColumns"
|
||||
show-overflow-tooltip
|
||||
:label="column.label"
|
||||
:prop="column.prop"
|
||||
sortable
|
||||
>
|
||||
<template v-if="column.prop=='payMode'" scope="{row}">
|
||||
{{row.payMode==='WeChat'?'微信':'支付宝'}}
|
||||
</template>
|
||||
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="200">
|
||||
<template slot-scope="{row}">
|
||||
<el-button size="mini" type="primary"
|
||||
@click="openView(row)">
|
||||
查看
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--#include("/layouts/pagination.html"){}#-->
|
||||
</el-card>
|
||||
</guava>
|
||||
|
||||
<el-dialog
|
||||
title="捐款详情"
|
||||
:visible.sync="viewDialogVisible"
|
||||
width="50%"
|
||||
:close-on-click-modal="false">
|
||||
|
||||
<el-descriptions class="margin-top" title="" :column="3" border>
|
||||
<el-descriptions-item label="捐款项目">
|
||||
{{viewData.contributionName}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="捐款人工号">
|
||||
{{viewData.loginname}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="姓名">
|
||||
{{viewData.username}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="联系方式">
|
||||
{{viewData.mobile}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="所属工会">
|
||||
{{viewData.unionname}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="所属单位">
|
||||
{{viewData.unitname}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="善款金额">
|
||||
{{viewData.money}}元
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="捐款方式">
|
||||
{{viewData.payMode==='WeChat'?'微信':'支付宝'}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="捐款时间">
|
||||
{{viewData.contributionTime}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="捐款凭证">
|
||||
<file-upload :files="viewData.contributionFiles" :view="true">
|
||||
</file-upload>
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="viewDialogVisible = false">关 闭</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</div>
|
||||
|
||||
|
||||
<script>
|
||||
var vue = new Vue({
|
||||
el: '#app',
|
||||
mixins: [initTableMixins],
|
||||
data() {
|
||||
return {
|
||||
viewData: {},
|
||||
viewDialogVisible: false,
|
||||
contributionOption: [],
|
||||
unions: [],
|
||||
units: [],
|
||||
pageForm: {
|
||||
contributionName: '',
|
||||
unionId: '',
|
||||
unitId: '',
|
||||
payMode: ''
|
||||
},
|
||||
tableColumns: [
|
||||
{prop: 'contributionName', label: '捐款项目'},
|
||||
{prop: 'loginname', label: '捐款人工号'},
|
||||
{prop: 'username', label: '姓名'},
|
||||
{prop: 'mobile', label: '联系方式'},
|
||||
{prop: 'unionname', label: '所属工会'},
|
||||
{prop: 'unitname', label: '所属单位'},
|
||||
{prop: 'money', label: '善款金额'},
|
||||
{prop: 'payMode', label: '捐款方式'},
|
||||
{prop: 'contributionTime', label: '捐款时间'},
|
||||
],
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
openView(row) {
|
||||
const rowc = clone(row)
|
||||
rowc.contributionFiles = JSON.parse(rowc.contributionFiles)
|
||||
this.viewData = rowc
|
||||
this.viewDialogVisible = true
|
||||
},
|
||||
doExport() {
|
||||
const {unionId, unitId, payMode, contributionName} = this.pageForm
|
||||
window.location.href = loc() + "/doExport?unionId=" + unionId + "&unitId=" + unitId + "&payMode=" + payMode + "&contributionName=" + contributionName
|
||||
},
|
||||
async flushUnits() {
|
||||
this.$set(this.pageForm, "unitId", "")
|
||||
if ("${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')||@shiro.hasRole('H03')}" === 'true') {
|
||||
this.units = await getUnits(this.pageForm.unionId)
|
||||
} else {
|
||||
this.units = await getUnits("${@shiro.getPrincipalProperty('unit').getUnionid()}")
|
||||
}
|
||||
},
|
||||
async getContribution() {
|
||||
const data = await $.get("/platform/contribution/list/getContribution")
|
||||
return data
|
||||
},
|
||||
getSummaries(param) {
|
||||
const {columns, data} = param;
|
||||
const sums = [];
|
||||
columns.forEach((column, index) => {
|
||||
if (index === 0) {
|
||||
sums[index] = '总额';
|
||||
return;
|
||||
}
|
||||
if (index !== 7) {
|
||||
sums[index] = null;
|
||||
return;
|
||||
}
|
||||
|
||||
const values = data.map(item => Number(item[column.property]));
|
||||
if (!values.every(value => isNaN(value))) {
|
||||
sums[index] = values.reduce((prev, curr) => {
|
||||
const value = Number(curr);
|
||||
if (!isNaN(value)) {
|
||||
return Math.floor((prev + curr) * 100) / 100;
|
||||
} else {
|
||||
return prev;
|
||||
}
|
||||
}, 0);
|
||||
sums[index] += ' 元';
|
||||
} else {
|
||||
sums[index] = null;
|
||||
}
|
||||
});
|
||||
|
||||
return sums;
|
||||
}
|
||||
},
|
||||
async created() {
|
||||
this.unions = await getUnions(null)
|
||||
this.contributionOption = await this.getContribution()
|
||||
this.flushUnits()
|
||||
this.pageData()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,147 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
|
||||
<div id="app" v-cloak>
|
||||
<guava>
|
||||
<el-card shadow="never">
|
||||
<div class="btn-group tool-button">
|
||||
<el-select placeholder="捐款项目" v-model="pageForm.contributionName"
|
||||
style="width: 100%;"
|
||||
@change="doSearch"
|
||||
filterable="true">
|
||||
<el-option v-for="item in contributionOption" :label="item.contributionName"
|
||||
:value="item.contributionName"></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
<div class="btn-group tool-button">
|
||||
<el-select placeholder="所属工会" v-model="pageForm.unionId" style="width: 100%;"
|
||||
clearable="true"
|
||||
@change="doSearch"
|
||||
filterable="true">
|
||||
<el-option v-for="item in unions" :label="item.unionname"
|
||||
:value="item.id"></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
|
||||
<el-card shadow="never" class="mt20">
|
||||
<table-tool label="捐款列表" :app="this">
|
||||
|
||||
</table-tool>
|
||||
<el-table :data="tableData" style="width: 100%" row-key="id" @sort-change="pageOrder"
|
||||
show-summary :summary-method="getSummaries">
|
||||
<el-table-column align="center" header-align="center" label="序号" width="120px">
|
||||
<template scope="scope">
|
||||
<span>{{scope.$index+(pageForm.pageNumber - 1) * pageForm.pageSize + 1}} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
align="center"
|
||||
header-align="center"
|
||||
v-for="column in tableColumns"
|
||||
show-overflow-tooltip
|
||||
:label="column.label"
|
||||
:prop="column.prop"
|
||||
sortable
|
||||
>
|
||||
|
||||
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-card>
|
||||
</guava>
|
||||
</div>
|
||||
|
||||
|
||||
<script>
|
||||
var vue = new Vue({
|
||||
el: '#app',
|
||||
mixins: [initTableMixins],
|
||||
data() {
|
||||
return {
|
||||
contributionOption: [],
|
||||
unions: [],
|
||||
units: [],
|
||||
tableColumns: [
|
||||
{prop: 'unioncode', label: '工会编码'},
|
||||
{prop: 'unionname', label: '工会名称'},
|
||||
{prop: 'contributionUserNum', label: '捐款人数'},
|
||||
{prop: 'contributionNum', label: '捐款多少笔'},
|
||||
{prop: 'money', label: '捐款总额(元)'},
|
||||
],
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
pageData() {
|
||||
sublime.showLoadingbar();
|
||||
this.tableLoading = true
|
||||
$.post(loc() + "/pageData", this.pageForm, (data) => {
|
||||
sublime.closeLoadingbar();
|
||||
this.tableLoading = false
|
||||
if (data.code == 0) {
|
||||
this.tableData = data.data;
|
||||
} else {
|
||||
this.$message.error(data.msg);
|
||||
}
|
||||
});
|
||||
},
|
||||
getSummaries(param) {
|
||||
const {columns, data} = param;
|
||||
const sums = [];
|
||||
columns.forEach((column, index) => {
|
||||
if (index === 0) {
|
||||
sums[index] = '总计';
|
||||
return;
|
||||
}
|
||||
if (![3, 4, 5].includes(index)) {
|
||||
sums[index] = null;
|
||||
return;
|
||||
}
|
||||
|
||||
const values = data.map(item => Number(item[column.property]));
|
||||
if (!values.every(value => isNaN(value))) {
|
||||
sums[index] = values.reduce((prev, curr) => {
|
||||
const value = Number(curr);
|
||||
if (!isNaN(value)) {
|
||||
return Math.floor((prev + curr) * 100) / 100;
|
||||
} else {
|
||||
return prev;
|
||||
}
|
||||
}, 0);
|
||||
if (index === 3) {
|
||||
sums[index] += ' 人';
|
||||
} else if (index === 4) {
|
||||
sums[index] += ' 笔';
|
||||
} else {
|
||||
sums[index] += ' 元';
|
||||
}
|
||||
|
||||
} else {
|
||||
sums[index] = null;
|
||||
}
|
||||
});
|
||||
|
||||
return sums;
|
||||
},
|
||||
async getContribution() {
|
||||
const data = await $.get("/platform/contribution/list/getContribution")
|
||||
return data
|
||||
},
|
||||
},
|
||||
async created() {
|
||||
this.unions = await getUnions(null)
|
||||
this.contributionOption = await this.getContribution()
|
||||
if (this.contributionOption && this.contributionOption.length > 0) {
|
||||
this.pageForm.contributionName = this.contributionOption[0].contributionName
|
||||
}
|
||||
this.pageData()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,554 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
<style>
|
||||
#app {
|
||||
display: flex;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
background-color: #f0f2f5;
|
||||
}
|
||||
|
||||
.box-card {
|
||||
width: calc(100% - 20px);
|
||||
height: calc(100% - 20px);
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.box-card .el-card__body {
|
||||
height: calc(100% - 67px - 20px);
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.box-card-title {
|
||||
font-size: 20px;
|
||||
}
|
||||
|
||||
.card-body {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
height: 100%;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.card-body-center {
|
||||
width: 60%;
|
||||
min-width: 800px;
|
||||
height: 100%;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.card-body-center-bottom {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
width: 100%;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.card-body-center-bottom button {
|
||||
margin: 0 10px;
|
||||
}
|
||||
|
||||
.card-body-center > .el-carousel {
|
||||
height: calc(100% - 120px);
|
||||
position: relative;
|
||||
overflow-y: hidden;
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
.card-body-center > .el-carousel > .el-carousel__container {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.carousel-table-item {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
padding: 10px 0;
|
||||
}
|
||||
|
||||
.carousel-table-item-center {
|
||||
height: 100%;
|
||||
width: 90%;
|
||||
min-width: 800px;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.carousel-table-item-center .card-body {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.checkGroup {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow-y: scroll;
|
||||
padding-right: 10px;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.checkGroup .el-radio, .checkGroup .el-checkbox {
|
||||
padding: 12px;
|
||||
margin: 0 !important;
|
||||
margin-top: 15px !important;
|
||||
}
|
||||
|
||||
.checkGroup .el-checkbox__label {
|
||||
width: calc(100% - 16px);
|
||||
}
|
||||
|
||||
.carousel-table-item-relation .el-card__body {
|
||||
position: relative;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.carousel-table-item-form .el-card__body {
|
||||
position: relative;
|
||||
height: 100%;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
</style>
|
||||
<div id="app" v-cloak>
|
||||
<el-card class="box-card" shadow="never">
|
||||
<div slot="header" class="clearfix">
|
||||
<span class="box-card-title">DataKid</span>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="card-body-center">
|
||||
<el-steps :active="active" align-center>
|
||||
<el-step title="选择数据表" icon="el-icon-document-copy"></el-step>
|
||||
<el-step title="选择数据列" icon="el-icon-s-unfold"></el-step>
|
||||
<el-step title="数据列对应" icon="el-icon-s-operation"></el-step>
|
||||
<el-step title="提交数据" icon="el-icon-upload"></el-step>
|
||||
<el-step title="导入结果" icon="el-icon-bell"></el-step>
|
||||
</el-steps>
|
||||
|
||||
<el-carousel indicator-position="none" :autoplay="false" arrow="never" ref="carousel"
|
||||
direction="vertical">
|
||||
<!--表选择-->
|
||||
<el-carousel-item class="carousel-table-item">
|
||||
<el-card class="carousel-table-item-center">
|
||||
<div slot="header" class="clearfix">
|
||||
<el-input style="width: 200px" v-model="tableNameKeyWord" placeholder="请输入关键字查询"
|
||||
clearable></el-input>
|
||||
<el-button type="primary" icon="el-icon-search" @click="tableNameSearch"></el-button>
|
||||
<el-button v-if="formData.tableName" style="float: right; padding: 10px 0" type="text">
|
||||
当前选中:{{formData.tableName}}
|
||||
</el-button>
|
||||
</div>
|
||||
|
||||
<el-radio-group class="checkGroup" v-model="formData.tableName">
|
||||
<el-radio v-for="item in tableOptionsClone" :key="item.table_name"
|
||||
:label="item.table_name" border>
|
||||
{{item.table_name}}{{item.table_comment?' ( '+item.table_comment+' )':''}}<span
|
||||
style="float: right;color: #F56C6C">rows: {{item.table_rows}}</span>
|
||||
</el-radio>
|
||||
</el-radio-group>
|
||||
</el-card>
|
||||
</el-carousel-item>
|
||||
|
||||
<!--列选择-->
|
||||
<el-carousel-item class="carousel-table-item">
|
||||
<el-card class="carousel-table-item-center">
|
||||
<div slot="header" class="clearfix">
|
||||
<el-input style="width: 200px" v-model="columnNameKeyWord" placeholder="请输入关键字查询"
|
||||
clearable></el-input>
|
||||
<el-button type="primary" icon="el-icon-search" @click="columnSearch"></el-button>
|
||||
|
||||
<el-button style="float: right; padding: 10px 0" type="text">
|
||||
{{formData.tableName}}
|
||||
</el-button>
|
||||
</div>
|
||||
<el-checkbox-group class="checkGroup" v-model="formData.columns">
|
||||
<el-checkbox v-for="item in columnOptionsClone" :key="item.column_name"
|
||||
:label="item.column_name" border>
|
||||
{{item.column_name}}{{item.column_comment?' ( '+item.column_comment+' )':''}}<span
|
||||
style="float: right;color: #F56C6C">{{item.column_type}}</span>
|
||||
</el-checkbox>
|
||||
</el-checkbox-group>
|
||||
</el-card>
|
||||
</el-carousel-item>
|
||||
|
||||
<!--列对应-->
|
||||
<el-carousel-item style="padding: 10px" class="carousel-table-item">
|
||||
<el-card style="width: 100%" class="carousel-table-item-relation">
|
||||
<el-table
|
||||
:data="relation" height="100%"
|
||||
style="width: 100%" border size="medium">
|
||||
<el-table-column
|
||||
prop="column_name"
|
||||
label="列名">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="column_comment"
|
||||
label="描述" show-overflow-tooltip="true">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="is_nullable"
|
||||
label="可为空">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="column_type"
|
||||
label="类型">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="column_key"
|
||||
label="key">
|
||||
</el-table-column>
|
||||
<el-table-column min-width="200px">
|
||||
<template slot="header" slot-scope="scope">
|
||||
目标列
|
||||
<el-popover
|
||||
placement="top-start"
|
||||
title="提示"
|
||||
trigger="hover"
|
||||
content="excel对应的表头名称,用于和表数据列对应">
|
||||
<i slot="reference" class="el-icon-question"></i>
|
||||
</el-popover>
|
||||
</template>
|
||||
<template slot-scope="{row}">
|
||||
<el-input
|
||||
v-model="row.relation"
|
||||
size="medium"
|
||||
placeholder="目标列"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-card>
|
||||
</el-carousel-item>
|
||||
|
||||
|
||||
<!--提交-->
|
||||
<el-carousel-item style="padding: 10px" class="carousel-table-item">
|
||||
<el-card style="width: 100%" class="carousel-table-item-form">
|
||||
<el-form label-width="120px" :model="formData" ref="form" :rules="formRules">
|
||||
<el-form-item label=" " label-width="135px" class="view-header">
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item prop="method" label="导入方式">
|
||||
<el-radio-group v-model="formData.method">
|
||||
<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-group>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item v-if="[1,3].includes(formData.method)" prop="field" label="关键字段">
|
||||
<el-select v-model="formData.field" placeholder="请选择" style="width:50%">
|
||||
<el-option
|
||||
v-for="item in relation"
|
||||
:key="item.column_name"
|
||||
:label="item.column_name"
|
||||
:value="item.column_name">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item prop="plugins" label="可选插件">
|
||||
<el-checkbox-group v-model="formData.plugins">
|
||||
<el-checkbox v-for="v in plugins" :label="v.name" border>{{v.description}}
|
||||
</el-checkbox>
|
||||
</el-checkbox-group>
|
||||
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="文  件" class="is-required">
|
||||
<el-upload
|
||||
drag
|
||||
name="file"
|
||||
ref="upload"
|
||||
action="****"
|
||||
:on-remove="handleRemove"
|
||||
:on-change="handleChange"
|
||||
:auto-upload="false"
|
||||
:limit="1"
|
||||
:file-list="fileList">
|
||||
<i class="el-icon-upload"></i>
|
||||
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
|
||||
<div class="el-upload__tip" slot="tip" style="color: #F56C6C">
|
||||
只能上传 xls/xlsx 文件
|
||||
</div>
|
||||
</el-upload>
|
||||
</el-form-item>
|
||||
|
||||
</el-form>
|
||||
</el-card>
|
||||
</el-carousel-item>
|
||||
|
||||
<!--结果-->
|
||||
<el-carousel-item style="padding: 10px">
|
||||
<el-card style="width: 100%">
|
||||
<div style="display: flex;justify-content: center;align-items: center;flex-direction:column ">
|
||||
<el-progress type="circle" :percentage="result.success/result.total*100"
|
||||
status="success"></el-progress>
|
||||
<div style="font-size: 12px;color: rgb(100,100,100);margin-top: 20px">总记录数
|
||||
{{result.total}} 条,成功
|
||||
{{result.success}} 条!
|
||||
</div>
|
||||
<div style="margin-top: 5px" v-if="result.cacheKey">
|
||||
<el-link type="primary" style="font-size: 12px;"
|
||||
:href="loc()+'/exportErrors?cacheKey='+result.cacheKey">下载错误记录
|
||||
</el-link>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
</el-carousel-item>
|
||||
</el-carousel>
|
||||
|
||||
|
||||
<div class="card-body-center-bottom">
|
||||
<el-button size="medium" @click="prev" :disabled="active==0||loading">上一步</el-button>
|
||||
<el-button type="primary" size="medium" :loading="loading" @click="active<4?next():carry()">
|
||||
{{active<4?'下一步':'完成'}}
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
</div>
|
||||
<script>
|
||||
var vue = new Vue({
|
||||
el: '#app',
|
||||
data() {
|
||||
return {
|
||||
active: 0,
|
||||
result: {success: 0, total: 0},
|
||||
loading: false,
|
||||
|
||||
/*提交数据*/
|
||||
/*start*/
|
||||
fileList: [],
|
||||
plugins: {},
|
||||
formRules: {
|
||||
method: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
field: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
},
|
||||
/*end*/
|
||||
|
||||
/*列对应*/
|
||||
/*start*/
|
||||
relation: [],
|
||||
/*end*/
|
||||
|
||||
/*tableColumn*/
|
||||
/*start*/
|
||||
columnOptions: [],
|
||||
columnOptionsClone: [],
|
||||
columnNameKeyWord: '',
|
||||
/*end*/
|
||||
|
||||
/*tableName*/
|
||||
/*start*/
|
||||
tableNameKeyWord: '',
|
||||
tableOptions: [],
|
||||
tableOptionsClone: [],
|
||||
cacheTableName: '',
|
||||
/*end*/
|
||||
|
||||
formData: {
|
||||
tableName: '',
|
||||
columns: [],
|
||||
method: 1,
|
||||
plugins: [],
|
||||
}
|
||||
}
|
||||
},
|
||||
components: {},
|
||||
filters: {},
|
||||
methods: {
|
||||
carry() {
|
||||
this.formData = {
|
||||
tableName: '',
|
||||
columns: [],
|
||||
method: 1,
|
||||
plugins: [],
|
||||
}
|
||||
this.relation = []
|
||||
this.fileList = []
|
||||
this.active = 0
|
||||
this.$refs.carousel.next()
|
||||
},
|
||||
async next() {
|
||||
const {active} = this
|
||||
if (active == 0) {
|
||||
if (!this.formData.tableName) {
|
||||
this.$notify({
|
||||
title: '警告',
|
||||
message: '请选择数据表',
|
||||
type: 'warning'
|
||||
});
|
||||
return
|
||||
}
|
||||
if (this.cacheTableName != this.formData.tableName) {
|
||||
this.loadColumn()
|
||||
this.formData.columns = []
|
||||
this.cacheTableName = this.formData.tableName
|
||||
}
|
||||
} else if (active == 1) {
|
||||
if (!this.formData.columns || !this.formData.columns.length) {
|
||||
this.$notify({
|
||||
title: '警告',
|
||||
message: '请选择数据列',
|
||||
type: 'warning'
|
||||
});
|
||||
return
|
||||
}
|
||||
this.genRelation()
|
||||
} else if (active == 2) {
|
||||
if (this.relation.find(v => !v.relation)) {
|
||||
this.$notify({
|
||||
title: '警告',
|
||||
message: '存在未填写的目标列',
|
||||
type: 'warning'
|
||||
});
|
||||
return
|
||||
}
|
||||
} else if (active == 3) {
|
||||
await this.doSubmit()
|
||||
}
|
||||
|
||||
this.$refs.carousel.next()
|
||||
this.active++
|
||||
},
|
||||
prev() {
|
||||
this.$refs.carousel.prev()
|
||||
this.active--
|
||||
},
|
||||
|
||||
async doSubmit() {
|
||||
let Break = false
|
||||
this.$refs["form"].validate((valid) => {
|
||||
if (!valid || !this.fileList.length) {
|
||||
this.$notify({
|
||||
title: '警告',
|
||||
message: '存在未填写的必填项',
|
||||
type: 'warning'
|
||||
});
|
||||
Break = true
|
||||
return
|
||||
}
|
||||
})
|
||||
if (Break) return
|
||||
|
||||
this.loading = true
|
||||
|
||||
let formData = new FormData()
|
||||
for (let key in this.formData) {
|
||||
formData.append(key, this.formData[key])
|
||||
}
|
||||
formData.append("relation", JSON.stringify(this.relation))
|
||||
this.fileList.forEach((val) => {
|
||||
formData.append("file", val.raw, val.raw.name);
|
||||
});
|
||||
|
||||
const {code, data, msg} = await $.ajax({
|
||||
url: loc() + "/importData",
|
||||
type: "post",
|
||||
data: formData,
|
||||
processData: false,
|
||||
contentType: false,
|
||||
});
|
||||
|
||||
this.loading = false
|
||||
|
||||
if (code) {
|
||||
this.$notify.error({
|
||||
title: '错误',
|
||||
message: msg
|
||||
});
|
||||
|
||||
this.result = {success: 0, total: 0}
|
||||
return
|
||||
}
|
||||
|
||||
this.result = data
|
||||
|
||||
},
|
||||
|
||||
/*提交数据*/
|
||||
/*start*/
|
||||
handleRemove(file, fileList) {
|
||||
this.fileList = fileList;
|
||||
},
|
||||
handleChange(file, fileList) {
|
||||
|
||||
const remove = () => {
|
||||
for (let i = 0; i < fileList.length; i++) {
|
||||
if (file == fileList[i]) {
|
||||
fileList.splice(i, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (file.size == 0) {
|
||||
this.$message.warning("您选择的是空文件!");
|
||||
remove()
|
||||
}
|
||||
|
||||
const type = ['xls', 'xlsx'].includes(file.name.split('.').pop().toLowerCase())
|
||||
if (!type) {
|
||||
this.$message.warning('上传文件只能是' + ['xls', 'xlsx'].map(v => v.toLowerCase()).join("/") + '格式!');
|
||||
remove()
|
||||
}
|
||||
|
||||
this.fileList = fileList;
|
||||
},
|
||||
async loadPlugins() {
|
||||
this.plugins = await getEnumOptions("DataImportPluginHandle")
|
||||
},
|
||||
/*end*/
|
||||
|
||||
/*数据列对应*/
|
||||
/*start*/
|
||||
genRelation() {
|
||||
this.relation = this.columnOptions.filter(v => this.formData.columns.includes(v.column_name))
|
||||
},
|
||||
/*end*/
|
||||
|
||||
/*tableName*/
|
||||
/*start*/
|
||||
columnSearch() {
|
||||
if (!this.columnNameKeyWord) {
|
||||
this.columnOptionsClone = clone(this.columnOptions)
|
||||
return
|
||||
}
|
||||
this.columnOptionsClone = this.columnOptions.filter(v => v.column_name.toLowerCase().indexOf(this.columnNameKeyWord.toLowerCase()) != -1 || v.column_comment.toLowerCase().indexOf(this.columnNameKeyWord.toLowerCase()) != -1)
|
||||
},
|
||||
async loadColumn() {
|
||||
const {tableName} = this.formData
|
||||
const {data} = await $.get(loc() + '/columns', {tableName})
|
||||
this.columnOptions = data
|
||||
this.columnOptionsClone = clone(data)
|
||||
},
|
||||
/*end*/
|
||||
|
||||
/*tableName*/
|
||||
/*start*/
|
||||
tableNameSearch() {
|
||||
if (!this.tableNameKeyWord) {
|
||||
this.tableOptionsClone = clone(this.tableOptions)
|
||||
return
|
||||
}
|
||||
this.tableOptionsClone = this.tableOptions.filter(v => v.table_name.toLowerCase().indexOf(this.tableNameKeyWord.toLowerCase()) != -1 || v.table_comment.toLowerCase().indexOf(this.tableNameKeyWord.toLowerCase()) != -1)
|
||||
},
|
||||
async loadTableName() {
|
||||
const {data} = await $.get(loc() + '/tableNames')
|
||||
this.tableOptions = data
|
||||
this.tableOptionsClone = clone(data)
|
||||
}
|
||||
/*end*/
|
||||
},
|
||||
created() {
|
||||
this.loadTableName()
|
||||
this.loadPlugins()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,544 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
<style>
|
||||
.el-transfer {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.el-transfer-panel {
|
||||
text-align: left;
|
||||
width: 35%;
|
||||
height: 400px;
|
||||
}
|
||||
|
||||
.el-transfer-panel__list.is-filterable {
|
||||
height: 300px;
|
||||
}
|
||||
|
||||
.v-tree-layout-left {
|
||||
overflow: unset !important;
|
||||
}
|
||||
|
||||
.v-tree-layout-left .v-tree {
|
||||
width: 100%;
|
||||
height: calc(100vh - 170px);
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.v-tree:hover::-webkit-scrollbar {
|
||||
width: 3px;
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
.v-tree-layout-left .custom-tree-node {
|
||||
width: 90%;
|
||||
position: relative;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.v-tree-layout-left .v-tree .v-node {
|
||||
width: 100%;
|
||||
display: inline-block;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar {
|
||||
/*width: 3px;*/
|
||||
/*background-color: transparent;*/
|
||||
display: none;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-thumb {
|
||||
background-color: rgba(0, 0, 0, 0.2);
|
||||
border-radius: 10px;
|
||||
}
|
||||
</style>
|
||||
<div id="app" v-cloak>
|
||||
<guava ref="guava">
|
||||
<el-card shadow="never" style="height: calc(100vh - 70px)">
|
||||
<tree-layout>
|
||||
<template #tree>
|
||||
<div style="padding:0 20px 20px;">
|
||||
<el-input placeholder="输入单位名称进行过滤" v-model="filterText"></el-input>
|
||||
</div>
|
||||
|
||||
<el-tree ref="tree" :data="treeData" class="v-tree" v-loading="treeLoading" node-key="id"
|
||||
:props="defaultProps"
|
||||
default-expand-all :expand-on-click-node="false"
|
||||
@node-click="handleNodeClick" accordion @node-expand="nodeExpand"
|
||||
highlight-current :filter-node-method="filterNode">
|
||||
<div class="custom-tree-node" slot-scope="{ node, data }">
|
||||
|
||||
<div v-if="node.level==1" style="font-size: 16px;" class="v-node"><i
|
||||
class="el-icon-s-home"></i>
|
||||
{{ data.name }}
|
||||
</div>
|
||||
|
||||
<div v-if="node.level==2"
|
||||
style="font-size: 15px" :title="data.name" class="v-node">
|
||||
<i class="el-icon-star-on" v-if="checkData.name==data.name"></i>
|
||||
<i class="el-icon-star-off" v-else></i>
|
||||
{{ data.name }}
|
||||
</div>
|
||||
|
||||
|
||||
<div v-if="node.level==3"
|
||||
style="font-size: 14px" :title="data.name" class="v-node">
|
||||
<i class="fa fa-dot-circle-o" v-if="checkData.name==data.name"></i>
|
||||
<i class="fa fa-circle-o" v-else></i>
|
||||
{{ data.name }}
|
||||
</div>
|
||||
|
||||
|
||||
<div v-if="node.level>3"
|
||||
style="font-size: 14px" :title="data.name" class="v-node">
|
||||
<i class="fa fa-dot-circle-o" v-if="checkData.name==data.name"></i>
|
||||
<i class="fa fa-circle-o" v-else></i>
|
||||
{{ data.name }}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</el-tree>
|
||||
</template>
|
||||
<template>
|
||||
<div style="padding:0 10px">
|
||||
<el-card shadow="never">
|
||||
<div class="btn-group tool-button mt5">
|
||||
<el-input placeholder="请输入内容" clearable v-model="pageForm.searchKeyword"
|
||||
@keyup.enter.native="doSearch">
|
||||
<el-select v-model="pageForm.searchName" slot="prepend" placeholder="查询类型"
|
||||
style="width: 120px;">
|
||||
<el-option label="单位名称" value="name"></el-option>
|
||||
<el-option label="单位代码" value="unitcode"></el-option>
|
||||
</el-select>
|
||||
</el-input>
|
||||
</div>
|
||||
<div class="btn-group tool-button mt5">
|
||||
<el-button type="primary" icon="el-icon-search" @click="doSearch"></el-button>
|
||||
</div>
|
||||
|
||||
<div class="pull-right offscreen-right mt5">
|
||||
<div class="btn-group tool-button" v-if="checkNode.level==1">
|
||||
<!--#if(@shiro.hasRole('sysadmin')){#-->
|
||||
<el-button icon="el-icon-refresh" :loading="loading" @click="dataUpdate"
|
||||
type="primary">更新组织机构
|
||||
</el-button>
|
||||
<!--#}#-->
|
||||
</div>
|
||||
<!-- <div class="btn-group tool-button">-->
|
||||
<!-- <el-button icon="el-icon-plus" @click="openAdd">新建单位</el-button>-->
|
||||
<!-- </div>-->
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<el-card shadow="never" class="mt10">
|
||||
<el-table :data="tableData" style="width: 100%" row-key="id" @sort-change="pageOrder"
|
||||
height="638px"
|
||||
v-loading="tabLoading" size="medium">
|
||||
<el-table-column align="center" :key="1" header-align="center" label="序号"
|
||||
type="index">
|
||||
<template scope="scope">
|
||||
<span>{{scope.$index+(pageForm.pageNumber - 1) * pageForm.pageSize + 1}} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column align="center" header-align="center" label="单位名称"
|
||||
prop="name"></el-table-column>
|
||||
|
||||
<el-table-column align="center" header-align="center" label="单位代码"
|
||||
prop="unitcode"></el-table-column>
|
||||
|
||||
<el-table-column label="单位等级" header-align="center" prop="unitlevel"
|
||||
:show-overflow-tooltip="true" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-button v-if="scope.row.unitlevel==1" size="mini" type="success" round
|
||||
style=" vertical-align: middle;">1级
|
||||
</el-button>
|
||||
<el-button v-if="scope.row.unitlevel==2" size="mini" type="warning" round
|
||||
style=" vertical-align: middle;">2级
|
||||
</el-button>
|
||||
<el-button v-if="scope.row.unitlevel==3" size="mini" type="danger" round
|
||||
style=" vertical-align: middle;">3级
|
||||
</el-button>
|
||||
<el-button v-if="scope.row.unitlevel>3" size="mini" type="info" round
|
||||
style=" vertical-align: middle;">{{scope.row.unitlevel}}级
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column align="center" header-align="center" label="操作"
|
||||
width="200px">
|
||||
<template slot-scope="{row}">
|
||||
<el-dropdown @command="dropdownCommand">
|
||||
<el-button size="mini">
|
||||
<i class="ti-settings"></i>
|
||||
<span class="ti-angle-down"></span>
|
||||
</el-button>
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
|
||||
<!-- <el-dropdown-item :command="{type:'view',data:row}">-->
|
||||
<!-- 查看-->
|
||||
<!-- </el-dropdown-item>-->
|
||||
<el-dropdown-item :command="{type:'edit',data:row}">
|
||||
编辑
|
||||
</el-dropdown-item>
|
||||
|
||||
<el-dropdown-item :command="{type:'delete',data:row}">
|
||||
删除
|
||||
</el-dropdown-item>
|
||||
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
</el-table>
|
||||
<el-row class="el-pagination-container">
|
||||
<el-pagination
|
||||
@size-change="pageSizeChange"
|
||||
@current-change="pageNumberChange"
|
||||
:current-page="pageForm.pageNumber"
|
||||
:page-sizes="[10, 20, 30, 50]"
|
||||
:page-size="pageForm.pageSize"
|
||||
layout="total, sizes, prev, pager, next"
|
||||
:total="pageForm.totalCount">
|
||||
</el-pagination>
|
||||
</el-row>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
</tree-layout>
|
||||
</el-card>
|
||||
<template #edit>
|
||||
|
||||
<el-divider content-position="left"><span style="color: rgb(121, 187, 255)">请填写以下单位信息</span>
|
||||
</el-divider>
|
||||
<el-form :model="formData" ref="form" :rules="formRules" label-position="top"
|
||||
label-width="120px"
|
||||
style="padding: 0 30px">
|
||||
<el-row gutter="30">
|
||||
<el-col :span="24">
|
||||
<el-form-item label="上级单位">
|
||||
<el-input maxlength="100" disabled :value="checkData.name"
|
||||
type="text"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="单位名称" prop="name">
|
||||
<el-input maxlength="100" placeholder="请输入单位名称" v-model="formData.name"
|
||||
type="text"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="单位代码" prop="unitcode">
|
||||
<el-input maxlength="100" placeholder="请输入社团编码" v-model="formData.unitcode"
|
||||
type="text"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="单位简称" prop="aliasName">
|
||||
<el-input maxlength="100" placeholder="请输入单位简称" v-model="formData.aliasName"
|
||||
type="text"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="联系电话" prop="telephone">
|
||||
<el-input maxlength="100" placeholder="请输入联系电话" v-model="formData.telephone"
|
||||
type="text"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="单位邮箱" prop="email">
|
||||
<el-input maxlength="100" placeholder="请输入单位邮箱" v-model="formData.email"
|
||||
type="text"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="单位网站" prop="website">
|
||||
<el-input maxlength="100" placeholder="请输入单位网站" v-model="formData.website"
|
||||
type="text"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="24">
|
||||
<el-form-item label="单位地址" prop="address">
|
||||
<el-input maxlength="100" placeholder="请输入单位地址" v-model="formData.address"
|
||||
type="text"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="单位介绍" prop="note">
|
||||
<el-input maxlength="500" type="textarea" placeholder="请输入单位介绍"
|
||||
v-model="formData.note"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
|
||||
<div style="display: flex;justify-content:flex-end;margin-top: 30px">
|
||||
<el-button type="primary" :loading="loading" @click="!formData.id?doAdd():doEdit()">提 交
|
||||
</el-button>
|
||||
</div>
|
||||
</el-form>
|
||||
|
||||
</template>
|
||||
</guava>
|
||||
</div>
|
||||
<script>
|
||||
var vue = new Vue({
|
||||
el: '#app',
|
||||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
filterText: '',
|
||||
defaultProps: {
|
||||
children: 'child',
|
||||
label: 'name',
|
||||
},
|
||||
exKeys: ['0'],
|
||||
activeName: [],
|
||||
typeOptions: [],
|
||||
treeLoading: true,
|
||||
tabLoading: false,
|
||||
formData: {},
|
||||
detailData: {},
|
||||
treeData: [],
|
||||
tableData: [],
|
||||
pageForm: {
|
||||
searchName: "name",
|
||||
searchKeyword: "",
|
||||
pageNumber: 1,
|
||||
pageSize: 10,
|
||||
totalCount: 0,
|
||||
pageOrderName: "",
|
||||
pageOrderBy: ""
|
||||
},
|
||||
formRules: {
|
||||
name: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
code: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
},
|
||||
checkNode: {level: 1},
|
||||
checkData: {},
|
||||
campusOptions: [],
|
||||
loading: false,
|
||||
}
|
||||
},
|
||||
components: {
|
||||
'tree-layout': httpVueLoader('/components/plugins/TreeLayout.vue'),
|
||||
'guava': httpVueLoader('/components/plugins/Guava.vue'),
|
||||
},
|
||||
watch: {
|
||||
filterText(val) {
|
||||
this.$refs.tree.filter(val);
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
//单位数据更新
|
||||
async dataUpdate() {
|
||||
this.$confirm('您确定要更新组织机构吗, 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(async () => {
|
||||
this.loading = true;
|
||||
const resp = await $.get(loc() + "/dataUpdate")
|
||||
if (resp.code == 0) {
|
||||
this.loading = false;
|
||||
this.$message({
|
||||
message: '更新成功',
|
||||
type: 'success'
|
||||
});
|
||||
this.pageData();
|
||||
} else {
|
||||
this.loading = false;
|
||||
this.$message.error('更新失败');
|
||||
}
|
||||
}).catch(() => {
|
||||
this.$message({
|
||||
type: 'info',
|
||||
message: '已取消更新'
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
dropdownCommand: function (command) {
|
||||
const {type, data} = command
|
||||
if (type == 'view') {
|
||||
|
||||
} else if (type == 'edit') {
|
||||
this.openEdit(data.id)
|
||||
} else if (type == 'delete') {
|
||||
this.doDelete(data.id)
|
||||
}
|
||||
},
|
||||
filterNode(value, data, node) {
|
||||
if (!value) return true;
|
||||
|
||||
return data.name.indexOf(value) !== -1
|
||||
|
||||
return false
|
||||
},
|
||||
nodeExpand(data, node, e) {
|
||||
|
||||
},
|
||||
async handleNodeClick(data, node) {
|
||||
this.checkData = data
|
||||
this.checkNode = node
|
||||
this.doSearch()
|
||||
},
|
||||
doDelete(id) {
|
||||
this.$confirm('确定要删除该单位吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
callback: (a, b) => {
|
||||
if ("confirm" == a) {//确认后再执行
|
||||
$.post(loc() + "/doDelete", {id}, (data) => {
|
||||
if (data.code == 0) {
|
||||
this.$message({
|
||||
message: data.msg,
|
||||
type: 'success'
|
||||
});
|
||||
this.loadTree(false)
|
||||
this.pageData()
|
||||
} else {
|
||||
this.$message({
|
||||
message: data.msg,
|
||||
type: 'error'
|
||||
});
|
||||
}
|
||||
}, "json");
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
doEdit() {
|
||||
this.$refs["form"].validate(async (valid) => {
|
||||
if (valid) {
|
||||
this.loading = true
|
||||
const resp = await $.post(loc() + "/doEdit", this.formData)
|
||||
this.loading = false
|
||||
if(resp.code===0){
|
||||
this.loadTree(false)
|
||||
this.pageData();
|
||||
this.$refs.guava.index()
|
||||
}else{
|
||||
this.notifyWarning(resp.msg)
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
async openEdit(id) {
|
||||
const resp = await $.get(loc() + "/findOne", {id})
|
||||
if(resp.code===0){
|
||||
this.formData = data
|
||||
this.$refs.guava.edit()
|
||||
if (this.$refs['form']) {
|
||||
this.$refs['form'].resetFields()
|
||||
}
|
||||
}else{
|
||||
this.notifyWarning(resp.msg)
|
||||
}
|
||||
},
|
||||
doAdd() {
|
||||
this.$refs["form"].validate(async (valid) => {
|
||||
if (valid) {
|
||||
this.loading = true
|
||||
const resp = await $.post(loc() + "/doAdd", this.formData)
|
||||
this.loading = false
|
||||
if(resp.code===0){
|
||||
this.loadTree(false)
|
||||
this.pageData();
|
||||
this.$refs.guava.index()
|
||||
}else{
|
||||
this.notifyWarning(resp.msg)
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
openAdd() {
|
||||
const {id, unitlevel} = this.checkData
|
||||
this.formData = {
|
||||
parentId: id,
|
||||
unitlevel: unitlevel + 1
|
||||
}
|
||||
this.$refs.guava.edit()
|
||||
if (this.$refs['form']) {
|
||||
this.$refs['form'].resetFields()
|
||||
}
|
||||
},
|
||||
doSearch() {
|
||||
this.tabKey = new Date().getTime()
|
||||
this.pageForm.pageNumber = 1
|
||||
this.pageData()
|
||||
}
|
||||
,
|
||||
pageOrder(column) {//按字段排序
|
||||
this.pageForm.pageOrderName = column.prop;
|
||||
this.pageForm.pageOrderBy = column.order;
|
||||
this.pageData();
|
||||
}
|
||||
,
|
||||
pageNumberChange(val) {//页码更新操作
|
||||
this.pageForm.pageNumber = val;
|
||||
this.pageData();
|
||||
}
|
||||
,
|
||||
pageSizeChange(val) {//分页大小更新操作
|
||||
this.pageForm.pageSize = val;
|
||||
this.pageData();
|
||||
}
|
||||
,
|
||||
pageData() {//加载分页数据
|
||||
sublime.showLoadingbar();//显示loading
|
||||
this.tabLoading = true
|
||||
this.pageForm.parentId = this.checkData.id
|
||||
$.post(base + "/platform/sys/unit/pageData", this.pageForm, (data) => {
|
||||
sublime.closeLoadingbar();//关闭loading
|
||||
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 loadTree(flush) {
|
||||
this.treeLoading = true
|
||||
const {code, data, msg} = await $.get("/platform/sys/unit/getUnitTreeData")
|
||||
this.treeLoading = false
|
||||
if (code == 0) {
|
||||
this.treeData = data
|
||||
} else {
|
||||
this.$message({
|
||||
message: data.msg,
|
||||
type: 'error'
|
||||
});
|
||||
}
|
||||
|
||||
if (flush && code == 0) {
|
||||
this.checkData = data[0]
|
||||
this.pageData();
|
||||
}
|
||||
},
|
||||
},
|
||||
async created() {
|
||||
this.loadTree(true)
|
||||
}
|
||||
})
|
||||
</script>
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,335 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
<style>
|
||||
.el-tabs__content {
|
||||
padding-top: 20px;
|
||||
}
|
||||
|
||||
.sourceCheckBox .el-checkbox__label {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
<div id="app" v-cloak>
|
||||
<guava ref="guava">
|
||||
<template>
|
||||
|
||||
<el-card shadow="never">
|
||||
|
||||
<div class="btn-group tool-button mt5">
|
||||
<el-date-picker
|
||||
style="width: 150px"
|
||||
v-model="pageForm.importDate"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
placeholder="拉取日期">
|
||||
</el-date-picker>
|
||||
</div>
|
||||
|
||||
<div class="btn-group tool-button mt5">
|
||||
<el-input placeholder="请输入内容" clearable v-model="pageForm.searchKeyword"
|
||||
@keyup.enter.native="doSearch">
|
||||
<el-select v-model="pageForm.searchName" slot="prepend" placeholder="查询类型"
|
||||
style="width: 100px;">
|
||||
<el-option label="姓名" value="username"></el-option>
|
||||
<el-option label="工号" value="loginname"></el-option>
|
||||
</el-select>
|
||||
</el-input>
|
||||
</div>
|
||||
|
||||
<el-row class="btn-group tool-button mt5">
|
||||
<el-select placeholder="所属单位" v-model="pageForm.unitId" style="width: 200px;" clearable="true"
|
||||
filterable="true">
|
||||
<el-option v-for="item in units" :label="item.name" :value="item.id"></el-option>
|
||||
</el-select>
|
||||
</el-row>
|
||||
|
||||
<div class="btn-group tool-button mt5">
|
||||
<dict-select v-model="pageForm.personType" style="width: 200px" clearable placeholder="人员类型"
|
||||
code="UserType"></dict-select>
|
||||
</div>
|
||||
|
||||
<div class="btn-group tool-button mt5">
|
||||
<dict-select v-model="pageForm.userState" style="width: 200px" clearable placeholder="在职状态"
|
||||
code="UserState"></dict-select>
|
||||
</div>
|
||||
|
||||
<div class="btn-group tool-button mt5">
|
||||
<el-button type="primary" icon="el-icon-search" @click="doSearch"></el-button>
|
||||
<span style="color: red">温馨提醒:对接数据方式是拉取</span>
|
||||
</div>
|
||||
|
||||
<div class="pull-right offscreen-right mt5">
|
||||
<div class="btn-group tool-button" v-show="!selection.length">
|
||||
<el-button icon="el-icon-delete" type="danger" @click="openDeleteUser">删除
|
||||
</el-button>
|
||||
</div>
|
||||
<div class="btn-group tool-button" v-show="selection.length">
|
||||
<el-button icon="el-icon-delete" type="danger" :loading="delLoading" @click="doDeleteUsers">删除
|
||||
</el-button>
|
||||
</div>
|
||||
<div class="btn-group tool-button">
|
||||
<el-button type="primary" :loading="pullLoading" @click="pull">
|
||||
拉取<i class="el-icon-download"></i>
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<el-card shadow="never" class="mt20">
|
||||
<el-table :data="tableData" style="width: 100%" row-key="id" @sort-change="pageOrder"
|
||||
v-loading="tableLoading" ref="table" @selection-change="handleSelectionChange">
|
||||
|
||||
<el-table-column :reserve-selection="true"
|
||||
type="selection"
|
||||
width="30">
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column align="center" header-align="center" type="index" :index="indexMethod" label="序号"
|
||||
width="70px"></el-table-column>
|
||||
|
||||
<el-table-column label="工号" prop="loginname" header-align="center"
|
||||
align="center" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column label="姓名" prop="username" header-align="center"
|
||||
align="center" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column label="性别" prop="sex" header-align="center"
|
||||
align="center" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column label="联系电话" prop="mobile" header-align="center"
|
||||
align="center" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column label="出生日期" prop="birthday" header-align="center"
|
||||
align="center" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column label="身份证" prop="idcard" header-align="center"
|
||||
align="center" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column label="人员类型" prop="personType" header-align="center" sortable
|
||||
align="center" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column label="在职状态" prop="userState" header-align="center" sortable
|
||||
align="center" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column label="所属单位" prop="unitid" header-align="center"
|
||||
align="center" show-overflow-tooltip sortable>
|
||||
<template scope="{row}">
|
||||
<span v-if="row.unitid"> {{row.unitname}}({{row.unitid}})</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="拉取时间" prop="pullTime" min-width="100px" header-align="center" sortable
|
||||
align="center" show-overflow-tooltip></el-table-column>
|
||||
|
||||
<el-table-column prop="userOnline" align="center" header-align="center" label="操作"
|
||||
min-width="80px">
|
||||
<template scope="scope">
|
||||
<el-dropdown @command="dropdownCommand">
|
||||
<el-button plain size="mini">
|
||||
<i class="ti-settings"></i>
|
||||
<span class="ti-angle-down"></span>
|
||||
</el-button>
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-item :command="{type:'view',data:scope.row}">
|
||||
查看
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item :command="{type:'delete',data:scope.row}">
|
||||
删除
|
||||
</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--#include("/layouts/pagination.html"){}#-->
|
||||
</el-card>
|
||||
|
||||
|
||||
</template>
|
||||
|
||||
|
||||
<template #view>
|
||||
|
||||
<el-tabs v-model="active">
|
||||
<el-tab-pane label="个人信息" name="info">
|
||||
<member ref="memberInfo" source="user_source" :id="userId" view></member>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
|
||||
</template>
|
||||
</guava>
|
||||
<el-dialog
|
||||
title="选择数据源"
|
||||
:visible.sync="dialogVisible"
|
||||
width="30%">
|
||||
<el-checkbox-group class="checkGroup" v-model="sourceTime" style="width: 100%">
|
||||
<el-row v-for="item in latelyDeleteTimes" style="margin-bottom: 10px" class="sourceCheckBox">
|
||||
<el-checkbox :key="item.pullTime" style="width: 100%"
|
||||
:label="item.pullTime" border>
|
||||
时间:{{item.pullTime}}<span
|
||||
style="float: right;color: #F56C6C">rows: {{item.num}}</span>
|
||||
</el-checkbox>
|
||||
</el-row>
|
||||
</el-checkbox-group>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" :loading="deleteLoading" @click="doDeleteUser">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<script>
|
||||
var vue = new Vue({
|
||||
el: '#app',
|
||||
mixins: [initTableMixins],
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
deleteLoading: false,
|
||||
sourceTime: [],
|
||||
active: 'info',
|
||||
pullLoading: false,
|
||||
pageForm: {
|
||||
searchName: "username",
|
||||
},
|
||||
latelyDeleteTimes: [],
|
||||
userId: "",
|
||||
unions: [],
|
||||
units: [],
|
||||
active: 'info',
|
||||
delLoading: false,
|
||||
selection: [],
|
||||
}
|
||||
},
|
||||
components: {
|
||||
'guava': httpVueLoader('/components/plugins/Guava.vue'),
|
||||
'member': httpVueLoader('/components/member/MemberInfo.vue?v=1.0.3'),
|
||||
'dict-select': httpVueLoader('/components/plugins/DictSelect.vue?v=1.0.0'),
|
||||
'mem-change-records': httpVueLoader('/components/member/MemChangeRecords.vue?v=1.0.2'),
|
||||
},
|
||||
methods: {
|
||||
doDeleteUser() {
|
||||
if (this.sourceTime.length === 0) {
|
||||
this.$notify({
|
||||
title: '警告',
|
||||
message: '请选择数据源',
|
||||
type: 'warning'
|
||||
});
|
||||
return
|
||||
}
|
||||
this.$confirm('是否确定删除用户数据?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(async () => {
|
||||
this.deleteLoading = true
|
||||
const resp = await $.post(loc() + '/deleteUser', {sourceTime: JSON.stringify(this.sourceTime)})
|
||||
this.deleteLoading = false
|
||||
if (resp.code === 0) {
|
||||
this.notifySuccess((resp.msg))
|
||||
this.pageData()
|
||||
this.getLatelyUpdateTimes()
|
||||
this.dialogVisible = false
|
||||
} else {
|
||||
this.notifyWarning(resp.msg)
|
||||
}
|
||||
})
|
||||
},
|
||||
async getLatelyUpdateTimes() {
|
||||
const resp = await $.get("/platform/data/user/update/latelyUpdateTimes")
|
||||
if(resp.code===0){
|
||||
this.latelyDeleteTimes = resp.data
|
||||
}else{
|
||||
this.notifyWarning(resp.msg)
|
||||
}
|
||||
},
|
||||
openDeleteUser() {
|
||||
if (!this.latelyDeleteTimes.length) {
|
||||
this.$notify({
|
||||
title: '警告',
|
||||
message: '没有可供删除的数据源',
|
||||
type: 'warning'
|
||||
});
|
||||
return
|
||||
}
|
||||
this.sourceTime = []
|
||||
this.dialogVisible = true
|
||||
},
|
||||
handleCommand(command) {
|
||||
this.pull(command === 'increment')
|
||||
},
|
||||
async doDeleteUsers() {
|
||||
this.$confirm('确定要删除吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(async () => {
|
||||
this.delLoading = true
|
||||
const resp = await $.post(loc() + "/delete", {ids: JSON.stringify(this.selection.map(v => v.id))})
|
||||
this.delLoading = false
|
||||
if (resp.code === 0) {
|
||||
this.$refs.table.clearSelection();
|
||||
this.doSearch()
|
||||
} else {
|
||||
this.notifyWarning(resp.msg)
|
||||
}
|
||||
})
|
||||
},
|
||||
handleSelectionChange(val) {
|
||||
this.selection = val;
|
||||
},
|
||||
pull(isIncrement) {
|
||||
this.$confirm('确定要从数据中心拉取数据吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(async () => {
|
||||
this.pullLoading = true
|
||||
const resp = await $.post(loc() + '/pull')
|
||||
this.pullLoading = false
|
||||
if(resp.code===0){
|
||||
this.pageData()
|
||||
}else{
|
||||
this.notifyWarning(resp.msg)
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
doDelete(userId) {
|
||||
this.$confirm('确定要删除吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
callback: async (a, b) => {
|
||||
if ("confirm" == a) {//确认后再执行
|
||||
const resp = await $.post(loc() + "/delete", {ids: JSON.stringify([userId])});
|
||||
if(resp.code===0){
|
||||
this.pageData()
|
||||
}else{
|
||||
this.notifyWarning(resp.msg)
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
openView(userId) {
|
||||
this.active = 'info'
|
||||
this.userId = userId
|
||||
this.$refs.guava.view()
|
||||
},
|
||||
dropdownCommand(command) {
|
||||
const {type, data} = command
|
||||
if (type == 'view') {
|
||||
this.openView(data.id)
|
||||
} else if (type == 'delete') {
|
||||
this.doDelete(data.id)
|
||||
}
|
||||
},
|
||||
},
|
||||
async created() {
|
||||
this.pageData();
|
||||
this.units = await getUnits()
|
||||
await this.getLatelyUpdateTimes()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,553 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
<style>
|
||||
.query-row {
|
||||
height: 60px;
|
||||
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:not(:last-child,:first-child) {*/
|
||||
/* height: 70px;*/
|
||||
/*}*/
|
||||
|
||||
.query-row-title {
|
||||
width: 100px;
|
||||
}
|
||||
|
||||
.el-table__header-wrapper th {
|
||||
padding: 5px 0 !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div id="app" v-cloak>
|
||||
<guava ref="guava">
|
||||
<template>
|
||||
<el-card shadow="never"
|
||||
style="margin-bottom: 5px;padding: 0px 10px 5px;">
|
||||
|
||||
<el-row type="flex" align="middle" class="query-row">
|
||||
<el-col class="query-row-title">基础查询:</el-col>
|
||||
<el-col class="query-row-content">
|
||||
<div class="btn-group tool-button">
|
||||
<el-input placeholder="请输入内容" clearable v-model="pageForm.searchKeyword"
|
||||
@keyup.enter.native="doSearch">
|
||||
<el-select v-model="pageForm.searchName" slot="prepend"
|
||||
placeholder="查询类型"
|
||||
style="width: 100px;">
|
||||
<el-option label="姓名" value="u.username"></el-option>
|
||||
<el-option label="工号" value="u.loginname"></el-option>
|
||||
</el-select>
|
||||
</el-input>
|
||||
</div>
|
||||
|
||||
<el-row class="btn-group tool-button">
|
||||
<el-select placeholder="所属单位" v-model="pageForm.unitId"
|
||||
style="width: 200px;"
|
||||
clearable="true"
|
||||
filterable="true">
|
||||
<el-option v-for="item in units" :label="item.name"
|
||||
:value="item.id"></el-option>
|
||||
</el-select>
|
||||
</el-row>
|
||||
|
||||
<div class="btn-group tool-button">
|
||||
<dict-select v-model="pageForm.personType" style="width: 200px"
|
||||
clearable placeholder="人员类型"
|
||||
code="UserType"></dict-select>
|
||||
</div>
|
||||
|
||||
<div class="btn-group tool-button">
|
||||
<dict-select v-model="pageForm.userState" style="width: 200px" clearable
|
||||
placeholder="在职状态"
|
||||
code="UserState"></dict-select>
|
||||
</div>
|
||||
<div class="btn-group tool-button">
|
||||
<el-button type="primary" icon="el-icon-search"
|
||||
@click="doSearch"></el-button>
|
||||
</div>
|
||||
<div class="pull-right offscreen-right">
|
||||
<div class="btn-group tool-button">
|
||||
<el-button @click="clearHistory" slot="reference"
|
||||
type="primary">
|
||||
清空历史记录
|
||||
</el-button>
|
||||
<el-button :loading="updateBirthdayLoading" @click="updateBirthday"
|
||||
slot="reference" type="primary">
|
||||
根据身份证号设置出生日期
|
||||
</el-button>
|
||||
<el-button slot="reference" type="primary"
|
||||
@click="checkSource" :loading="updateLoading">
|
||||
更新
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row type="flex" align="middle" class="query-row">
|
||||
<el-col class="query-row-title">异动查询:</el-col>
|
||||
<el-col class="query-row-content">
|
||||
<div class="btn-group tool-button">
|
||||
<el-date-picker
|
||||
style="width: 200px"
|
||||
v-model="pageForm.changeDate"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
placeholder="更新日期">
|
||||
</el-date-picker>
|
||||
</div>
|
||||
<div class="btn-group tool-button">
|
||||
<enum-select v-model="pageForm.changeType" value="code"
|
||||
label="description"
|
||||
style="width: 200px"
|
||||
clearable placeholder="异动类型"
|
||||
enum="UserChangeType"></enum-select>
|
||||
</div>
|
||||
<div class="btn-group tool-button">
|
||||
<el-button type="primary" icon="el-icon-search"
|
||||
@click="doSearch"></el-button>
|
||||
<el-button type="primary" @click="exportChange">导出异动人员</el-button>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
</el-card>
|
||||
|
||||
<el-card shadow="never">
|
||||
<el-table :data="tableData" style="width: 100%" row-key="id"
|
||||
@sort-change="pageOrder" :key="tableKey"
|
||||
v-loading="tableLoading"
|
||||
lazy
|
||||
:load="load"
|
||||
:tree-props="{hasChildren: 'hasHis'}"
|
||||
border
|
||||
>
|
||||
<el-table-column align="center" header-align="center" type="index"
|
||||
:index="indexMethod" label="序号"
|
||||
width="80px"></el-table-column>
|
||||
|
||||
<el-table-column label="工号" prop="loginname" header-align="center"
|
||||
align="center" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column label="姓名" prop="username" header-align="center"
|
||||
align="center" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column label="性别" prop="sex" header-align="center"
|
||||
align="center" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column label="联系电话" prop="mobile" header-align="center"
|
||||
align="center" show-overflow-tooltip></el-table-column>
|
||||
<!-- <el-table-column label="出生日期" prop="birthday" header-align="center"-->
|
||||
<!-- align="center" show-overflow-tooltip></el-table-column>-->
|
||||
<!-- <el-table-column label="身份证" prop="idcard" header-align="center"-->
|
||||
<!-- align="center" show-overflow-tooltip></el-table-column>-->
|
||||
<el-table-column label="人员类型" prop="personType" header-align="center" sortable
|
||||
align="center" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column label="在职状态" prop="userState" header-align="center" sortable
|
||||
align="center" show-overflow-tooltip></el-table-column>
|
||||
|
||||
<el-table-column label="所属单位" prop="unitid" header-align="center"
|
||||
align="center" show-overflow-tooltip sortable>
|
||||
<template scope="{row}">
|
||||
<span v-if="row.unitid"> {{row.unitname}}({{row.unitid}})</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="异动信息" header-align="center">
|
||||
<el-table-column label="更新时间" prop="changeTime" min-width="100px"
|
||||
header-align="center" sortable
|
||||
align="center" show-overflow-tooltip>
|
||||
<!-- <template scope="{row:{changeTime}}">
|
||||
{{changeTime?changeTime:'暂无'}}
|
||||
</template>-->
|
||||
</el-table-column>
|
||||
<el-table-column label="异动类型" prop="changeType" header-align="center"
|
||||
align="center" show-overflow-tooltip sortable>
|
||||
<template scope="{row}">
|
||||
<span style="color: #0e78c5">{{changeType[row.changeType]}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column prop="userOnline" align="center" header-align="center"
|
||||
label="操作"
|
||||
min-width="80px">
|
||||
<template scope="scope">
|
||||
<el-dropdown @command="dropdownCommand">
|
||||
<el-button plain size="mini">
|
||||
<i class="ti-settings"></i>
|
||||
<span class="ti-angle-down"></span>
|
||||
</el-button>
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-item :command="{type:'view',data:scope.row}">
|
||||
查看
|
||||
</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--#include("/layouts/pagination.html"){}#-->
|
||||
</el-card>
|
||||
|
||||
|
||||
</template>
|
||||
|
||||
|
||||
<template #view>
|
||||
|
||||
<el-tabs v-model="active">
|
||||
<el-tab-pane label="个人信息" name="info">
|
||||
<member ref="memberInfo" :source="source" :id="userId" view></member>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
|
||||
</template>
|
||||
</guava>
|
||||
|
||||
<el-dialog
|
||||
title="选择数据源"
|
||||
:visible.sync="dialogVisible"
|
||||
width="50%">
|
||||
<el-timeline>
|
||||
<el-timeline-item timestamp="数据源" placement="top">
|
||||
<el-radio-group class="checkGroup" v-model="sourceTime" style="width: 100%">
|
||||
<el-row v-for="item in latelyUpdateTimes" style="margin-bottom: 10px">
|
||||
<el-radio :key="item.pullTime" style="width: 100%"
|
||||
:label="item.pullTime" border>
|
||||
时间:{{item.pullTime}}<span
|
||||
style="float: right;color: #F56C6C">rows: {{item.num}}</span>
|
||||
</el-radio>
|
||||
</el-row>
|
||||
</el-radio-group>
|
||||
</el-timeline-item>
|
||||
|
||||
<el-timeline-item timestamp="更新方式" placement="top">
|
||||
<el-radio-group class="checkGroup" style="width: 100%" v-model="sourceType">
|
||||
<el-row>
|
||||
<el-radio border label="all">全部更新</el-radio>
|
||||
<el-radio border label="add">仅更新新增人员</el-radio>
|
||||
<el-radio border label="part">部分更新</el-radio>
|
||||
</el-row>
|
||||
</el-radio-group>
|
||||
</el-timeline-item>
|
||||
|
||||
<el-timeline-item timestamp="选择更新组别" placement="top" v-if="sourceType=='part'">
|
||||
<el-row class="query-row">
|
||||
<el-col span="12">
|
||||
<el-select v-model="partGroupId" clearable filterable
|
||||
placeholder="请选择更新组别" style="width: 100%">
|
||||
<el-option
|
||||
v-for="column in partGroupInfos"
|
||||
:key="column.groupId"
|
||||
:label="column.groupName"
|
||||
:value="column.groupId">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-col>
|
||||
<el-col>
|
||||
<el-checkbox style="margin-left: 10px;margin-top: 4px" v-model="isInvert" label="是否更新此组别之外人员" border></el-checkbox>
|
||||
<el-button style="margin-left: 10px;margin-top: 4px" type="primary" @click="partUpdate(sourceType)">设置部分更新人员</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-timeline-item>
|
||||
|
||||
<el-timeline-item timestamp="过滤字段" placement="top" v-if="sourceType=='part'">
|
||||
<el-row class="query-row">
|
||||
<el-col class="query-title" span="6">过滤字段:</el-col>
|
||||
<el-col style="justify-content: end;margin-left: 10px">
|
||||
<el-select v-model="columnNames" clearable filterable
|
||||
placeholder="请选择字段" style="width: 100%" multiple>
|
||||
<el-option
|
||||
v-for="column in columnInfos"
|
||||
:key="column.COLUMN_NAME"
|
||||
:label="column.COLUMN_COMMENT"
|
||||
:value="column.COLUMN_NAME">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-col>
|
||||
<el-col class="query-row">
|
||||
<span style="color: red;margin-left: 10px">该条件为更新时忽略某字段,如无需忽略请勿填充该条件</span>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-timeline-item>
|
||||
</el-timeline>
|
||||
|
||||
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" :loading="updateLoading" @click="doUpdate">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
|
||||
|
||||
<el-drawer
|
||||
title="我是标题" size="78%"
|
||||
:visible.sync="userScopeDialog"
|
||||
:append-to-body="true"
|
||||
:with-header="false">
|
||||
<div style="padding: 0px 16px;" class="clearfix">
|
||||
<el-button icon="el-icon-back" style="font-size: 16px" type="text"
|
||||
@click="doBack()">返回
|
||||
</el-button>
|
||||
</div>
|
||||
<guava>
|
||||
<el-tabs tab-position="top" v-model="activeName" @tab-click="handleClick">
|
||||
<el-tab-pane label="人员设置" name="1">
|
||||
<template>
|
||||
<user-upset ref="userUpset"></user-upset>
|
||||
</template>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="人员查看" name="2">
|
||||
<template>
|
||||
<user-upset-data ref="userUpsetData"></user-upset-data>
|
||||
</template>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
|
||||
</guava>
|
||||
</el-drawer>
|
||||
|
||||
</div>
|
||||
|
||||
<script>
|
||||
var vue = new Vue({
|
||||
el: '#app',
|
||||
mixins: [initTableMixins],
|
||||
data() {
|
||||
return {
|
||||
active: 'info',
|
||||
updateLoading: false,
|
||||
updateBirthdayLoading: false,
|
||||
pageForm: {
|
||||
searchName: "u.username",
|
||||
},
|
||||
|
||||
userId: "",
|
||||
unions: [],
|
||||
units: [],
|
||||
|
||||
latelyUpdateTimes: [],
|
||||
dialogVisible: false,
|
||||
sourceTime: "",
|
||||
changeType: {},
|
||||
source: 'sys_user',
|
||||
sourceType: null,
|
||||
|
||||
activeName: '1',
|
||||
userScopeDialog: false,
|
||||
columnNames: [],
|
||||
columnInfos: [],
|
||||
upDataCount: '0',
|
||||
isUpSet: '0',
|
||||
|
||||
partGroupId: '',
|
||||
partGroupInfos: [],
|
||||
isInvert:'',
|
||||
}
|
||||
},
|
||||
components: {
|
||||
'guava': httpVueLoader('/components/plugins/Guava.vue'),
|
||||
'member': httpVueLoader('/components/member/MemberInfo.vue?v=1.0.3'),
|
||||
'dict-select': httpVueLoader('/components/plugins/DictSelect.vue?v=1.0.0'),
|
||||
'mem-change-records': httpVueLoader('/components/member/MemChangeRecords.vue?v=1.0.2'),
|
||||
'enum-select': httpVueLoader('/components/plugins/EnumSelect.vue?v=1.0.0'),
|
||||
'user-upset': httpVueLoader('/components/userpartupdate/UserPartUpdateSet.vue'),
|
||||
'user-upset-data': httpVueLoader('/components/userpartupdate/UserDataPartUpSet.vue'),
|
||||
},
|
||||
methods: {
|
||||
async getColumnInfo() {
|
||||
const {data, msg, code} = await $.post('/platform/activity/basic/scope/getUserTableColumnInfo')
|
||||
if (code !== 0) {
|
||||
this.$notify.warning(msg)
|
||||
return
|
||||
}
|
||||
this.columnInfos = data
|
||||
},
|
||||
clearHistory() {
|
||||
this.$confirm('您确定要清空历史记录吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(async () => {
|
||||
const resp = await $.post(loc() + '/clearHistory')
|
||||
if (resp.code === 0) {
|
||||
this.notifySuccess(resp.msg)
|
||||
this.doSearch()
|
||||
} else {
|
||||
this.notifyWarning(resp.msg)
|
||||
}
|
||||
})
|
||||
},
|
||||
async updateBirthday() {
|
||||
const confirm = await this.$confirm('是否确定根据身份证号更新出生日期?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
})
|
||||
if (confirm === "confirm") {
|
||||
this.updateBirthdayLoading = true
|
||||
const resp = await $.post(loc() + '/updateBirthday')
|
||||
this.updateBirthdayLoading = false
|
||||
}
|
||||
},
|
||||
async load(tree, treeNode, resolve) {
|
||||
const {loginname} = tree
|
||||
const resp = await $.get(loc() + "/historyUsers", {loginname})
|
||||
if (resp.code === 0) {
|
||||
resolve(resp.data)
|
||||
} else {
|
||||
resolve([])
|
||||
}
|
||||
},
|
||||
checkSource() {
|
||||
if (!this.latelyUpdateTimes.length) {
|
||||
this.$notify({
|
||||
title: '警告',
|
||||
message: '没有可供更新的数据源',
|
||||
type: 'warning'
|
||||
});
|
||||
return
|
||||
}
|
||||
this.sourceTime = ''
|
||||
this.dialogVisible = true
|
||||
// this.doUpdate()
|
||||
},
|
||||
doUpdate() {
|
||||
if (!this.sourceTime) {
|
||||
this.$notify({
|
||||
title: '警告',
|
||||
message: '请选择数据源',
|
||||
type: 'warning'
|
||||
});
|
||||
return
|
||||
}
|
||||
if (!this.sourceType) {
|
||||
this.$notify({
|
||||
title: '警告',
|
||||
message: '请选择更新范围',
|
||||
type: 'warning'
|
||||
});
|
||||
return
|
||||
}
|
||||
if (this.sourceType == 'part' && !this.partGroupId) {
|
||||
this.$notify({
|
||||
title: '警告',
|
||||
message: '部分更新请选择更新组别',
|
||||
type: 'warning'
|
||||
});
|
||||
return;
|
||||
}
|
||||
this.$confirm('是否确定更新用户数据?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(async () => {
|
||||
this.updateLoading = true
|
||||
const resp = await $.post(loc() + '/update', {
|
||||
sourceTime: this.sourceTime,
|
||||
sourceType: this.sourceType,
|
||||
columnNames: JSON.stringify(this.columnNames),
|
||||
isUpSet: this.isUpSet,
|
||||
partGroupId: this.partGroupId,
|
||||
isInvert: this.isInvert,
|
||||
})
|
||||
this.updateLoading = false
|
||||
if (resp.code === 0) {
|
||||
this.tableKey = new Date().getTime()
|
||||
this.pageData()
|
||||
this.dialogVisible = false
|
||||
this.reset()
|
||||
} else {
|
||||
this.notifyWarning(resp.msg)
|
||||
}
|
||||
})
|
||||
},
|
||||
reset(){
|
||||
this.isInvert = ''
|
||||
this.sourceType = ''
|
||||
this.partGroupId = ''
|
||||
},
|
||||
openView({id, flag}) {
|
||||
this.active = 'info'
|
||||
this.userId = id
|
||||
this.source = flag ? 'sys_user' : 'user_history'
|
||||
this.$refs.guava.view()
|
||||
},
|
||||
dropdownCommand(command) {
|
||||
const {type, data} = command
|
||||
if (type == 'view') {
|
||||
this.openView(data)
|
||||
}
|
||||
},
|
||||
|
||||
async getLatelyUpdateTimes() {
|
||||
const resp = await $.get(loc() + "/latelyUpdateTimes")
|
||||
if (resp.code === 0) {
|
||||
this.latelyUpdateTimes = resp.data
|
||||
}
|
||||
},
|
||||
|
||||
async getChangeType() {
|
||||
const changeType = {}
|
||||
const changeTypeOptions = await getEnumOptions("UserChangeType")
|
||||
changeTypeOptions.forEach(v => {
|
||||
changeType[v.code] = v.description
|
||||
})
|
||||
return changeType
|
||||
},
|
||||
exportChange() {
|
||||
const {
|
||||
searchName,
|
||||
searchKeyword,
|
||||
unitId,
|
||||
personType,
|
||||
changeDate,
|
||||
userState
|
||||
} = this.pageForm
|
||||
window.open(loc() + '/exportChangePeo?searchName=' + searchName + '&searchKeyword=' + searchKeyword + '&unitId=' + (unitId ? unitId : '') +
|
||||
'&userState=' + (userState ? userState : '') + '&personType=' + (personType ? personType : '') + '&changeDate=' + (changeDate ? changeDate : ''))
|
||||
},
|
||||
async getPartCount() {
|
||||
const resp = await $.get('/platform/user/part/update/getPartCount')
|
||||
this.upDataCount = resp.data
|
||||
},
|
||||
partUpdate(sourceType) {
|
||||
if (sourceType === 'part') {
|
||||
this.userScopeDialog = true
|
||||
}
|
||||
this.getPartCount()
|
||||
},
|
||||
handleClick() {
|
||||
if (this.activeName === "2") {
|
||||
this.$refs.userUpsetData.pageData();
|
||||
this.$refs.userUpsetData.getActivityGroup();
|
||||
}
|
||||
},
|
||||
async getPartGroupInfos() {
|
||||
const resp = await $.get('/platform/user/part/update/getUserPart')
|
||||
this.partGroupInfos = resp.data
|
||||
},
|
||||
doBack(){
|
||||
this.userScopeDialog = false
|
||||
this.getPartGroupInfos();
|
||||
}
|
||||
},
|
||||
async created() {
|
||||
this.pageData();
|
||||
this.units = await getUnits()
|
||||
await this.getLatelyUpdateTimes()
|
||||
this.changeType = await this.getChangeType()
|
||||
await this.getColumnInfo()
|
||||
await this.getPartGroupInfos()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,206 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8"/>
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=no"/>
|
||||
<title></title>
|
||||
<link rel="stylesheet" href="/assets/platform/css/datav/activity.css">
|
||||
<link rel="stylesheet" href="${base!}/assets/platform/plugins/element-ui/lib/theme-chalk/index.css">
|
||||
<script src="${base!}/assets/platform/plugins/vue/vue.min.js"></script>
|
||||
<script src="${base!}/assets/platform/plugins/element-ui/lib/index.js"></script>
|
||||
<script src="${base!}/assets/platform/plugins/element-ui/lib/i18n/${lang,escape}.js"></script>
|
||||
<script src="${base!}/assets/platform/plugins/datav/datav.map.vue.js"></script>
|
||||
<script src="${base!}/assets/platform/plugins/jquery/jquery-1.11.1.min.js"></script>
|
||||
<script src="${base!}/assets/platform/plugins/vue-loader/httpVueLoader.js"></script>
|
||||
<script src="https://cdn.staticfile.org/g2plot/2.4.31/g2plot.min.js"></script>
|
||||
<script src="https://cdn.staticfile.org/echarts/5.2.2/echarts.js"></script>
|
||||
<script src="https://cdn.staticfile.org/echarts/5.2.2/i18n/langZH.js"></script>
|
||||
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="app">
|
||||
<div id="data-view">
|
||||
<div id="top-header">
|
||||
<dv-decoration-8 class="header-left-decoration"></dv-decoration-8>
|
||||
<dv-decoration-11 class="header-center-decoration">活动</dv-decoration-11>
|
||||
<dv-decoration-8 class="header-right-decoration" reverse></dv-decoration-8>
|
||||
</div>
|
||||
<div id="main-content">
|
||||
<div class="box box1">
|
||||
<h4 class="box-title">活动举办数量</h4>
|
||||
<dv-capsule-chart :config="configType" style="width:90%;height: calc(100% - 60px)"/>
|
||||
</div>
|
||||
<div class="box box2">
|
||||
<h4 class="box-title" style="position: relative">
|
||||
活动参与人数
|
||||
<dv-decoration-11 style="width:200px;height:7vh;position: absolute;right: 10px;line-height: 5vh">
|
||||
<el-select v-model="activityCode" style="width: 120px;height: 5vh" @change="getTakePartUser">
|
||||
<el-option v-for="item in activityCodes" :key="item.code" :value="item.code"
|
||||
:label="item.name">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</dv-decoration-11>
|
||||
</h4>
|
||||
<dv-conical-column-chart :config="box2Config" style="width:100%;height:calc(100% - 13vh);"/>
|
||||
</div>
|
||||
<div class="box box5">
|
||||
<h4 class="box-title">分工会举办活动</h4>
|
||||
<div style="height: calc(100% - 6vh);display: flex;">
|
||||
<div id="unionChart" style="width: 100%;height: calc(100 - 6vh)"></div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="box box6">
|
||||
<h4 class="box-title">每月举办活动信息</h4>
|
||||
<div id="dateChart" style="height: calc(100% - 6vh);display: flex;">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
var app = new Vue({
|
||||
el: '#app',
|
||||
data() {
|
||||
return {
|
||||
userNum: {},
|
||||
unionMember: [],
|
||||
medicalData: {},
|
||||
configType: {
|
||||
data: [],
|
||||
showValue: true
|
||||
},
|
||||
box2Config: {
|
||||
data: [
|
||||
{
|
||||
name: '周口',
|
||||
value: 55
|
||||
},
|
||||
{
|
||||
name: '南阳',
|
||||
value: 120
|
||||
},
|
||||
{
|
||||
name: '西峡',
|
||||
value: 71
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
activityCodes: [],
|
||||
activityCode: null
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async getActivityCode() {
|
||||
const {data} = await $.get('/platform/activity/basic/basic/settings/getActivityTwoLevelType', {code: '50000'})
|
||||
this.activityCodes = data
|
||||
this.activityCode = this.activityCodes[0].code
|
||||
},
|
||||
async getTypeNum() {
|
||||
const {data} = await $.get('/platform/datav/activity/typeNum')
|
||||
this.configType = {
|
||||
data,
|
||||
showValue: true
|
||||
}
|
||||
},
|
||||
async getTakePartUser() {
|
||||
const {data} = await $.get('/platform/datav/activity/takePartUser', {activityCode: this.activityCode})
|
||||
this.box2Config = {
|
||||
data
|
||||
}
|
||||
},
|
||||
async getUnionActivity(){
|
||||
const {data} = await $.get('/platform/datav/activity/unionActivity')
|
||||
const chart = new G2Plot.Column('unionChart', {
|
||||
data,
|
||||
padding: 50,
|
||||
xField: 'name',
|
||||
yField: 'value',
|
||||
forceFit: true,
|
||||
columnStyle: {
|
||||
radius: [20, 20, 0, 0],
|
||||
},
|
||||
xAxis: {
|
||||
label: {
|
||||
autoRotate: true,
|
||||
autoHide: true,
|
||||
autoEllipsis: true,
|
||||
style: {
|
||||
fill: '#fff', // 文字颜色:红色
|
||||
}
|
||||
},
|
||||
},
|
||||
yAxis: {
|
||||
label: {
|
||||
style: {
|
||||
fill: '#fff',
|
||||
},
|
||||
},
|
||||
},
|
||||
legend: {
|
||||
position: 'right', // 图例位置:下边
|
||||
offsetX: -10,
|
||||
itemName: {
|
||||
style: {
|
||||
fill: '#fff', // 文字颜色:红色
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
chart.render();
|
||||
},
|
||||
async getDateActivity(){
|
||||
const {data} = await $.get('/platform/datav/activity/dateActivity')
|
||||
const column = new G2Plot.Column('dateChart', {
|
||||
data,
|
||||
xField: 'type',
|
||||
yField: 'value',
|
||||
xAxis: {
|
||||
label: {
|
||||
autoRotate: false,
|
||||
autoHide: true,
|
||||
autoEllipsis: true,
|
||||
style: {
|
||||
fill: '#fff', // 文字颜色:红色
|
||||
}
|
||||
},
|
||||
},
|
||||
yAxis: {
|
||||
label: {
|
||||
style: {
|
||||
fill: '#fff',
|
||||
},
|
||||
},
|
||||
},
|
||||
scrollbar: {
|
||||
type: 'horizontal',
|
||||
},
|
||||
columnStyle: {
|
||||
radius: [20, 20, 0, 0],
|
||||
},
|
||||
});
|
||||
|
||||
column.render();
|
||||
|
||||
}
|
||||
},
|
||||
created() {
|
||||
setTimeout(async () => {
|
||||
this.getTypeNum()
|
||||
this.getUnionActivity()
|
||||
this.getDateActivity()
|
||||
await this.getActivityCode()
|
||||
await this.getTakePartUser()
|
||||
|
||||
|
||||
})
|
||||
}
|
||||
})
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,566 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Title</title>
|
||||
<link rel="stylesheet" href="${base!}/assets/platform/css/datav/proposal.css">
|
||||
<script src="${base!}/assets/platform/plugins/vue/vue.min.js"></script>
|
||||
<script src="${base!}/assets/platform/plugins/datav/datav.map.vue.js"></script>
|
||||
<script src="${base!}/assets/platform/plugins/jquery/jquery-1.11.1.min.js"></script>
|
||||
<script src="${base!}/assets/platform/plugins/vue-loader/httpVueLoader.js"></script>
|
||||
<!-- <script src="${base!}/assets/platform/plugins/g2/g2.min.js?v=4.1.9"></script>-->
|
||||
<!-- <script src="${base!}/assets/platform/plugins/g2/data-set.js"></script>-->
|
||||
<!-- <script src="${base!}/assets/platform/plugins/g2/g2plot.js?v=1.0.0"></script>-->
|
||||
|
||||
<script src="https://cdn.staticfile.org/g2plot/2.4.31/g2plot.min.js"></script>
|
||||
|
||||
<script src="https://cdn.staticfile.org/echarts/5.2.2/echarts.js"></script>
|
||||
<script src="https://cdn.staticfile.org/echarts/5.2.2/i18n/langZH.js"></script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div id="app">
|
||||
<div id="data-view">
|
||||
<div id="top-header">
|
||||
<dv-decoration-8 class="header-left-decoration"></dv-decoration-8>
|
||||
<dv-decoration-5 class="header-center-decoration"></dv-decoration-5>
|
||||
<dv-decoration-8 class="header-right-decoration" :reverse="true"></dv-decoration-8>
|
||||
<div class="center-title">提案</div>
|
||||
</div>
|
||||
<div id="main-content" style="">
|
||||
<dv-border-box-9 class="box1">
|
||||
<div class="box-title">
|
||||
提案类型统计
|
||||
</div>
|
||||
<div id="proposalTypeChart" style="height:calc((100vh - 160px) / 3)"></div>
|
||||
</dv-border-box-9>
|
||||
<dv-border-box-3 class="box2">
|
||||
<div class="middle">
|
||||
<dv-scroll-board :config="scrollBoardConfig"
|
||||
style="width:100%;padding:50px;height:35%;box-sizing: border-box"></dv-scroll-board>
|
||||
|
||||
<div class="ball ball1">
|
||||
<div class="title">代表人数</div>
|
||||
<div class="num">{{comprehensiveData.representativesNum || 0}}</div>
|
||||
</div>
|
||||
<div class="ball ball2">
|
||||
<div class="title">提案总数</div>
|
||||
<div class="num">{{comprehensiveData.proposalSum || 0}}</div>
|
||||
</div>
|
||||
<div class="ball ball3">
|
||||
<div class="title">个人提案</div>
|
||||
<div class="num">{{comprehensiveData.personalProposalNum || 0}}</div>
|
||||
</div>
|
||||
<div class="ball ball4">
|
||||
<div class="title">代表团提案</div>
|
||||
<div class="num">{{comprehensiveData.delegationProposalNum || 0}}</div>
|
||||
</div>
|
||||
<div class="cicle1"></div>
|
||||
</div>
|
||||
</dv-border-box-3>
|
||||
<dv-border-box-9 class="box3">
|
||||
<div class="box-title">
|
||||
提案满意度
|
||||
</div>
|
||||
<div id="satisfiedChart" style="height:calc((100vh - 160px) / 2)"></div>
|
||||
</dv-border-box-9>
|
||||
<dv-border-box-9 class="box4">
|
||||
<div class="box-title">
|
||||
提案立案率
|
||||
</div>
|
||||
<div id="caseRateChart" style="height:calc((100vh - 160px) / 3)"></div>
|
||||
</dv-border-box-9>
|
||||
<!-- <dv-border-box-9 class="box5">-->
|
||||
<!-- <div id="relationChart" style="height:calc((100vh - 160px) / 3)"></div>-->
|
||||
<!-- </dv-border-box-9>-->
|
||||
<dv-border-box-9 class="box6">
|
||||
<div class="box-title">
|
||||
提案代表团人数/提案数
|
||||
</div>
|
||||
<div id="delegationChart" style="height:calc((100vh - 160px) / 3)"></div>
|
||||
</dv-border-box-9>
|
||||
<dv-border-box-9 class="box7">
|
||||
<div class="box-title">
|
||||
承办单位承办提统计
|
||||
</div>
|
||||
<div id="underTakeChart" style="height:calc((100vh - 160px) / 3);"></div>
|
||||
</dv-border-box-9>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
var app = new Vue({
|
||||
el: '#app',
|
||||
data() {
|
||||
return {
|
||||
comprehensiveData: {
|
||||
representativesNum: 0,
|
||||
proposalNum: 0
|
||||
},
|
||||
proposalNames: [],
|
||||
scrollBoardConfig: {},
|
||||
meetingId: '2b0c15egeeg8lo74lgaiu2cgev'
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
renderProposalTypeCount() {
|
||||
$.get('/platform/datav/proposal/typeData', {meetingId: this.meetingId}).then(res => {
|
||||
const data = res.data
|
||||
const chart = new G2Plot.Column('proposalTypeChart', {
|
||||
data,
|
||||
padding: 50,
|
||||
autoFit: true,
|
||||
xField: 'type',
|
||||
yField: 'value',
|
||||
meta: {
|
||||
type: {
|
||||
alias: '类别',
|
||||
},
|
||||
sales: {
|
||||
alias: '数量',
|
||||
},
|
||||
},
|
||||
xAxis: {
|
||||
label: {
|
||||
autoRotate: true,
|
||||
autoHide: false,
|
||||
autoEllipsis: false,
|
||||
style: {
|
||||
fill: '#fff', // 文字颜色
|
||||
}
|
||||
},
|
||||
},
|
||||
yAxis: {
|
||||
label: {
|
||||
style: {
|
||||
fill: '#fff',
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
chart.render()
|
||||
})
|
||||
},
|
||||
renderProposalSatisfied() {
|
||||
$.get('/platform/datav/proposal/satisfiedData', {meetingId: this.meetingId}).then(res => {
|
||||
const data = res.data
|
||||
const chart = new G2Plot.Pie('satisfiedChart', {
|
||||
data,
|
||||
padding: 30,
|
||||
autoFit: true,
|
||||
angleField: 'num',
|
||||
colorField: 'name',
|
||||
radius: 0.65,
|
||||
color: ['#9661BC', '#5B8FF9', '#61DDAA'],
|
||||
label: {
|
||||
type: 'spider',
|
||||
labelHeight: 28,
|
||||
content: '{name}\n{percentage}',
|
||||
style: {
|
||||
fill: '#fff', // 文字颜色:红色
|
||||
}
|
||||
},
|
||||
interactions: [{type: 'element-selected'}, {type: 'element-active'}],
|
||||
legend: {
|
||||
position: 'bottom', // 图例位置:右边
|
||||
offsetY: -25, // 在 y 轴上向下偏移 20px
|
||||
itemName: {
|
||||
style: {
|
||||
fill: '#fff', // 文字颜色:红色
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
chart.render();
|
||||
})
|
||||
},
|
||||
renderProposalCaseRate() {
|
||||
$.get('/platform/datav/proposal/caseRate', {meetingId: this.meetingId}).then(res => {
|
||||
const data = res.data
|
||||
const chart = new G2Plot.Radar('caseRateChart', {
|
||||
data,
|
||||
xField: 'name',
|
||||
yField: 'value',
|
||||
padding: 60,
|
||||
seriesField: 'type',
|
||||
meta: {
|
||||
num: {
|
||||
alias: '数量',
|
||||
min: 0
|
||||
},
|
||||
},
|
||||
xAxis: {
|
||||
line: null,
|
||||
tickLine: null,
|
||||
grid: {
|
||||
line: {
|
||||
style: {
|
||||
lineDash: null,
|
||||
},
|
||||
},
|
||||
},
|
||||
label: {
|
||||
style: {
|
||||
fill: '#fff', // 文字颜色:红色
|
||||
},
|
||||
},
|
||||
},
|
||||
yAxis: {
|
||||
line: null,
|
||||
tickLine: null,
|
||||
grid: {
|
||||
line: {
|
||||
type: 'line',
|
||||
style: {
|
||||
lineDash: null,
|
||||
},
|
||||
},
|
||||
},
|
||||
label: {
|
||||
style: {
|
||||
fill: '#fff', // 文字颜色:红色
|
||||
},
|
||||
},
|
||||
},
|
||||
label: {
|
||||
style: {
|
||||
fill: '#fff'
|
||||
}
|
||||
},
|
||||
area: {},
|
||||
point: {
|
||||
size: 2,
|
||||
},
|
||||
legend: false
|
||||
});
|
||||
|
||||
chart.render();
|
||||
})
|
||||
},
|
||||
renderProposalDelegationCount() {
|
||||
$.get('/platform/datav/proposal/delegationCount', {meetingId: this.meetingId}).then(res => {
|
||||
const data = res.data
|
||||
const chart = new G2Plot.Column('delegationChart', {
|
||||
data,
|
||||
padding: 50,
|
||||
xField: 'name',
|
||||
yField: 'value',
|
||||
seriesField: 'type',
|
||||
isGroup: 'true',
|
||||
forceFit: true,
|
||||
columnStyle: {
|
||||
radius: [20, 20, 0, 0],
|
||||
},
|
||||
xAxis: {
|
||||
label: {
|
||||
autoRotate: true,
|
||||
autoHide: true,
|
||||
autoEllipsis: true,
|
||||
style: {
|
||||
fill: '#fff', // 文字颜色:红色
|
||||
}
|
||||
},
|
||||
},
|
||||
yAxis: {
|
||||
label: {
|
||||
style: {
|
||||
fill: '#fff',
|
||||
},
|
||||
},
|
||||
},
|
||||
legend: {
|
||||
position: 'right', // 图例位置:下边
|
||||
offsetX: -10,
|
||||
itemName: {
|
||||
style: {
|
||||
fill: '#fff', // 文字颜色:红色
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
chart.render();
|
||||
})
|
||||
},
|
||||
renderProposalUnderTakeCount() {
|
||||
$.get('/platform/datav/proposal/underTakeCount', {meetingId: this.meetingId}).then(res => {
|
||||
let data = res.data
|
||||
const chart = new G2Plot.Column(document.getElementById('underTakeChart'), {
|
||||
forceFit: true,
|
||||
data,
|
||||
padding: 50,
|
||||
xField: 'name',
|
||||
yField: 'value',
|
||||
columnStyle: {
|
||||
radius: [20, 20, 0, 0],
|
||||
},
|
||||
xAxis: {
|
||||
label: {
|
||||
autoHide: true,
|
||||
style: {
|
||||
fill: '#fff', // 文字颜色:红色
|
||||
}
|
||||
},
|
||||
},
|
||||
yAxis: {
|
||||
label: {
|
||||
visible: true,
|
||||
formatter: (v) => v,
|
||||
style: {
|
||||
fill: '#fff',
|
||||
},
|
||||
},
|
||||
},
|
||||
interactions: [
|
||||
{
|
||||
type: 'scrollbar',
|
||||
},
|
||||
],
|
||||
});
|
||||
chart.render();
|
||||
|
||||
})
|
||||
},
|
||||
getComprehensiveData() {
|
||||
$.get('/platform/datav/proposal/comprehensiveData', {meetingId: this.meetingId}).then(res => {
|
||||
this.comprehensiveData = res.data
|
||||
})
|
||||
},
|
||||
getProposalNames() {
|
||||
$.get('/platform/datav/proposal/proposalNames', {meetingId: this.meetingId}).then(res => {
|
||||
this.proposalNames = res.data
|
||||
this.scrollBoardConfig = {
|
||||
header: ['提案名称'],
|
||||
data: res.data,
|
||||
index: true,
|
||||
columnWidth: [50],
|
||||
align: ['center'],
|
||||
waitTime: 2000
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
|
||||
},
|
||||
async created() {
|
||||
this.renderProposalTypeCount()
|
||||
this.renderProposalSatisfied()
|
||||
this.renderProposalCaseRate()
|
||||
this.renderProposalDelegationCount()
|
||||
this.renderProposalUnderTakeCount()
|
||||
this.getComprehensiveData()
|
||||
this.getProposalNames()
|
||||
|
||||
/*************** 关系图 **************/
|
||||
//初始化echarts实例
|
||||
const relationChart = echarts.init(document.getElementById("relationChart"));
|
||||
const relationOpt = {
|
||||
animationDurationUpdate: 1500,
|
||||
animationEasingUpdate: 'quinticInOut',
|
||||
label: {
|
||||
normal: {
|
||||
show: true,
|
||||
textStyle: {
|
||||
fontSize: 12
|
||||
}
|
||||
}
|
||||
},
|
||||
series: [{
|
||||
type: 'graph',
|
||||
symbolSize: 45,
|
||||
focusNodeAdjacency: true,
|
||||
roam: true,
|
||||
layout: 'force',
|
||||
force: {
|
||||
repulsion: 320 //斥力因子,值越大,斥力越大
|
||||
},
|
||||
label: {
|
||||
normal: {
|
||||
show: true,
|
||||
textStyle: {
|
||||
fontSize: 12
|
||||
},
|
||||
}
|
||||
},
|
||||
edgeSymbolSize: [4, 50],
|
||||
edgeLabel: {
|
||||
normal: {
|
||||
show: true,
|
||||
textStyle: {
|
||||
fontSize: 10
|
||||
},
|
||||
formatter: "{c}"
|
||||
}
|
||||
},
|
||||
categories: [{
|
||||
name: '全栈',
|
||||
itemStyle: {
|
||||
normal: {
|
||||
color: '#f2637b'
|
||||
}
|
||||
}
|
||||
}, {
|
||||
name: '前端',
|
||||
itemStyle: {
|
||||
normal: {
|
||||
color: "#eaa674",
|
||||
}
|
||||
}
|
||||
}, {
|
||||
name: '移动端',
|
||||
itemStyle: {
|
||||
normal: {
|
||||
color: "#3aa1ff",
|
||||
}
|
||||
}
|
||||
}, {
|
||||
name: '服务端',
|
||||
itemStyle: {
|
||||
normal: {
|
||||
color: "#4ecb73",
|
||||
}
|
||||
}
|
||||
}],
|
||||
data: [{
|
||||
name: '全栈',
|
||||
category: 0,
|
||||
draggable: true
|
||||
}, {
|
||||
name: '前端',
|
||||
category: 1,
|
||||
draggable: true
|
||||
}, {
|
||||
name: '移动端',
|
||||
category: 2,
|
||||
draggable: true
|
||||
}, {
|
||||
name: '服务端',
|
||||
category: 3,
|
||||
draggable: true
|
||||
}, {
|
||||
name: 'HTML',
|
||||
category: 1,
|
||||
draggable: true,
|
||||
}, {
|
||||
name: 'CSS',
|
||||
category: 1,
|
||||
draggable: true,
|
||||
}, {
|
||||
name: 'JavaScript',
|
||||
category: 1,
|
||||
draggable: true,
|
||||
}, {
|
||||
name: 'TypeScript',
|
||||
category: 1,
|
||||
draggable: true,
|
||||
}, {
|
||||
name: 'Java',
|
||||
category: 3,
|
||||
draggable: true,
|
||||
}, {
|
||||
name: 'PHP',
|
||||
category: 3,
|
||||
draggable: true,
|
||||
}, {
|
||||
name: 'Python',
|
||||
category: 3,
|
||||
draggable: true,
|
||||
}, {
|
||||
name: 'Andriod',
|
||||
category: 2,
|
||||
draggable: true,
|
||||
}, {
|
||||
name: 'Object-C',
|
||||
category: 2,
|
||||
draggable: true,
|
||||
}, {
|
||||
name: 'Swift',
|
||||
category: 2,
|
||||
draggable: true,
|
||||
}],
|
||||
links: [{
|
||||
source: 0,
|
||||
target: 1,
|
||||
value: ''
|
||||
}, {
|
||||
source: 0,
|
||||
target: 2,
|
||||
value: ''
|
||||
}, {
|
||||
source: 0,
|
||||
target: 3,
|
||||
value: ''
|
||||
}, {
|
||||
source: 1,
|
||||
target: 4,
|
||||
value: ''
|
||||
}, {
|
||||
source: 1,
|
||||
target: 5,
|
||||
value: ''
|
||||
}, {
|
||||
source: 1,
|
||||
target: 6,
|
||||
value: ''
|
||||
}, {
|
||||
source: 1,
|
||||
target: 7,
|
||||
value: ''
|
||||
}, {
|
||||
source: 6,
|
||||
target: 7,
|
||||
value: '超集'
|
||||
}, {
|
||||
source: 3,
|
||||
target: 8,
|
||||
value: ''
|
||||
}, {
|
||||
source: 3,
|
||||
target: 9,
|
||||
value: ''
|
||||
}, {
|
||||
source: 3,
|
||||
target: 10,
|
||||
value: ''
|
||||
}, {
|
||||
source: 9,
|
||||
target: 10,
|
||||
value: '脚本'
|
||||
}, {
|
||||
source: 2,
|
||||
target: 11,
|
||||
value: ''
|
||||
}, {
|
||||
source: 2,
|
||||
target: 12,
|
||||
value: ''
|
||||
}, {
|
||||
source: 2,
|
||||
target: 13,
|
||||
value: ''
|
||||
}, {
|
||||
source: 12,
|
||||
target: 13,
|
||||
value: 'iOS'
|
||||
}],
|
||||
lineStyle: {
|
||||
normal: {
|
||||
opacity: 0.9,
|
||||
width: 1,
|
||||
curveness: 0
|
||||
}
|
||||
}
|
||||
}]
|
||||
};
|
||||
relationChart.setOption(relationOpt);
|
||||
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,350 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8"/>
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=no"/>
|
||||
<title></title>
|
||||
<link rel="stylesheet" href="/assets/platform/css/datav/staff.css">
|
||||
<script src="${base!}/assets/platform/plugins/vue/vue.min.js"></script>
|
||||
<script src="${base!}/assets/platform/plugins/datav/datav.map.vue.js"></script>
|
||||
<script src="${base!}/assets/platform/plugins/jquery/jquery-1.11.1.min.js"></script>
|
||||
<script src="${base!}/assets/platform/plugins/vue-loader/httpVueLoader.js"></script>
|
||||
<script src="https://cdn.staticfile.org/g2plot/2.4.31/g2plot.min.js"></script>
|
||||
<script src="https://cdn.staticfile.org/echarts/5.2.2/echarts.js"></script>
|
||||
<script src="https://cdn.staticfile.org/echarts/5.2.2/i18n/langZH.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="app">
|
||||
<div id="data-view">
|
||||
<div id="top-header">
|
||||
<dv-decoration-8 class="header-left-decoration"></dv-decoration-8>
|
||||
<dv-decoration-11 class="header-center-decoration">工会</dv-decoration-11>
|
||||
<dv-decoration-8 class="header-right-decoration" :reverse="true"></dv-decoration-8>
|
||||
</div>
|
||||
<div id="main-content">
|
||||
<div class="box box1">
|
||||
<h4 class="box-title">工会信息</h4>
|
||||
|
||||
<div style="display: grid;grid-template-columns: repeat(3,1fr);grid-row-gap: 2vh;height: calc(100% - 60px);">
|
||||
<template v-for="item in userNum">
|
||||
<div style="text-align: center">
|
||||
<img src="/assets/platform/img/datav/staff/icon03.png" alt=""
|
||||
style="width: 4vw;height: 4vw">
|
||||
<div style="text-align: center;font-size: 1vw;color: #02d4ec">
|
||||
{{item}}
|
||||
</div>
|
||||
<div style="text-align: center;font-size: 1vw;color: #02d4ec">
|
||||
会员人数
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- {{userNum.singleNum}}-->
|
||||
<!-- {{userNum.currentYearNewUserNum}}-->
|
||||
<!-- {{userNum.currentYearRetireUserNum}}-->
|
||||
<!-- {{userNum.difficultNum}}-->
|
||||
<!-- {{userNum.condolenceNum}}-->
|
||||
<!-- {{userNum.aidFundMemberNum}}-->
|
||||
<!-- {{userNum.medicalNum}}-->
|
||||
<!-- {{userNum.subsidyMoney}}-->
|
||||
|
||||
</div>
|
||||
<div class="box box2">
|
||||
<h4 class="box-title">各工会会员数</h4>
|
||||
<div id="unionMemberChart" style="width: 100%;height: 100px"></div>
|
||||
|
||||
<div class="unionList" style="display: flex;row-gap: 10px;flex-direction: column;padding: 10px">
|
||||
<div v-for="(item,index) in unionMember" :key="item.id" class="listRow clearBox"
|
||||
style="display: flex;column-gap: 20px">
|
||||
<div><span class="sameIndex" style="flex: 3">{{index + 1}}</span></div>
|
||||
<div style="flex: 10">
|
||||
<span>{{item.unionname}}</span>
|
||||
</div>
|
||||
<div style="flex: 20">
|
||||
<span class="sameLoad" style="width: 100%">
|
||||
<span class="loadBg" :style="{width: item.ratio+'%'}"></span>
|
||||
</span>
|
||||
</div>
|
||||
<div class="sameCount" style="flex: 3;color: #057584;text-align: left">
|
||||
<span>{{item.value}}</span>
|
||||
<span>人</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="box box3">
|
||||
<h4 class="box-title">男女会员</h4>
|
||||
<div id="memberSexPercentageChart" style="height: calc(100% - 6vh);"></div>
|
||||
</div>
|
||||
<div class="box box4">
|
||||
<h4 class="box-title">人员类型</h4>
|
||||
<div id="userTypeChart" style="height: calc(100% - 6vh);"></div>
|
||||
</div>
|
||||
<div class="box box5">
|
||||
<h4 class="box-title">大病互助</h4>
|
||||
<div style="height: calc(100% - 6vh);display: flex;">
|
||||
<div id="medicalChart" style="width: calc(100% - 20vw)"></div>
|
||||
<div style="width: 20vw">
|
||||
<div style="display: flex;justify-content: space-around">
|
||||
<div style="text-align: center">
|
||||
<img src="/assets/platform/img/datav/staff/icon03.png" alt=""
|
||||
style="width: 4vw;height: 4vw">
|
||||
<div style="text-align: center;font-size: 1vw;color: #02d4ec">
|
||||
{{medicalData.aidFundMemberNum || 0}}
|
||||
</div>
|
||||
<div style="text-align: center;font-size: 1vw;color: #02d4ec">
|
||||
基金会员人数
|
||||
</div>
|
||||
</div>
|
||||
<div style="text-align: center">
|
||||
<img src="/assets/platform/img/datav/staff/icon03.png" alt=""
|
||||
style="width: 4vw;height: 4vw">
|
||||
<div style="text-align: center;font-size: 1vw;color: #02d4ec">
|
||||
{{medicalData.subsidyMoney || 0}}元
|
||||
</div>
|
||||
<div style="text-align: center;font-size: 1vw;color: #02d4ec">
|
||||
本年补助金额
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="box box6">
|
||||
<h4 class="box-title">福利</h4>
|
||||
<div id="welfareChart" style="height: calc(100% - 6vh);display: flex;"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
var app = new Vue({
|
||||
el: '#app',
|
||||
data() {
|
||||
return {
|
||||
userNum: {},
|
||||
unionMember: [],
|
||||
medicalData: {}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async getUserNum() {
|
||||
const {data} = await $.get('/platform/datav/staff/userNum')
|
||||
this.userNum = data
|
||||
},
|
||||
async getMemberSexPercentage() {
|
||||
const {data} = await $.get('/platform/datav/staff/memberSexPercentage')
|
||||
const piePlot = new G2Plot.Pie('memberSexPercentageChart', {
|
||||
appendPadding: 10,
|
||||
data,
|
||||
angleField: 'value',
|
||||
colorField: 'type',
|
||||
radius: 1,
|
||||
innerRadius: 0.6,
|
||||
label: {
|
||||
type: 'inner',
|
||||
offset: '-50%',
|
||||
content: '{value}',
|
||||
style: {
|
||||
textAlign: 'center',
|
||||
fontSize: 14,
|
||||
},
|
||||
},
|
||||
legend: false,
|
||||
interactions: [{type: 'element-selected'}, {type: 'element-active'}],
|
||||
statistic: {
|
||||
title: false,
|
||||
content: {
|
||||
style: {
|
||||
whiteSpace: 'pre-wrap',
|
||||
overflow: 'hidden',
|
||||
textOverflow: 'ellipsis',
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
piePlot.render();
|
||||
},
|
||||
|
||||
async renderUserType() {
|
||||
const {data} = await $.get('/platform/datav/staff/userTypeCount')
|
||||
const piePlot = new G2Plot.Column('userTypeChart', {
|
||||
data,
|
||||
xField: 'name',
|
||||
yField: 'value',
|
||||
padding: [20, 50, 50, 50],
|
||||
label: {
|
||||
// 可手动配置 label 数据标签位置
|
||||
position: 'middle', // 'top', 'bottom', 'middle',
|
||||
// 配置样式
|
||||
style: {
|
||||
fill: '#FFFFFF',
|
||||
opacity: 0.6,
|
||||
},
|
||||
},
|
||||
xAxis: {
|
||||
label: {
|
||||
autoHide: true,
|
||||
autoRotate: false,
|
||||
style: {
|
||||
fill: '#FFFFFF',
|
||||
},
|
||||
},
|
||||
},
|
||||
yAxis: {
|
||||
label: {
|
||||
style: {
|
||||
fill: '#FFFFFF',
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
meta: {
|
||||
type: {
|
||||
alias: '类别',
|
||||
},
|
||||
sales: {
|
||||
alias: '销售额',
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
piePlot.render();
|
||||
|
||||
},
|
||||
|
||||
async getUnionMember() {
|
||||
const {data: {chartData, tableData}} = await $.get('/platform/datav/staff/unionMember')
|
||||
this.unionMember = tableData
|
||||
const labels = chartData.map(v => v.unionname)
|
||||
const values = chartData.map(v => v.value)
|
||||
const chart = new G2Plot.TinyArea('unionMemberChart', {
|
||||
autoFit: true,
|
||||
data: values,
|
||||
smooth: true,
|
||||
tooltip: {
|
||||
customContent: function (i, data) {
|
||||
if (labels[i]) {
|
||||
return labels[i] + '- ' + data[0]?.data?.y + '人';
|
||||
}
|
||||
return ''
|
||||
},
|
||||
},
|
||||
})
|
||||
chart.render();
|
||||
|
||||
|
||||
},
|
||||
|
||||
async renderMedical() {
|
||||
const {data} = await $.get('/platform/datav/staff/medicalData')
|
||||
this.medicalData = data
|
||||
const piePlot = new G2Plot.Column('medicalChart', {
|
||||
data: data.applyList,
|
||||
xField: 'year',
|
||||
yField: 'value',
|
||||
padding: [20, 50, 50, 50],
|
||||
label: {
|
||||
// 可手动配置 label 数据标签位置
|
||||
position: 'middle', // 'top', 'bottom', 'middle',
|
||||
// 配置样式
|
||||
style: {
|
||||
fill: '#FFFFFF',
|
||||
opacity: 0.6,
|
||||
},
|
||||
},
|
||||
xAxis: {
|
||||
label: {
|
||||
autoHide: true,
|
||||
autoRotate: false,
|
||||
style: {
|
||||
fill: '#FFFFFF',
|
||||
},
|
||||
},
|
||||
},
|
||||
yAxis: {
|
||||
label: {
|
||||
style: {
|
||||
fill: '#FFFFFF',
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
meta: {
|
||||
type: {
|
||||
alias: '类别',
|
||||
},
|
||||
sales: {
|
||||
alias: '销售额',
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
piePlot.render();
|
||||
|
||||
|
||||
},
|
||||
|
||||
async renderWelfareData() {
|
||||
const {data} = await $.get('/platform/datav/staff/welfareData')
|
||||
const columnPlot = new G2Plot.Column('welfareChart', {
|
||||
data,
|
||||
xField: 'name',
|
||||
yField: 'count',
|
||||
padding: [20, 50, 50, 50],
|
||||
color: '#4f88f1',
|
||||
maxColumnWidth:40,
|
||||
label: {
|
||||
// 可手动配置 label 数据标签位置
|
||||
position: 'middle', // 'top', 'bottom', 'middle',
|
||||
// 配置样式
|
||||
style: {
|
||||
fill: '#FFFFFF',
|
||||
opacity: 0.6,
|
||||
},
|
||||
},
|
||||
xAxis: {
|
||||
label: {
|
||||
autoHide: true,
|
||||
autoRotate: false,
|
||||
style: {
|
||||
fill: '#fff'
|
||||
}
|
||||
},
|
||||
},
|
||||
yAxis: {
|
||||
label: {
|
||||
style: {
|
||||
fill: '#fff'
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
columnStyle: {
|
||||
radius: [20, 20, 0, 0],
|
||||
},
|
||||
});
|
||||
|
||||
columnPlot.render();
|
||||
}
|
||||
},
|
||||
created() {
|
||||
setTimeout(() => {
|
||||
this.getUserNum()
|
||||
this.getMemberSexPercentage()
|
||||
this.renderUserType()
|
||||
this.getUnionMember()
|
||||
this.renderMedical()
|
||||
this.renderWelfareData()
|
||||
})
|
||||
}
|
||||
})
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,387 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
<style>
|
||||
.el-select {
|
||||
width: 100%;
|
||||
}
|
||||
</style>
|
||||
<div id="app" v-cloak>
|
||||
<guava ref="guava">
|
||||
<template>
|
||||
|
||||
<el-card shadow="never">
|
||||
|
||||
<div class="btn-group tool-button">
|
||||
<div class="block">
|
||||
<el-date-picker
|
||||
style="width: 100px"
|
||||
v-model="pageForm.year"
|
||||
type="year" @change="getEvaluateByYear()"
|
||||
value-format="yyyy"
|
||||
placeholder="年度">
|
||||
</el-date-picker>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="btn-group tool-button">
|
||||
<el-select placeholder="评优评先名称" v-model="pageForm.evaluateId" style="width: 100%;"
|
||||
clearable="true" filterable="true">
|
||||
<el-option v-for="item in evaluateList" :label="item.evaluateName"
|
||||
:value="item.evaluateId"></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
|
||||
<div class="btn-group tool-button" v-if="pageForm.honorType=='101'">
|
||||
<div>
|
||||
<el-input placeholder="请输入内容" v-model="pageForm.searchKeyword" clearable>
|
||||
<el-select v-model="pageForm.searchName" slot="prepend" placeholder="查询类型"
|
||||
style="width: 100px;">
|
||||
<el-option label="工号" value="us.loginname"></el-option>
|
||||
<el-option label="姓名" value="us.username"></el-option>
|
||||
</el-select>
|
||||
</el-input>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="btn-group tool-button">
|
||||
<el-select placeholder="所属工会" v-model="pageForm.unionId" style="width: 100%;"
|
||||
clearable="true"
|
||||
@change="flushUnits" @clear="flushUnits"
|
||||
v-if="${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')}"
|
||||
filterable="true">
|
||||
<el-option v-for="item in unions" :label="item.unionname" :value="item.id"></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
|
||||
<div class="btn-group tool-button">
|
||||
<el-select placeholder="所属单位" v-model="pageForm.unitId" style="width: 100%;"
|
||||
clearable="true"
|
||||
filterable="true">
|
||||
<el-option v-for="item in units" :label="item.name" :value="item.id"></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
|
||||
<!-- <div class="btn-group tool-button">-->
|
||||
<!-- <el-radio-group v-model="pageForm.honorType" @change="(o) => {radioChange(o)}">-->
|
||||
<!-- <el-radio-button v-for="v in honorTypeList" :label="v.id">{{v.name}}({{v.num}})-->
|
||||
<!-- </el-radio-button>-->
|
||||
<!-- </el-radio-group>-->
|
||||
<!-- </div>-->
|
||||
|
||||
<div class="btn-group tool-button">
|
||||
<el-button type="primary" @click="doSearch" icon="el-icon-search"></el-button>
|
||||
</div>
|
||||
<div class="pull-right offscreen-right">
|
||||
|
||||
<el-radio-group v-model="pageForm.isAudit" @change="doSearch">
|
||||
<el-radio-button :label="null">全部</el-radio-button>
|
||||
<el-radio-button :label="true">已审核</el-radio-button>
|
||||
<el-radio-button :label="false">未审核</el-radio-button>
|
||||
</el-radio-group>
|
||||
</div>
|
||||
|
||||
</el-card>
|
||||
|
||||
<el-card class="mt10" shadow="never">
|
||||
|
||||
<vi-title2 title="申请列表"></vi-title2>
|
||||
|
||||
<el-table :data="tableData">
|
||||
<el-table-column align="center" header-align="center" label="序号" type="index"
|
||||
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"
|
||||
:sortable="column.sortable" show-overflow-tooltip>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="申请时间" prop="applyTime" sortable header-align="center"
|
||||
align="center"></el-table-column>
|
||||
<el-table-column align="center" header-align="center" label="审核状态" prop="year"
|
||||
show-overflow-tooltip>
|
||||
<template slot-scope="{row}">
|
||||
<span :style="'color: ' + row.stateColor">{{row.stateName}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" header-align="center" label="操作" fixed="right" width="220px">
|
||||
<template scope="{row}">
|
||||
<el-button size="mini" @click="openView(row)" type="primary">
|
||||
查看
|
||||
</el-button>
|
||||
<el-button size="mini" @click="rollback(row)" type="danger"
|
||||
v-if="pageForm.isAudit === true && row.stateId <= 1800">
|
||||
撤回
|
||||
</el-button>
|
||||
<el-button size="mini" @click="openEdit(row)" type="primary" v-if="row.stateId == 1700">
|
||||
审核
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
</el-table>
|
||||
|
||||
<!--#include("/layouts/pagination.html"){}#-->
|
||||
|
||||
</el-card>
|
||||
|
||||
|
||||
</template>
|
||||
|
||||
<template #edit>
|
||||
<evaluate-info ref="info2" :handle="true" label="二级党组织审核" :panes="[2, 3, 4]">
|
||||
<template #handle>
|
||||
<vi-title title="审核信息"></vi-title>
|
||||
<el-form :model="formData" ref="form" :rules="formRules" label-position="right"
|
||||
label-width="120px">
|
||||
<el-row gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item prop="username" label="审核人员">
|
||||
<el-input v-model="formData.username"
|
||||
disabled></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item prop="time" label="审核时间">
|
||||
<el-input v-model="formData.auditTime" disabled></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-form-item prop="auditOpinion" label="审核意见">
|
||||
<el-input type="textarea" v-model="formData.auditOpinion" rows="4" maxlength="500"
|
||||
placeholder="请填写您的审核意见"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="auditSign" label="签  字">
|
||||
<sign :qz.sync="formData.auditSign"></sign>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<div style="float: right;margin: 20px 0">
|
||||
<el-button @click="doReview(false)">拒
|
||||
绝
|
||||
</el-button>
|
||||
<!-- <el-button type="danger" @click="returnBack()">退-->
|
||||
<!-- 回-->
|
||||
<!-- </el-button>-->
|
||||
<el-button type="primary" @click="doReview(true)">通
|
||||
过
|
||||
</el-button>
|
||||
|
||||
</div>
|
||||
|
||||
</template>
|
||||
</evaluate-info>
|
||||
</template>
|
||||
|
||||
<template #view>
|
||||
<evaluate-info ref="info"></evaluate-info>
|
||||
</template>
|
||||
|
||||
</guava>
|
||||
</div>
|
||||
|
||||
|
||||
<script>
|
||||
var vue = new Vue({
|
||||
el: '#app',
|
||||
mixins: [initTableMixins],
|
||||
data() {
|
||||
return {
|
||||
units: [],
|
||||
unions: [],
|
||||
honorLevelList: [],
|
||||
honorTypeList: [],
|
||||
evaluateList: [],
|
||||
pageForm: {
|
||||
// year: new Date().getFullYear() + "",
|
||||
year: "",
|
||||
isAudit: false,
|
||||
searchName: 'us.username',
|
||||
honorType: '',
|
||||
honorLevel: ''
|
||||
},
|
||||
rowData: {},
|
||||
tableColumns: [
|
||||
{prop: 'evaluateName', label: '评优评先名称', sortable: true},
|
||||
{prop: 'honorName', label: '申请类型', sortable: true},
|
||||
{prop: 'username', label: '申请人姓名', sortable: true},
|
||||
{prop: 'loginname', label: '工号', sortable: true},
|
||||
{prop: 'userSex', label: '性别', sortable: true},
|
||||
{prop: 'unitName', label: '单位', sortable: true},
|
||||
{prop: 'unionName', label: '工会', sortable: true},
|
||||
{prop: 'clubName', label: '协会', sortable: true},
|
||||
// {prop: 'unionName', label: '加入工会时间', sortable: true},
|
||||
// {prop: 'unionName', label: '担任工会职务'},
|
||||
],
|
||||
formRules: {
|
||||
auditOpinion: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
auditSign: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
}
|
||||
}
|
||||
},
|
||||
components: {
|
||||
'evaluate-info': httpVueLoader('/components/evaluate/evaluateInfo.vue?v=1.0.0'),
|
||||
},
|
||||
methods: {
|
||||
rollback(row) {
|
||||
this.$confirm('确定要撤回吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
callback: async (a, b) => {
|
||||
if ("confirm" == a) {//确认后再执行
|
||||
const resp = await $.post('/platform/evaluate/audit/party/rollback', {
|
||||
id: row.id,
|
||||
type: row.honorTypeId === HonorApi.honor_single_id,
|
||||
})
|
||||
if (resp.code === 0) {
|
||||
this.$message.success(resp.msg)
|
||||
await this.getHonorNum()
|
||||
this.pageData()
|
||||
} else {
|
||||
this.$message.warning(resp.msg)
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
returnBack() {
|
||||
this.formData.id = this.rowData.id
|
||||
this.formData.type = this.rowData.honorTypeId === HonorApi.honor_single_id
|
||||
this.formData.userId = this.rowData.userId
|
||||
this.$confirm('确定要退回吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
callback: async (a, b) => {
|
||||
if ("confirm" == a) {//确认后再执行
|
||||
const resp = await $.post('/platform/evaluate/audit/party/returnBack', this.formData)
|
||||
if (resp.code === 0) {
|
||||
this.$message.success(resp.msg)
|
||||
await this.getHonorNum()
|
||||
this.pageData()
|
||||
this.$refs.guava.index()
|
||||
} else {
|
||||
this.$message.warning(resp.msg)
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
radioChange(o) {
|
||||
if (this.pageForm.honorType == HonorApi.honor_single_id) {
|
||||
this.tableColumns = [
|
||||
{prop: 'evaluateName', label: '评优评先名称', sortable: true},
|
||||
{prop: 'honorName', label: '申报类型', sortable: true},
|
||||
{prop: 'username', label: '申请人姓名', sortable: true},
|
||||
{prop: 'loginname', label: '工号', sortable: true},
|
||||
{prop: 'userSex', label: '性别', sortable: true},
|
||||
{prop: 'unitName', label: '单位', sortable: true},
|
||||
{prop: 'unionName', label: '工会', sortable: true},
|
||||
{prop: 'joinTime', label: '加入工会时间', sortable: true},
|
||||
{prop: 'position', label: '担任工会职务'},
|
||||
]
|
||||
} else {
|
||||
this.tableColumns = [
|
||||
{prop: 'evaluateName', label: '评优评先名称', sortable: true},
|
||||
{prop: 'applyUnionName', label: '申报院级工会', sortable: true},
|
||||
{prop: 'unionLeader', label: '工会主席', sortable: true},
|
||||
{prop: 'memberNumber', label: '会员人数', sortable: true},
|
||||
{prop: 'unionGroupNumber', label: '工会小组数', sortable: true},
|
||||
]
|
||||
}
|
||||
this.doSearch()
|
||||
},
|
||||
dropdownCommand(command) {
|
||||
const {type, data} = command
|
||||
if (type == 'view') {
|
||||
this.openView(data)
|
||||
} else if (type == 'edit') {
|
||||
this.openEdit(data)
|
||||
}
|
||||
},
|
||||
async doReview(flag) {
|
||||
if (!this.formData.auditSign) {
|
||||
this.$message.warning("请填写签字!")
|
||||
return
|
||||
}
|
||||
this.$refs["form"].validate(async (valid) => {
|
||||
if (valid) {
|
||||
this.formData.pass = flag
|
||||
const resp = await $.post(loc() + "/doReview", this.formData)
|
||||
if (resp.code === 0) {
|
||||
this.notifySuccess(resp.msg)
|
||||
this.pageData()
|
||||
this.getHonorNum()
|
||||
this.$refs.guava.index()
|
||||
} else {
|
||||
this.notifyWarning(resp.msg)
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
openView(data) {
|
||||
this.$refs.info.getInfo(data.id)
|
||||
this.$refs.guava.view()
|
||||
},
|
||||
openEdit(data) {
|
||||
this.rowData = data
|
||||
this.formData = {
|
||||
id: data.id,
|
||||
username: "${@shiro.getPrincipalProperty('username')}",
|
||||
auditTime: moment().format('YYYY-MM-DD'),
|
||||
}
|
||||
|
||||
this.$refs.info2.getInfo(data.id)
|
||||
this.$refs.guava.edit()
|
||||
if (this.$refs['form']) {
|
||||
this.$refs['form'].resetFields()
|
||||
}
|
||||
},
|
||||
async flushUnits() {
|
||||
this.$set(this.pageForm, "unitId", "")
|
||||
if ("${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')}" === 'true') {
|
||||
this.units = await getUnits(this.pageForm.unionId)
|
||||
} else {
|
||||
this.units = await getUnits("${@shiro.getPrincipalProperty('unit').getUnionid()}")
|
||||
}
|
||||
},
|
||||
async getHonorNum() {
|
||||
const evaluateNum = await HonorApi.getEvaluateNum(1700)
|
||||
this.honorTypeList.map(v => {
|
||||
if (v.code === "H1100") {
|
||||
v.num = evaluateNum.gr
|
||||
} else {
|
||||
v.num = evaluateNum.jt
|
||||
}
|
||||
})
|
||||
this.$forceUpdate();
|
||||
},
|
||||
async getEvaluateByYear() {
|
||||
const {data} = await $.post('/platform/evaluate/apply/getEvaluateByYear', {year: this.pageForm.year})
|
||||
this.evaluateList = data
|
||||
}
|
||||
},
|
||||
async created() {
|
||||
this.honorLevelList = await HonorApi.getHonorLevel()
|
||||
this.honorTypeList = await HonorApi.getHonorType()
|
||||
if (this.honorTypeList) {
|
||||
await this.getHonorNum()
|
||||
this.$set(this.pageForm, "honorType", this.honorTypeList[0].id)
|
||||
}
|
||||
await this.getEvaluateByYear()
|
||||
this.unions = await getUnions(null)
|
||||
this.flushUnits()
|
||||
this.pageData()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,491 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
<style>
|
||||
.el-select {
|
||||
width: 100%;
|
||||
}
|
||||
</style>
|
||||
<div id="app" v-cloak>
|
||||
<guava ref="guava">
|
||||
<template>
|
||||
<el-card shadow="never">
|
||||
<div class="btn-group tool-button">
|
||||
<div class="block">
|
||||
<el-date-picker
|
||||
style="width: 100px"
|
||||
v-model="pageForm.year"
|
||||
type="year" @change="getEvaluateByYear()"
|
||||
value-format="yyyy"
|
||||
placeholder="年度">
|
||||
</el-date-picker>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="btn-group tool-button">
|
||||
<el-select placeholder="评优评先名称" v-model="pageForm.evaluateId"
|
||||
style="width: 100%;"
|
||||
clearable="true" filterable="true">
|
||||
<el-option v-for="item in evaluateList" :label="item.evaluateName"
|
||||
:value="item.evaluateId"></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
|
||||
<div class="btn-group tool-button">
|
||||
<el-input placeholder="请输入内容" v-model="pageForm.searchKeyword" clearable>
|
||||
<el-select v-model="pageForm.searchName" slot="prepend"
|
||||
placeholder="查询类型"
|
||||
style="width: 100px;">
|
||||
<el-option label="工号" value="us.loginname"></el-option>
|
||||
<el-option label="姓名" value="us.username"></el-option>
|
||||
</el-select>
|
||||
</el-input>
|
||||
</div>
|
||||
|
||||
<div class="btn-group tool-button" v-if="pageForm.honorType=== HonorApi.honor_single_id">
|
||||
<el-select placeholder="所属工会" v-model="pageForm.unionId" style="width: 100%;"
|
||||
clearable="true"
|
||||
@change="flushUnits" @clear="flushUnits"
|
||||
v-if="${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')}"
|
||||
filterable>
|
||||
<el-option v-for="item in unions" :label="item.unionname"
|
||||
:value="item.id"></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
|
||||
<div class="btn-group tool-button" v-if="pageForm.honorType=== HonorApi.honor_single_id">
|
||||
<el-select placeholder="所属单位" v-model="pageForm.unitId" style="width: 100%;"
|
||||
clearable="true"
|
||||
filterable="true">
|
||||
<el-option v-for="item in units" :label="item.name"
|
||||
:value="item.id"></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
|
||||
<!-- v-if="pageForm.honorType !== HonorApi.honor_single_id"-->
|
||||
<div class="btn-group tool-button">
|
||||
<el-select placeholder="请选择申报协会" v-model="pageForm.clubId"
|
||||
style="width: 100%;"
|
||||
clearable
|
||||
filterable>
|
||||
<el-option v-for="item in clubs"
|
||||
:label="item.name"
|
||||
:value="item.stid"></el-option>
|
||||
</el-select>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- <div class="btn-group tool-button">-->
|
||||
<!-- <el-radio-group v-model="pageForm.honorType" @change="(o) => {radioChange(o)}">-->
|
||||
<!-- <el-radio-button v-for="v in honorTypeList" :label="v.id">-->
|
||||
<!-- {{v.name}}({{v.num}})-->
|
||||
<!-- </el-radio-button>-->
|
||||
<!-- </el-radio-group>-->
|
||||
<!-- </div>-->
|
||||
|
||||
<div class="btn-group tool-button">
|
||||
<el-button type="primary" @click="doSearch" icon="el-icon-search"></el-button>
|
||||
</div>
|
||||
|
||||
</el-card>
|
||||
|
||||
<el-card class="mt10" shadow="never">
|
||||
|
||||
<vi-title2 title="申请列表">
|
||||
<template #func>
|
||||
<!-- <el-button @click="exportTableData" type="primary" size="small">导出汇总表-->
|
||||
<!-- </el-button>-->
|
||||
<!-- <el-button @click="exportFiles" type="primary" size="small">一键导出附件-->
|
||||
<!-- </el-button>-->
|
||||
<el-radio-group v-model="pageForm.isAudit" @change="doSearch" size="small"
|
||||
class="ml10">
|
||||
<el-radio-button :label="null">全部</el-radio-button>
|
||||
<el-radio-button :label="true">已审核</el-radio-button>
|
||||
<el-radio-button :label="false">未审核</el-radio-button>
|
||||
</el-radio-group>
|
||||
</template>
|
||||
</vi-title2>
|
||||
|
||||
<el-table :data="tableData" ref="multipleTable"
|
||||
@selection-change="handleSelectionChange">
|
||||
<!-- <el-table-column type="selection" width="55"></el-table-column>-->
|
||||
<el-table-column align="center" header-align="center" label="序号" type="index"
|
||||
width="80px"></el-table-column>
|
||||
<el-table-column align="center" header-align="center" label="评优评先名称"
|
||||
prop="evaluateName"
|
||||
show-overflow-tooltip></el-table-column>
|
||||
<el-table-column align="center" header-align="center" label="申请类型"
|
||||
prop="honorName"
|
||||
show-overflow-tooltip></el-table-column>
|
||||
|
||||
<el-table-column
|
||||
align="center"
|
||||
header-align="center"
|
||||
v-for="column in tableColumns"
|
||||
:label="column.label"
|
||||
:prop="column.prop"
|
||||
:sortable="column.sortable"
|
||||
show-overflow-tooltip>
|
||||
<template v-if="column.prop=='unionClub'" scope="{row}">
|
||||
{{row.pxxmlx===1?row.unionName:row.clubName}}
|
||||
</template>
|
||||
|
||||
</el-table-column>
|
||||
|
||||
<!-- <template v-if="pageForm.honorType !== HonorApi.honor_single_id">-->
|
||||
|
||||
<!-- <el-table-column align="center" header-align="center" label="工会/协会"-->
|
||||
<!-- prop="applyTime"-->
|
||||
<!-- show-overflow-tooltip>-->
|
||||
<!-- <template slot-scope="{row}">-->
|
||||
<!-- <template v-if="row.pxxmlx===1">-->
|
||||
<!-- {{row.applyUnionName}}-->
|
||||
<!-- </template>-->
|
||||
<!-- <template v-if="row.pxxmlx===2">-->
|
||||
<!-- {{row.clubName}}-->
|
||||
<!-- </template>-->
|
||||
<!-- </template>-->
|
||||
<!-- </el-table-column>-->
|
||||
|
||||
<!-- <el-table-column align="center" header-align="center" label="工会主席/协会会长"-->
|
||||
<!-- prop="applyTime"-->
|
||||
<!-- show-overflow-tooltip>-->
|
||||
<!-- <template slot-scope="{row}">-->
|
||||
<!-- <template v-if="row.pxxmlx===1">-->
|
||||
<!-- {{row.unionLeader}}-->
|
||||
<!-- </template>-->
|
||||
<!-- <template v-if="row.pxxmlx===2">-->
|
||||
<!-- {{row.clubLeader}}-->
|
||||
<!-- </template>-->
|
||||
<!-- </template>-->
|
||||
<!-- </el-table-column>-->
|
||||
|
||||
<!-- <el-table-column align="center" header-align="center" label="会员人数"-->
|
||||
<!-- prop="applyTime"-->
|
||||
<!-- show-overflow-tooltip>-->
|
||||
<!-- <template slot-scope="{row}">-->
|
||||
<!-- <template v-if="row.pxxmlx===1">-->
|
||||
<!-- {{row.memberNumber}}-->
|
||||
<!-- </template>-->
|
||||
<!-- <template v-if="row.pxxmlx===2">-->
|
||||
<!-- {{row.clubNumber}}-->
|
||||
<!-- </template>-->
|
||||
<!-- </template>-->
|
||||
<!-- </el-table-column>-->
|
||||
<!-- </template>-->
|
||||
|
||||
<!-- <el-table-column align="center" header-align="center" label="评选项目类型"-->
|
||||
<!-- prop="applyTime"-->
|
||||
<!-- show-overflow-tooltip>-->
|
||||
<!-- <template slot-scope="{row}">-->
|
||||
<!-- {{row.pxxmlx===1?'工会':'协会'}}-->
|
||||
<!-- </template>-->
|
||||
<!-- </el-table-column>-->
|
||||
|
||||
<el-table-column label="申请时间" prop="applyTime" sortable header-align="center"
|
||||
align="center"></el-table-column>
|
||||
<el-table-column align="center" header-align="center" label="审核状态" prop="year"
|
||||
show-overflow-tooltip>
|
||||
<template slot-scope="{row}">
|
||||
<span :style="'color: ' + row.stateColor">{{row.stateName}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" header-align="center" label="操作" fixed="right"
|
||||
width="220px">
|
||||
<template scope="{row}">
|
||||
<el-button size="mini" @click="openView(row)" type="primary">
|
||||
查看
|
||||
</el-button>
|
||||
<el-button size="mini" @click="rollback(row)" type="danger"
|
||||
v-if="pageForm.isAudit === true && row.stateId <= 1850">
|
||||
撤回
|
||||
</el-button>
|
||||
<el-button size="mini" @click="openEdit(row)" type="primary"
|
||||
v-if="row.stateId == 1800">
|
||||
审核
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
</el-table>
|
||||
|
||||
<!--#include("/layouts/pagination.html"){}#-->
|
||||
|
||||
</el-card>
|
||||
|
||||
|
||||
</template>
|
||||
|
||||
<template #edit>
|
||||
<evaluate-info ref="info2" :handle="true" label="校工会审核" :panes="[2, 3, 4, 5]">
|
||||
<template #handle>
|
||||
<vi-title title="审核信息"></vi-title>
|
||||
<el-form :model="formData" ref="form" :rules="formRules" label-position="right"
|
||||
style="padding: 20px 0"
|
||||
label-width="120px">
|
||||
|
||||
<el-row gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item prop="username" label="审核人员">
|
||||
<el-input v-model="formData.username"
|
||||
disabled></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item prop="time" label="审核时间">
|
||||
<el-input v-model="formData.auditTime" disabled></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
|
||||
</el-row>
|
||||
<el-form-item prop="auditOpinion" label="审核意见">
|
||||
<el-input type="textarea" v-model="formData.auditOpinion" rows="4"
|
||||
maxlength="500"
|
||||
placeholder="请填写您的审核意见"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="auditSign" label="签  字">
|
||||
<sign :qz.sync="formData.auditSign"></sign>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<div style="float: right;margin: 20px 0">
|
||||
<el-button @click="doReview(false)">
|
||||
拒绝
|
||||
</el-button>
|
||||
<!-- <el-button type="danger" @click="returnBack()">退-->
|
||||
<!-- 回-->
|
||||
<!-- </el-button>-->
|
||||
<el-button type="primary" @click="doReview(true)">
|
||||
通过
|
||||
</el-button>
|
||||
</div>
|
||||
|
||||
</template>
|
||||
</evaluate-info>
|
||||
</template>
|
||||
|
||||
<template #view>
|
||||
<evaluate-info ref="info"></evaluate-info>
|
||||
</template>
|
||||
|
||||
</guava>
|
||||
</div>
|
||||
|
||||
|
||||
<script>
|
||||
var vue = new Vue({
|
||||
el: '#app',
|
||||
mixins: [initTableMixins],
|
||||
data() {
|
||||
return {
|
||||
clubs: [],
|
||||
units: [],
|
||||
unions: [],
|
||||
honorLevelList: [],
|
||||
evaluateList: [],
|
||||
honorTypeList: [],
|
||||
pageForm: {
|
||||
year: new Date().getFullYear() + "",
|
||||
isAudit: false,
|
||||
searchName: 'us.username',
|
||||
honorType: '',
|
||||
honorLevel: ''
|
||||
},
|
||||
rowData: {},
|
||||
tableColumns: [
|
||||
{prop: 'username', label: '申请人姓名', sortable: true},
|
||||
{prop: 'loginname', label: '工号', sortable: true},
|
||||
{prop: 'userSex', label: '性别', sortable: true},
|
||||
{prop: 'unitName', label: '单位', sortable: true},
|
||||
{prop: 'unionName', label: '分工会', sortable: true},
|
||||
{prop: 'clubName', label: '协会', sortable: true},
|
||||
// {prop: 'political', label: '政治面貌', sortable: true},
|
||||
// {prop: 'joinTime', label: '加入工会时间', sortable: true},
|
||||
// {prop: 'position', label: '担任职务'},
|
||||
// {prop: 'unionClub', label: '工会/协会'},
|
||||
],
|
||||
multipleSelection: [],
|
||||
formRules: {
|
||||
auditOpinion: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
auditSign: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
}
|
||||
}
|
||||
},
|
||||
components: {
|
||||
'evaluate-info': httpVueLoader('/components/evaluate/evaluateInfo.vue?v=1.0.0'),
|
||||
},
|
||||
methods: {
|
||||
handleSelectionChange(val) {
|
||||
this.multipleSelection = val;
|
||||
},
|
||||
exportFiles() {
|
||||
if (this.multipleSelection.length === 0) {
|
||||
this.$notify.warning({title: '提示', message: '请在左侧多选框中选择再进行此操作!'});
|
||||
return
|
||||
}
|
||||
const ids = this.multipleSelection.map(o => o.id)
|
||||
window.location.href = "/platform/evaluate/audit/school/downloadAnnex?ids=" + JSON.stringify(ids)
|
||||
},
|
||||
exportTableData() {
|
||||
this.pageForm.honorTypeBoolean = this.pageForm.honorType === HonorApi.honor_single_id
|
||||
window.location.href = "/platform/evaluate/audit/school/exportTableData?data=" + JSON.stringify(this.pageForm)
|
||||
},
|
||||
rollback(row) {
|
||||
this.$confirm('确定要撤回吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
callback: async (a, b) => {
|
||||
if ("confirm" == a) {//确认后再执行
|
||||
const resp = await $.post('/platform/evaluate/audit/school/rollback', {
|
||||
id: row.id,
|
||||
type: row.honorTypeId === HonorApi.honor_single_id,
|
||||
})
|
||||
if (resp.code === 0) {
|
||||
this.$message.success(resp.msg)
|
||||
await this.getHonorNum()
|
||||
this.pageData()
|
||||
} else {
|
||||
this.$message.warning(resp.msg)
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
returnBack() {
|
||||
this.formData.id = this.rowData.id
|
||||
this.formData.type = this.rowData.honorTypeId === HonorApi.honor_single_id
|
||||
this.formData.userId = this.rowData.userId
|
||||
this.$confirm('确定要退回吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
callback: async (a, b) => {
|
||||
if ("confirm" == a) {//确认后再执行
|
||||
const resp = await $.post('/platform/evaluate/audit/school/returnBack', this.formData)
|
||||
if (resp.code === 0) {
|
||||
this.$message.success(resp.msg)
|
||||
await this.getHonorNum()
|
||||
this.pageData()
|
||||
this.$refs.guava.index()
|
||||
} else {
|
||||
this.$message.warning(resp.msg)
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
radioChange(o) {
|
||||
if (this.pageForm.honorType == HonorApi.honor_single_id) {
|
||||
this.tableColumns = [
|
||||
{prop: 'username', label: '申请人姓名', sortable: true},
|
||||
{prop: 'loginname', label: '工号', sortable: true},
|
||||
{prop: 'userSex', label: '性别', sortable: true},
|
||||
{prop: 'unitName', label: '单位', sortable: true},
|
||||
{prop: 'unionName', label: '工会', sortable: true},
|
||||
// {prop: 'joinTime', label: '加入工会时间', sortable: true},
|
||||
{prop: 'position', label: '担任职务'},
|
||||
]
|
||||
} else {
|
||||
this.tableColumns = [
|
||||
/* {prop: 'evaluateName', label: '评优评先名称', sortable: true},
|
||||
{prop: 'applyUnionName', label: '申报院级工会', sortable: true},
|
||||
{prop: 'unionLeader', label: '工会主席', sortable: true},
|
||||
{prop: 'memberNumber', label: '会员人数', sortable: true},
|
||||
{prop: 'unionGroupNumber', label: '工会小组数', sortable: true},*/
|
||||
]
|
||||
}
|
||||
this.doSearch()
|
||||
},
|
||||
dropdownCommand(command) {
|
||||
const {type, data} = command
|
||||
if (type == 'view') {
|
||||
this.openView(data)
|
||||
} else if (type == 'edit') {
|
||||
this.openEdit(data)
|
||||
}
|
||||
},
|
||||
async doReview(flag) {
|
||||
if (!this.formData.auditSign) {
|
||||
this.$message.warning("请填写签字!")
|
||||
return
|
||||
}
|
||||
this.$refs["form"].validate(async (valid) => {
|
||||
if (valid) {
|
||||
this.formData.pass = flag
|
||||
const resp = await $.post(loc() + "/doReview", this.formData)
|
||||
if (resp.code === 0) {
|
||||
this.notifySuccess(resp.msg)
|
||||
this.pageData()
|
||||
this.getHonorNum()
|
||||
this.$refs.guava.index()
|
||||
} else {
|
||||
this.notifyWarning(resp.msg)
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
openView(data) {
|
||||
this.$refs.info.getInfo(data.id)
|
||||
this.$refs.guava.view()
|
||||
},
|
||||
openEdit(data) {
|
||||
this.rowData = data
|
||||
this.formData = {
|
||||
id: data.id,
|
||||
username: "${@shiro.getPrincipalProperty('username')}",
|
||||
auditTime: moment().format('YYYY-MM-DD'),
|
||||
}
|
||||
|
||||
this.$refs.info2.getInfo(data.id)
|
||||
this.$refs.guava.edit()
|
||||
if (this.$refs['form']) {
|
||||
this.$refs['form'].resetFields()
|
||||
}
|
||||
},
|
||||
async flushUnits() {
|
||||
this.$set(this.pageForm, "unitId", "")
|
||||
if ("${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')}" === 'true') {
|
||||
this.units = await getUnits(this.pageForm.unionId)
|
||||
} else {
|
||||
this.units = await getUnits("${@shiro.getPrincipalProperty('unit').getUnionid()}")
|
||||
}
|
||||
},
|
||||
async getHonorNum() {
|
||||
const evaluateNum = await HonorApi.getEvaluateNum(1800)
|
||||
this.honorTypeList.map(v => {
|
||||
if (v.code === "H1100") {
|
||||
v.num = evaluateNum.gr
|
||||
} else {
|
||||
v.num = evaluateNum.jt
|
||||
}
|
||||
})
|
||||
this.$forceUpdate();
|
||||
},
|
||||
async getEvaluateByYear() {
|
||||
const {data} = await $.post('/platform/evaluate/apply/getEvaluateByYear', {year: this.pageForm.year})
|
||||
this.evaluateList = data
|
||||
},
|
||||
},
|
||||
async created() {
|
||||
this.honorLevelList = await HonorApi.getHonorLevel()
|
||||
this.honorTypeList = await HonorApi.getHonorType()
|
||||
|
||||
if (this.honorTypeList) {
|
||||
await this.getHonorNum()
|
||||
this.$set(this.pageForm, "honorType", this.honorTypeList[0].id)
|
||||
}
|
||||
await this.getEvaluateByYear()
|
||||
this.unions = await getUnions(null)
|
||||
this.clubs = await getClubsByRole()
|
||||
this.flushUnits()
|
||||
this.pageData()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,388 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
<style>
|
||||
.el-select {
|
||||
width: 100%;
|
||||
}
|
||||
</style>
|
||||
<div id="app" v-cloak>
|
||||
<guava ref="guava">
|
||||
<template>
|
||||
|
||||
<el-card shadow="never">
|
||||
|
||||
<div class="btn-group tool-button">
|
||||
<div class="block">
|
||||
<el-date-picker
|
||||
style="width: 100px"
|
||||
v-model="pageForm.year"
|
||||
type="year" @change="getEvaluateByYear()"
|
||||
value-format="yyyy"
|
||||
placeholder="年度">
|
||||
</el-date-picker>
|
||||
</div>
|
||||
</div>
|
||||
<div class="btn-group tool-button">
|
||||
<el-select placeholder="评优评先名称" v-model="pageForm.evaluateId" style="width: 100%;"
|
||||
clearable="true" filterable="true">
|
||||
<el-option v-for="item in evaluateList" :label="item.evaluateName"
|
||||
:value="item.evaluateId"></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
|
||||
<div class="btn-group tool-button" v-if="pageForm.honorType=='101'">
|
||||
<div>
|
||||
<el-input placeholder="请输入内容" v-model="pageForm.searchKeyword" clearable>
|
||||
<el-select v-model="pageForm.searchName" slot="prepend" placeholder="查询类型"
|
||||
style="width: 100px;">
|
||||
<el-option label="工号" value="us.loginname"></el-option>
|
||||
<el-option label="姓名" value="us.username"></el-option>
|
||||
</el-select>
|
||||
</el-input>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="btn-group tool-button">
|
||||
<el-select placeholder="所属工会" v-model="pageForm.unionId" style="width: 100%;"
|
||||
clearable="true"
|
||||
@change="flushUnits" @clear="flushUnits"
|
||||
|
||||
v-if="${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')||@shiro.hasRole('H03')}"
|
||||
|
||||
filterable="true">
|
||||
<el-option v-for="item in unions" :label="item.unionname" :value="item.id"></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
|
||||
<div class="btn-group tool-button">
|
||||
<el-select placeholder="所属单位" v-model="pageForm.unitId" style="width: 100%;"
|
||||
clearable="true"
|
||||
filterable="true">
|
||||
<el-option v-for="item in units" :label="item.name" :value="item.id"></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
|
||||
<!-- <div class="btn-group tool-button">-->
|
||||
<!-- <el-radio-group v-model="pageForm.honorType" @change="(o) => {radioChange(o)}">-->
|
||||
<!-- <el-radio-button v-for="v in honorTypeList" :label="v.id">{{v.name}}({{v.num}})-->
|
||||
<!-- </el-radio-button>-->
|
||||
<!-- </el-radio-group>-->
|
||||
<!-- </div>-->
|
||||
|
||||
<div class="btn-group tool-button">
|
||||
<el-button type="primary" @click="doSearch" icon="el-icon-search"></el-button>
|
||||
</div>
|
||||
<div class="pull-right offscreen-right">
|
||||
|
||||
<el-radio-group v-model="pageForm.isAudit" @change="doSearch">
|
||||
<el-radio-button :label="null">全部</el-radio-button>
|
||||
<el-radio-button :label="true">已审核</el-radio-button>
|
||||
<el-radio-button :label="false">未审核</el-radio-button>
|
||||
</el-radio-group>
|
||||
</div>
|
||||
|
||||
</el-card>
|
||||
|
||||
<el-card class="mt10" shadow="never">
|
||||
|
||||
<vi-title2 title="申请列表"></vi-title2>
|
||||
|
||||
<el-table :data="tableData">
|
||||
<el-table-column align="center" header-align="center" label="序号" type="index"
|
||||
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"
|
||||
:sortable="column.sortable" show-overflow-tooltip>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="申请时间" prop="applyTime" sortable header-align="center"
|
||||
align="center"></el-table-column>
|
||||
<el-table-column align="center" header-align="center" label="审核状态" prop="year"
|
||||
show-overflow-tooltip>
|
||||
<template slot-scope="{row}">
|
||||
<span :style="'color: ' + row.stateColor">{{row.stateName}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" header-align="center" label="操作" fixed="right" width="220px">
|
||||
<template scope="{row}">
|
||||
<el-button size="mini" @click="openView(row)" type="primary">
|
||||
查看
|
||||
</el-button>
|
||||
<el-button size="mini" @click="rollback(row)" type="danger"
|
||||
v-if="pageForm.isAudit === true && row.stateId <= 1800">
|
||||
撤回
|
||||
</el-button>
|
||||
<el-button size="mini" @click="openEdit(row)" type="primary" v-if="row.stateId == 1600">
|
||||
审核
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
</el-table>
|
||||
|
||||
<!--#include("/layouts/pagination.html"){}#-->
|
||||
|
||||
</el-card>
|
||||
|
||||
</template>
|
||||
|
||||
<template #edit>
|
||||
<evaluate-info ref="info2" :handle="true" label="院级工会审核" :panes="[2, 3]">
|
||||
<template #handle>
|
||||
<vi-title title="审核信息"></vi-title>
|
||||
<el-form :model="formData" ref="form" :rules="formRules" label-position="right"
|
||||
style="padding: 20px 0"
|
||||
label-width="120px">
|
||||
|
||||
<el-row gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item prop="username" label="审核人员">
|
||||
<el-input v-model="formData.username"
|
||||
disabled></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item prop="time" label="审核时间">
|
||||
<el-input v-model="formData.auditTime" disabled></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
|
||||
</el-row>
|
||||
<el-form-item prop="auditOpinion" label="审核意见">
|
||||
<el-input type="textarea" v-model="formData.auditOpinion" rows="4" maxlength="500"
|
||||
placeholder="请填写您的审核意见"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="auditSign" label="签  字">
|
||||
<sign :qz.sync="formData.auditSign"></sign>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<div style="float: right;margin: 20px 0">
|
||||
<el-button @click="doReview(false)">拒
|
||||
绝
|
||||
</el-button>
|
||||
<!-- <el-button type="danger" @click="returnBack()">退-->
|
||||
<!-- 回-->
|
||||
<!-- </el-button>-->
|
||||
<el-button type="primary" @click="doReview(true)">通
|
||||
过
|
||||
</el-button>
|
||||
|
||||
</div>
|
||||
|
||||
</template>
|
||||
</evaluate-info>
|
||||
</template>
|
||||
|
||||
<template #view>
|
||||
<evaluate-info ref="info"></evaluate-info>
|
||||
</template>
|
||||
|
||||
</guava>
|
||||
</div>
|
||||
|
||||
|
||||
<script>
|
||||
var vue = new Vue({
|
||||
el: '#app',
|
||||
mixins: [initTableMixins],
|
||||
data() {
|
||||
return {
|
||||
units: [],
|
||||
unions: [],
|
||||
honorLevelList: [],
|
||||
evaluateList: [],
|
||||
honorTypeList: [],
|
||||
pageForm: {
|
||||
year: new Date().getFullYear() + "",
|
||||
isAudit: false,
|
||||
searchName: 'us.username',
|
||||
honorType: '',
|
||||
honorLevel: ''
|
||||
},
|
||||
rowData: {},
|
||||
tableColumns: [
|
||||
{prop: 'username', label: '申请人姓名', sortable: true},
|
||||
{prop: 'evaluateName', label: '评优评先名称', sortable: true},
|
||||
{prop: 'loginname', label: '工号', sortable: true},
|
||||
{prop: 'userSex', label: '性别', sortable: true},
|
||||
{prop: 'unitName', label: '单位', sortable: true},
|
||||
{prop: 'unionName', label: '工会', sortable: true},
|
||||
{prop: 'joinTime', label: '加入工会时间', sortable: true},
|
||||
{prop: 'position', label: '担任工会职务'},
|
||||
],
|
||||
formRules: {
|
||||
auditOpinion: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
auditSign: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
}
|
||||
}
|
||||
},
|
||||
components: {
|
||||
'evaluate-info': httpVueLoader('/components/evaluate/evaluateInfo.vue?v=1.0.0'),
|
||||
},
|
||||
methods: {
|
||||
async getEvaluateByYear() {
|
||||
const {data} = await $.post('/platform/evaluate/apply/getEvaluateByYear', {year: this.pageForm.year})
|
||||
this.evaluateList = data
|
||||
},
|
||||
rollback(row) {
|
||||
this.$confirm('确定要撤回吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
callback: async (a, b) => {
|
||||
if ("confirm" == a) {//确认后再执行
|
||||
const resp = await $.post('/platform/evaluate/audit/union/rollback', {
|
||||
id: row.id,
|
||||
type: row.honorTypeId === HonorApi.honor_single_id,
|
||||
})
|
||||
if (resp.code === 0) {
|
||||
this.$message.success(resp.msg)
|
||||
await this.getHonorNum()
|
||||
this.pageData()
|
||||
} else {
|
||||
this.$message.warning(resp.msg)
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
returnBack() {
|
||||
this.formData.id = this.rowData.id
|
||||
this.formData.type = this.rowData.honorTypeId === HonorApi.honor_single_id
|
||||
this.formData.userId = this.rowData.userId
|
||||
this.$confirm('确定要退回吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
callback: async (a, b) => {
|
||||
if ("confirm" == a) {//确认后再执行
|
||||
const resp = await $.post('/platform/evaluate/audit/union/returnBack', this.formData)
|
||||
if (resp.code === 0) {
|
||||
this.$message.success(resp.msg)
|
||||
await this.getHonorNum()
|
||||
this.pageData()
|
||||
this.$refs.guava.index()
|
||||
} else {
|
||||
this.$message.warning(resp.msg)
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
radioChange(o) {
|
||||
if (this.pageForm.honorType == HonorApi.honor_single_id) {
|
||||
this.tableColumns = [
|
||||
{prop: 'username', label: '申请人姓名', sortable: true},
|
||||
{prop: 'evaluateName', label: '评优评先名称', sortable: true},
|
||||
{prop: 'loginname', label: '工号', sortable: true},
|
||||
{prop: 'userSex', label: '性别', sortable: true},
|
||||
{prop: 'unitName', label: '单位', sortable: true},
|
||||
{prop: 'unionName', label: '工会', sortable: true},
|
||||
{prop: 'joinTime', label: '加入工会时间', sortable: true},
|
||||
{prop: 'position', label: '担任工会职务'},
|
||||
]
|
||||
} else {
|
||||
this.tableColumns = [
|
||||
{prop: 'evaluateName', label: '评优评先名称', sortable: true},
|
||||
{prop: 'applyUnionName', label: '申报院级工会', sortable: true},
|
||||
{prop: 'unionLeader', label: '工会主席', sortable: true},
|
||||
{prop: 'memberNumber', label: '会员人数', sortable: true},
|
||||
{prop: 'unionGroupNumber', label: '工会小组数', sortable: true},
|
||||
]
|
||||
}
|
||||
this.doSearch()
|
||||
},
|
||||
dropdownCommand(command) {
|
||||
const {type, data} = command
|
||||
if (type == 'view') {
|
||||
this.openView(data)
|
||||
} else if (type == 'edit') {
|
||||
this.openEdit(data)
|
||||
}
|
||||
},
|
||||
async doReview(flag) {
|
||||
|
||||
if (!this.formData.auditSign){
|
||||
this.$message.warning("请填写签字!")
|
||||
return
|
||||
}
|
||||
this.$refs["form"].validate(async (valid) => {
|
||||
if (valid) {
|
||||
this.formData.pass = flag
|
||||
const resp = await $.post(loc() + "/doReview", this.formData)
|
||||
if(resp.code===0){
|
||||
this.$message.success(resp.msg)
|
||||
this.pageData()
|
||||
this.getHonorNum()
|
||||
this.$refs.guava.index()
|
||||
}else{
|
||||
this.$message.warning(resp.msg)
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
openView(data) {
|
||||
this.$refs.info.getInfo(data.id)
|
||||
this.$refs.guava.view()
|
||||
},
|
||||
openEdit(data) {
|
||||
this.rowData = data
|
||||
this.formData = {
|
||||
id: data.id,
|
||||
username: "${@shiro.getPrincipalProperty('username')}",
|
||||
auditTime: moment().format('YYYY-MM-DD'),
|
||||
}
|
||||
|
||||
this.$refs.info2.getInfo(data.id)
|
||||
this.$refs.guava.edit()
|
||||
if (this.$refs['form']) {
|
||||
this.$refs['form'].resetFields()
|
||||
}
|
||||
},
|
||||
async flushUnits() {
|
||||
this.$set(this.pageForm, "unitId", "")
|
||||
if ("${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')||@shiro.hasRole('H03')}" === 'true') {
|
||||
this.units = await getUnits(this.pageForm.unionId)
|
||||
} else {
|
||||
this.units = await getUnits("${@shiro.getPrincipalProperty('unit').getUnionid()}")
|
||||
}
|
||||
},
|
||||
async getHonorNum() {
|
||||
const evaluateNum = await HonorApi.getEvaluateNum(1600)
|
||||
this.honorTypeList.map(v => {
|
||||
if (v.code === "H1100") {
|
||||
v.num = evaluateNum.gr
|
||||
} else {
|
||||
v.num = evaluateNum.jt
|
||||
}
|
||||
})
|
||||
this.$forceUpdate();
|
||||
}
|
||||
},
|
||||
async created() {
|
||||
this.honorLevelList = await HonorApi.getHonorLevel()
|
||||
this.honorTypeList = await HonorApi.getHonorType()
|
||||
if (this.honorTypeList) {
|
||||
await this.getHonorNum()
|
||||
this.$set(this.pageForm, "honorType", this.honorTypeList[0].id)
|
||||
}
|
||||
await this.getEvaluateByYear()
|
||||
this.unions = await getUnions(null)
|
||||
this.flushUnits()
|
||||
this.pageData()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,360 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
<style>
|
||||
.el-select {
|
||||
width: 100%;
|
||||
}
|
||||
</style>
|
||||
<div id="app" v-cloak>
|
||||
<guava ref="guava">
|
||||
<template>
|
||||
|
||||
<el-card shadow="never">
|
||||
|
||||
<div class="btn-group tool-button">
|
||||
<div class="block">
|
||||
<el-date-picker
|
||||
v-model="pageForm.year"
|
||||
type="year" @change="getEvaluateByYear()"
|
||||
value-format="yyyy"
|
||||
placeholder="年度">
|
||||
</el-date-picker>
|
||||
</div>
|
||||
</div>
|
||||
<!--<div class="btn-group tool-button">
|
||||
<el-select v-model="pageForm.honorLevel" placeholder="请选择级别" style="width: 200px"
|
||||
@change="doSearch"
|
||||
clearable>
|
||||
<el-option v-for="o in honorLevelList"
|
||||
:key="o.id"
|
||||
:label="o.name"
|
||||
:value="o.id"
|
||||
></el-option>
|
||||
</el-select>
|
||||
|
||||
</div>-->
|
||||
<div class="btn-group tool-button">
|
||||
<el-select placeholder="请选择申报协会" v-model="pageForm.clubId"
|
||||
style="width: 100%;"
|
||||
clearable
|
||||
filterable>
|
||||
<el-option v-for="item in clubs"
|
||||
:label="item.name"
|
||||
:value="item.stid"></el-option>
|
||||
</el-select>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="btn-group tool-button">
|
||||
<el-select placeholder="评优评先名称" v-model="pageForm.evaluateId" style="width: 100%;"
|
||||
clearable="true" filterable="true">
|
||||
<el-option v-for="item in evaluateList" :label="item.evaluateName"
|
||||
:value="item.evaluateId"></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
|
||||
<!-- <div class="btn-group tool-button">
|
||||
<el-select placeholder="所属工会" v-model="pageForm.unionId" style="width: 100%;"
|
||||
clearable="true"
|
||||
@change="flushUnits" @clear="flushUnits"
|
||||
|
||||
v-if="${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')}"
|
||||
|
||||
filterable="true">
|
||||
<el-option v-for="item in unions" :label="item.unionname" :value="item.id"></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
|
||||
<div class="btn-group tool-button">
|
||||
<el-select placeholder="所属单位" v-model="pageForm.unitId" style="width: 100%;"
|
||||
clearable="true"
|
||||
filterable="true">
|
||||
<el-option v-for="item in units" :label="item.name" :value="item.id"></el-option>
|
||||
</el-select>
|
||||
</div>-->
|
||||
|
||||
<div class="btn-group tool-button" v-if="pageForm.honorType=='101'">
|
||||
<div>
|
||||
<el-input placeholder="请输入内容" v-model="pageForm.searchKeyword" clearable>
|
||||
<el-select v-model="pageForm.searchName" slot="prepend" placeholder="查询类型"
|
||||
style="width: 100px;">
|
||||
<el-option label="工号" value="us.loginname"></el-option>
|
||||
<el-option label="姓名" value="us.username"></el-option>
|
||||
</el-select>
|
||||
</el-input>
|
||||
</div>
|
||||
</div>
|
||||
<div class="btn-group tool-button">
|
||||
<el-radio-group v-model="pageForm.honorType" @change="doSearch">
|
||||
<el-radio-button v-for="v in honorTypeList" :label="v.id">{{v.name}}</el-radio-button>
|
||||
</el-radio-group>
|
||||
</div>
|
||||
|
||||
<div class="btn-group tool-button">
|
||||
<el-button type="primary" @click="doSearch" icon="el-icon-search"></el-button>
|
||||
</div>
|
||||
<div class="pull-right offscreen-right">
|
||||
|
||||
<el-radio-group v-model="pageForm.isAudit" @change="doSearch">
|
||||
<el-radio-button :label="null">全部</el-radio-button>
|
||||
<el-radio-button :label="true">已审核</el-radio-button>
|
||||
<el-radio-button :label="false">未审核</el-radio-button>
|
||||
</el-radio-group>
|
||||
</div>
|
||||
|
||||
</el-card>
|
||||
|
||||
<el-card class="mt10" shadow="never">
|
||||
|
||||
<vi-title2 title="申请列表"></vi-title2>
|
||||
|
||||
<el-table :data="tableData">
|
||||
<el-table-column align="center" header-align="center" label="序号" type="index"
|
||||
width="80px"></el-table-column>
|
||||
<el-table-column align="center" header-align="center" label="评优评先名称" prop="evaluateName"
|
||||
show-overflow-tooltip></el-table-column>
|
||||
<el-table-column align="center" header-align="center" label="申请类型" prop="honorName"
|
||||
show-overflow-tooltip></el-table-column>
|
||||
<el-table-column align="center" header-align="center" label="申请人姓名" prop="userName"
|
||||
show-overflow-tooltip></el-table-column>
|
||||
<el-table-column align="center" header-align="center" label="工号" prop="loginname"
|
||||
show-overflow-tooltip></el-table-column>
|
||||
<el-table-column align="center" header-align="center" label="性别" prop="userSex"
|
||||
show-overflow-tooltip></el-table-column>
|
||||
<el-table-column align="center" header-align="center" label="单位" prop="unitName"
|
||||
show-overflow-tooltip></el-table-column>
|
||||
<el-table-column align="center" header-align="center" label="协会" prop="clubName"
|
||||
show-overflow-tooltip></el-table-column>
|
||||
<!-- <el-table-column align="center" header-align="center" label="加入工会时间" prop="joinTime"
|
||||
show-overflow-tooltip></el-table-column>-->
|
||||
<!-- <el-table-column align="center" header-align="center" label="担任职务" prop="position"-->
|
||||
<!-- show-overflow-tooltip></el-table-column>-->
|
||||
<el-table-column align="center" header-align="center" label="申请时间" prop="applyTime"
|
||||
show-overflow-tooltip></el-table-column>
|
||||
<el-table-column align="center" header-align="center" label="审核状态" prop="year"
|
||||
show-overflow-tooltip>
|
||||
<template slot-scope="{row}">
|
||||
<span :style="'color: ' + row.stateColor">{{row.stateName}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" header-align="center" label="操作" fixed="right" width="220px">
|
||||
<template scope="{row}">
|
||||
<el-button size="mini" @click="openView(row)" type="primary">
|
||||
查看
|
||||
</el-button>
|
||||
<el-button size="mini" @click="rollback(row)" type="danger"
|
||||
v-if="pageForm.isAudit === true && row.stateId <= 1800">
|
||||
撤回
|
||||
</el-button>
|
||||
<el-button size="mini" @click="openEdit(row)" type="primary" v-if="row.stateId==1450">
|
||||
审核
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<!--#include("/layouts/pagination.html"){}#-->
|
||||
|
||||
</el-card>
|
||||
|
||||
</template>
|
||||
|
||||
<template #edit>
|
||||
<evaluate-info ref="info2" :handle="true" label="协会审核" :panes="[2]">
|
||||
<template #handle>
|
||||
<vi-title title="审核信息"></vi-title>
|
||||
<el-form :model="formData" ref="form" :rules="formRules" label-position="right"
|
||||
label-width="120px">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item prop="username" label="审核人员">
|
||||
<el-input v-model="formData.username"
|
||||
disabled></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item prop="time" label="审核时间">
|
||||
<el-input v-model="formData.auditTime" disabled></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-form-item prop="auditOpinion" label="审核意见">
|
||||
<el-input type="textarea" v-model="formData.auditOpinion" rows="4" maxlength="500"
|
||||
placeholder="请填写您的审核意见"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="auditSign" label="签  字">
|
||||
<sign :qz.sync="formData.auditSign"></sign>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<div style="float: right;margin: 20px 0">
|
||||
<el-button @click="doReview(false)">
|
||||
拒绝
|
||||
</el-button>
|
||||
<!-- <el-button type="danger" @click="returnBack()">退-->
|
||||
<!-- 回-->
|
||||
<!-- </el-button>-->
|
||||
<el-button type="primary" @click="doReview(true)">
|
||||
通过
|
||||
</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</evaluate-info>
|
||||
</template>
|
||||
|
||||
<template #view>
|
||||
<evaluate-info ref="info"></evaluate-info>
|
||||
</template>
|
||||
</guava>
|
||||
</div>
|
||||
|
||||
|
||||
<script>
|
||||
var vue = new Vue({
|
||||
el: '#app',
|
||||
mixins: [initTableMixins],
|
||||
data() {
|
||||
return {
|
||||
clubs: [],
|
||||
units: [],
|
||||
unions: [],
|
||||
evaluateList: [],
|
||||
honorLevelList: [],
|
||||
honorTypeList: [],
|
||||
pageForm: {
|
||||
// year: new Date().getFullYear() + "",
|
||||
year: "",
|
||||
isAudit: false,
|
||||
searchName: 'us.username',
|
||||
honorType: '',
|
||||
honorLevel: ''
|
||||
},
|
||||
rowData: {},
|
||||
formRules: {
|
||||
auditOpinion: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
auditSign: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
}
|
||||
}
|
||||
},
|
||||
components: {
|
||||
'evaluate-info': httpVueLoader('/components/evaluate/evaluateInfo.vue?v=1.0.0'),
|
||||
},
|
||||
methods: {
|
||||
async getEvaluateByYear() {
|
||||
const {data} = await $.post('/platform/evaluate/apply/getEvaluateByYear', {year: this.pageForm.year})
|
||||
this.evaluateList = data
|
||||
},
|
||||
rollback(row) {
|
||||
this.$confirm('确定要撤回吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
callback: async (a, b) => {
|
||||
if ("confirm" == a) {//确认后再执行
|
||||
const resp = await $.post('/platform/evaluate/audit/unit/rollback', {
|
||||
id: row.id,
|
||||
type: row.honorTypeId === HonorApi.honor_single_id,
|
||||
})
|
||||
if (resp.code === 0) {
|
||||
this.$message.success(resp.msg)
|
||||
this.pageData()
|
||||
} else {
|
||||
this.$message.warning(resp.msg)
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
returnBack() {
|
||||
this.formData.id = this.rowData.id
|
||||
this.formData.type = this.rowData.honorTypeId === HonorApi.honor_single_id
|
||||
this.formData.userId = this.rowData.userId
|
||||
this.$confirm('确定要退回吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
callback: async (a, b) => {
|
||||
if ("confirm" == a) {//确认后再执行
|
||||
const resp = await $.post('/platform/evaluate/audit/unit/returnBack', this.formData)
|
||||
if (resp.code === 0) {
|
||||
this.$message.success(resp.msg)
|
||||
this.pageData()
|
||||
this.$refs.guava.index()
|
||||
} else {
|
||||
this.$message.warning(resp.msg)
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
dropdownCommand(command) {
|
||||
const {type, data} = command
|
||||
if (type == 'view') {
|
||||
this.openView(data)
|
||||
} else if (type == 'edit') {
|
||||
this.openEdit(data)
|
||||
}
|
||||
},
|
||||
async doReview(flag) {
|
||||
if (!this.formData.auditSign) {
|
||||
this.$message.warning("请填写签字!")
|
||||
return
|
||||
}
|
||||
this.$refs["form"].validate(async (valid) => {
|
||||
if (valid) {
|
||||
this.formData.pass = flag
|
||||
const resp = await $.post(loc() + "/doReview", this.formData)
|
||||
if (resp.code === 0) {
|
||||
this.notifySuccess(resp.msg)
|
||||
this.pageData()
|
||||
this.$refs.guava.index()
|
||||
} else {
|
||||
this.notifyWarning(resp.msg)
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
openView(data) {
|
||||
this.$refs.info.getInfo(data.id)
|
||||
this.$refs.guava.view()
|
||||
},
|
||||
openEdit(data) {
|
||||
this.rowData = data
|
||||
this.formData = {
|
||||
id: data.id,
|
||||
username: "${@shiro.getPrincipalProperty('username')}",
|
||||
auditTime: moment().format('YYYY-MM-DD'),
|
||||
}
|
||||
|
||||
this.$refs.info2.getInfo(data.id)
|
||||
this.$refs.guava.edit()
|
||||
if (this.$refs['form']) {
|
||||
this.$refs['form'].resetFields()
|
||||
}
|
||||
},
|
||||
async flushUnits() {
|
||||
this.$set(this.pageForm, "unitId", "")
|
||||
if ("${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')}" === 'true') {
|
||||
this.units = await getUnits(this.pageForm.unionId)
|
||||
} else {
|
||||
this.units = await getUnits("${@shiro.getPrincipalProperty('unit').getUnionid()}")
|
||||
}
|
||||
},
|
||||
},
|
||||
async created() {
|
||||
await this.getEvaluateByYear()
|
||||
this.honorLevelList = await HonorApi.getHonorLevel()
|
||||
const honorTypeList = await HonorApi.getHonorType()
|
||||
this.unions = await getUnions(null)
|
||||
this.flushUnits()
|
||||
this.clubs = await getClubsByRole()
|
||||
this.pageData()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,304 @@
|
||||
<!--#
|
||||
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"
|
||||
@change="doSearch"
|
||||
v-model="pageForm.year"
|
||||
value-format="yyyy">
|
||||
</el-date-picker>
|
||||
</div>
|
||||
<div class="btn-group tool-button">
|
||||
<el-select placeholder="评优评先名称" v-model="pageForm.evaluateId" style="width: 100%;"
|
||||
@change="doSearch"
|
||||
clearable="true" filterable="true">
|
||||
<el-option v-for="item in evaluateList" :label="item.evaluateName"
|
||||
:value="item.evaluateId"></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
<!-- <div class="btn-group tool-button">-->
|
||||
<!-- <el-radio-group v-model="pageForm.honorType" @change="doSearch();getEvaluateByYear()">-->
|
||||
<!-- <el-radio-button v-for="v in honorTypeList" :label="v.id">{{v.name}}-->
|
||||
<!-- </el-radio-button>-->
|
||||
<!-- </el-radio-group>-->
|
||||
<!-- </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" @sort-change="pageOrder">
|
||||
<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="honorName"
|
||||
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="startTime"
|
||||
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="startTime" 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="150px">
|
||||
<template scope="{row}">
|
||||
<el-dropdown>
|
||||
<el-button plain size="mini">
|
||||
<i class="ti-settings"></i>
|
||||
<span class="ti-angle-down"></span>
|
||||
</el-button>
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-item @click.native="openCode(row.id)">
|
||||
活动二维码
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item @click.native="sendMsg(row)">
|
||||
通知
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item @click.native="openView(row)">
|
||||
查看
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item @click.native="openEdit(row)">
|
||||
编辑
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item @click.native="deleteDo(row)"
|
||||
v-if="moment().unix() <= moment(row.endTime).unix()">
|
||||
删除
|
||||
</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</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 v-if="!viewData.directions" :data="viewData.unionLimit">
|
||||
<el-table-column prop="unionname" label="分工会"></el-table-column>
|
||||
<el-table-column prop="teacherCount" label="人数"></el-table-column>
|
||||
<el-table-column prop="ratio" label="比例(%)"></el-table-column>
|
||||
<el-table-column prop="limitCount" label="分配人数"></el-table-column>
|
||||
</el-table>
|
||||
<template v-if="viewData.directions">
|
||||
<div style="float: left">评选名额:</div>
|
||||
<el-input type="textarea" v-model="viewData.directions" rows="4" maxlength="500"
|
||||
style="width: 94%" readonly=""></el-input>
|
||||
</template>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</template>
|
||||
|
||||
<send-msg ref="sendMsg" :url="url"></send-msg>
|
||||
<open-qr-code ref="openQRCode" :url="url"></open-qr-code>
|
||||
</guava>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
var vue = new Vue({
|
||||
el: '#app',
|
||||
mixins: [initTableMixins],
|
||||
data() {
|
||||
return {
|
||||
pageForm: {
|
||||
year: moment().format('YYYY'),
|
||||
},
|
||||
viewData: {},
|
||||
viewDataTable: [],
|
||||
activityGroupList: [],
|
||||
evaluateList: [],
|
||||
url: '',
|
||||
honorTypeList: [],
|
||||
}
|
||||
},
|
||||
components: {
|
||||
'open-qr-code': httpVueLoader('/components/plugins/OpenQRCode.vue'),
|
||||
'send-msg': httpVueLoader('/components/plugins/SendMsgByGroupId.vue'),
|
||||
},
|
||||
methods: {
|
||||
sendMsg(row) {
|
||||
this.url = `<a href="` + (APP_DOMAIN + "/platform/evaluate/apply") + `">点击参与</a>`
|
||||
this.$refs.sendMsg.openDialog(row.groupId)
|
||||
},
|
||||
openCode(id) {
|
||||
this.$refs.openQRCode.openCode("/platform/evaluate/apply")
|
||||
},
|
||||
pageOrder(column) {//按字段排序
|
||||
this.pageForm.pageOrderName = column.prop;
|
||||
this.pageForm.pageOrderBy = column.order;
|
||||
this.pageData();
|
||||
},
|
||||
async deleteDo(row) {
|
||||
const resp = await $.post('/platform/evaluate/getApplyData', {id: row.id})
|
||||
if(resp.data && resp.data.length > 0) {
|
||||
this.$notify({title: '提示', message: '此评优评先活动已有申请记录,不能删除!', type: 'warning'})
|
||||
return
|
||||
}
|
||||
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.$message.success(resp.msg)
|
||||
this.pageData();
|
||||
} else {
|
||||
this.$message.warning(resp.msg)
|
||||
}
|
||||
}, "json");
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
async getEvaluateByYear() {
|
||||
const {data} = await $.post('/platform/evaluate/apply/getEvaluateByYear', {year: this.pageForm.year,type:this.pageForm.honorType})
|
||||
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() {
|
||||
this.honorTypeList = await HonorApi.getHonorType()
|
||||
if (this.honorTypeList) {
|
||||
this.$set(this.pageForm, "honorType", this.honorTypeList[0].id)
|
||||
}
|
||||
await this.getActivityGroup()
|
||||
await this.getEvaluateByYear()
|
||||
this.pageData()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,179 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
|
||||
<div id="app" v-cloak>
|
||||
<guava ref="guava">
|
||||
<el-card shadow="never">
|
||||
<!--#include("/platform/evaluate/include_evaluate_edit.html"){}#-->
|
||||
</el-card>
|
||||
</guava>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
|
||||
let E = window.wangEditor
|
||||
const editors = {}
|
||||
|
||||
var vue = new Vue({
|
||||
el: '#app',
|
||||
components: {
|
||||
'fgh-select': httpVueLoader('/components/plugins/FghSelect.vue?v=1.0.0'),
|
||||
'drawer-user-scope': httpVueLoader('/components/plugins/DrawerUserScope.vue'),
|
||||
},
|
||||
data() {
|
||||
let validProgram = (rule, value, callback) => {
|
||||
if (!this.formData.program || !dd3s.html2txt(this.formData.program)) {
|
||||
callback(new Error('请填写评选表彰程序'));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
};
|
||||
return {
|
||||
stepActive: 0,
|
||||
formData: {
|
||||
time: [],
|
||||
unionLimit: [],
|
||||
},
|
||||
formRules: {
|
||||
name: [{required: true, message: '请填写评优评先名称', trigger: ['blur', 'change']}],
|
||||
honor: [{required: true, message: '请选择类型', trigger: ['blur', 'change']}],
|
||||
time: [{required: true, message: '请选择申请时间', trigger: ['blur', 'change']}],
|
||||
groupId: [{required: true, message: '请选择参加人员范围', trigger: ['blur', 'change']}],
|
||||
conditions: [{required: true, message: '请填写评选条件', trigger: ['blur', 'change']}],
|
||||
pxxmlx: [{required: true, message: '请填写评选项目类型', trigger: ['blur', 'change']}],
|
||||
program: [{validator: validProgram, trigger: ['blur', 'change']}],
|
||||
},
|
||||
unions: [],
|
||||
unionTableData: [],
|
||||
activityGroupList: [],
|
||||
honorOptions: [],
|
||||
radioActive: '直接分配',
|
||||
rate: 0,
|
||||
honor: {},
|
||||
fpme: [],
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
cascaderChange(o) {
|
||||
for (const item of this.honorOptions) {
|
||||
this.honor = item.children.find(x => {
|
||||
return x.value === o
|
||||
})
|
||||
if (this.honor) {
|
||||
this.formData.honorTypeId = item.value
|
||||
return
|
||||
}
|
||||
}
|
||||
},
|
||||
initEditor() {
|
||||
|
||||
let keys = ['program']
|
||||
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 initData() {
|
||||
const id = GetQueryString("id")
|
||||
this.id = id
|
||||
if (id) {
|
||||
const resp = await $.post('/platform/evaluate/findOne', {id})
|
||||
if (resp.code === 0) {
|
||||
this.formData = resp.data.evaluate
|
||||
this.$set(this.formData, 'time', [this.formData.startTime, this.formData.endTime])
|
||||
this.formData.honor = this.formData.honorId
|
||||
this.fpme = resp.data.fpme
|
||||
this.cascaderChange(this.formData.honorId)
|
||||
this.$nextTick(() => {
|
||||
this.initEditor()
|
||||
})
|
||||
}
|
||||
}
|
||||
},
|
||||
async next() {
|
||||
this.unionTableData = []
|
||||
this.$refs.form.validate(async (valid) => {
|
||||
if (valid) {
|
||||
this.stepActive = 1
|
||||
} else {
|
||||
this.$notify({title: '警告', message: '存在未填的必填项', type: 'warning'})
|
||||
}
|
||||
});
|
||||
},
|
||||
async doAdd() {
|
||||
this.formData.startTime = this.formData.time[0]
|
||||
this.formData.endTime = this.formData.time[1]
|
||||
this.formData.honorId = this.honor.value
|
||||
|
||||
if (this.honor.parentName === '集体荣誉' && !this.formData.directions) {
|
||||
this.$notify({title: '警告', message: '请填写评选名额的说明', type: 'warning'})
|
||||
return
|
||||
}
|
||||
|
||||
const loading = this.$loading({
|
||||
lock: true,
|
||||
text: '正在提交...',
|
||||
spinner: 'el-icon-loading',
|
||||
background: 'rgba(0, 0, 0, 0.7)'
|
||||
});
|
||||
const resp = await $.post('/platform/Evaluate/doHandle', {
|
||||
evaluate: JSON.stringify(this.formData),
|
||||
data: this.honor.parentName === '个人荣誉' ? JSON.stringify(this.unionTableData) : JSON.stringify([])
|
||||
})
|
||||
if (resp.code === 0) {
|
||||
loading.close();
|
||||
this.$notify({
|
||||
title: '成功',
|
||||
message: resp.msg,
|
||||
type: 'success',
|
||||
duration: 500,
|
||||
onClose: () => {
|
||||
sublime.jumpPagePjax('/platform/evaluate/manage')
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
async getActivityGroup() {
|
||||
const resp = await $.get('/platform/activity/basic/scope/getActivityUserScopeGroup')
|
||||
this.activityGroupList = resp.data
|
||||
},
|
||||
async getHonor() {
|
||||
const resp = await $.get('/platform/evaluate/getHonor')
|
||||
this.honorOptions = resp.data
|
||||
},
|
||||
doBack() {
|
||||
if (GetQueryString("id") !== '') {
|
||||
sublime.jumpPagePjax('/platform/evaluate/manage')
|
||||
}
|
||||
},
|
||||
},
|
||||
async created() {
|
||||
const self = this
|
||||
setTimeout(function () {
|
||||
self.initEditor()
|
||||
}, 100)
|
||||
await this.getActivityGroup()
|
||||
await this.getHonor()
|
||||
await this.initData()
|
||||
},
|
||||
watch: {
|
||||
'rate'(o) {
|
||||
this.unionTableData.forEach(item => {
|
||||
item.number = Math.round(item.membercount * o / 100)
|
||||
})
|
||||
},
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,142 @@
|
||||
<style>
|
||||
|
||||
.editor .el-form-item__label:before {
|
||||
content: '*';
|
||||
color: #F56C6C;
|
||||
margin-right: 4px;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
<template>
|
||||
<el-row style="padding: 0 10%;">
|
||||
|
||||
<el-steps :active="stepActive" finish-status="success" simple>
|
||||
<el-step description="" title="活动信息">
|
||||
|
||||
</el-step>
|
||||
<el-step description="" title="名额分配">
|
||||
|
||||
</el-step>
|
||||
</el-steps>
|
||||
|
||||
<div class="transition-box" style="margin-top: 20px;" v-show="stepActive === 0">
|
||||
<el-form :model="formData" :rules="formRules" label-width="120px" ref="form">
|
||||
|
||||
<el-row gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="评优评先名称" prop="name">
|
||||
<el-input v-model="formData.name"
|
||||
placeholder="请填写评优评先名称"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="类型" prop="honor">
|
||||
<el-cascader style="width: 100%" :show-all-levels="false" :props="{ emitPath: false }"
|
||||
v-model="formData.honor" clearable filterable @change="cascaderChange"
|
||||
:options="honorOptions"></el-cascader>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="申请时间" label-width="120px" prop="time">
|
||||
<el-date-picker
|
||||
align="right"
|
||||
end-placeholder="结束日期"
|
||||
start-placeholder="开始日期"
|
||||
style="width: 100%"
|
||||
type="datetimerange"
|
||||
v-model="formData.time"
|
||||
value-format="yyyy-MM-dd HH:mm:ss">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" v-if="honor.parentName !== '集体荣誉'">
|
||||
<el-form-item label="参加人员范围" prop="groupId">
|
||||
<div style="display: flex; justify-content: space-between">
|
||||
<div style="width: 99%">
|
||||
<el-select placeholder="请选择参加人员范围" v-model="formData.groupId" style="width: 99%"
|
||||
clearable
|
||||
filterable>
|
||||
<el-option v-for="item in activityGroupList" :label="item.groupName"
|
||||
:value="item.groupId"></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
<div>
|
||||
<el-button @click="$refs.drawerUserScope.userScopeDialog = true" type="primary">设置</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item prop="pxxmlx" label="评选项目类型">
|
||||
<el-radio-group v-model="formData.pxxmlx">
|
||||
<el-radio-button :label="1">工会</el-radio-button>
|
||||
<el-radio-button :label="2">协会</el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item prop="xlFlag" label="活动提醒">
|
||||
<el-switch
|
||||
v-model="formData.xlFlag"
|
||||
active-color="#13ce66"
|
||||
inactive-color="#ff4949">
|
||||
</el-switch>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-form-item label="评选条件" prop="conditions">
|
||||
<el-input type="textarea" v-model="formData.conditions" rows="4" maxlength="500"
|
||||
placeholder="请填写评选条件"></el-input>
|
||||
</el-form-item>
|
||||
|
||||
<div class="editor">
|
||||
<el-form-item label="评选表彰程序" prop="program" class="is-required">
|
||||
<div id="program"></div>
|
||||
</el-form-item>
|
||||
</div>
|
||||
|
||||
</el-form>
|
||||
<div style="float: right;margin: 20px 0">
|
||||
<el-button v-if="GetQueryString('id') !== ''" @click="doBack" type="primary">返回</el-button>
|
||||
<el-button @click="next" type="primary">下一步</el-button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="transition-box" style="margin-top: 20px;" v-show="stepActive === 1">
|
||||
|
||||
<template v-if="honor.parentName === '个人荣誉' && stepActive === 1">
|
||||
<fgh-select :user_scope="formData.groupId" :union_limit.sync="formData.unionLimit"></fgh-select>
|
||||
</template>
|
||||
|
||||
<template v-if="honor.parentName === '集体荣誉'">
|
||||
|
||||
<el-form label-width="120px">
|
||||
<el-form-item label="评选名额" prop="conditions">
|
||||
<el-input type="textarea" v-model="formData.directions" rows="4" maxlength="500"
|
||||
placeholder="请填写评选名额的说明"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
</template>
|
||||
|
||||
<div style="float: right;margin: 20px 0">
|
||||
<el-button v-if="GetQueryString('id') !== ''" @click="doBack" type="primary">返回</el-button>
|
||||
<el-button @click="stepActive = 0" type="primary">上一步</el-button>
|
||||
<el-button @click="doAdd()" type="primary">提
|
||||
交
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</el-row>
|
||||
|
||||
<drawer-user-scope
|
||||
@group_change="getActivityGroup"
|
||||
ref="drawerUserScope"
|
||||
:group_id.sync="formData.groupId"
|
||||
></drawer-user-scope>
|
||||
</template>
|
||||
@@ -0,0 +1,336 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
<style>
|
||||
.el-select {
|
||||
width: 100%;
|
||||
}
|
||||
</style>
|
||||
<div id="app" v-cloak>
|
||||
<guava ref="guava">
|
||||
<template>
|
||||
|
||||
<el-card shadow="never">
|
||||
|
||||
<div class="btn-group tool-button">
|
||||
<div class="block">
|
||||
<el-date-picker
|
||||
style="width: 100px"
|
||||
v-model="pageForm.year"
|
||||
type="year" @change="getEvaluateByYear()"
|
||||
value-format="yyyy"
|
||||
placeholder="年度">
|
||||
</el-date-picker>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="btn-group tool-button">
|
||||
<el-input placeholder="请输入内容" v-model="pageForm.searchKeyword" clearable>
|
||||
<el-select v-model="pageForm.searchName" slot="prepend" placeholder="查询类型"
|
||||
style="width: 100px;">
|
||||
<el-option label="工号" value="us.loginname"></el-option>
|
||||
<el-option label="姓名" value="us.username"></el-option>
|
||||
</el-select>
|
||||
</el-input>
|
||||
</div>
|
||||
|
||||
<div class="btn-group tool-button">
|
||||
<el-select placeholder="评优评先名称" v-model="pageForm.evaluateId" style="width: 100%;"
|
||||
clearable="true" filterable="true">
|
||||
<el-option v-for="item in evaluateList" :label="item.evaluateName"
|
||||
:value="item.evaluateId"></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
|
||||
<div class="btn-group tool-button"
|
||||
v-if="pageForm.honorType=== HonorApi.honor_single_id">
|
||||
|
||||
|
||||
<div class="btn-group tool-button">
|
||||
<el-select placeholder="所属工会" v-model="pageForm.unionId" style="width: 100%;"
|
||||
clearable="true"
|
||||
@change="flushUnits" @clear="flushUnits"
|
||||
|
||||
v-if="${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')}"
|
||||
|
||||
filterable="true">
|
||||
<el-option v-for="item in unions" :label="item.unionname" :value="item.id"></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
|
||||
<div class="btn-group tool-button">
|
||||
<el-select placeholder="所属单位" v-model="pageForm.unitId" style="width: 100%;"
|
||||
clearable="true"
|
||||
filterable="true">
|
||||
<el-option v-for="item in units" :label="item.name" :value="item.id"></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="btn-group tool-button" v-if="pageForm.honorType !== HonorApi.honor_single_id">
|
||||
<el-select placeholder="请选择申报协会" v-model="pageForm.clubId"
|
||||
style="width: 100%;"
|
||||
clearable
|
||||
filterable>
|
||||
<el-option v-for="item in clubs"
|
||||
:label="item.name"
|
||||
:value="item.stid"></el-option>
|
||||
</el-select>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- <div class="btn-group tool-button">-->
|
||||
<!-- <el-radio-group v-model="pageForm.honorType" @change="(o) => {radioChange(o)}">-->
|
||||
<!-- <el-radio-button v-for="v in honorTypeList" :label="v.id">{{v.name}}-->
|
||||
<!-- </el-radio-button>-->
|
||||
<!-- </el-radio-group>-->
|
||||
<!-- </div>-->
|
||||
|
||||
<div class="btn-group tool-button">
|
||||
<el-button type="primary" @click="doSearch" icon="el-icon-search"></el-button>
|
||||
</div>
|
||||
|
||||
|
||||
</el-card>
|
||||
|
||||
<el-card class="mt10" shadow="never">
|
||||
|
||||
<vi-title2 title="申请列表">
|
||||
<template #func>
|
||||
<el-button type="primary" @click="exportExcel" size="small">一键导出excel表</el-button>
|
||||
<el-button type="primary" @click="exportTableAll" size="small">一键导出登记表</el-button>
|
||||
<!-- <el-button type="primary" @click="exportResult" size="small">导出公示结果</el-button>-->
|
||||
</template>
|
||||
</vi-title2>
|
||||
|
||||
<el-table :data="tableData">
|
||||
<el-table-column align="center" header-align="center" label="序号" type="index"
|
||||
width="80px"></el-table-column>
|
||||
|
||||
<el-table-column align="center" header-align="center" label="评优评先名称"
|
||||
prop="evaluateName"
|
||||
show-overflow-tooltip></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"
|
||||
:sortable="column.sortable" show-overflow-tooltip>
|
||||
|
||||
<template v-if="column.prop=='unionClub'" scope="{row}">
|
||||
{{row.pxxmlx===1?row.unionName:row.clubName}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<template v-if="pageForm.honorType !== HonorApi.honor_single_id">
|
||||
|
||||
<el-table-column align="center" header-align="center" label="工会/协会"
|
||||
prop="applyTime"
|
||||
show-overflow-tooltip>
|
||||
<template slot-scope="{row}">
|
||||
<template v-if="row.pxxmlx===1">
|
||||
{{row.applyUnionName}}
|
||||
</template>
|
||||
<template v-if="row.pxxmlx===2">
|
||||
{{row.clubName}}
|
||||
</template>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column align="center" header-align="center" label="工会主席/协会会长"
|
||||
prop="applyTime"
|
||||
show-overflow-tooltip>
|
||||
<template slot-scope="{row}">
|
||||
<template v-if="row.pxxmlx===1">
|
||||
{{row.unionLeader}}
|
||||
</template>
|
||||
<template v-if="row.pxxmlx===2">
|
||||
{{row.clubLeader}}
|
||||
</template>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column align="center" header-align="center" label="会员人数"
|
||||
prop="applyTime"
|
||||
show-overflow-tooltip>
|
||||
<template slot-scope="{row}">
|
||||
<template v-if="row.pxxmlx===1">
|
||||
{{row.memberNumber}}
|
||||
</template>
|
||||
<template v-if="row.pxxmlx===2">
|
||||
{{row.clubNumber}}
|
||||
</template>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</template>
|
||||
|
||||
<el-table-column align="center" header-align="center" label="评选项目类型"
|
||||
prop="applyTime"
|
||||
show-overflow-tooltip>
|
||||
<template slot-scope="{row}">
|
||||
{{row.pxxmlx===1?'工会':'协会'}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="申请时间" prop="applyTime" sortable header-align="center"
|
||||
align="center"></el-table-column>
|
||||
|
||||
<el-table-column align="center" header-align="center" label="审核状态" prop="year"
|
||||
show-overflow-tooltip>
|
||||
<template slot-scope="{row}">
|
||||
<span :style="'color: ' + row.stateColor">{{row.stateName}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" header-align="center" label="操作" fixed="right" width="250px">
|
||||
<template scope="{row}">
|
||||
<el-button size="mini" @click="openView(row)" type="primary">
|
||||
查看
|
||||
</el-button>
|
||||
<el-button size="mini" @click="exportTable(row)" type="primary">
|
||||
导出登记表
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<!--#include("/layouts/pagination.html"){}#-->
|
||||
|
||||
</el-card>
|
||||
|
||||
|
||||
</template>
|
||||
|
||||
<template #view>
|
||||
<evaluate-info ref="info"></evaluate-info>
|
||||
</template>
|
||||
|
||||
</guava>
|
||||
</div>
|
||||
|
||||
|
||||
<script>
|
||||
var vue = new Vue({
|
||||
el: '#app',
|
||||
mixins: [initTableMixins],
|
||||
data() {
|
||||
return {
|
||||
clubs: [],
|
||||
units: [],
|
||||
unions: [],
|
||||
evaluateList: [],
|
||||
pageForm: {
|
||||
year: '',
|
||||
isAudit: false,
|
||||
searchName: 'us.username',
|
||||
honorType: '',
|
||||
honorLevel: '',
|
||||
evaluateId: '',
|
||||
unionId: '',
|
||||
unitId: '',
|
||||
},
|
||||
honorTypeList: [],
|
||||
tableColumns: [
|
||||
{prop: 'userName', label: '申请人姓名', sortable: true},
|
||||
{prop: 'loginname', label: '工号', sortable: true},
|
||||
{prop: 'userSex', label: '性别', sortable: true},
|
||||
{prop: 'unitName', label: '单位', sortable: true},
|
||||
{prop: 'political', label: '政治面貌', sortable: true},
|
||||
// {prop: 'joinTime', label: '加入工会时间', sortable: true},
|
||||
{prop: 'position', label: '担任职务'},
|
||||
{prop: 'unionClub', label: '工会/协会'},
|
||||
],
|
||||
}
|
||||
},
|
||||
components: {
|
||||
'evaluate-info': httpVueLoader('/components/evaluate/evaluateInfo.vue'),
|
||||
},
|
||||
methods: {
|
||||
exportTableAll() {
|
||||
window.location.href = "/platform/evaluate/summary/exportTableAll?year=" + this.pageForm.year +
|
||||
"&evaluateId=" + this.pageForm.evaluateId +
|
||||
"&unionId=" + this.pageForm.unionId +
|
||||
"&unitId=" + this.pageForm.unitId +
|
||||
"&honorType=" + this.pageForm.honorType
|
||||
},
|
||||
exportExcel() {
|
||||
if (!this.pageForm.year) {
|
||||
this.$message({
|
||||
type: 'error',
|
||||
message: '请选择年份'
|
||||
});
|
||||
return
|
||||
}
|
||||
window.open(loc() + '/exportExcel?year='+ this.pageForm.year )
|
||||
},
|
||||
|
||||
exportTable(row) {
|
||||
window.location.href = "/platform/evaluate/summary/exportTable?id=" + row.id
|
||||
},
|
||||
exportResult() {
|
||||
window.location.href = "/platform/evaluate/summary/exportResult?data=" + JSON.stringify(this.pageForm)
|
||||
},
|
||||
openView(data) {
|
||||
this.$refs.info.getInfo(data.id)
|
||||
this.$refs.guava.view()
|
||||
},
|
||||
radioChange() {
|
||||
if (this.pageForm.honorType === HonorApi.honor_single_id) {
|
||||
this.tableColumns = [
|
||||
{prop: 'userName', label: '申请人姓名', sortable: true},
|
||||
{prop: 'loginname', label: '工号', sortable: true},
|
||||
{prop: 'userSex', label: '性别', sortable: true},
|
||||
{prop: 'unitName', label: '单位', sortable: true},
|
||||
{prop: 'unionName', label: '工会', sortable: true},
|
||||
// {prop: 'joinTime', label: '加入工会时间', sortable: true},
|
||||
{prop: 'position', label: '担任职务'},
|
||||
]
|
||||
} else {
|
||||
this.tableColumns = [
|
||||
/* {prop: 'evaluateName', label: '评优评先名称', sortable: true},
|
||||
{prop: 'applyUnionName', label: '申报院级工会', sortable: true},
|
||||
{prop: 'unionLeader', label: '工会主席', sortable: true},
|
||||
{prop: 'memberNumber', label: '会员人数', sortable: true},
|
||||
{prop: 'unionGroupNumber', label: '工会小组数', sortable: true},*/
|
||||
]
|
||||
}
|
||||
this.doSearch()
|
||||
},
|
||||
async flushUnits() {
|
||||
this.$set(this.pageForm, "unitId", "")
|
||||
if ("${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')}" === 'true') {
|
||||
this.units = await getUnits(this.pageForm.unionId)
|
||||
} else {
|
||||
this.units = await getUnits("${@shiro.getPrincipalProperty('unit').getUnionid()}")
|
||||
}
|
||||
},
|
||||
async pageData() {
|
||||
const res = await $.post('/platform/evaluate/summary/pageData', this.pageForm)
|
||||
if (res.code === 0) {
|
||||
this.tableData = res.data.list;
|
||||
this.pageForm.totalCount = res.data.totalCount;
|
||||
}
|
||||
},
|
||||
async getEvaluateByYear() {
|
||||
const {data} = await $.post('/platform/evaluate/apply/getEvaluateByYear', {year: this.pageForm.year})
|
||||
this.evaluateList = data
|
||||
}
|
||||
},
|
||||
async created() {
|
||||
this.honorTypeList = await HonorApi.getHonorType()
|
||||
if (this.honorTypeList) {
|
||||
this.$set(this.pageForm, "honorType", this.honorTypeList[0].id)
|
||||
}
|
||||
await this.getEvaluateByYear()
|
||||
this.unions = await getUnions(null)
|
||||
this.clubs = await getClubsByRole()
|
||||
this.flushUnits()
|
||||
this.pageData()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,369 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
<style>
|
||||
.table_fixed {
|
||||
table-layout: fixed !important;
|
||||
}
|
||||
|
||||
.map-search {
|
||||
margin-bottom: 1rem;
|
||||
border-radius: .25rem;
|
||||
position: absolute;
|
||||
top: 1rem;
|
||||
background-color: white;
|
||||
width: auto;
|
||||
min-width: 22rem;
|
||||
border-width: 0;
|
||||
right: 1rem;
|
||||
box-shadow: 0 2px 6px 0 rgba(114, 124, 245, .5);
|
||||
}
|
||||
|
||||
.map-search .input-item {
|
||||
position: relative;
|
||||
display: -ms-flexbox;
|
||||
display: flex;
|
||||
-ms-flex-wrap: wrap;
|
||||
flex-wrap: wrap;
|
||||
-ms-flex-align: center;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
height: 3rem;
|
||||
}
|
||||
|
||||
|
||||
</style>
|
||||
|
||||
|
||||
<div id="app" v-cloak>
|
||||
<guava ref="guava">
|
||||
<el-card shadow="never">
|
||||
<div class="search">
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">年度:</div>
|
||||
<div class="search-item-option">
|
||||
<el-date-picker
|
||||
placeholder="选择年度"
|
||||
type="year" style="width: 100%"
|
||||
v-model="pageForm.year"
|
||||
value-format="yyyy">
|
||||
</el-date-picker>
|
||||
</div>
|
||||
</div>
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">活动名称:</div>
|
||||
<div class="search-item-option">
|
||||
<el-input @keyup.enter.native="doSearch" clearable placeholder="请输入内容"
|
||||
clearable
|
||||
style="width: 100%" v-model="pageForm.activityName">
|
||||
</el-input>
|
||||
</div>
|
||||
</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">
|
||||
<table-tool :app="this" label="活动列表">
|
||||
<template #func>
|
||||
<el-button @click="openAdd" size="medium" type="primary">新建活动</el-button>
|
||||
</template>
|
||||
</table-tool>
|
||||
<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
|
||||
:label="column.label"
|
||||
:prop="column.prop"
|
||||
:sortable="column.sortable"
|
||||
align="center"
|
||||
header-align="center"
|
||||
show-overflow-tooltip
|
||||
v-for="column in tableColumns"
|
||||
>
|
||||
<template scope="{row}" v-if="column.prop==='isDisabled'">
|
||||
<el-switch
|
||||
:active-value="false"
|
||||
:inactive-value="true"
|
||||
@change="(val)=>{activityStatusChange(row.notice,val,row.id)}"
|
||||
active-color="#13ce66"
|
||||
inactive-color="#ff4949"
|
||||
v-model="row.isDisabled">
|
||||
</el-switch>
|
||||
</template>
|
||||
<template scope="{row:{opAt}}" v-else-if="column.prop==='opAt'">
|
||||
{{moment(opAt * 1000).format('YYYY-MM-DD HH:mm:ss')}}
|
||||
</template>
|
||||
<template scope="{row}" v-else-if="column.prop==='notice'">
|
||||
<el-switch
|
||||
:active-value="true"
|
||||
:inactive-value="false"
|
||||
@change="(val)=>{activityNoticeChange(row.isDisabled,val,row.id)}"
|
||||
active-color="#13ce66"
|
||||
inactive-color="#ff4949"
|
||||
v-model="row.notice">
|
||||
</el-switch>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="150px">
|
||||
<template scope="{row}">
|
||||
<el-dropdown>
|
||||
<el-button plain size="mini">
|
||||
<i class="ti-settings"></i>
|
||||
<span class="ti-angle-down"></span>
|
||||
</el-button>
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-item @click.native="openCode(row.id)">
|
||||
活动二维码
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item @click.native="makeCode(row)">
|
||||
签到二维码
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item @click.native="sendMsg(row)">
|
||||
通知
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item @click.native="openView(row)">
|
||||
查看
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item @click.native="openEdit(row)">
|
||||
编辑
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item @click.native="deleteDo(row)">
|
||||
删除
|
||||
</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--#include("/layouts/pagination.html"){}#-->
|
||||
</el-card>
|
||||
|
||||
<template #view>
|
||||
<!--#include("/platform/fellowship/manage/include_activity_view.html"){}#-->
|
||||
</template>
|
||||
</guava>
|
||||
|
||||
<el-dialog :close-on-click-modal="false" :visible.sync="courseDialog" :title="trainType + '列表'"
|
||||
top="50px">
|
||||
|
||||
<el-table :data="clickRow.courseList">
|
||||
<el-table-column :label="trainType + '名称'" prop="courseName"></el-table-column>
|
||||
<el-table-column label="校区" prop="campus"></el-table-column>
|
||||
<el-table-column label="是否签到" prop="isMobileSign">
|
||||
<template scope="{row}">
|
||||
<span v-if="row.isMobileSign === true">签到</span>
|
||||
<span v-else>不签到</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="签到方式" prop="signType">
|
||||
<template scope="{row}">
|
||||
<span v-if="row.signType === 1">扫描二维码</span>
|
||||
<span v-else-if="row.signType === 2">被扫</span>
|
||||
<span v-else-if="row.signType === 3">GPS定位签到</span>
|
||||
<span v-else>暂无签到方式</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="是否领取礼品" prop="isReceiveGift">
|
||||
<template scope="{row}">
|
||||
<span v-if="row.isReceiveGift === true">领取</span>
|
||||
<span v-else>不领取</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="领取方式" prop="giftType">
|
||||
<template scope="{row}">
|
||||
<span v-if="row.giftType === 1">扫描二维码</span>
|
||||
<span v-else-if="row.giftType === 2">面对面确认</span>
|
||||
<span v-else>暂无领取方式</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="260">
|
||||
<template scope="{row}">
|
||||
<el-button v-if="row.signType === 1" @click="makeCourseCode(row)" size="mini"
|
||||
type="primary">生成二维码
|
||||
</el-button>
|
||||
<el-button v-else size="mini" type="text">该{{trainType}}的签到方式不支持生成二维码
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-dialog>
|
||||
|
||||
<send-msg ref="sendMsg" :url="url"></send-msg>
|
||||
<open-qr-code ref="openQRCode" :url="url"></open-qr-code>
|
||||
|
||||
</div>
|
||||
|
||||
<script>
|
||||
let geocoder = null
|
||||
let viewMap = null
|
||||
let viewMarker = null
|
||||
var vue = new Vue({
|
||||
el: '#app',
|
||||
mixins: [initTableMixins],
|
||||
data() {
|
||||
const that = this
|
||||
return {
|
||||
url: '',
|
||||
courseDialog: false,
|
||||
trainType: '',
|
||||
trainTypeList: [],
|
||||
campusList: [],
|
||||
tableColumns: [
|
||||
{label: '活动名称', prop: 'activityName'},
|
||||
{label: '年度', prop: 'year'},
|
||||
{label: '开始时间', prop: 'activityStartTime'},
|
||||
{label: '结束时间', prop: 'activityEndTime'},
|
||||
{label: '是否开启', prop: 'isDisabled'},
|
||||
{label: '是否通知', prop: 'notice'},
|
||||
{label: '创建时间', prop: 'opAt'},
|
||||
],
|
||||
viewData: {},
|
||||
mapDialog: false,
|
||||
mapIndex: 0,
|
||||
courseTimeListDialog: false,
|
||||
courseTimeList: [],
|
||||
viewMapDialog: false,
|
||||
clickRow: {},
|
||||
}
|
||||
},
|
||||
components: {
|
||||
'open-qr-code': httpVueLoader('/components/plugins/OpenQRCode.vue'),
|
||||
'send-msg': httpVueLoader('/components/plugins/SendMsgByGroupId.vue'),
|
||||
},
|
||||
methods: {
|
||||
sendMsg(row) {
|
||||
this.url = `<a href="` + (APP_DOMAIN + "/platform/mobile/fellowshipActivity/fellowshipLis") + `">点击参与</a>`
|
||||
this.$refs.sendMsg.openDialog(row.activityGroupId)
|
||||
},
|
||||
openCode(id) {
|
||||
this.$refs.openQRCode.openCode("/platform/mobile/fellowshipActivity/fellowshipList")
|
||||
},
|
||||
makeCode(row) {
|
||||
this.clickRow = row
|
||||
const type = this.trainTypeList.find(o => o.code === row.trainType)
|
||||
this.trainType = type ? type.name : '交友联谊'
|
||||
this.courseDialog = true
|
||||
},
|
||||
makeCourseCode(row) {
|
||||
const o = {
|
||||
courseId: row.id
|
||||
}
|
||||
// 生成二维码的 base64 编码
|
||||
const content = jrQrcode.getQrBase64(JSON.stringify(o))
|
||||
let image = new Image()
|
||||
image.src = content
|
||||
let viewer = new Viewer(image)
|
||||
viewer.show()
|
||||
},
|
||||
openAdd() {
|
||||
sublime.jumpPagePjax('/platform/fellowship/manage/activity/add')
|
||||
},
|
||||
//活动状态改变
|
||||
async activityStatusChange(notice, val, id) {
|
||||
const resp = await $.post(loc() + '/activityStatusChange', {
|
||||
notice: notice,
|
||||
isDisabled: val,
|
||||
id
|
||||
})
|
||||
if (resp.code === 0) {
|
||||
this.notifySuccess(resp.msg)
|
||||
} else {
|
||||
this.notifyError(resp.msg)
|
||||
}
|
||||
},
|
||||
async activityNoticeChange(isDisabled, val, id) {
|
||||
const resp = await $.post(loc() + '/activityStatusChange', {
|
||||
isDisabled: isDisabled,
|
||||
notice: val,
|
||||
id
|
||||
})
|
||||
if (resp.code === 0) {
|
||||
this.notifySuccess(resp.msg)
|
||||
} else {
|
||||
this.notifyError(resp.msg)
|
||||
}
|
||||
},
|
||||
async openEdit(row) {
|
||||
sublime.jumpPagePjax('/platform/fellowship/manage/activity/add?id=' + row.id + '&fromEdit=edit')
|
||||
},
|
||||
async deleteDo(row) {
|
||||
const confirm = await this.$confirm('此操作将永久删除, 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
})
|
||||
if (confirm === "confirm") {
|
||||
const resp = await $.post(loc() + '/doDelete', {id: row.id})
|
||||
this.notifySuccess("删除成功")
|
||||
this.doSearch()
|
||||
}
|
||||
},
|
||||
async openView(row) {
|
||||
const {id} = row
|
||||
const resp = await $.get(loc() + '/findOne', {id})
|
||||
if (resp.code === 0) {
|
||||
let cloneData = clone(resp.data)
|
||||
cloneData.campusList = new Set(cloneData.courseList.map(v => v.campus))
|
||||
this.viewData = cloneData
|
||||
const type = this.trainTypeList.find(o => o.code === cloneData.trainType)
|
||||
this.trainType = type ? type.name : '交友联谊'
|
||||
this.$refs['guava'].view()
|
||||
}
|
||||
},
|
||||
openViewMap(point) {
|
||||
if (!Array.isArray(point)) {
|
||||
this.$message.warning('没有设置点位,无法通过地图查看')
|
||||
return
|
||||
}
|
||||
this.viewMapDialog = true
|
||||
this.$nextTick(() => {
|
||||
viewMap = new AMap.Map("viewMap", {
|
||||
resizeEnable: true,
|
||||
center: point,
|
||||
zoom: 16
|
||||
})
|
||||
if (viewMarker) {
|
||||
viewMap.remove(viewMarker)
|
||||
}
|
||||
viewMarker = new AMap.Marker({
|
||||
position: point,
|
||||
offset: new AMap.Pixel(-13, -30)
|
||||
})
|
||||
viewMap.add(viewMarker)
|
||||
viewMap.setFitView(null, false, [150, 60, 100, 60]);
|
||||
})
|
||||
},
|
||||
getAddress(position) {
|
||||
// if (!geocoder) {
|
||||
// geocoder = new AMap.Geocoder({
|
||||
// city: "010", //城市设为北京,默认:“全国”
|
||||
// radius: 1000 //范围,默认:500
|
||||
// });
|
||||
// }
|
||||
// geocoder.getAddress(position, (status, result) => {
|
||||
// if (status === 'complete' && result.regeocode) {
|
||||
// const address = result.regeocode.formattedAddress
|
||||
// this.formData.courseList[this.mapIndex].location = address
|
||||
// } else {
|
||||
// log.error('根据经纬度查询地址失败')
|
||||
// }
|
||||
// })
|
||||
},
|
||||
openViewCourseTime(courseTimeList) {
|
||||
this.courseTimeList = courseTimeList
|
||||
this.courseTimeListDialog = true
|
||||
},
|
||||
},
|
||||
async created() {
|
||||
this.pageData()
|
||||
this.trainTypeList = await getDictOptions("fellowshipType")
|
||||
this.campusList = await getCampus()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,697 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
|
||||
<style>
|
||||
|
||||
.el-row--flex {
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.el-drawer__body {
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
|
||||
.my-drawer .el-col-4 {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.my-drawer .el-row {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
<div id="app" v-cloak>
|
||||
<guava ref="guava">
|
||||
<el-card shadow="never">
|
||||
<!--#include("/platform/fellowship/manage/include_activity_edit.html"){}#-->
|
||||
</el-card>
|
||||
</guava>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
let pointX = '${config.AppMapCenterPointX!}'
|
||||
let pointY = '${config.AppMapCenterPointY!}'
|
||||
let map = null
|
||||
let marker = null
|
||||
let geocoder = null
|
||||
let E = window.wangEditor
|
||||
var vue = new Vue({
|
||||
el: '#app',
|
||||
components: {
|
||||
'condition': httpVueLoader('/components/plugins/ConditionStructure.vue?v=1.0.0'),
|
||||
'drawer-user-scope': httpVueLoader('/components/plugins/DrawerUserScope.vue'),
|
||||
},
|
||||
data() {
|
||||
const that = this
|
||||
return {
|
||||
trainType: '交友联谊',
|
||||
trainTypeList: [],
|
||||
fromEdit: '',
|
||||
formData: {
|
||||
notice: false,
|
||||
courseList: [
|
||||
{
|
||||
courseName: '1',
|
||||
courseTimeList: [],
|
||||
isMobileSign: false,
|
||||
isReceiveGift: false
|
||||
},
|
||||
{
|
||||
courseName: '2',
|
||||
courseTimeList: [],
|
||||
isMobileSign: false,
|
||||
isReceiveGift: false
|
||||
}
|
||||
],
|
||||
conditionStructure: {
|
||||
method: "AND",
|
||||
conditions: [{}],
|
||||
},
|
||||
restrictLimit: 1,
|
||||
limitNum: 1,
|
||||
typeLimits: [],
|
||||
},
|
||||
pickerOptions: {
|
||||
disabledDate(time) {
|
||||
return time.getTime() < Date.now() - 24 * 60 * 60 * 1000;
|
||||
},
|
||||
},
|
||||
setUpCoursePickerOptions: {
|
||||
disabledDate(time) {
|
||||
return time.getTime() < Date.parse(moment(that.formData.activityTime[0]).format('YYYY-MM-DD') + ' 00:00:00')
|
||||
|| time.getTime() > Date.parse(moment(that.formData.activityTime[1]).format('YYYY-MM-DD') + ' 00:00:00')
|
||||
},
|
||||
},
|
||||
courseIndex: 0,
|
||||
setUpCourseDialog: false,
|
||||
unionLimitIndex: 0,
|
||||
setUpUnionLimitDialog: false,
|
||||
viewMapDialog: false,
|
||||
mapDialog: false,
|
||||
courseTypeList: [],
|
||||
campusList: [],
|
||||
courseTimeOneKeySet: {
|
||||
startTime: '',
|
||||
endTime: '',
|
||||
},
|
||||
conditionStructure: {
|
||||
method: "AND",
|
||||
conditions: [{}],
|
||||
},
|
||||
fields: [],
|
||||
activityGroupList: [],
|
||||
signUpDialog: false,
|
||||
|
||||
userScopeIndex: 0,
|
||||
|
||||
unionUserNumCalc: [{}],
|
||||
unionUserNumOneKeyRatio: null,
|
||||
|
||||
summaryCount: 0,
|
||||
|
||||
moreInfoDrawer: false,
|
||||
moreInfoRow: {},
|
||||
moreInfoIndex: 0,
|
||||
placeSearchComponent: null,
|
||||
addressValue: '',
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
unionUserNumCalcTips() {
|
||||
return this.unionUserNumCalc.map(v => {
|
||||
return (v.startNum ? v.startNum : '?') + '-' + (v.endNum ? v.endNum : '?') + '人的分工会,限报' + (v.resultNum ? v.resultNum : '?') + '人'
|
||||
})
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
openMoreInfo(row, index) {
|
||||
this.moreInfoRow = row
|
||||
this.moreInfoIndex = index
|
||||
this.moreInfoDrawer = true
|
||||
},
|
||||
openSetUpUserScope(index) {
|
||||
const id = GetQueryString("id")
|
||||
if (id && this.formData.courseList[index].conditionStructure
|
||||
&& this.formData.courseList[index].conditionStructure.conditions.length > 0) {
|
||||
this.conditionStructure = this.formData.courseList[index].conditionStructure
|
||||
} else {
|
||||
this.conditionStructure = {
|
||||
method: "AND",
|
||||
conditions: [{}],
|
||||
}
|
||||
}
|
||||
this.userScopeIndex = index
|
||||
this.$refs.joinCnd.open()
|
||||
},
|
||||
cancel() {
|
||||
sublime.jumpPagePjax('/platform/fellowship/manage/activity')
|
||||
},
|
||||
changeActivity(val) {
|
||||
if (val) {
|
||||
const group = this.activityGroupList.find(v => v.groupId === val)
|
||||
this.$set(this.formData, "activityGroupName", group.groupName)
|
||||
} else {
|
||||
this.$set(this.formData, "activityGroupName", "全部教职工")
|
||||
}
|
||||
},
|
||||
//添加交友联谊
|
||||
addCourse() {
|
||||
this.formData.courseList.push({
|
||||
courseTimeList: [],
|
||||
isMobileSign: false,
|
||||
isReceiveGift: false
|
||||
})
|
||||
},
|
||||
//删除交友联谊
|
||||
async removeTableCourse(index) {
|
||||
const confirm = await this.$confirm('请确认是否删除此' + this.trainType + '?如果该' + this.trainType + '已有报名人员,会随之一起删除!确定吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
})
|
||||
if (confirm) {
|
||||
this.formData.courseList.splice(index, 1)
|
||||
}
|
||||
},
|
||||
//培训日期change
|
||||
setUpCourseDataChange(val) {
|
||||
if (!val) {
|
||||
this.formData.courseList[this.courseIndex].courseTimeList = []
|
||||
return
|
||||
}
|
||||
//培训时间日期Set
|
||||
const ctList = new Set(this.formData.courseList[this.courseIndex].courseTimeList.map(v => moment(v.courseDate).format('YYYY-MM-DD')))
|
||||
val.forEach(v => {
|
||||
if (!ctList.has(v)) {
|
||||
this.formData.courseList[this.courseIndex].courseTimeList.push({
|
||||
courseDate: v, courseTime: null
|
||||
})
|
||||
}
|
||||
})
|
||||
const filterCtList = this.formData.courseList[this.courseIndex].courseTimeList.filter(v => {
|
||||
return val.includes(moment(v.courseDate).format('YYYY-MM-DD'))
|
||||
})
|
||||
this.formData.courseList[this.courseIndex].courseTimeList = filterCtList
|
||||
this.formData.courseList[this.courseIndex].courseTimeList.sort((a, b) => {
|
||||
return Date.parse(a['courseDate']) - Date.parse(b['courseDate'])
|
||||
})
|
||||
},
|
||||
//设置课程时间确定
|
||||
doConfirmSetUpCourse() {
|
||||
const courseTableData = this.formData.courseList[this.courseIndex].courseTimeList
|
||||
if (courseTableData.length === 0) {
|
||||
this.$message.warning('请填写时间!')
|
||||
return
|
||||
}
|
||||
if (courseTableData && courseTableData.length > 0) {
|
||||
const valid = courseTableData.every(v => v.courseStartTime && v.courseEndTime && (v.courseStartTime < v.courseEndTime))
|
||||
if (!valid) {
|
||||
this.$message.warning('时间填写不完整或者有误!')
|
||||
return
|
||||
}
|
||||
this.setUpCourseDialog = false
|
||||
}
|
||||
|
||||
},
|
||||
//打开设置课程时间
|
||||
openSetUpCourseTime(index) {
|
||||
if (!this.formData.activitySignTime) {
|
||||
this.$message.warning('请先设置活动报名起止时间')
|
||||
return
|
||||
}
|
||||
this.courseIndex = index
|
||||
this.setUpCourseDialog = true
|
||||
},
|
||||
//打开设置分工会人数限制
|
||||
async openSetUpUnionLimit(index) {
|
||||
this.unionLimitIndex = index
|
||||
this.setUpUnionLimitDialog = true
|
||||
if (!this.formData.courseList[this.unionLimitIndex].unionLimit || this.formData.courseList[this.unionLimitIndex].unionLimit.length === 0) {
|
||||
const resp = await $.get('/platform/fellowship/manage/activity/getUnionLimit', {activityScopeId: this.formData.activityGroupId})
|
||||
if (resp.code === 0) {
|
||||
this.$set(this.formData.courseList[this.unionLimitIndex], 'unionLimit', resp.data)
|
||||
}
|
||||
}
|
||||
this.summaryCount = this.formData.courseList[this.unionLimitIndex].unionLimit.reduce((prev, curr) => {
|
||||
console.log(curr)
|
||||
const value = Number(curr.limitCount);
|
||||
if (!isNaN(value)) {
|
||||
return prev + curr.limitCount;
|
||||
} else {
|
||||
return prev;
|
||||
}
|
||||
}, 0)
|
||||
},
|
||||
unionLimitQuickSetting() {
|
||||
this.unionUserNumCalc.forEach((v, i) => {
|
||||
const startNum = v.startNum
|
||||
const endNum = v.endNum
|
||||
const resultNum = v.resultNum
|
||||
if (startNum > endNum) {
|
||||
this.$message.warning('第' + (i + 1) + '行设置错误')
|
||||
} else {
|
||||
this.formData.courseList[this.unionLimitIndex].unionLimit.forEach(x => {
|
||||
if (x.teacherCount >= startNum && x.teacherCount <= endNum) {
|
||||
x.limitCount = resultNum
|
||||
}
|
||||
})
|
||||
this.calSummaryCount()
|
||||
}
|
||||
})
|
||||
},
|
||||
doConfirmSetUpUnionLimit() {
|
||||
if (this.summaryCount <= 0) {
|
||||
this.formData.courseList[this.moreInfoIndex].unionLimit = []
|
||||
}
|
||||
this.setUpUnionLimitDialog = false
|
||||
/*if (this.formData.courseList[this.unionLimitIndex].unionLimit) {
|
||||
const totalLimit = this.formData.courseList[this.unionLimitIndex].unionLimit.map(v => v.limitCount).reduce((a, b) => a + b)
|
||||
console.log(totalLimit)
|
||||
this.formData.courseList[this.unionLimitIndex].coursePeopleNumber = totalLimit
|
||||
}*/
|
||||
},
|
||||
//应用比例设置
|
||||
applyScaleSettings() {
|
||||
this.formData.courseList[this.unionLimitIndex].unionLimit.forEach(v => {
|
||||
v.limitCount = parseFloat((v.teacherCount * this.unionUserNumOneKeyRatio / 100).toFixed(0))
|
||||
if (v.ratio) {
|
||||
v.limitCount = parseFloat((v.teacherCount * v.ratio / 100).toFixed(0))
|
||||
}
|
||||
})
|
||||
this.calSummaryCount()
|
||||
},
|
||||
async clearUnionLimit() {
|
||||
const confirm = await this.$confirm('确定要清空分工会人数限制吗, 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
})
|
||||
if ('confirm' === confirm) {
|
||||
this.formData.courseList[this.unionLimitIndex].unionLimit = []
|
||||
this.unionUserNumOneKeyRatio = null
|
||||
this.unionUserNumCalc = [{}]
|
||||
this.setUpUnionLimitDialog = false
|
||||
}
|
||||
},
|
||||
//设置签到点位
|
||||
openMap(index) {
|
||||
this.mapIndex = index
|
||||
this.mapDialog = true
|
||||
this.$nextTick(() => {
|
||||
map = new AMap.Map("signMap", {
|
||||
resizeEnable: true,
|
||||
center: [pointX, pointY],
|
||||
zoom: 16
|
||||
})
|
||||
this.placeSearchComponent = new AMap.PlaceSearch({
|
||||
// city 指定搜索所在城市,支持传入格式有:城市名、citycode和adcode
|
||||
city: ''
|
||||
})
|
||||
const coordinateArray = this.formData.courseList[this.mapIndex].courseLocationCoordinates
|
||||
this.clearMarker()
|
||||
this.createMarker(coordinateArray)
|
||||
map.on('click', (e) => {
|
||||
this.clearMarker()
|
||||
const position = [e.lnglat.getLng(), e.lnglat.getLat()]
|
||||
this.createMarker(position)
|
||||
this.formData.courseList[this.mapIndex].courseLocationCoordinates = position
|
||||
})
|
||||
})
|
||||
},
|
||||
handleSelect(item) {
|
||||
if (item.location) {
|
||||
//定位到中心点
|
||||
map.setCenter(item.location);
|
||||
//TODO 获取数据,对数据进行操作如:添加marker等
|
||||
this.clearMarker()
|
||||
this.createMarker(item.location)
|
||||
this.formData.courseList[this.mapIndex].courseLocationCoordinates = [item.location.lng, item.location.lat]
|
||||
}
|
||||
},
|
||||
querySearchAsync(queryString, cb) {
|
||||
if (!queryString) {
|
||||
return
|
||||
}
|
||||
this.placeSearchComponent.search(queryString, function (status, result) {
|
||||
// 查询成功时,result即对应匹配的POI信息
|
||||
if (status !== 'error') {
|
||||
result.poiList.pois.forEach(item => {
|
||||
item.value = item.name + '【详细地址:' + item.address + '】'
|
||||
})
|
||||
cb(result.poiList.pois)
|
||||
}
|
||||
})
|
||||
},
|
||||
//删除一行培训时间记录
|
||||
removeSetUpTableCourseRow(row, index) {
|
||||
this.formData.courseList[this.courseIndex].courseTimeList.splice(index, 1)
|
||||
//培训时间列表日期数组
|
||||
const courseDateArray = this.formData.courseList[this.courseIndex].courseTimeList.map(v => moment(v.courseDate).format('YYYY-MM-DD'))
|
||||
//选择课程日期数组
|
||||
const scdList = this.formData.courseList[this.courseIndex].setUpCourseData
|
||||
|
||||
this.formData.courseList[this.courseIndex].setUpCourseData = scdList.filter(v => {
|
||||
return courseDateArray.includes(moment(v).format('YYYY-MM-DD'))
|
||||
})
|
||||
},
|
||||
//清楚签到点位
|
||||
clearMarker() {
|
||||
if (marker) {
|
||||
map.remove(marker)
|
||||
}
|
||||
},
|
||||
//创建签到点位
|
||||
createMarker(position) {
|
||||
marker = new AMap.Marker({
|
||||
position: position,
|
||||
offset: new AMap.Pixel(-13, -30)
|
||||
})
|
||||
map.add(marker)
|
||||
this.getAddress(position)
|
||||
map.setFitView(null, false, [150, 60, 100, 60]);
|
||||
},
|
||||
getAddress() {
|
||||
|
||||
},
|
||||
courseOrderNumChange() {
|
||||
this.formData.courseList = this.formData.courseList.sort((a, b) => a.orderNum - b.orderNum)
|
||||
},
|
||||
//提交
|
||||
async doHandle() {
|
||||
const valid = await this.$refs['form'].validate()
|
||||
if (valid) {
|
||||
const courseValid = this.formData.courseList.some((v, i) => {
|
||||
const basicValid = v.courseName && v.coursePeopleNumber && v.campus
|
||||
&& v.courseLocation && v.courseInstructor && v.courseType
|
||||
const timeValid = v.courseTimeList.length > 0 && v.courseTimeList.every(x => {
|
||||
return x.courseStartTime && x.courseEndTime && (x.courseStartTime < x.courseEndTime)
|
||||
})
|
||||
|
||||
if (!timeValid) {
|
||||
this.$message.warning('第' + (i + 1) + '行' + this.trainType + '时间填写有误,请核查!')
|
||||
return true
|
||||
}
|
||||
if (!basicValid) {
|
||||
this.$message.warning('第' + (i + 1) + '行' + this.trainType + '信息填写有误,请核查!')
|
||||
return true
|
||||
}
|
||||
if (v.isMobileSign === true && (v.courseLocationCoordinates === undefined || v.courseLocationCoordinates.length < 2)) {
|
||||
this.$message.warning('第' + (i + 1) + '行' + this.trainType + '地点坐标填写有误,请核查!')
|
||||
return true
|
||||
}
|
||||
if (v.isMobileSign === true && (v.signType === '' || v.signType === undefined)) {
|
||||
this.$message.warning('第' + (i + 1) + '行' + this.trainType + '签到方式填写有误,请核查!')
|
||||
return true
|
||||
}
|
||||
if (v.isReceiveGift === true && (v.giftType === '' || v.giftType === undefined)) {
|
||||
this.$message.warning('第' + (i + 1) + '行' + this.trainType + '领取方式填写有误,请核查!')
|
||||
return true
|
||||
}
|
||||
return false
|
||||
})
|
||||
if (courseValid) {
|
||||
return
|
||||
}
|
||||
if (this.formData.restrictLimit === 2) {
|
||||
if (this.formData.typeLimits.length === 0) {
|
||||
this.$notify({title: '警告', type: 'warning', message: '请设置报名限制!'});
|
||||
return
|
||||
}
|
||||
}
|
||||
this.changeActivity(this.formData.activityGroupId)
|
||||
const cloneData = clone(this.formData)
|
||||
//cloneData.conditionStructure.conditions = cloneData.conditionStructure.conditions.filter(v => v.field && v.fieldObj && v.operational && v.value)
|
||||
|
||||
if (cloneData.cover && cloneData.cover.length > 0) {
|
||||
cloneData.cover = cloneData.cover[0]
|
||||
}
|
||||
if (cloneData.wechat && cloneData.wechat.length > 0) {
|
||||
cloneData.wechat = cloneData.wechat[0]
|
||||
}
|
||||
cloneData.activitySignUpStartTime = cloneData.activitySignTime[0]
|
||||
cloneData.activitySignUpEndTime = cloneData.activitySignTime[1]
|
||||
cloneData.activityStartTime = cloneData.activityTime[0]
|
||||
cloneData.activityEndTime = cloneData.activityTime[1]
|
||||
cloneData.year = new Date(cloneData.activityStartTime).getFullYear()
|
||||
|
||||
/*const limitNumArray = []
|
||||
this.formData.typeLimits.forEach(item => {
|
||||
limitNumArray.push({
|
||||
typeId: item.id,
|
||||
limitNum: item.limitNum
|
||||
})
|
||||
})*/
|
||||
const limitNumArray = []
|
||||
this.formData.typeLimits.forEach(item => {
|
||||
if (item.typeId === '' || item.typeId === undefined) {
|
||||
limitNumArray.push({
|
||||
typeId: item.id,
|
||||
limitNum: item.limitNum
|
||||
})
|
||||
} else {
|
||||
limitNumArray.push(item)
|
||||
}
|
||||
})
|
||||
cloneData.typeLimits = limitNumArray
|
||||
|
||||
const resp = await $.post('/platform/fellowship/manage/activity/doHandle', {data: JSON.stringify(cloneData)})
|
||||
if (resp.code === 0) {
|
||||
this.$notify({
|
||||
title: '成功',
|
||||
message: resp.msg,
|
||||
type: 'success',
|
||||
duration: 500,
|
||||
onClose: () => {
|
||||
sublime.jumpPagePjax('/platform/fellowship/manage/activity')
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
async initData() {
|
||||
const id = GetQueryString("id")
|
||||
if (id) {
|
||||
const resp = await $.get('/platform/fellowship/manage/activity/findOne', {id})
|
||||
if (resp.code === 0) {
|
||||
resp.data.cover = [resp.data.cover]
|
||||
if (resp.data.wechat) {
|
||||
resp.data.wechat = [resp.data.wechat]
|
||||
}
|
||||
this.formData = resp.data
|
||||
const type = this.trainTypeList.find(o => o.code === this.formData.trainType)
|
||||
this.trainType = type ? type.name : '交友联谊'
|
||||
this.$nextTick(() => {
|
||||
$("#introduce").html("")
|
||||
var editor = new E("#introduce")
|
||||
editor.config.onchange = (html) => {
|
||||
this.formData.introduce = html.replace(/<p\><\/p>/g, '')
|
||||
}
|
||||
editor.create()
|
||||
editor.txt.html(resp.data.introduce)
|
||||
})
|
||||
}
|
||||
} else {
|
||||
this.$nextTick(() => {
|
||||
$("#introduce").html("")
|
||||
var editor = new E("#introduce")
|
||||
editor.config.onchange = (html) => {
|
||||
this.formData.introduce = html.replace(/<p\><\/p>/g, '')
|
||||
}
|
||||
editor.create()
|
||||
})
|
||||
}
|
||||
},
|
||||
async initCnd() {
|
||||
const userState = await getDictByCode('userState')
|
||||
const personType = await getDictByCode('personType')
|
||||
|
||||
const userStateOptions = userState.map(v => {
|
||||
return {label: v.name, value: v.name}
|
||||
})
|
||||
|
||||
const personTypeOptions = personType.map(v => {
|
||||
return {label: v.name, value: v.name}
|
||||
})
|
||||
|
||||
|
||||
this.fields = [
|
||||
{
|
||||
label: '性别',
|
||||
value: 'sex',
|
||||
type: "select",
|
||||
options: [{label: '男', value: '男'}, {label: '女', value: '女'}]
|
||||
},
|
||||
{label: '在职状态', value: 'userState', type: "select", options: userStateOptions},
|
||||
{label: '人员类型', value: 'personType', type: "select", options: personTypeOptions},
|
||||
]
|
||||
},
|
||||
oneKeySetStartEndTime() {
|
||||
const {startTime, endTime} = this.courseTimeOneKeySet
|
||||
this.formData.courseList[this.courseIndex].courseTimeList.forEach(v => {
|
||||
this.$set(v, 'courseStartTime', startTime)
|
||||
this.$set(v, 'courseEndTime', endTime)
|
||||
// if (!v.courseStartTime) {
|
||||
// v.courseStartTime = startTime
|
||||
// }
|
||||
// if (!v.courseEndTime) {
|
||||
// v.courseEndTime = endTime
|
||||
// }
|
||||
})
|
||||
this.$forceUpdate()
|
||||
},
|
||||
doBack() {
|
||||
if (GetQueryString("id") !== '') {
|
||||
sublime.jumpPagePjax('/platform/fellowship/manage/activity')
|
||||
}
|
||||
},
|
||||
async validNumber(row) {
|
||||
if (GetQueryString("id") === '') {
|
||||
if (row.courseReservedNumber > row.coursePeopleNumber) {
|
||||
this.$alert('预留人数不能大于' + this.trainType + '人数!', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
callback: action => {
|
||||
}
|
||||
});
|
||||
row.courseReservedNumber = 0
|
||||
}
|
||||
} else {
|
||||
const registerUserCount = await this.getRegisterUserCount(row.id)
|
||||
if ((row.courseReservedNumber + registerUserCount) > row.coursePeopleNumber) {
|
||||
this.$alert('您设置的' + this.trainType + '人数为' + row.coursePeopleNumber + '人,当前报名人数为' + registerUserCount + '人,预留名额上限为' + (row.coursePeopleNumber - registerUserCount) + '人!', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
callback: action => {
|
||||
}
|
||||
});
|
||||
row.courseReservedNumber = 0
|
||||
}
|
||||
}
|
||||
},
|
||||
//获取交友联谊报名人数
|
||||
async getRegisterUserCount(courseId) {
|
||||
const resp = await $.post('/platform/fellowship/manage/activity/getRegisterUserCount', {courseId})
|
||||
return resp.code === 0 ? resp.data : 0
|
||||
},
|
||||
setSignUpCondition() {
|
||||
|
||||
if (this.formData.courseList !== undefined && this.formData.courseList.length > 0) {
|
||||
const courseValid = this.formData.courseList.some((item, index) => {
|
||||
if (item.courseType === undefined) {
|
||||
this.$notify({
|
||||
title: '警告',
|
||||
type: 'warning',
|
||||
message: '请在' + (index + 1) + '行' + this.trainType + '信息中选择类型!'
|
||||
});
|
||||
return true
|
||||
}
|
||||
return false
|
||||
})
|
||||
if (courseValid) {
|
||||
return
|
||||
}
|
||||
|
||||
const array = [...new Set(this.formData.courseList.map(o => o.courseType))]
|
||||
const typeArray = clone([...this.courseTypeList].filter(x => array.some(y => x.id === y)))
|
||||
const arr = []
|
||||
typeArray.forEach(item => {
|
||||
const t = this.formData.typeLimits.find(o => o.typeId === item.id)
|
||||
if (t) {
|
||||
const type = this.courseTypeList.find(o => o.id === t.typeId)
|
||||
t.code = type.code
|
||||
t.lxname = type.lxname
|
||||
arr.push(t)
|
||||
} else {
|
||||
item.limitNum = 0
|
||||
arr.push(item)
|
||||
}
|
||||
})
|
||||
this.formData.typeLimits = arr
|
||||
|
||||
/*if (GetQueryString("id") === '' || this.formData.typeLimits.length === 0) {
|
||||
const array = [...new Set(this.formData.courseList.map(o => o.courseType))]
|
||||
this.formData.typeLimits = clone([...this.courseTypeList].filter(x => array.some(y => x.id === y)))
|
||||
} else {
|
||||
this.formData.typeLimits.forEach(item => {
|
||||
const type = this.courseTypeList.find(o => o.id === item.typeId)
|
||||
item.code = type.code
|
||||
item.lxname = type.lxname
|
||||
})
|
||||
}*/
|
||||
this.signUpDialog = true
|
||||
} else {
|
||||
this.$notify({
|
||||
title: '警告',
|
||||
type: 'warning',
|
||||
message: '请在' + this.trainType + '信息中选择类型!'
|
||||
});
|
||||
}
|
||||
},
|
||||
doLimitNum() {
|
||||
/* const courseValid = this.formData.typeLimits.some((item, index) => {
|
||||
if(item.limitNum === 0) {
|
||||
this.$notify({title: '警告', type: 'warning', message: '第'+ (index + 1) +'行限制个数不能为0!'});
|
||||
return true
|
||||
}
|
||||
return false
|
||||
})
|
||||
if(courseValid) {
|
||||
return
|
||||
}*/
|
||||
this.signUpDialog = false
|
||||
},
|
||||
cancelLimitNum() {
|
||||
//this.formData.typeLimits.forEach(item => item.limitNum = 0)
|
||||
this.signUpDialog = false
|
||||
},
|
||||
async getAllType() {
|
||||
const resp = await $.post('/platform/fellowship/manage/type/getAllType', {})
|
||||
return resp.data
|
||||
},
|
||||
calSummaryCount() {
|
||||
const array = this.formData.courseList[this.unionLimitIndex].unionLimit
|
||||
if (array) {
|
||||
this.summaryCount = array.reduce((prev, curr) => {
|
||||
const value = Number(curr.limitCount);
|
||||
if (!isNaN(value)) {
|
||||
return prev + curr.limitCount;
|
||||
} else {
|
||||
return prev;
|
||||
}
|
||||
}, 0)
|
||||
}
|
||||
},
|
||||
typeChange(val) {
|
||||
const type = this.trainTypeList.find(o => o.code === val)
|
||||
this.trainType = type ? type.name : ''
|
||||
}
|
||||
},
|
||||
async created() {
|
||||
await this.initCnd()
|
||||
this.trainTypeList = await getDictOptions("fellowshipType")
|
||||
if (this.trainTypeList && this.trainTypeList.length > 0) {
|
||||
this.formData.trainType = this.trainTypeList[0].code
|
||||
this.typeChange(this.trainTypeList[0].code)
|
||||
}
|
||||
await this.initData()
|
||||
this.activityGroupList = await getActivityGroup()
|
||||
this.campusList = await getCampus()
|
||||
this.courseTypeList = await this.getAllType()
|
||||
},
|
||||
watch: {
|
||||
'formData.restrictLimit'(val) {
|
||||
if (GetQueryString("id") === '') {
|
||||
this.formData.limitNum = val === 3 ? 1 : ''
|
||||
}
|
||||
},
|
||||
conditionStructure(val) {
|
||||
this.formData.courseList[this.userScopeIndex].conditionStructure = val
|
||||
},
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user