Files
UNION_HUTB/target/classes/static/components/medicalaid/MedicalAidSearch.vue
T
2026-09-09 09:14:28 +08:00

120 lines
3.6 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">
<div class="search-item">
<div class="search-item-label">&emsp;&emsp;</div>
<div class="search-item-option">
<el-date-picker
v-model="page_form.year"
type="year"
value-format="yyyy" style="width: 100%"
placeholder="选择年" @change="$emit('search')">
</el-date-picker>
</div>
</div>
<div class="search-item">
<div class="search-item-option" style="width: 100%">
<el-input placeholder="请输入内容" clearable v-model="page_form.searchKeyword"
@keyup.enter.native="$emit('search')">
<el-select v-model="page_form.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>
</div>
<div class="search-item" v-if="has_type">
<div class="search-item-label">补助类型</div>
<div class="search-item-option">
<el-select v-model="page_form.type" style="width: 100%" placeholder="补助类型" clearable @change="$emit('search')"
@clear="$emit('search')">
<el-option
v-for="item in medicalAid.med_types"
:key="item.val"
:label="item.lab"
:value="item.val">
</el-option>
</el-select>
</div>
</div>
<template v-if="searchMore&&has_union">
<div class="search-item">
<div class="search-item-label">所属工会</div>
<div class="search-item-option">
<el-select placeholder="所属工会" v-model="page_form.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="page_form.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>
</template>
<div class="search-query">
<el-button type="primary" icon="el-icon-search" @click="$emit('search')">搜索</el-button>
<more v-model="searchMore" v-if="has_union"></more>
</div>
</div>
</el-card>
</template>
<script>
module.exports = {
props: {
page_form: '',
has_add: {
type: Boolean,
default: false
},
has_type: {
type: Boolean,
default: false
},
has_union: {
type: Boolean,
default: true
},
dis_add: {
type: Boolean,
default: false
}
},
data() {
return {
unions: [],
units: [],
searchMore: false
}
},
watch: {},
methods: {
async flushUnits() {
this.$set(this.page_form, "unitId", "")
this.units = await getUnits(this.page_form.unionId)
}
},
async created() {
this.unions = await getUnions(null)
},
}
</script>
<style>
</style>