change
This commit is contained in:
@@ -0,0 +1,330 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
<div id="app" v-cloak>
|
||||
<guava ref="guava">
|
||||
<template>
|
||||
<el-card shadow="never">
|
||||
<search @search="searchBirthday">
|
||||
<search-item label="姓名/工号">
|
||||
<el-input v-model="pageForm.searchKeyword" clearable placeholder="请输入姓名或工号"></el-input>
|
||||
</search-item>
|
||||
<search-item label="所属工会">
|
||||
<el-select v-model="pageForm.unionId" clearable filterable placeholder="请选择所属工会"
|
||||
style="width:100%" @change="handleUnionChange" @clear="handleUnionChange">
|
||||
<el-option v-for="item in unions" :key="item.id" :label="item.name" :value="item.id"></el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
<search-item label="所属单位">
|
||||
<el-select v-model="pageForm.unitId" clearable filterable placeholder="请选择所属单位" style="width:100%">
|
||||
<el-option v-for="item in units" :key="item.id" :label="item.name" :value="item.id"></el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
<search-item label="在职状态">
|
||||
<dict-select v-model="queryForm.userStates" code="USER_STATE" multiple placeholder="请选择在职状态"></dict-select>
|
||||
</search-item>
|
||||
<search-item label="人员类型">
|
||||
<dict-select v-model="queryForm.personTypes" code="USER_PERSON_TYPE" multiple placeholder="请选择人员类型"></dict-select>
|
||||
</search-item>
|
||||
<search-item label="人员性质">
|
||||
<dict-select v-model="queryForm.preparedBys" code="PREPARED_BY" multiple placeholder="请选择人员性质"></dict-select>
|
||||
</search-item>
|
||||
<search-item label="生日日期">
|
||||
<el-date-picker v-model="birthdayRange" type="daterange" value-format="yyyy-MM-dd"
|
||||
range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期"
|
||||
style="width:100%" @change="handleBirthdayRangeChange"></el-date-picker>
|
||||
</search-item>
|
||||
</search>
|
||||
</el-card>
|
||||
|
||||
<el-card shadow="never" class="mt10">
|
||||
<table-tool label="生日人员(默认展示未来15天,日期查询忽略年份)"
|
||||
:columns.sync="tableColumns">
|
||||
<el-button size="small" type="primary" @click="doExport">导出Excel</el-button>
|
||||
<el-button size="small" type="primary" @click="openSendByQuery">发送通知</el-button>
|
||||
<el-button size="small" type="primary" @click="openConfig">配置图片</el-button>
|
||||
</table-tool>
|
||||
<el-table ref="table" v-loading="tableLoading" :data="tableData" :size="tableSize"
|
||||
row-key="id" style="width:100%" @sort-change="pageOrder">
|
||||
<el-table-column :index="indexMethod" label="序号" type="index" width="70" align="center"></el-table-column>
|
||||
<el-table-column v-for="column in tableColumns" v-if="column.visible !== false"
|
||||
:key="column.prop" :prop="column.prop"
|
||||
:label="column.label" :width="column.width" :fixed="column.fixed"
|
||||
:sortable="column.sortable"
|
||||
header-align="center" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column fixed="right" label="操作" width="210" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-button size="mini" type="primary" @click="openView(scope.row)">人员信息</el-button>
|
||||
<el-button size="mini" type="primary" @click="openSendByUser(scope.row)">发送通知</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--#include("/layouts/pagination.html"){}#-->
|
||||
</el-card>
|
||||
</template>
|
||||
|
||||
<template #view>
|
||||
<member-info ref="memberInfoRef"></member-info>
|
||||
</template>
|
||||
</guava>
|
||||
|
||||
<el-dialog title="按查询条件发送生日通知" :visible.sync="sendQueryDialogVisible"
|
||||
:close-on-click-modal="false" width="50%" @close="closeSendByQuery">
|
||||
<el-form ref="sendQueryFormRef" :model="sendQueryForm" label-width="90px">
|
||||
<el-form-item label="发送标题" prop="title"
|
||||
:rules="[{required:true,message:'请输入发送标题',trigger:['blur','change']}]">
|
||||
<el-input v-model="sendQueryForm.title" maxlength="255" placeholder="请输入发送标题"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="发送内容" prop="content"
|
||||
:rules="[{required:true,message:'请输入发送内容',trigger:['blur','change']}]">
|
||||
<el-input v-model="sendQueryForm.content" type="textarea" :rows="6" placeholder="请输入发送内容"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<span slot="footer">
|
||||
<el-button @click="closeSendByQuery">取消</el-button>
|
||||
<el-button type="primary" :loading="formLoading" @click="sendByQuery">确定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog title="向单个用户发送生日通知" :visible.sync="sendUserDialogVisible"
|
||||
:close-on-click-modal="false" width="50%" @close="closeSendByUser">
|
||||
<el-form ref="sendUserFormRef" :model="sendUserForm" label-width="90px">
|
||||
<el-form-item label="发送对象">
|
||||
<el-input v-model="sendUserForm.userInfo" readonly></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="发送标题" prop="title"
|
||||
:rules="[{required:true,message:'请输入发送标题',trigger:['blur','change']}]">
|
||||
<el-input v-model="sendUserForm.title" maxlength="255" placeholder="请输入发送标题"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="发送内容" prop="content"
|
||||
:rules="[{required:true,message:'请输入发送内容',trigger:['blur','change']}]">
|
||||
<el-input v-model="sendUserForm.content" type="textarea" :rows="6" placeholder="请输入发送内容"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<span slot="footer">
|
||||
<el-button @click="closeSendByUser">取消</el-button>
|
||||
<el-button type="primary" :loading="formLoading" @click="sendByUser">确定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog title="生日祝福页面图片配置" :visible.sync="configDialogVisible"
|
||||
:close-on-click-modal="false" width="50%" @close="closeConfig">
|
||||
<el-form ref="configFormRef" :model="configForm" label-width="110px">
|
||||
<el-form-item label="页面背景图片" prop="picUrl">
|
||||
<file-upload :value.sync="configForm.picUrl" :upload_number="1" upload_mode="image"
|
||||
accept=".jpg,.jpeg,.png" upload_result_category="interval"></file-upload>
|
||||
<div class="text-muted">建议使用竖版生日主题图片。</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="福利贺卡图片" prop="birthdayUrl">
|
||||
<file-upload :value.sync="configForm.birthdayUrl" :upload_number="1" upload_mode="image"
|
||||
accept=".jpg,.jpeg,.png" upload_result_category="interval"></file-upload>
|
||||
<div class="text-muted">移动端点击“领取生日福利”后展示该图片。</div>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<span slot="footer">
|
||||
<el-button @click="closeConfig">取消</el-button>
|
||||
<el-button type="primary" :loading="formLoading" @click="saveConfig">保存</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</div>
|
||||
|
||||
<script nonce="${cspNonce!}">
|
||||
<!--#include("/platform/zhgh/staffmanage/member/common/info/memberInfo.js"){}#-->
|
||||
new Vue({
|
||||
el: "#app",
|
||||
store,
|
||||
mixins: [initTableMixins],
|
||||
data() {
|
||||
return {
|
||||
pageForm: {
|
||||
searchKeyword: "",
|
||||
unionId: "",
|
||||
unitId: "",
|
||||
userStates: "[]",
|
||||
personTypes: "[]",
|
||||
preparedBys: "[]",
|
||||
startDate: "",
|
||||
endDate: "",
|
||||
pageNumber: 1,
|
||||
pageSize: 10,
|
||||
totalCount: 0,
|
||||
pageOrderName: "",
|
||||
pageOrderBy: ""
|
||||
},
|
||||
queryForm: {userStates:[],personTypes:[],preparedBys:[]},
|
||||
birthdayRange: [],
|
||||
unions: [],
|
||||
units: [],
|
||||
tableColumns: [
|
||||
{prop:"loginname",label:"工号",sortable:true,width:"120"},
|
||||
{prop:"username",label:"姓名",sortable:true,width:"110"},
|
||||
{prop:"sex",label:"性别",width:"70"},
|
||||
{prop:"mobile",label:"联系方式",width:"130"},
|
||||
{prop:"birthday",label:"出生日期",sortable:true,width:"120"},
|
||||
{prop:"daysUntilBirthday",label:"生日倒计时(天)",sortable:true,width:"150"},
|
||||
{prop:"userState",label:"在职状态",width:"100"},
|
||||
{prop:"personType",label:"人员类型",width:"130"},
|
||||
{prop:"preparedBy",label:"人员性质",width:"130"},
|
||||
{prop:"unionName",label:"所属工会",width:"180"},
|
||||
{prop:"unitName",label:"所属单位",width:"180"}
|
||||
],
|
||||
sendQueryDialogVisible: false,
|
||||
sendQueryForm: {title:"",content:""},
|
||||
sendUserDialogVisible: false,
|
||||
sendUserForm: {userId:"",userInfo:"",title:"",content:""},
|
||||
configDialogVisible: false,
|
||||
configForm: {id:"",picUrl:"",birthdayUrl:""}
|
||||
}
|
||||
},
|
||||
components: {
|
||||
"member-info": MEMBER_INFO
|
||||
},
|
||||
methods: {
|
||||
initOrganizationOptions() {
|
||||
if (this.$auth.hasRoleOr("SYSADMIN, SCHOOL_UNION_ADMIN, SCHOOL_UNION_MEMBER_ADMIN")) {
|
||||
this.$businessTool.listUnion().then((data) => {
|
||||
this.$set(this, "unions", data || [])
|
||||
})
|
||||
this.$businessTool.listUnit().then((data) => {
|
||||
this.$set(this, "units", data || [])
|
||||
})
|
||||
} else {
|
||||
const unionId = this.$store.state.user.union.id
|
||||
this.$businessTool.listUnion(unionId).then((data) => {
|
||||
this.$set(this, "unions", data || [])
|
||||
})
|
||||
this.$businessTool.listUnit(unionId).then((data) => {
|
||||
this.$set(this, "units", data || [])
|
||||
})
|
||||
}
|
||||
},
|
||||
handleUnionChange() {
|
||||
this.$set(this.pageForm, "unitId", "")
|
||||
this.$set(this, "units", [])
|
||||
if (this.pageForm.unionId) {
|
||||
this.$businessTool.listUnit(this.pageForm.unionId).then((data) => {
|
||||
this.$set(this, "units", data || [])
|
||||
})
|
||||
}
|
||||
},
|
||||
handleBirthdayRangeChange(value) {
|
||||
this.$set(this.pageForm, "startDate", value && value.length ? value[0] : "")
|
||||
this.$set(this.pageForm, "endDate", value && value.length ? value[1] : "")
|
||||
this.searchBirthday()
|
||||
},
|
||||
searchBirthday() {
|
||||
this.$set(this.pageForm, "userStates", JSON.stringify(this.queryForm.userStates || []))
|
||||
this.$set(this.pageForm, "personTypes", JSON.stringify(this.queryForm.personTypes || []))
|
||||
this.$set(this.pageForm, "preparedBys", JSON.stringify(this.queryForm.preparedBys || []))
|
||||
this.doSearch()
|
||||
},
|
||||
requestParams() {
|
||||
return clone(this.pageForm)
|
||||
},
|
||||
doExport() {
|
||||
this.$downLoad(loc() + "/doExport", this.requestParams())
|
||||
},
|
||||
openView(row) {
|
||||
this.$refs.guava.view()
|
||||
this.$nextTick(() => {
|
||||
this.$refs.memberInfoRef.onOpen(row.id)
|
||||
})
|
||||
},
|
||||
openSendByQuery() {
|
||||
this.$set(this, "sendQueryForm", Object.assign(this.requestParams(), {title:"",content:""}))
|
||||
this.$set(this, "sendQueryDialogVisible", true)
|
||||
},
|
||||
closeSendByQuery() {
|
||||
this.$set(this, "sendQueryDialogVisible", false)
|
||||
this.$nextTick(() => {
|
||||
if (this.$refs.sendQueryFormRef) this.$refs.sendQueryFormRef.clearValidate()
|
||||
})
|
||||
},
|
||||
sendByQuery() {
|
||||
this.$refs.sendQueryFormRef.validate((valid) => {
|
||||
if (!valid) return
|
||||
this.$confirm("确定按当前查询条件发送生日通知吗?", "提示", {type:"warning"}).then(() => {
|
||||
this.$set(this, "formLoading", true)
|
||||
this.$axios.post(loc() + "/sendMsgByQueryUsers", this.sendQueryForm).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.$message.success(res.msg)
|
||||
this.closeSendByQuery()
|
||||
} else {
|
||||
this.$message.warning(res.msg)
|
||||
}
|
||||
}).finally(() => {
|
||||
this.$set(this, "formLoading", false)
|
||||
})
|
||||
}).catch(() => {})
|
||||
})
|
||||
},
|
||||
openSendByUser(row) {
|
||||
this.$set(this, "sendUserForm", {userId:row.id,userInfo:row.username + "(" + row.loginname + ")",title:"",content:""})
|
||||
this.$set(this, "sendUserDialogVisible", true)
|
||||
},
|
||||
closeSendByUser() {
|
||||
this.$set(this, "sendUserDialogVisible", false)
|
||||
this.$nextTick(() => {
|
||||
if (this.$refs.sendUserFormRef) this.$refs.sendUserFormRef.clearValidate()
|
||||
})
|
||||
},
|
||||
sendByUser() {
|
||||
this.$refs.sendUserFormRef.validate((valid) => {
|
||||
if (!valid) return
|
||||
this.$confirm("确定向" + this.sendUserForm.userInfo + "发送生日通知吗?", "提示", {type:"warning"}).then(() => {
|
||||
this.$set(this, "formLoading", true)
|
||||
this.$axios.post(loc() + "/sendMsgByUser", this.sendUserForm).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.$message.success(res.msg)
|
||||
this.closeSendByUser()
|
||||
} else {
|
||||
this.$message.warning(res.msg)
|
||||
}
|
||||
}).finally(() => {
|
||||
this.$set(this, "formLoading", false)
|
||||
})
|
||||
}).catch(() => {})
|
||||
})
|
||||
},
|
||||
openConfig() {
|
||||
this.$set(this, "formLoading", true)
|
||||
this.$axios.post(loc() + "/getConfig").then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.$set(this, "configForm", Object.assign({id:"",picUrl:"",birthdayUrl:""}, res.data || {}))
|
||||
this.$set(this, "configDialogVisible", true)
|
||||
} else {
|
||||
this.$message.warning(res.msg)
|
||||
}
|
||||
}).finally(() => {
|
||||
this.$set(this, "formLoading", false)
|
||||
})
|
||||
},
|
||||
closeConfig() {
|
||||
this.$set(this, "configDialogVisible", false)
|
||||
},
|
||||
saveConfig() {
|
||||
this.$confirm("确定保存生日祝福页面配置吗?", "提示", {type:"warning"}).then(() => {
|
||||
this.$set(this, "formLoading", true)
|
||||
this.$axios.post(loc() + "/saveOrModifyConfig", this.configForm).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.$message.success(res.msg)
|
||||
this.$set(this, "configForm", res.data)
|
||||
this.closeConfig()
|
||||
} else {
|
||||
this.$message.warning(res.msg)
|
||||
}
|
||||
}).finally(() => {
|
||||
this.$set(this, "formLoading", false)
|
||||
})
|
||||
}).catch(() => {})
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.initOrganizationOptions()
|
||||
this.pageData()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,112 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
<div id="app" v-cloak>
|
||||
<guava ref="guava">
|
||||
<template>
|
||||
<el-card shadow="never">
|
||||
<search @search="doSearch">
|
||||
<search-item label="姓名/工号">
|
||||
<el-input v-model="pageForm.searchKeyword" clearable placeholder="请输入姓名或工号"></el-input>
|
||||
</search-item>
|
||||
<search-item label="所属工会">
|
||||
<el-select v-model="pageForm.unionId" clearable filterable placeholder="请选择所属工会"
|
||||
style="width:100%" @change="handleUnionChange" @clear="handleUnionChange">
|
||||
<el-option v-for="item in unions" :key="item.id" :label="item.name" :value="item.id"></el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
<search-item label="所属单位">
|
||||
<el-select v-model="pageForm.unitId" clearable filterable placeholder="请选择所属单位" style="width:100%">
|
||||
<el-option v-for="item in units" :key="item.id" :label="item.name" :value="item.id"></el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
</search>
|
||||
</el-card>
|
||||
|
||||
<el-card shadow="never" class="mt10">
|
||||
<table-tool label="生日消息记录" :columns.sync="tableColumns"></table-tool>
|
||||
<el-table ref="table" v-loading="tableLoading" :data="tableData" :size="tableSize"
|
||||
row-key="id" style="width:100%" @sort-change="pageOrder">
|
||||
<el-table-column :index="indexMethod" label="序号" type="index" width="70" align="center"></el-table-column>
|
||||
<el-table-column v-for="column in tableColumns" v-if="column.visible !== false"
|
||||
:key="column.prop" :prop="column.prop"
|
||||
:label="column.label" :width="column.width" :fixed="column.fixed"
|
||||
:sortable="column.sortable"
|
||||
header-align="center" show-overflow-tooltip></el-table-column>
|
||||
</el-table>
|
||||
<!--#include("/layouts/pagination.html"){}#-->
|
||||
</el-card>
|
||||
</template>
|
||||
</guava>
|
||||
</div>
|
||||
|
||||
<script nonce="${cspNonce!}">
|
||||
new Vue({
|
||||
el: "#app",
|
||||
store,
|
||||
mixins: [initTableMixins],
|
||||
data() {
|
||||
return {
|
||||
pageForm: {
|
||||
searchKeyword: "",
|
||||
unionId: "",
|
||||
unitId: "",
|
||||
pageNumber: 1,
|
||||
pageSize: 10,
|
||||
totalCount: 0,
|
||||
pageOrderName: "",
|
||||
pageOrderBy: ""
|
||||
},
|
||||
unions: [],
|
||||
units: [],
|
||||
tableColumns: [
|
||||
{prop:"loginname",label:"工号",sortable:true,width:"120"},
|
||||
{prop:"username",label:"姓名",sortable:true,width:"110"},
|
||||
{prop:"unionName",label:"所属工会",width:"180"},
|
||||
{prop:"unitName",label:"所属单位",width:"180"},
|
||||
{prop:"msgTitle",label:"消息标题",width:"220"},
|
||||
{prop:"msgContent",label:"消息内容",width:"260"},
|
||||
{prop:"pushByName",label:"推送人",width:"120"},
|
||||
{prop:"pushTime",label:"推送时间",sortable:true,width:"170"},
|
||||
{prop:"pushType",label:"推送类型"}
|
||||
]
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
initOrganizationOptions() {
|
||||
if (this.$auth.hasRoleOr("SYSADMIN, SCHOOL_UNION_ADMIN, SCHOOL_UNION_MEMBER_ADMIN")) {
|
||||
this.$businessTool.listUnion().then((data) => {
|
||||
this.$set(this, "unions", data || [])
|
||||
})
|
||||
this.$businessTool.listUnit().then((data) => {
|
||||
this.$set(this, "units", data || [])
|
||||
})
|
||||
} else {
|
||||
const unionId = this.$store.state.user.union.id
|
||||
this.$businessTool.listUnion(unionId).then((data) => {
|
||||
this.$set(this, "unions", data || [])
|
||||
})
|
||||
this.$businessTool.listUnit(unionId).then((data) => {
|
||||
this.$set(this, "units", data || [])
|
||||
})
|
||||
}
|
||||
},
|
||||
handleUnionChange() {
|
||||
this.$set(this.pageForm, "unitId", "")
|
||||
this.$set(this, "units", [])
|
||||
if (this.pageForm.unionId) {
|
||||
this.$businessTool.listUnit(this.pageForm.unionId).then((data) => {
|
||||
this.$set(this, "units", data || [])
|
||||
})
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.initOrganizationOptions()
|
||||
this.pageData()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
Reference in New Issue
Block a user