291 lines
7.7 KiB
Vue
291 lines
7.7 KiB
Vue
<template>
|
||
|
||
<div>
|
||
|
||
<div class="search-fixed">
|
||
<van-dropdown-menu class="slide-dropdown">
|
||
<van-dropdown-item v-model="pageForm.year" @change="yearChange" :options="yearList"></van-dropdown-item>
|
||
<van-dropdown-item v-model="pageForm.isAudit" @change="yearChange" :options="auditList">
|
||
</van-dropdown-item>
|
||
<van-dropdown-item v-model="pageForm.unionId" @change="yearChange" :options="unionList">
|
||
</van-dropdown-item>
|
||
<van-dropdown-item v-model="pageForm.unitId" @change="yearChange" :options="unitList">
|
||
</van-dropdown-item>
|
||
|
||
</van-dropdown-menu>
|
||
</div>
|
||
|
||
<div>
|
||
<van-list v-model="tableLoading" :finished="finished" :finished-text="tableData.length>0?'没有更多了':''"
|
||
v-if="tableData && tableData.length>0" @load="pageData">
|
||
|
||
<div v-for="o in tableData" class="van-doc-card" @click="openView(o)">
|
||
|
||
<van-row>
|
||
<van-col span="3">
|
||
<uni-icons type="person-filled" size="26"
|
||
style="background-color: #44b887; border-radius: 50%; color: white"></uni-icons>
|
||
</van-col>
|
||
<van-col span="11" class="username">
|
||
{{ o.helpUserName + '(' + o.helpLoginName + ')' }}
|
||
</van-col>
|
||
<van-col span="10" class="applyTime">
|
||
<span>申请时间:{{ o.applyTime }}</span>
|
||
</van-col>
|
||
</van-row>
|
||
|
||
<van-row class="info" style="margin-top: 8px">
|
||
<van-col span="12">
|
||
<span>申 请 人:</span>
|
||
<span>{{ o.applyUserName }}</span>
|
||
</van-col>
|
||
<van-col span="12">
|
||
<span>联系方式:</span>
|
||
<span>{{ o.mobile }}</span>
|
||
</van-col>
|
||
</van-row>
|
||
<van-row class="info">
|
||
<van-col span="24">
|
||
<span>所属单位:</span>
|
||
<span>{{ o.helpDeptName }}</span>
|
||
</van-col>
|
||
</van-row>
|
||
<van-row class="info">
|
||
<van-col span="24">
|
||
<span>所属工会:</span>
|
||
<span>{{ o.helpUnionName }}</span>
|
||
</van-col>
|
||
</van-row>
|
||
<van-row class="info">
|
||
<van-col span="24">
|
||
<span>审核状态:</span>
|
||
<span :style="'color:'+o.stateColor">{{ o.stateName }}</span>
|
||
</van-col>
|
||
</van-row>
|
||
|
||
<div v-if="[280,290,300].includes(o.state)" style="position: absolute; right: 8px; bottom: 10px">
|
||
<van-button @click.stop="rollBack(o)" color="#1867b0" size="small" round>撤 回</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>
|
||
<info ref="viewInfo"></info>
|
||
</van-popup>
|
||
|
||
</div>
|
||
|
||
</template>
|
||
|
||
<script>
|
||
import initTableMixins from "@/mixins/initTableMixins";
|
||
import Info from "./common/info.vue";
|
||
|
||
export default {
|
||
name: 'difficultySchoolAudit',
|
||
components: {Info},
|
||
mixins: [initTableMixins],
|
||
data() {
|
||
return {
|
||
infoShow: false,
|
||
yearList: [],
|
||
auditList: [{
|
||
text: '未审核',
|
||
value: false
|
||
},
|
||
{
|
||
text: '已审核',
|
||
value: true
|
||
},
|
||
],
|
||
pageForm: {
|
||
year: new Date().getFullYear(),
|
||
isAudit: false,
|
||
},
|
||
id: "",
|
||
formData: {},
|
||
}
|
||
},
|
||
methods: {
|
||
async rollBack(row) {
|
||
this.$modal.confirm('您确定要撤回吗?').then(async () => {
|
||
const resp = await this.$http.post("/staff/difficulty/schoolAudit/rollBack/" + row.id);
|
||
if (resp.code === 200) {
|
||
this.$modal.msg(resp.msg)
|
||
this.doSearch()
|
||
}
|
||
})
|
||
},
|
||
openView(o) {
|
||
this.id = o.id
|
||
if(o.state === 270) {
|
||
this.$tab.navigateTo('/pages/difficulty/difficultySchoolAudit?id=' + o.id)
|
||
} else {
|
||
this.infoShow = true
|
||
this.$nextTick(() => {
|
||
this.$refs.viewInfo.getInfo(o.id)
|
||
})
|
||
}
|
||
},
|
||
yearChange() {
|
||
this.finished = false
|
||
this.flushUnits()
|
||
this.doSearch()
|
||
},
|
||
async pageData() {
|
||
const resp = await this.$http.post('/staff/difficulty/schoolAudit/pageData', this.pageForm, {
|
||
params: {
|
||
year: this.pageForm.year,
|
||
unitId: this.pageForm.unitId,
|
||
unionId: this.pageForm.unionId,
|
||
isAudit: this.pageForm.isAudit,
|
||
}
|
||
})
|
||
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++
|
||
}
|
||
}
|
||
},
|
||
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)
|
||
}
|
||
},
|
||
doSearch() {
|
||
this.tableData = []
|
||
this.pageForm.pageNumber = 1
|
||
this.pageData()
|
||
},
|
||
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 created() {
|
||
await this.init()
|
||
await this.pageData()
|
||
},
|
||
onLoad() {
|
||
uni.$on('refreshData', res => {
|
||
this.doSearch()
|
||
})
|
||
}
|
||
}
|
||
</script>
|
||
|
||
<style lang="scss">
|
||
|
||
.info {
|
||
line-height: 28px;
|
||
font-size: 14px;
|
||
}
|
||
|
||
.info span:nth-of-type(1) {
|
||
color: grey;
|
||
}
|
||
|
||
.username {
|
||
font-size: 17px;
|
||
font-weight: bold;
|
||
}
|
||
|
||
.applyTime {
|
||
font-size: 12px;
|
||
color: grey;
|
||
}
|
||
|
||
::v-deep .van-nav-bar__title {
|
||
font-weight: 700;
|
||
font-size: 16px;
|
||
opacity: 1;
|
||
}
|
||
|
||
::v-deep .van-nav-bar__left .van-icon{
|
||
color: rgb(0, 0, 0);
|
||
font-size: 22px;
|
||
}
|
||
::v-deep .van-nav-bar__left {
|
||
padding: 0 6px;
|
||
}
|
||
|
||
.van-cell, .van-picker button, .submit .van-button--normal {
|
||
font-size: 16px;
|
||
}
|
||
|
||
.van-button--small {
|
||
height: 28px;
|
||
padding: 0px 20px;
|
||
}
|
||
|
||
</style>
|