This commit is contained in:
Paidax
2024-08-02 16:07:40 +08:00
parent eed2d41b09
commit efdedc3405
7 changed files with 274 additions and 13 deletions
@@ -0,0 +1,143 @@
<!--#
layout("/layouts/platform.html"){
#-->
<div id="app" v-clock>
<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-date-picker
v-model="pageForm.year"
value-format="yyyy"
formData="yyyy"
type="year"
@change="doSearch"
style="width: 100%"
placeholder="请选择年度">
</el-date-picker>
</div>
</div>
<div class="search-item">
<div class="search-item-label">所属工会:</div>
<div class="search-item-option">
<el-select placeholder="所属工会" v-model="pageForm.unionId"
style="width: 100%;"
clearable="true"
@change="doSearch"
filterable="true">
<el-option v-for="item in unions" :label="item.unionname"
:value="item.id"></el-option>
</el-select>
</div>
</div>
<div class="search-query">
<el-button type="primary" icon="el-icon-search" @click="doSearch">搜索
</el-button>
</div>
</div>
</el-card>
<el-card shadow="never" class="mt10">
<table-tool label="申报列表" :app="this">
<template #func>
</template>
</table-tool>
<el-table ref="table" :data="tableData" style="width: 100%" row-key="id"
@sort-change="pageOrder"
v-loading="tableLoading" :size="tableSize" class="vi-table">
<el-table-column align="center" header-align="center" type="index"
:index="indexMethod" label="序号"
width="80px"></el-table-column>
<el-table-column
align="center"
header-align="center"
v-for="column in tableColumns"
show-overflow-tooltip
:label="column.label"
:prop="column.prop"
:sortable="column.sortable"
>
<template scope="{row}" v-if="column.prop === 'applyDate'">
<span>{{ moment(row.applyDate).format('YYYY年MM月DD日') }}</span>
</template>
</el-table-column>
<el-table-column align="center" header-align="center" label="操作" fixed="right" width="250px">
<template scope="{row}">
<el-button @click="openView(row)" size="mini" type="primary">查看</el-button>
<el-button @click="openExport(row.id)" size="mini" type="primary">导出申报表</el-button>
</template>
</el-table-column>
</el-table>
<!--#include("/layouts/pagination.html"){}#-->
</el-card>
</template>
<template #view>
<wakes-info-apply ref="viewInfo"></wakes-info-apply>
</template>
</guava>
</div>
<script>
const vue = new Vue({
el: '#app',
mixins: [initTableMixins],
data: {
id:'',
unions:[],
pageForm:{
isAudit:false,
year: moment().format('YYYY'),
},
tableColumns: [
{prop: 'unionName', label: '申报工会', sortable: true},
{prop: 'username', label: '申报人', sortable: true},
{prop: 'loginName', label: '申报人工号', sortable: true},
{prop: 'mobile', label: '联系方式', sortable: true},
// {prop: 'basicInformation', label: '基本情况简介', sortable: true},
{prop: 'applyDate', label: '申报日期', sortable: true},
{prop: 'stateName', label: '审核状态', sortable: true},
],
formRules: {
auditSign: [{required: true, message: '必填', trigger: ['blur', 'change']}],
auditOpinion: [{required: true, message: '必填', trigger: ['blur', 'change']}],
},
},
components: {
'wakes-info-apply': httpVueLoader('/components/wakeshome/declaration/WakesHomeInfoApply.vue')
},
methods: {
openExport(id) {
window.open("/platform/wakeshome/declaration/mine/openExport?id=" + id)
},
openView(row){
this.$refs.guava.view()
this.$refs.viewInfo.openView(row.id)
},
async flushUnits() {
this.$set(this.pageForm, "unitId", null)
this.units = []
if (this.pageForm.unionId) {
this.units = await getUnits(this.pageForm.unionId)
}
},
},
async created(){
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()
}
this.pageData();
}
})
</script>
<!--#
}
#-->
@@ -32,6 +32,7 @@ layout("/layouts/platform.html"){
:picker-options="pickerOptions"
v-model="pageForm.annual"
type="year"
style="width: 100%"
value-format="yyyy"
placeholder="选择年度">
</el-date-picker>
@@ -357,9 +358,10 @@ layout("/layouts/platform.html"){
async openView(id) {
this.$refs.guava.view()
this.loading = true;
const {code, data, msg} = await $.get(loc() + '/edit', {id})
const {code, data, msg} = await $.get('/platform/wakeshome/review/khzb/edit', {id})
if (code === 0) {
this.viewData = data
this.viewData.applyTime = [this.viewData.startTime,this.viewData.endTime]
}
this.loading = false;
},
@@ -79,12 +79,11 @@ layout("/layouts/platform.html"){
:prop="column.prop" :width="column.width" min-width="100px">
</el-table-column>
<el-table-column prop="userOnline" align="center" header-align="center" label="操作"
width="100px"
width="200px"
fixed="right">
<template scope="{row}">
<el-button plain size="mini" @click="openView(row)">
查看
</el-button>
<el-button size="mini" @click="openView(row)">查看</el-button>
<el-button v-if="canDownload()" size="mini" type="primary" @click="openView(row)">查看</el-button>
</template>
</el-table-column>
</el-table>
@@ -309,7 +308,6 @@ layout("/layouts/platform.html"){
}
this.doSearch()
},
},
async created() {
await this.getZbList()