264 lines
7.7 KiB
Vue
264 lines
7.7 KiB
Vue
<template>
|
||
|
||
<div>
|
||
|
||
<div class="search-fixed">
|
||
<van-dropdown-menu class="slide-dropdown">
|
||
<van-dropdown-item v-model="pageForm.year" :options="yearList" @change="getEvaluateByYear"></van-dropdown-item>
|
||
<van-dropdown-item v-model="pageForm.evaluateId" :options="evaluateList" @change="doSearch"></van-dropdown-item>
|
||
<van-dropdown-item v-model="pageForm.unionId" :options="unionList" @change="unionChange"></van-dropdown-item>
|
||
<van-dropdown-item v-model="pageForm.unitId" :options="unitList" @change="doSearch"></van-dropdown-item>
|
||
<van-dropdown-item v-model="pageForm.honorType" :options="honorTypeList" @change="doSearch"></van-dropdown-item>
|
||
</van-dropdown-menu>
|
||
</div>
|
||
|
||
<van-notice-bar
|
||
left-icon="volume-o" mode="closeable"
|
||
text="温馨提示:左滑上面的条件区域可根据更多的筛选条件查询。"
|
||
/>
|
||
|
||
<div style="overflow: scroll; height: 100%">
|
||
<van-list v-model="tableLoading" :finished="finished" @load="pageData"
|
||
v-if="tableData && tableData.length>0" :finished-text="tableData.length > 0 ? '没有更多了' : ''">
|
||
<div class="van-doc-card" v-for="o in tableData">
|
||
<div class="title">
|
||
<span class="title_span">|</span>
|
||
<span>{{ o.userName + '(' + o.loginname + ')' }}</span>
|
||
</div>
|
||
<div style="margin-top: 10px">
|
||
<span class="text-grey">评优评先:</span>
|
||
<span>{{ o.evaluateName }}</span>
|
||
</div>
|
||
<div>
|
||
<span class="text-grey">所属单位:</span>
|
||
<span>{{ o.unitName }}</span>
|
||
</div>
|
||
<div>
|
||
<span class="text-grey">所属工会:</span>
|
||
<span>{{ o.unionName }}</span>
|
||
</div>
|
||
<div>
|
||
<span class="text-grey">申请时间:</span>
|
||
<span>{{ o.applyTime }}</span>
|
||
</div>
|
||
<div class="text-right">
|
||
<van-button size="small" type="info" @click="openView(o)">查看</van-button>
|
||
</div>
|
||
</div>
|
||
</van-list>
|
||
<van-empty v-else description="暂无数据"></van-empty>
|
||
</div>
|
||
|
||
<van-popup v-model="infoShow" position="right" style="height: 100%; width: 100%; background-color: #f6f7f9">
|
||
<van-nav-bar title="详细信息" left-arrow placeholder fixed @click-left="infoShow = false"></van-nav-bar>
|
||
<EvaluateInfo ref="info"></EvaluateInfo>
|
||
</van-popup>
|
||
|
||
</div>
|
||
|
||
</template>
|
||
|
||
<script>
|
||
import initTableMixins from "@/mixins/initTableMixins";
|
||
import EvaluateInfo from "./evaluateInfo.vue";
|
||
|
||
export default {
|
||
name: 'evaluateSummary',
|
||
dicts: ['sys_nation', 'sys_user_sex', 'political_status'],
|
||
components: {EvaluateInfo},
|
||
mixins: [initTableMixins],
|
||
data() {
|
||
return {
|
||
infoShow: false,
|
||
yearList: [],
|
||
unionList: [],
|
||
unitList: [],
|
||
honorTypeList: [],
|
||
pageForm: {
|
||
year: new Date().getFullYear(),
|
||
},
|
||
evaluateList: [],
|
||
}
|
||
},
|
||
methods: {
|
||
openView(row) {
|
||
this.infoShow = true
|
||
this.$nextTick(() => {
|
||
this.$refs.info.getInfo(row.id)
|
||
})
|
||
},
|
||
async pageData() {
|
||
this.tableLoading = true
|
||
const resp = await this.$http.post('/additional/evaluate/evaluateSummary/pageData', this.pageForm, {
|
||
params: {
|
||
year: this.pageForm.year,
|
||
unitId: this.pageForm.unitId,
|
||
unionId: this.pageForm.unionId,
|
||
honorType: this.pageForm.honorType,
|
||
evaluateId: this.pageForm.evaluateId,
|
||
}
|
||
})
|
||
if (resp.code === 200) {
|
||
this.tableData = this.tableData.concat(resp.data.list)
|
||
if (this.tableData.length === resp.data.totalCount) {
|
||
this.finished = true
|
||
} else {
|
||
this.pageForm.pageNumber++
|
||
}
|
||
}
|
||
this.tableLoading = false
|
||
},
|
||
async unionChange() {
|
||
await this.flushUnits()
|
||
this.doSearch()
|
||
},
|
||
async getHonorType() {
|
||
const { data } = await this.$http.get('additional/honor/basicSetting/getData', {
|
||
params: {
|
||
parentId: '69dc3d774bf34ccd838a272d7272ae29'
|
||
}
|
||
})
|
||
this.honorTypeList = data
|
||
this.honorTypeList.forEach(v => {
|
||
v.text = v.name
|
||
v.value = v.id
|
||
})
|
||
this.honorTypeList.unshift({
|
||
text: "全部类型",
|
||
value: null
|
||
})
|
||
},
|
||
async getEvaluateByYear() {
|
||
this.evaluateList = []
|
||
const { data } = await this.$http.get('additional/evaluate/evaluateManage/getEvaluateByYear', {
|
||
params: {
|
||
year: this.pageForm.year
|
||
}
|
||
})
|
||
this.evaluateList = data
|
||
this.evaluateList.forEach(v => {
|
||
v.text = v.evaluateName
|
||
v.value = v.evaluateId
|
||
})
|
||
this.evaluateList.unshift({
|
||
text: "全部活动",
|
||
value: null
|
||
})
|
||
if (this.evaluateList && this.evaluateList.length > 0) {
|
||
this.$set(this.pageForm, 'evaluateId', this.evaluateList[0].value)
|
||
}
|
||
},
|
||
async getUnions() {
|
||
const resp = await this.$http.get('/system/union/listUnionByRole')
|
||
this.unionList = resp.data
|
||
this.unionList.forEach(v => {
|
||
v.text = v.unionName
|
||
v.value = v.id
|
||
})
|
||
this.unionList.unshift({
|
||
text: "全部工会",
|
||
value: null
|
||
})
|
||
},
|
||
async getUnits() {
|
||
const resp = await this.$http.get('/system/dept/listUnitByRole')
|
||
this.unitList = resp.data
|
||
this.unitList.forEach(v => {
|
||
v.text = v.deptName
|
||
v.value = v.deptId
|
||
})
|
||
this.unitList.unshift({
|
||
text: "全部单位",
|
||
value: null
|
||
})
|
||
},
|
||
async getUnitsByUnionId(unionId) {
|
||
const resp = await this.$http.get('/system/dept/listUnitByUnionId', {
|
||
params: {
|
||
unionId
|
||
}
|
||
})
|
||
this.unitList = resp.data
|
||
this.unitList.forEach(v => {
|
||
v.text = v.deptName
|
||
v.value = v.deptId
|
||
})
|
||
this.unitList.unshift({
|
||
text: "全部单位",
|
||
value: null
|
||
})
|
||
if (this.unitList) {
|
||
this.$set(this.pageForm, "unitId", this.unitList[0].value)
|
||
}
|
||
},
|
||
async flushUnits() {
|
||
this.$set(this.pageForm, "unitId", "")
|
||
if (this.$auth.hasRoleOr(['admin', 'A06', 'H03'])) {
|
||
await this.getUnitsByUnionId(this.pageForm.unionId)
|
||
} else {
|
||
await this.getUnitsByUnionId(this.$store.state.user.userInfo.union.id)
|
||
}
|
||
},
|
||
async init() {
|
||
let nowYear = new Date().getFullYear()
|
||
for (let i = nowYear; i >= nowYear - 9; i--) {
|
||
this.yearList.push({
|
||
text: i,
|
||
value: i
|
||
})
|
||
}
|
||
await this.getUnions()
|
||
await this.getUnits()
|
||
if (this.unionList && this.unionList.length > 0) {
|
||
this.$set(this.pageForm, "unionId", this.unionList[0].value)
|
||
}
|
||
if (this.unitList && this.unitList.length > 0) {
|
||
this.$set(this.pageForm, "unitId", this.unitList[0].value)
|
||
}
|
||
await this.getHonorType()
|
||
if (this.honorTypeList && this.honorTypeList.length > 0) {
|
||
this.$set(this.pageForm, 'honorType', this.honorTypeList[0].value)
|
||
}
|
||
await this.getEvaluateByYear()
|
||
if (this.evaluateList && this.evaluateList.length > 0) {
|
||
this.$set(this.pageForm, 'evaluateId', this.evaluateList[0].value)
|
||
}
|
||
},
|
||
},
|
||
async created() {
|
||
await this.init()
|
||
await this.pageData()
|
||
},
|
||
onLoad() {
|
||
uni.$on('refreshData', res => {
|
||
this.doSearch()
|
||
})
|
||
}
|
||
}
|
||
</script>
|
||
|
||
<style scoped>
|
||
.van-button {
|
||
width: 56px;
|
||
height: 26px;
|
||
border-radius: 8px;
|
||
}
|
||
|
||
.title_span {
|
||
font-size: 16px;
|
||
font-weight: bold;
|
||
position: absolute;
|
||
left: -1px;
|
||
top: 11px;
|
||
color: #1867b0;
|
||
}
|
||
|
||
.title {
|
||
font-size: 13px;
|
||
font-weight: bold;
|
||
flex: 1;
|
||
overflow: hidden;
|
||
white-space: nowrap;
|
||
}
|
||
</style>
|