first commit
This commit is contained in:
@@ -0,0 +1,111 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
<div id="app" v-cloak>
|
||||
<el-card shadow="never">
|
||||
<el-form :model="msgForm" label-width="120px" ref="msgFormRef" style="max-width: 760px;">
|
||||
<el-form-item label="自动发送标题" prop="title"
|
||||
:rules="[{required: true, message: '请输入自动发送标题', trigger: ['blur', 'change']}]">
|
||||
<el-input v-model="msgForm.title" placeholder="请输入自动发送标题"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="自动发送内容" prop="content"
|
||||
:rules="[{required: true, message: '请输入自动发送内容', trigger: ['blur', 'change']}]">
|
||||
<el-input v-model="msgForm.content" type="textarea" :rows="4" placeholder="请输入自动发送内容"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button :loading="msgLoading" @click="saveMsgConfig" type="primary">保存发送文案</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
|
||||
<el-card shadow="never" class="mt10" v-if="isSuperAdmin">
|
||||
<table-tool :app="this" label="自动任务列表(仅超级管理员可见)"></table-tool>
|
||||
<el-table :data="tasks" border style="width: 100%">
|
||||
<el-table-column label="任务名称" prop="name" align="center" header-align="center" width="180"></el-table-column>
|
||||
<el-table-column label="任务说明" prop="note" align="center" header-align="center" min-width="220"></el-table-column>
|
||||
<el-table-column label="执行类" prop="jobClass" align="center" header-align="center" min-width="280" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column label="执行周期" align="center" header-align="center" min-width="220">
|
||||
<template slot-scope="{row}">
|
||||
<el-input v-model="row.cron" size="small"></el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="是否禁用" align="center" header-align="center" width="120">
|
||||
<template slot-scope="{row}">
|
||||
<el-switch v-model="row.disabled"></el-switch>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" header-align="center" width="120">
|
||||
<template slot-scope="{row}">
|
||||
<el-button :loading="row.loading" @click="saveTask(row)" type="primary" size="mini">保存</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-card>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
new Vue({
|
||||
el: '#app',
|
||||
data() {
|
||||
return {
|
||||
isSuperAdmin: "${@shiro.hasRole('sysadmin')}" === 'true',
|
||||
msgLoading: false,
|
||||
msgForm: {
|
||||
title: '',
|
||||
content: ''
|
||||
},
|
||||
tasks: []
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async getData() {
|
||||
const resp = await $.post('/platform/staffManage/birthday/autoSend/getData')
|
||||
if (resp.code === 0) {
|
||||
const data = resp.data || {}
|
||||
this.msgForm.title = data.title || ''
|
||||
this.msgForm.content = data.content || ''
|
||||
this.tasks = (data.tasks || []).map(item => ({ ...item, loading: false }))
|
||||
}
|
||||
},
|
||||
async saveMsgConfig() {
|
||||
const valid = await this.$refs.msgFormRef.validate()
|
||||
if (!valid) return
|
||||
this.msgLoading = true
|
||||
const resp = await $.post('/platform/staffManage/birthday/autoSend/saveMsgConfig', this.msgForm)
|
||||
this.msgLoading = false
|
||||
if (resp.code === 0) {
|
||||
this.$message.success('保存成功')
|
||||
} else {
|
||||
this.$message.error(resp.msg)
|
||||
}
|
||||
},
|
||||
saveTask(row) {
|
||||
this.$confirm('确定要保存该自动任务配置吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(async () => {
|
||||
row.loading = true
|
||||
const resp = await $.post('/platform/staffManage/birthday/autoSend/saveTask', {
|
||||
id: row.id,
|
||||
cron: row.cron,
|
||||
disabled: row.disabled
|
||||
})
|
||||
row.loading = false
|
||||
if (resp.code === 0) {
|
||||
this.$message.success('保存成功')
|
||||
this.getData()
|
||||
} else {
|
||||
this.$message.error(resp.msg)
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getData()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,145 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
<div id="app" v-cloak>
|
||||
<el-card shadow="never">
|
||||
<el-form :model="formData" label-width="120px" ref="formRef" style="max-width: 720px;">
|
||||
<el-form-item label="背景图片" prop="picUrl">
|
||||
<image-Upload :file-size="5"
|
||||
:file-type="['png','jpg']"
|
||||
:height="100"
|
||||
:limit="1"
|
||||
:width="100"
|
||||
ref="picUpload"
|
||||
v-model="formData.picUrl"></image-Upload>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="生日贺卡" prop="birthdayUrl">
|
||||
<image-Upload :file-size="5"
|
||||
:file-type="['png','jpg']"
|
||||
:height="100"
|
||||
:limit="1"
|
||||
:width="100"
|
||||
ref="birthdayUpload"
|
||||
v-model="formData.birthdayUrl"></image-Upload>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="生日倒计时" prop="birthdayDays">
|
||||
<el-input-number v-model="formData.birthdayDays"
|
||||
:min="1"
|
||||
:precision="0"
|
||||
:step="1"
|
||||
controls-position="right"
|
||||
placeholder="请输入生日倒计时天数"
|
||||
style="width: 220px;"></el-input-number>
|
||||
<span style="margin-left: 8px;">天</span>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="自动发送祝福" prop="autoSendEnabled">
|
||||
<el-switch v-model="formData.autoSendEnabled"
|
||||
:disabled="autoSendConfirming"
|
||||
@change="handleAutoSendEnabledChange"
|
||||
active-text="开启"
|
||||
inactive-text="关闭"></el-switch>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item>
|
||||
<el-button :loading="loading" @click="doSubmit" type="primary">保存配置</el-button>
|
||||
<el-button @click="openH5">预览手机端H5</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
new Vue({
|
||||
el: '#app',
|
||||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
autoSendConfirming: false,
|
||||
savedAutoSendEnabled: true,
|
||||
formData: {
|
||||
id: '',
|
||||
picUrl: '',
|
||||
birthdayUrl: '',
|
||||
birthdayDays: 15,
|
||||
autoSendEnabled: true
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handleAutoSendEnabledChange(val) {
|
||||
if (this.autoSendConfirming) {
|
||||
return
|
||||
}
|
||||
const oldVal = !val
|
||||
this.autoSendConfirming = true
|
||||
this.$confirm('确定要' + (val ? '开启' : '关闭') + '自动发送祝福吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.autoSendConfirming = false
|
||||
}).catch(() => {
|
||||
this.formData.autoSendEnabled = oldVal
|
||||
this.$nextTick(() => {
|
||||
this.autoSendConfirming = false
|
||||
})
|
||||
})
|
||||
},
|
||||
async getConfig() {
|
||||
const resp = await $.post('/platform/staffManage/birthday/config/getConfig')
|
||||
if (resp.code === 0) {
|
||||
const data = resp.data || {}
|
||||
const autoSendEnabled = data.autoSendEnabled !== false
|
||||
this.formData = {
|
||||
id: data.config ? data.config.id : '',
|
||||
picUrl: data.config ? data.config.picUrl : '',
|
||||
birthdayUrl: data.config ? data.config.birthdayUrl : '',
|
||||
birthdayDays: Number(data.birthdayDays || 15),
|
||||
autoSendEnabled: autoSendEnabled
|
||||
}
|
||||
this.savedAutoSendEnabled = autoSendEnabled
|
||||
}
|
||||
},
|
||||
async doSubmit() {
|
||||
if (this.formData.autoSendEnabled !== this.savedAutoSendEnabled) {
|
||||
try {
|
||||
await this.$confirm('自动发送祝福将' + (this.formData.autoSendEnabled ? '开启' : '关闭') + ',是否继续保存?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
})
|
||||
} catch (e) {
|
||||
return
|
||||
}
|
||||
}
|
||||
this.$confirm('确定要保存生日祝福系统配置吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(async () => {
|
||||
this.loading = true
|
||||
const resp = await $.post('/platform/staffManage/birthday/config/saveConfig', this.formData)
|
||||
this.loading = false
|
||||
if (resp.code === 0) {
|
||||
this.$message.success('保存成功,手机端H5将同步使用最新配置')
|
||||
this.getConfig()
|
||||
} else {
|
||||
this.$message.error(resp.msg)
|
||||
}
|
||||
})
|
||||
},
|
||||
openH5() {
|
||||
window.open('/platform/staffManage/birthday/manage/h5', '_blank')
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getConfig()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,104 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
<style>
|
||||
.birthday-search {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.birthday-search .search-item,
|
||||
.birthday-search .search-query {
|
||||
box-sizing: border-box;
|
||||
flex: 0 0 25%;
|
||||
max-width: 25%;
|
||||
}
|
||||
|
||||
.birthday-search .search-item-label {
|
||||
min-width: 70px;
|
||||
}
|
||||
</style>
|
||||
<div id="app" v-cloak>
|
||||
<guava ref="guava">
|
||||
<el-card shadow="never">
|
||||
<common-query ref="commonQueryRef" @search="search"></common-query>
|
||||
</el-card>
|
||||
|
||||
<el-card shadow="never" class="mt10">
|
||||
<table-tool :app="this" :label="tableToolLabel">
|
||||
<template #func>
|
||||
<el-button type="primary" size="small" @click="doExport">导出当前列表</el-button>
|
||||
</template>
|
||||
</table-tool>
|
||||
<el-table :data="tableData" :size="tableSize" @sort-change="pageOrder" ref="table"
|
||||
row-key="id" style="width: 100%">
|
||||
<el-table-column :index="indexMethod"
|
||||
align="center"
|
||||
header-align="center"
|
||||
label="序号" type="index" width="80px"></el-table-column>
|
||||
<el-table-column :label="column.label"
|
||||
align="center"
|
||||
:prop="column.prop"
|
||||
:sortable="column.sortable"
|
||||
:width="column.width"
|
||||
header-align="center"
|
||||
min-width="100px"
|
||||
show-overflow-tooltip
|
||||
v-for="column in tableColumns">
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--#include("/layouts/pagination.html"){}#-->
|
||||
</el-card>
|
||||
</guava>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
<!--#include("/platform/staffmanage/birthday/manage/commonQuery.js"){}#-->
|
||||
|
||||
new Vue({
|
||||
el: '#app',
|
||||
mixins: [initTableMixins],
|
||||
data() {
|
||||
return {
|
||||
pageForm: {},
|
||||
tableColumns: [
|
||||
{ prop: "campusName", label: "校区", sortable: true },
|
||||
{ prop: "loginname", label: "工号", sortable: true },
|
||||
{ prop: "username", label: "姓名", sortable: true },
|
||||
{ prop: "sex", label: "性别", sortable: true },
|
||||
{ prop: "mobile", label: "联系方式", sortable: true },
|
||||
{ prop: "birthday", label: "出生年月", sortable: true },
|
||||
{ prop: "daysUntilBirthday", label: "生日倒计时(天)", sortable: true },
|
||||
{ prop: "userState", label: "在职状态", sortable: true, width: "100px" },
|
||||
{ prop: "personType", label: "人员类型", sortable: true, width: "120px" },
|
||||
{ prop: "unionname", label: "所属工会", sortable: true, width: "160px" },
|
||||
{ prop: "unitname", label: "所属单位", sortable: true, width: "160px" }
|
||||
],
|
||||
}
|
||||
},
|
||||
components: {
|
||||
'common-query': COMMON_QUERY,
|
||||
},
|
||||
computed: {
|
||||
tableToolLabel() {
|
||||
return '生日人员导出(默认展示当月的数据,搜索会忽略年份)'
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
doExport() {
|
||||
const query = $.param(this.pageForm)
|
||||
window.location.href = "/platform/staffManage/birthday/export/doExport" + (query ? "?" + query : "")
|
||||
},
|
||||
search(pageForm) {
|
||||
this.pageForm = { ...this.pageForm, ...pageForm }
|
||||
this.pageData()
|
||||
},
|
||||
},
|
||||
async created() {
|
||||
this.pageData()
|
||||
},
|
||||
})
|
||||
</script>
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,166 @@
|
||||
const COMMON_QUERY = {
|
||||
template: /*language=HTML*/ `
|
||||
<div class="search birthday-search">
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">校区</div>
|
||||
<div class="search-item-option">
|
||||
<el-select v-model="pageForm.campus" style="width: 100%">
|
||||
<el-option :key="item.campus_id"
|
||||
:label="item.campus_name"
|
||||
:value="item.campus_name"
|
||||
v-for="item in campusList"></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"></el-input>
|
||||
</div>
|
||||
</div>
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">所属工会</div>
|
||||
<div class="search-item-option">
|
||||
<el-select @change="flushUnits" @clear="flushUnits" clearable filterable
|
||||
placeholder="请选择所属工会" style="width: 100%;" 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>
|
||||
<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.unitId">
|
||||
<el-option :key="item.id" :label="item.name" :value="item.id"
|
||||
v-for="item in units"></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.userStates" style="width: 100%" placeholder="在职状态" @change="doSearch"
|
||||
clearable filterable multiple>
|
||||
<el-option :key="item.code" :label="item.name" :value="item.name"
|
||||
v-for="item in userStateOptions"></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.personTypes" style="width: 100%" placeholder="人员类型" @change="doSearch"
|
||||
clearable filterable multiple>
|
||||
<el-option :key="item.code" :label="item.name" :value="item.name"
|
||||
v-for="item in personTypeOptions"></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">生日日期</div>
|
||||
<div class="search-item-option">
|
||||
<el-date-picker :picker-options="pickerOptions" @change="changeDateRangeChange"
|
||||
align="right" end-placeholder="结束日期" format="yyyy-MM-dd"
|
||||
range-separator="-" start-placeholder="开始日期" style="width: 100%"
|
||||
type="datetimerange" v-model="pageForm.changeDateRange"
|
||||
value-format="yyyy-MM-dd"></el-date-picker>
|
||||
</div>
|
||||
</div>
|
||||
<div class="search-query">
|
||||
<el-button type="primary" icon="el-icon-search" @click="doSearch">搜索</el-button>
|
||||
</div>
|
||||
</div>
|
||||
`,
|
||||
data() {
|
||||
return {
|
||||
pickerOptions: {
|
||||
shortcuts: [
|
||||
{
|
||||
text: "未来一周",
|
||||
onClick(picker) {
|
||||
const end = new Date()
|
||||
const start = new Date()
|
||||
end.setTime(start.getTime() + 3600 * 1000 * 24 * 7)
|
||||
picker.$emit("pick", [start, end])
|
||||
}
|
||||
},
|
||||
{
|
||||
text: "未来一个月",
|
||||
onClick(picker) {
|
||||
const end = new Date()
|
||||
const start = new Date()
|
||||
end.setTime(start.getTime() + 3600 * 1000 * 24 * 30)
|
||||
picker.$emit("pick", [start, end])
|
||||
}
|
||||
},
|
||||
{
|
||||
text: "未来三个月",
|
||||
onClick(picker) {
|
||||
const end = new Date()
|
||||
const start = new Date()
|
||||
end.setTime(start.getTime() + 3600 * 1000 * 24 * 90)
|
||||
picker.$emit("pick", [start, end])
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
unions: [],
|
||||
units: [],
|
||||
userStateOptions: [],
|
||||
personTypeOptions: [],
|
||||
pageForm: {
|
||||
searchKeyword: '',
|
||||
unionId: '',
|
||||
unitId: '',
|
||||
userStates: [],
|
||||
personTypes: [],
|
||||
changeDateRange: [],
|
||||
},
|
||||
campusList: []
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
doSearch(){
|
||||
const pageForm = clone(this.pageForm)
|
||||
pageForm.userStates = JSON.stringify(this.pageForm.userStates)
|
||||
pageForm.personTypes = JSON.stringify(this.pageForm.personTypes)
|
||||
this.$emit('search', pageForm)
|
||||
},
|
||||
changeDateRangeChange(val){
|
||||
if (val && val.length > 0) {
|
||||
this.pageForm.startDate = val[0]
|
||||
this.pageForm.endDate = val[1]
|
||||
} else {
|
||||
this.pageForm.startDate = null
|
||||
this.pageForm.endDate = null
|
||||
}
|
||||
this.doSearch()
|
||||
},
|
||||
async initData(){
|
||||
if ("${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')||@shiro.hasRole('H03')||@shiro.hasRole('SchoolUnionAdmin')||@shiro.hasRole('SchoolUnionMemberAdmin')}" === 'true') {
|
||||
this.unions = await getUnions(null, false)
|
||||
this.units = await getUnits()
|
||||
} else {
|
||||
this.unions = await getUnions(null, true)
|
||||
this.$set(this.pageForm, 'unionId', this.unions && this.unions.length ? this.unions[0].id : null)
|
||||
await this.flushUnits()
|
||||
}
|
||||
this.userStateOptions = await getDictOptions("UserState")
|
||||
this.personTypeOptions = await getDictOptions("UserType")
|
||||
},
|
||||
async flushUnits(){
|
||||
this.$set(this.pageForm, "unitId", null)
|
||||
this.units = []
|
||||
if (this.pageForm.unionId) {
|
||||
this.units = await getUnits(this.pageForm.unionId)
|
||||
}
|
||||
}
|
||||
},
|
||||
async created() {
|
||||
this.initData()
|
||||
this.campusList = await getCampus()
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,335 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
<style>
|
||||
.birthday-search {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.birthday-search .search-item,
|
||||
.birthday-search .search-query {
|
||||
box-sizing: border-box;
|
||||
flex: 0 0 25%;
|
||||
max-width: 25%;
|
||||
}
|
||||
|
||||
.birthday-search .search-item-label {
|
||||
min-width: 70px;
|
||||
}
|
||||
</style>
|
||||
<div id="app" v-cloak>
|
||||
<guava ref="guava">
|
||||
<el-card shadow="never">
|
||||
<common-query ref="commonQueryRef" @search="search"></common-query>
|
||||
</el-card>
|
||||
|
||||
<el-card shadow="never" class="mt10">
|
||||
<table-tool :app="this" :label="tableToolLabel">
|
||||
<template #func>
|
||||
<el-button type="primary" size="small" @click="openSendMsgByQuery">发送通知</el-button>
|
||||
</template>
|
||||
</table-tool>
|
||||
<el-table :data="tableData" :size="tableSize" @sort-change="pageOrder" ref="table"
|
||||
row-key="id" style="width: 100%">
|
||||
<el-table-column :index="indexMethod"
|
||||
align="center"
|
||||
header-align="center"
|
||||
label="序号" type="index" width="80px"></el-table-column>
|
||||
<el-table-column :label="column.label"
|
||||
align="center"
|
||||
:prop="column.prop"
|
||||
:sortable="column.sortable"
|
||||
:width="column.width"
|
||||
header-align="center"
|
||||
min-width="100px"
|
||||
show-overflow-tooltip
|
||||
v-for="column in tableColumns">
|
||||
</el-table-column>
|
||||
<el-table-column align="center" fixed="right" label="操作" width="250px">
|
||||
<template slot-scope="{row}">
|
||||
<el-button @click="openView(row)" size="mini" type="primary">人员信息</el-button>
|
||||
<el-button @click="openSendMsgByUser(row)" size="mini" type="primary">发送通知</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--#include("/layouts/pagination.html"){}#-->
|
||||
</el-card>
|
||||
|
||||
<template #view>
|
||||
<member-info ref="memberInfoRef"></member-info>
|
||||
</template>
|
||||
</guava>
|
||||
|
||||
<el-dialog
|
||||
:close-on-click-modal="false"
|
||||
:visible.sync="sendMsgByQueryDialogVisible"
|
||||
title="请在下方填写需要发送的内容"
|
||||
width="50%"
|
||||
>
|
||||
<el-form :model="sendMsgByQueryFormData" label-width="80px" ref="sendMsgByQueryForm">
|
||||
|
||||
<el-form-item
|
||||
:rules="[{required: true, message: '请输入发送标题', trigger: ['blur', 'change']}]"
|
||||
label="发送标题"
|
||||
prop="title">
|
||||
<el-input
|
||||
:rows="6"
|
||||
placeholder="请输入发送标题"
|
||||
v-model="sendMsgByQueryFormData.title">
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item
|
||||
:rules="[{required: true, message: '请选择发送内容', trigger: ['blur', 'change']}]"
|
||||
label="发送内容"
|
||||
prop="content">
|
||||
<el-input
|
||||
:rows="6"
|
||||
placeholder="请输入内容"
|
||||
type="textarea"
|
||||
v-model="sendMsgByQueryFormData.content">
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
|
||||
</el-form>
|
||||
<span class="dialog-footer" slot="footer">
|
||||
<el-button @click="sendMsgByQueryDialogVisible = false">取 消</el-button>
|
||||
<el-button @click="sendMsgByQueryUsers" type="primary">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 根据行内数据发送消息 -->
|
||||
<el-dialog
|
||||
:close-on-click-modal="false"
|
||||
:visible.sync="sendMsgByUserDialogVisible"
|
||||
title="请在下方填写需要发送的内容"
|
||||
width="50%"
|
||||
>
|
||||
<el-form :model="sendMsgByUserFormData" label-width="80px" ref="sendForm">
|
||||
<el-form-item label="发送对象" prop="userInfo">
|
||||
<el-input placeholder="请输入发送对象" readonly v-model="sendMsgByUserFormData.userInfo"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
:rules="[{required: true, message: '请输入发送标题', trigger: ['blur', 'change']}]"
|
||||
label="发送标题"
|
||||
prop="title">
|
||||
<el-input
|
||||
placeholder="请输入发送标题"
|
||||
v-model="sendMsgByUserFormData.title">
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item
|
||||
:rules="[{required: true, message: '请选择发送内容', trigger: ['blur', 'change']}]"
|
||||
label="发送内容"
|
||||
prop="content">
|
||||
<el-input
|
||||
:rows="6"
|
||||
placeholder="请输入内容"
|
||||
type="textarea"
|
||||
v-model="sendMsgByUserFormData.content">
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<span class="dialog-footer" slot="footer">
|
||||
<el-button @click="sendMsgByUserDialogVisible = false">取 消</el-button>
|
||||
<el-button @click="sendMsgByUser" type="primary">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
|
||||
|
||||
<el-dialog
|
||||
:close-on-click-modal="false"
|
||||
:visible.sync="dialogVisible"
|
||||
title="生日贺卡图片设置"
|
||||
width="50%"
|
||||
>
|
||||
<el-form :model="formData" label-width="80px" ref="formRef">
|
||||
<el-form-item label="背景图片" prop="picUrl">
|
||||
<image-Upload :file-size="5"
|
||||
:file-type="['png','jpg']"
|
||||
:height="100"
|
||||
:limit="1"
|
||||
:width="100"
|
||||
ref="imageUpload"
|
||||
v-model="formData.picUrl"></image-Upload>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="贺卡图片" prop="birthdayUrl">
|
||||
<image-Upload :file-size="5"
|
||||
:file-type="['png','jpg']"
|
||||
:height="100"
|
||||
:limit="1"
|
||||
:width="100"
|
||||
ref="imageUpload"
|
||||
v-model="formData.birthdayUrl"></image-Upload>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<span class="dialog-footer" slot="footer">
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
<el-button @click="doSubmit" type="primary">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
|
||||
</div>
|
||||
|
||||
<script>
|
||||
<!--#include("commonQuery.js"){}#-->
|
||||
<!--#include("/platform/member/common/memberInfo.js"){}#-->
|
||||
|
||||
new Vue({
|
||||
el: '#app',
|
||||
mixins: [initTableMixins],
|
||||
data() {
|
||||
return {
|
||||
pageForm: {},
|
||||
|
||||
tableColumns: [
|
||||
{ prop: "loginname", label: "工号", sortable: true },
|
||||
{ prop: "username", label: "姓名", sortable: true },
|
||||
{ prop: "sex", label: "性别", sortable: true },
|
||||
{ prop: "mobile", label: "联系方式", sortable: true },
|
||||
{ prop: "birthday", label: "出生年月", sortable: true },
|
||||
{ prop: "daysUntilBirthday", label: "生日倒计时(天)", sortable: true },
|
||||
{ prop: "userState", label: "在职状态", sortable: true, width: "100px" },
|
||||
{ prop: "personType", label: "人员类型", sortable: true, width: "120px" },
|
||||
{ prop: "unionname", label: "所属工会", sortable: true, width: "160px" },
|
||||
{ prop: "unitname", label: "所属单位", sortable: true, width: "160px" }
|
||||
],
|
||||
|
||||
// 根据查询条件推送消息相关
|
||||
sendMsgByQueryDialogVisible: false,
|
||||
sendMsgByQueryFormData: {},
|
||||
|
||||
// 根据行内发送消息相关
|
||||
sendMsgByUserDialogVisible: false,
|
||||
sendMsgByUserFormData: {},
|
||||
|
||||
// 图片配置
|
||||
dialogVisible: false,
|
||||
formData: {
|
||||
picUrl: '',
|
||||
birthdayUrl: ''
|
||||
},
|
||||
|
||||
}
|
||||
},
|
||||
components: {
|
||||
'common-query': COMMON_QUERY,
|
||||
'member-info': MEMBER_INFO,
|
||||
},
|
||||
computed: {
|
||||
tableToolLabel() {
|
||||
return '数据列表(默认展示当月的数据,搜索会忽略年份)'
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async openPicSet() {
|
||||
const resp = await $.post('/platform/staffManage/birthday/manage/getConfig')
|
||||
if (resp.code === 0) {
|
||||
this.formData = resp.data
|
||||
}
|
||||
this.dialogVisible = true
|
||||
},
|
||||
|
||||
doSubmit() {
|
||||
this.$confirm('确定要提交吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(async () => {
|
||||
const resp = await $.post('/platform/staffManage/birthday/manage/saveOrModifyConfig', this.formData)
|
||||
if (resp.code === 0) {
|
||||
this.$message.success('保存成功')
|
||||
this.dialogVisible = false
|
||||
} else {
|
||||
this.$message.error(resp.msg)
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
openSendMsgByUser(row) {
|
||||
this.sendMsgByUserFormData.userId = row.id
|
||||
this.sendMsgByUserFormData.userInfo = row.username
|
||||
this.fillSendMsgConfig(this.sendMsgByUserFormData)
|
||||
this.sendMsgByUserDialogVisible = true
|
||||
},
|
||||
async sendMsgByUser() {
|
||||
const valid = await this.$refs['sendForm'].validate()
|
||||
if (!valid) return
|
||||
const confirm = await this.$confirm('您确定要向' + this.sendMsgByUserFormData.userInfo + '数据发送信息吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonTest: '取消',
|
||||
type: 'warning'
|
||||
})
|
||||
if (confirm === "confirm") {
|
||||
const resp = await $.post('/platform/staffManage/birthday/manage/sendMsgByUser',
|
||||
this.sendMsgByUserFormData
|
||||
)
|
||||
if (resp.code === 0) {
|
||||
this.sendMsgByUserDialogVisible = false
|
||||
this.$message.success(resp.msg)
|
||||
} else {
|
||||
this.$message.warning(resp.msg)
|
||||
}
|
||||
}
|
||||
},
|
||||
openSendMsgByQuery() {
|
||||
this.sendMsgByQueryFormData = JSON.parse(JSON.stringify(this.pageForm))
|
||||
this.fillSendMsgConfig(this.sendMsgByQueryFormData)
|
||||
this.sendMsgByQueryDialogVisible = true
|
||||
},
|
||||
fillSendMsgConfig(formData) {
|
||||
$.post('/platform/staffManage/birthday/manage/getSendMsgConfig')
|
||||
.then((resp) => {
|
||||
if (resp.code === 0) {
|
||||
const data = resp.data || {}
|
||||
this.$set(formData, 'title', data.title || '')
|
||||
this.$set(formData, 'content', data.content || '')
|
||||
}
|
||||
})
|
||||
.always(() => {
|
||||
})
|
||||
},
|
||||
async sendMsgByQueryUsers() {
|
||||
const valid = await this.$refs['sendMsgByQueryForm'].validate()
|
||||
if (!valid) return
|
||||
const confirm = await this.$confirm('您确定根据查询条件发送信息吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonTest: '取消',
|
||||
type: 'warning'
|
||||
})
|
||||
if (confirm === "confirm") {
|
||||
const resp = await $.post('/platform/staffManage/birthday/manage/sendMsgByQueryUsers', this.sendMsgByQueryFormData)
|
||||
if (resp.code === 0) {
|
||||
this.sendMsgByQueryDialogVisible = false
|
||||
this.$message.success(resp.msg)
|
||||
} else {
|
||||
this.$message.warning(resp.msg)
|
||||
}
|
||||
}
|
||||
},
|
||||
doExport() {
|
||||
const query = $.param(this.pageForm)
|
||||
window.location.href = "/platform/staffManage/birthday/manage/doExport" + (query ? "?" + query : "")
|
||||
},
|
||||
openView(row) {
|
||||
this.$refs.guava.view()
|
||||
this.$nextTick(() => {
|
||||
this.$refs.memberInfoRef.onOpen(row.id)
|
||||
})
|
||||
},
|
||||
search(pageForm){
|
||||
this.pageForm = { ...this.pageForm, ...pageForm }
|
||||
this.pageData()
|
||||
},
|
||||
},
|
||||
async created() {
|
||||
this.pageData()
|
||||
},
|
||||
})
|
||||
</script>
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,72 @@
|
||||
const COMMON_QUERY = {
|
||||
template: /*language=HTML*/ `
|
||||
<div class="search">
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">姓名/工号</div>
|
||||
<div class="search-item-option">
|
||||
<el-input placeholder="请输入姓名或工号查询" clearable v-model="pageForm.searchKeyword"></el-input>
|
||||
</div>
|
||||
</div>
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">所属工会</div>
|
||||
<div class="search-item-option">
|
||||
<el-select @change="flushUnits" @clear="flushUnits" clearable filterable
|
||||
placeholder="请选择所属工会" style="width: 100%;" 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>
|
||||
<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.unitId">
|
||||
<el-option :key="item.id" :label="item.name" :value="item.id"
|
||||
v-for="item in units"></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="search-query">
|
||||
<el-button type="primary" icon="el-icon-search" @click="doSearch">搜索</el-button>
|
||||
</div>
|
||||
</div>
|
||||
`,
|
||||
data() {
|
||||
return {
|
||||
|
||||
unions: [],
|
||||
units: [],
|
||||
pageForm: {
|
||||
searchKeyword: '',
|
||||
unionId: '',
|
||||
unitId: '',
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
doSearch(){
|
||||
this.$emit('search', this.pageForm)
|
||||
},
|
||||
async initData(){
|
||||
if ("${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')||@shiro.hasRole('H03')||@shiro.hasRole('SchoolUnionAdmin')||@shiro.hasRole('SchoolUnionMemberAdmin')}" === 'true') {
|
||||
this.unions = await getUnions(null, false)
|
||||
this.units = await getUnits()
|
||||
} else {
|
||||
this.unions = await getUnions(null, true)
|
||||
this.$set(this.pageForm, 'unionId', this.unions && this.unions.length ? this.unions[0].id : null)
|
||||
await this.flushUnits()
|
||||
}
|
||||
},
|
||||
async flushUnits(){
|
||||
this.$set(this.pageForm, "unitId", null)
|
||||
this.units = []
|
||||
if (this.pageForm.unionId) {
|
||||
this.units = await getUnits(this.pageForm.unionId)
|
||||
}
|
||||
}
|
||||
},
|
||||
async created() {
|
||||
this.initData()
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
<div id="app">
|
||||
<guava ref="guava">
|
||||
<el-card shadow="never">
|
||||
<common-query ref="commonQuery" @search="search"></common-query>
|
||||
</el-card>
|
||||
|
||||
<el-card shadow="never" class="mt10">
|
||||
<table-tool :app="this" label="数据列表">
|
||||
<template #func>
|
||||
<!-- <el-button type="primary" size="small" @click="doExport">导出Excel</el-button>-->
|
||||
</template>
|
||||
</table-tool>
|
||||
<el-table :data="tableData" :size="tableSize" @sort-change="pageOrder" ref="table"
|
||||
row-key="id" style="width: 100%">
|
||||
<el-table-column :index="indexMethod"
|
||||
align="center"
|
||||
header-align="center"
|
||||
label="序号" type="index" width="80px"></el-table-column>
|
||||
<el-table-column :label="column.label"
|
||||
align="center"
|
||||
:prop="column.prop"
|
||||
:sortable="column.sortable"
|
||||
:width="column.width"
|
||||
header-align="center"
|
||||
min-width="100px"
|
||||
show-overflow-tooltip
|
||||
v-for="column in tableColumns">
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--#include("/layouts/pagination.html"){}#-->
|
||||
</el-card>
|
||||
</guava>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
<!--#include("commonQuery.js"){}#-->
|
||||
|
||||
new Vue({
|
||||
el: '#app',
|
||||
mixins: [initTableMixins],
|
||||
data(){
|
||||
return{
|
||||
pageForm: {},
|
||||
|
||||
tableColumns: [
|
||||
{ prop: "loginname", label: "工号", sortable: true },
|
||||
{ prop: "username", label: "姓名", sortable: true },
|
||||
{ prop: "unionName", label: "所属工会", sortable: true, width: "160px" },
|
||||
{ prop: "unitName", label: "所属单位", sortable: true, width: "160px" },
|
||||
{ prop: "msgTitle", label: "消息标题", sortable: true },
|
||||
{ prop: "msgContent", label: "消息内容", sortable: true },
|
||||
{ prop: "pushByName", label: "推送人", sortable: true },
|
||||
{ prop: "pushTime", label: "推送时间", sortable: true },
|
||||
{ prop: "pushType", label: "推送类型", sortable: true },
|
||||
],
|
||||
}
|
||||
},
|
||||
components: {
|
||||
'common-query': COMMON_QUERY,
|
||||
},
|
||||
methods: {
|
||||
doExport(){
|
||||
|
||||
},
|
||||
search(pageForm){
|
||||
this.pageForm = { ...this.pageForm, ...pageForm }
|
||||
this.pageData()
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.pageData()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
Reference in New Issue
Block a user