376 lines
16 KiB
HTML
376 lines
16 KiB
HTML
<!--#
|
|
layout("/layouts/platform.html"){
|
|
#-->
|
|
|
|
<div id="app" v-cloak>
|
|
<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
|
|
style="width: 100%"
|
|
@change="yearChange"
|
|
:clearable="false"
|
|
value-format="yyyy"
|
|
v-model="pageForm.year"
|
|
type="year"
|
|
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.projectId" @change="doSearch"
|
|
style="width: 100%;"
|
|
filterable="true">
|
|
<el-option v-for="item in welfareProjectList" :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">
|
|
<el-select @change="pageData" clearable filterable
|
|
placeholder="所属工会" style="width: 100%;" v-model="pageForm.welfareUnitCode">
|
|
<el-option :label="item.unionname" :value="item.unioncode"
|
|
v-for="item in unions"></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>
|
|
<el-button type="primary" size="small" icon="el-icon-printer"
|
|
@click="sendMsgToNotSelUsers">
|
|
给未选人员发送信息
|
|
</el-button>
|
|
|
|
<el-button type="primary" size="small" icon="el-icon-printer" :disabled="provideMode!==3"
|
|
@click="openImportExpressExcel">
|
|
导入快递单号
|
|
</el-button>
|
|
|
|
<el-button :disabled="!pageForm.projectId" type="primary" size="small"
|
|
icon="el-icon-printer"
|
|
@click="exportByUnion">按福利单位导出统计表
|
|
</el-button>
|
|
<el-button :disabled="!pageForm.projectId" type="primary" size="small"
|
|
icon="el-icon-printer"
|
|
@click="exportReceiveDetail">导出发放详细名单
|
|
</el-button>
|
|
</template>
|
|
|
|
</template>
|
|
</table-tool>
|
|
<el-table :data="tableData"
|
|
@sort-change="pageOrder"
|
|
row-key="id" show-summary
|
|
style="width: 100%"
|
|
v-loading="tableLoading" ref="table" class="vi-table" :size="tableSize">
|
|
<el-table-column type="index" width="50"></el-table-column>
|
|
<el-table-column
|
|
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=='welfareUnitName'">
|
|
({{row.welfareUnitCode}}){{row.welfareUnitName}}
|
|
</template>
|
|
<template scope="{row}" v-else-if="column.prop=='unselectedTeacherSum'">
|
|
<el-link @click="openUnclaimed(row.welfareUnitCode)" type="primary">
|
|
{{row.unselectedTeacherSum}}
|
|
</el-link>
|
|
</template>
|
|
</el-table-column>
|
|
|
|
<el-table-column header-align="center" label="操作" v-if="tableColumns.length>0" width="200px">
|
|
<template scope="{ row }">
|
|
<el-button @click="openView(row.welfareUnitCode)" size="mini" type="primary">查看已领取人员
|
|
</el-button>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table>
|
|
</el-card>
|
|
</template>
|
|
<template #view>
|
|
<el-button type="primary" size="small"
|
|
icon="el-icon-printer"
|
|
@click="exportReceiveDetailByUnionId">导出发放详细名单
|
|
</el-button>
|
|
<el-table :data="receive_tableData" style="width: 100%" row-key="id" max-height="1000"
|
|
v-loading="tableLoading" class="vi-table" :size="tableSize">
|
|
<el-table-column type="index" width="50"></el-table-column>
|
|
<el-table-column
|
|
align="center"
|
|
v-for="column in receive_tableColumns"
|
|
show-overflow-tooltip
|
|
:label="column.label"
|
|
:prop="column.prop"
|
|
:sortable="column.sortable"
|
|
>
|
|
</el-table-column>
|
|
</el-table>
|
|
</template>
|
|
</guava>
|
|
|
|
<el-dialog :visible.sync="unclaimedDialog" title="未领取人员" width="65%">
|
|
<el-table :data="unclaimed_tableData" style="width: 100%" row-key="id" max-height="650"
|
|
v-loading="tableLoading" class="vi-table" :size="tableSize">
|
|
<el-table-column type="index" width="50"></el-table-column>
|
|
<el-table-column
|
|
align="center"
|
|
v-for="column in unclaimed_tableColumns"
|
|
show-overflow-tooltip
|
|
:label="column.label"
|
|
:prop="column.prop"
|
|
:sortable="column.sortable"
|
|
>
|
|
</el-table-column>
|
|
</el-table>
|
|
</el-dialog>
|
|
|
|
<el-dialog :visible.sync="importExpressExcelDialog" title="导入快递单号" width="65%">
|
|
<el-row type="flex" justify="end">
|
|
<el-button size="small" type="primary" @click="downLoadExpressTemplate">下载模板</el-button>
|
|
</el-row>
|
|
<el-row type="flex" justify="center">
|
|
<el-upload
|
|
ref="expressExcelUpload"
|
|
:auto-upload="false"
|
|
:file-list="importExpressExcelFile"
|
|
:limit="1"
|
|
:data="{projectId:pageForm.projectId}"
|
|
drag
|
|
:action="loc()+'/importCourierNumber'"
|
|
:on-success="expressExcelHandleSuccess"
|
|
>
|
|
<i class="el-icon-upload"></i>
|
|
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
|
|
<div class="el-upload__tip" slot="tip">只能上传xls,xlsx文件</div>
|
|
</el-upload>
|
|
</el-row>
|
|
|
|
<el-row type="flex" justify="end">
|
|
<el-button @click="importExpressExcelDialog=false">取消</el-button>
|
|
<el-button type="primary" @click="doImportExpressExcel">提交</el-button>
|
|
</el-row>
|
|
</el-dialog>
|
|
|
|
</div>
|
|
|
|
<script>
|
|
<!--#include("/platform/welfare/include/common.js"){}#-->
|
|
|
|
const vue = new Vue({
|
|
el: '#app',
|
|
mixins: [initTableMixins],
|
|
data() {
|
|
return {
|
|
welfareProjectList: [],
|
|
pageForm: {
|
|
year: null,
|
|
welfareUnitCode: null
|
|
},
|
|
unions: [],
|
|
tableColumns: [],
|
|
receive_tableColumns: [],
|
|
receive_tableData: [],
|
|
unclaimedDialog: false,
|
|
unclaimed_tableData: [],
|
|
unclaimed_tableColumns: [
|
|
{label: '姓名', prop: 'username'},
|
|
{label: '工号', prop: 'loginname'},
|
|
{label: '单位', prop: 'unitname'},
|
|
{label: '工会', prop: 'unionname'},
|
|
{label: '联系方式', prop: 'mobile'},
|
|
],
|
|
welfare,
|
|
welfareUnitCode: null,
|
|
importExpressExcelDialog: false,
|
|
importExpressExcelFile: []
|
|
}
|
|
},
|
|
computed: {
|
|
provideMode() {
|
|
const project = this.welfareProjectList.find(v => v.id === this.pageForm.projectId)
|
|
if (project) {
|
|
return project.provideMode
|
|
}
|
|
return null
|
|
}
|
|
},
|
|
methods: {
|
|
downLoadExpressTemplate() {
|
|
window.open(loc() + '/downLoadExpressTemplate')
|
|
},
|
|
openImportExpressExcel() {
|
|
this.importExpressExcelDialog = true
|
|
if (this.$refs.expressExcelUpload) {
|
|
this.$refs.expressExcelUpload.clearFiles()
|
|
}
|
|
},
|
|
|
|
expressExcelHandleSuccess(response, file, fileList) {
|
|
if (response.code !== 0) {
|
|
this.notifyWarning(response.msg)
|
|
this.$refs.expressExcelUpload.clearFiles()
|
|
} else {
|
|
this.notifySuccess(response.msg)
|
|
this.$refs.expressExcelUpload.clearFiles()
|
|
this.importExpressExcelDialog = false
|
|
this.doSearch()
|
|
}
|
|
},
|
|
|
|
doImportExpressExcel() {
|
|
this.$refs.expressExcelUpload.submit()
|
|
},
|
|
|
|
async init() {
|
|
this.unions = await getUnions(null)
|
|
this.pageForm.year = new Date().getFullYear().toString()
|
|
this.getWelfareProjectList()
|
|
},
|
|
async getWelfareProjectList() {
|
|
const resp = await $.get(loc() + '/welfareProjectList', {year: this.pageForm.year})
|
|
this.welfareProjectList = resp.data
|
|
if (this.welfareProjectList && this.welfareProjectList.length > 0) {
|
|
this.$set(this.pageForm, "projectId", this.welfareProjectList[0].id)
|
|
this.pageData()
|
|
} else {
|
|
this.tableData = []
|
|
this.tableColumns = []
|
|
}
|
|
},
|
|
async yearChange() {
|
|
this.$set(this.pageForm, "projectId", null)
|
|
this.$set(this.pageForm, "welfareUnitCode", null)
|
|
await this.getWelfareProjectList()
|
|
},
|
|
async pageData() {
|
|
this.tableLoading = true
|
|
sublime.showLoadingbar()
|
|
const resp = await $.post(loc() + '/pageData', this.pageForm)
|
|
sublime.closeLoadingbar()
|
|
this.tableLoading = false
|
|
if (resp.code === 0) {
|
|
this.tableColumns = [{
|
|
prop: 'welfareUnitName',
|
|
label: welfare.welfareUnitModeName
|
|
}].concat(resp.data.tableColumn)
|
|
this.tableData = resp.data.tableList
|
|
}
|
|
},
|
|
async openView(welfareUnitCode) {
|
|
this.welfareUnitCode = welfareUnitCode
|
|
const resp = await $.post(loc() + '/receivePageData', {
|
|
welfareUnitCode,
|
|
projectId: this.pageForm.projectId
|
|
})
|
|
if (resp.code === 0) {
|
|
this.$refs.guava.view()
|
|
this.receive_tableColumns = resp.data.label
|
|
this.receive_tableData = resp.data.list
|
|
|
|
}
|
|
},
|
|
async openUnclaimed(welfareUnitCode) {
|
|
const resp = await $.post(loc() + '/unclaimedData', {
|
|
welfareUnitCode,
|
|
projectId: this.pageForm.projectId
|
|
})
|
|
if (resp.code === 0) {
|
|
this.unclaimedDialog = true
|
|
this.unclaimed_tableData = resp.data
|
|
}
|
|
},
|
|
exportByUnion() {
|
|
const {projectId, welfareUnitCode} = this.pageForm
|
|
window.open(loc() + '/exportByUnion?projectId=' + projectId + '&welfareUnitCode=' + (welfareUnitCode ? welfareUnitCode : ''))
|
|
},
|
|
exportReceiveDetail() {
|
|
const {projectId, welfareUnitCode} = this.pageForm
|
|
window.open(loc() + '/exportReceiveDetail?projectId=' + projectId + '&welfareUnitCode=' + (welfareUnitCode ? welfareUnitCode : ''))
|
|
},
|
|
exportReceiveDetailByUnionId() {
|
|
const {projectId} = this.pageForm
|
|
const welfareUnitCode = this.welfareUnitCode ? this.welfareUnitCode : ''
|
|
window.open(loc() + '/exportReceiveDetail?projectId=' + projectId + '&welfareUnitCode=' + welfareUnitCode)
|
|
},
|
|
async sendMsgToNotSelUsers() {
|
|
const project = this.welfareProjectList.find(v => v.id === this.pageForm.projectId)
|
|
console.log(project)
|
|
const projectName = project.name
|
|
|
|
const confirm = await this.$confirm('您确定要向' + projectName + '未选人员发送信息吗?', '提示', {
|
|
confirmButtonText: '确定',
|
|
cancelButtonTest: '取消',
|
|
type: 'warning'
|
|
})
|
|
if ('confirm' !== confirm) return
|
|
|
|
const resp = await $.post(loc() + '/sendMsgToNotSelUsers/' + project.id)
|
|
if (resp.code === 0) {
|
|
this.notifySuccess(resp.msg)
|
|
} else {
|
|
this.notifyWarning(resp.msg)
|
|
}
|
|
},
|
|
getSummaries(param) {
|
|
const {columns, data} = param;
|
|
const sums = [];
|
|
columns.forEach((column, index) => {
|
|
if ([0].includes(index)) {
|
|
sums[index] = '合计';
|
|
return;
|
|
}
|
|
if ([1, 7].includes(index)) {
|
|
sums[index] = '';
|
|
return;
|
|
}
|
|
const values = data.map(item => Number(item[column.property]));
|
|
if (!values.every(value => isNaN(value))) {
|
|
sums[index] = values.reduce((prev, curr) => {
|
|
const value = Number(curr);
|
|
if (!isNaN(value)) {
|
|
return prev + curr;
|
|
} else {
|
|
return prev;
|
|
}
|
|
}, 0);
|
|
// sums[index] += ' 元';
|
|
} else {
|
|
sums[index] = '';
|
|
}
|
|
});
|
|
|
|
return sums;
|
|
}
|
|
|
|
},
|
|
created() {
|
|
this.init()
|
|
}
|
|
})
|
|
</script>
|
|
<!--#
|
|
}
|
|
#--> |