Files
UNION_NJUST/target/classes/static/components/diseaseaid/aidfund/Search.vue
T
2026-09-23 09:38:39 +08:00

189 lines
5.2 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<template>
<el-card shadow="never">
<div class="search">
<slot name="before"></slot>
<div v-if="has_year" class="search-item">
<div class="search-item-label">年度:</div>
<div class="search-item-option">
<el-date-picker
v-model="value.year"
placeholder="选择年"
style="width: 100%" type="year"
value-format="yyyy" @change="doSearch">
</el-date-picker>
</div>
</div>
<div class="search-item">
<div class="search-item-option" style="width: 100%">
<el-input v-model="value.searchKeyword" clearable placeholder="请输入内容"
style="width: 100%" @keyup.enter.native="doSearch">
<el-select slot="prepend" v-model="value.searchName" style="width:100px;">
<el-option label="姓名" value="username"></el-option>
<el-option label="工号" value="loginname"></el-option>
</el-select>
</el-input>
</div>
</div>
<div class="search-item">
<div class="search-item-label">人员类型:</div>
<div class="search-item-option">
<dict-select v-model="value.personType" clearable code="UserType"
placeholder="人员类型"
style="width: 100%" @change="doSearch"></dict-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="value.union" clearable filterable placeholder="请选择"
style="width: 100%" @change="getUnits">
<el-option
v-for="item in unions"
: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-select v-model="value.unit" clearable filterable placeholder="请选择"
style="width: 100%" @change="doSearch">
<el-option
v-for="item in units"
: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 v-model="value.userState" clearable code="userState"
placeholder="在职状态"
style="width: 100%" @change="doSearch"></dict-select>
</div>
</div>
<div v-if="is_join" class="search-item">
<div class="search-item-label">变更类型:</div>
<div class="search-item-option">
<el-select v-model="value.isJoin" clearable filterable placeholder="请选择"
style="width: 100%" @change="doSearch">
<el-option
v-for="item in changeType"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</div>
</div>
<slot name="rear"></slot>
</template>
<div class="search-query">
<el-button icon="el-icon-search" type="primary" @click="doSearch">搜索</el-button>
<more v-model="searchMore"></more>
</div>
</div>
</el-card>
</template>
<script>
module.exports = {
components: {
'dict-select': httpVueLoader('/components/plugins/DictSelect.vue?v=1.0.0'),
},
props: {
value: {type: Object},
has_year: {
type: Boolean,
default: false
},
is_join: {
type: Boolean,
default: false
},
judgment_hgh: {type: Boolean, default: false},
ltxgbc: {type: Boolean, default: false},
unionid: {type: String, default: ""},
},
model: {
prop: 'value',
event: 'search'
},
data() {
return {
searchMore: false,
units: [],
unions: [],
JoinType: [
{
id: "1",
name: '加入基金'
},
{
id: "0",
name: '退出基金'
}
],
changeType: [
{id: 1, name: '会员新增'},
{id: 2, name: '工号变更'},
{id: 3, name: '会员退休'},
{id: 4, name: '自愿退出'},
{id: 5, name: '会员去世'},
{id: 6, name: '离职'}
]
}
},
methods: {
doSearch() {
this.$emit("search", this.value)
},
async getUnits() {
this.$set(this.value, "unit", "")
this.units = await getUnits(this.value.union)
},
},
async created() {
// if (!this.judgment_hgh) {
// this.unions = await getUnionList(this.unionid)
// this.value.union = this.unions[0].id
// } else {
// this.unions = await getUnionList()
// }
this.unions = await getUnionList()
this.getUnits()
this.doSearch()
}
}
</script>
<style scoped>
</style>