first commit

This commit is contained in:
2026-09-23 09:38:39 +08:00
commit 98a8b8cace
6257 changed files with 1266718 additions and 0 deletions
@@ -0,0 +1,485 @@
<!--#
layout("/layouts/platform.html"){
#-->
<style>
.el-tabs__content {
padding-top: 20px;
}
.el-icon-close:before {
content: '取消';
color: #f78989;
}
.btnCancel {
background-color: #e6a23c;
color: white;
border-color: #e6a23c;
}
.btnCancel:hover {
background: #ebb563;
border-color: #ebb563;
color: #fff;
}
</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 @keyup.enter.native="doSearch" clearable placeholder="请输入内容"
style="width: 100%"
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="true"
filterable="true"
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="true" filterable="true" placeholder="所属单位"
style="width: 100%;"
v-model="pageForm.unitId">
<el-option :label="item.name" :value="item.id" v-for="item in units"></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.unionGroupId" style="width: 100%"
filterable
clearable
@change="getThreeUnits"
placeholder="请选择">
<el-option
v-for="item in unionGroups"
:key="item.id"
:label="item.groupName"
: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.threeUnitId" style="width: 100%" filterable
clearable
placeholder="请选择">
<el-option
v-for="item in threeUnits"
: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">
<dict-select clearable code="UserType" placeholder="人员类型"
style="width: 100%"
v-model="pageForm.personType"></dict-select>
</div>
</div>
<div class="search-item">
<div class="search-item-label">在职状态:</div>
<div class="search-item-option">
<dict-select clearable code="UserState" placeholder="在职状态"
style="width: 100%"
v-model="pageForm.userState"></dict-select>
</div>
</div>
<div class="search-item">
<div class="search-item-label">会员状态:</div>
<div class="search-item-option">
<dict-select clearable code="memberStatusText" placeholder="会员状态"
style="width: 100%" v-model="pageForm.memberStatus"></dict-select>
</div>
</div>
</template>
<div class="search-query">
<el-button @click="doSearch" icon="el-icon-search" type="primary">搜索</el-button>
<more v-model="searchMore"></more>
</div>
</div>
</el-card>
<el-card class="mt10" shadow="never">
<div class="search" style="position:relative;">
<div class="search-item">
<div class="search-item-label">工号开头:</div>
<div class="search-item-option">
<el-input maxLength="100" placeholder="多个请用英文逗号分隔"
v-model="pageForm.startLoginNames"></el-input>
</div>
</div>
<div class="search-item">
<div class="search-item-label">工号结尾:</div>
<div class="search-item-option">
<el-input maxLength="100" placeholder="多个请用英文逗号分隔"
v-model="pageForm.endLoginNames"></el-input>
</div>
</div>
<div class="search-item" style="width: calc(100% - 160px)">
<div class="search-item-label">人员类型:</div>
<div class="search-item-option">
<el-tag
:effect="pageForm.personTypes.includes(item.name)?'dark':'plain'"
:key="item.code"
:type="item.name"
@click="tagClick('personTypes',item.name)"
style="margin-right: 10px;margin-bottom: 10px;cursor: pointer"
v-for="item in personTypeOptions">
{{ item.name }}
</el-tag>
<el-link :underline="false" @click="pageForm.personTypes=[];doSearch()"
type="danger"
v-if="personTypeOptions.length&&pageForm.personTypes.length">清空
</el-link>
<el-link :underline="false"
@click="pageForm.personTypes=personTypeOptions.map(p=>p.code);doSearch()"
type="success">全部
</el-link>
</div>
</div>
<div class="search-item" style="width: calc(100% - 160px)">
<div class="search-item-label">在职状态:</div>
<div class="search-item-option">
<el-tag
:effect="pageForm.userStates.includes(item.name)?'dark':'plain'"
:key="item.code"
:type="item.name"
@click="tagClick('userStates',item.name)"
style="margin-right: 10px;margin-bottom: 10px;cursor: pointer"
v-for="item in userStateOptions">
{{ item.name }}
</el-tag>
<el-link :underline="false" @click="pageForm.userStates=[];doSearch()"
type="danger"
v-if="userStateOptions.length&&pageForm.userStates.length">清空
</el-link>
<el-link :underline="false"
@click="pageForm.userStates=userStateOptions.map(p=>p.code);doSearch()"
type="success">全部
</el-link>
</div>
</div>
<div class="search-query" style="position:absolute;right: 0;bottom: 0">
<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="setBirthdayByIdCard" size="mini" type="primary">
根据身份证设置生日
</el-button>
<el-tooltip content="温馨提醒:设置会员前,请事先更新基础数据" placement="top">
<el-button @click="setMember" size="mini" type="primary">
设置会员
</el-button>
</el-tooltip>
<el-tooltip content="温馨提醒:设置福利会员前,请事先更新基础数据" placement="top">
<el-button @click="setWelfareMember" size="mini" type="primary">
设置福利会员
</el-button>
</el-tooltip>
</template>
</table-tool>
<el-table :data="tableData" :size="tableSize" @sort-change="pageOrder" class="vi-table"
row-key="id" style="width: 100%" 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 tableColumns"
>
<template scope="{row:{type}}" v-if="column.prop=='type'">
{{changeType[type]}}
</template>
<template scope="{row}" v-else-if="column.prop==='unitname'">
{{isDisPlayCode?'('+row.unitcode+')':null}}{{row.unitname}}
</template>
<template scope="{row}" v-else-if="column.prop==='unionname'">
{{isDisPlayCode?'('+row.unioncode+')':null}}{{row.unionname}}
</template>
<template scope="{row}" v-else-if="column.prop==='member'">
<span class="text-success " v-if="row.member==1">
<i class="fa fa-circle ml5"></i> 是
</span>
<span class="text-danger" v-else>
<i class="fa fa-circle ml5"></i> 否
</span>
</template>
<template scope="{row}" v-else-if="column.prop==='welfareMember'">
<span class="text-success " v-if="row.welfareMember==1">
<i class="fa fa-circle ml5"></i> 是
</span>
<span class="text-danger" v-else>
<i class="fa fa-circle ml5"></i> 否
</span>
</template>
</el-table-column>
<el-table-column align="center" header-align="center" label="操作" prop="userOnline"
width="100px">
<template scope="{row}">
<el-button @click="openView(row.id)" size="mini" type="primary">查看</el-button>
</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 :id="userId" ref="memberInfo" view></member>
</el-tab-pane>
<el-tab-pane label="变更记录" name="change">
<mem-change-records :userid="userId"></mem-change-records>
</el-tab-pane>
</el-tabs>
</template>
</guava>
</div>
<script>
const vue = new Vue({
el: '#app',
mixins: [initTableMixins],
data() {
return {
submitLoading: false,
pageForm: {
userStates: ['在职', '在岗'],
personTypes: [],
},
userId: "",
unions: [],
units: [],
active: 'info',
tableColumns: [
{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: 'threeUnitName', label: '所在科室', sortable: true},
//{prop: 'unionGroupName', label: '工会小组', sortable: true},
{prop: 'member', label: '是否会员', sortable: true},
{prop: 'welfareMember', label: '是否福利会员', sortable: true},
{prop: 'mobile', label: '联系电话'},
{prop: 'birthday', label: '生日'},
{prop: 'campusName', label: '所属校区', sortable: true},
],
setMemberDialogVisible: false,
personTypeOptions: [],
userStateOptions: [],
}
},
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: {
async pageData() {
sublime.showLoadingbar()
this.tableLoading = true
const pageForm = clone(this.pageForm)
pageForm.personTypes = JSON.stringify(pageForm.personTypes)
pageForm.userStates = JSON.stringify(pageForm.userStates)
const {data, code, msg} = await $.post(loc() + '/pageData', pageForm)
this.tableLoading = false
sublime.closeLoadingbar()
if (code === 0) {
this.tableData = data.list
this.pageForm.totalCount = data.totalCount
} else {
this.notifyWarning(msg)
}
},
setBirthdayByIdCard() {
this.$confirm('确定根据身份证设置生日吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(async () => {
const resp = await $.post(loc() + "/setBirthdayByIdCard")
if (resp.code === 0) {
this.pageData()
this.notifySuccess(resp.msg)
} else {
this.notifyWarning(resp.msg)
}
})
},
tagClick(key, val) {
const index = this.pageForm[key].findIndex(v => v === val)
if (index > -1) {
this.pageForm[key].splice(index, 1)
} else {
this.pageForm[key].push(val)
}
this.doSearch()
},
async setMember() {
this.$confirm("<i class='el-icon-s-help' style='margin-right: 6px;'></i>" +
"如果先清空已有数据,后更新,请选择<span style='color: red'>更新</span>" +
"<span style='font-weight: bolder'>(这将清空目前所有的会员,请谨慎操作!)</span>" +
"<br/>" +
"<i class='el-icon-s-help' style='margin-right: 6px;'></i>" +
"如果追加或更新数据,请选择<span style='color: red'>追加</span>", '提示', {
confirmButtonText: '更新',
cancelButtonText: '追加',
dangerouslyUseHTMLString: true,
distinguishCancelAndClose: true,
cancelButtonClass: 'btnCancel',
type: 'warning'
}).then(async () => {
await this.setMemberDo(true)
}).catch(async action => {
if (action === 'cancel') {
await this.setMemberDo(false)
}
})
},
async setMemberDo(confirm) {
const pageForm = clone(this.pageForm)
pageForm.personTypes = JSON.stringify(pageForm.personTypes)
pageForm.userStates = JSON.stringify(pageForm.userStates)
pageForm.confirm = confirm
const resp = await $.post(loc() + "/setMemberByCnd", pageForm)
if (resp.code === 0) {
this.pageData()
this.notifySuccess(resp.msg)
} else {
this.notifyWarning(resp.msg)
}
},
setWelfareMember() {
this.$confirm("<i class='el-icon-s-help' style='margin-right: 6px;'></i>" +
"如果先清空已有数据,后更新,请选择<span style='color: red'>更新</span>" +
"<span style='font-weight: bolder'>(这将清空目前所有的福利会员,请谨慎操作!)</span>" +
"<br/>" +
"<i class='el-icon-s-help' style='margin-right: 6px;'></i>" +
"如果追加或更新数据,请选择<span style='color: red'>追加</span>", '提示', {
confirmButtonText: '更新',
cancelButtonText: '追加',
dangerouslyUseHTMLString: true,
distinguishCancelAndClose: true,
cancelButtonClass: 'btnCancel',
type: 'warning'
}).then(async () => {
await this.setWelfareMemberDo(true)
}).catch(async action => {
if (action === 'cancel') {
await this.setWelfareMemberDo(false)
}
})
},
async setWelfareMemberDo(confirm) {
const pageForm = clone(this.pageForm)
pageForm.personTypes = JSON.stringify(pageForm.personTypes)
pageForm.userStates = JSON.stringify(pageForm.userStates)
pageForm.confirm = confirm
const resp = await $.post(loc() + "/setWelfareMemberByCnd", pageForm)
if (resp.code === 0) {
this.pageData()
this.notifySuccess(resp.msg)
} else {
this.notifyWarning(resp.msg)
}
},
openView(userId) {
this.active = 'info'
this.userId = userId
this.$refs.guava.view()
},
async flushUnits() {
this.$set(this.pageForm, "unitId", null)
this.$set(this.pageForm, "unionGroupId", null)
this.$set(this.pageForm, "threeUnitId", null)
this.units = []
this.unionGroups = []
this.threeUnits = []
if (this.pageForm.unionId) {
this.units = await getUnits(this.pageForm.unionId)
this.unionGroups = await unionGroupsByUnionId(this.pageForm.unionId)
}
},
},
async created() {
this.pageData();
this.personTypeOptions = await getDictOptions("UserType")
this.userStateOptions = await getDictOptions("UserState")
if ("${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')||@shiro.hasRole('H03')}" === 'true') {
this.unions = await getUnions(null, false)
} else {
this.unions = await getUnions(null, true)
this.$set(this.pageForm, 'unionId', this.unions ? this.unions[0].id : null)
this.flushUnits()
}
}
})
</script>
<!--#
}
#-->