398 lines
18 KiB
HTML
398 lines
18 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" 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" :disabled="provideMode!==3"
|
|
@click="openImportExpressExcel">
|
|
导入快递单号
|
|
</el-button>
|
|
<el-button @click="sendMsg" icon="el-icon-s-promotion" size="small" type="primary">
|
|
短信通知
|
|
</el-button>
|
|
<el-button
|
|
@click="shopExport()" icon="el-icon-printer"
|
|
size="small"
|
|
type="primary">按商品导出
|
|
</el-button>
|
|
|
|
<el-button :disabled="!pageForm.projectId" type="primary" size="small"
|
|
icon="el-icon-printer"
|
|
@click="exportReceiveDetail(true)">导出已选名单
|
|
</el-button>
|
|
<el-button :disabled="!pageForm.projectId" @click="exportReceiveDetail(false)"
|
|
icon="el-icon-printer"
|
|
size="small"
|
|
type="primary">导出未选名单
|
|
</el-button>
|
|
<el-button :disabled="!pageForm.projectId" type="primary" size="small"
|
|
icon="el-icon-printer"
|
|
@click="exportByUnion">导出汇总表
|
|
</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="400px">
|
|
<template scope="{ row }">
|
|
<el-button @click="exportReceiveDetailByUnionIdWord(row.welfareUnitId)" plain size="mini"
|
|
type="primary">导出签领表
|
|
</el-button>
|
|
<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"
|
|
class="pull-right"
|
|
icon="el-icon-printer"
|
|
@click="exportReceiveDetailByUnionId(true)">导出已选名单
|
|
</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-button @click="exportReceiveDetailByUnionId(false)"
|
|
class="pull-right"
|
|
icon="el-icon-printer"
|
|
type="primary">导出未选名单
|
|
</el-button>
|
|
<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 style="justify-content: space-between;align-items: center" type="flex">
|
|
<span>只能导入已选人员名单,导入未选人员名单无效。</span>
|
|
<el-button @click="downLoadExpressTemplate" size="small" type="primary">下载模板</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: {
|
|
exportReceiveDetailByUnionIdWord(welfareUnitId) {
|
|
window.open(loc() + '/exportReceiveDetailByUnionIdWord?welfareUnitId=' + welfareUnitId + '&projectId=' + this.pageForm.projectId)
|
|
},
|
|
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) {
|
|
this.welfareUnitCode = 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(flag) {
|
|
const {projectId, welfareUnitCode} = this.pageForm
|
|
window.open(loc() + '/exportReceiveDetail?projectId=' + projectId + '&welfareUnitCode=' + (welfareUnitCode ? welfareUnitCode : '') + '&flag=' + flag)
|
|
},
|
|
exportReceiveDetailByUnionId(flag) {
|
|
const {projectId} = this.pageForm
|
|
const welfareUnitCode = this.welfareUnitCode ? this.welfareUnitCode : ''
|
|
window.open(loc() + '/exportReceiveDetail?projectId=' + projectId + '&welfareUnitCode=' + welfareUnitCode + '&flag=' + flag)
|
|
},
|
|
shopExport() {
|
|
if (!this.pageForm.projectId) {
|
|
this.$notify.warning({title: '警告', message: '请先选择福利项目!'});
|
|
return
|
|
}
|
|
const loading = this.$loading({
|
|
lock: true,
|
|
text: '正在努力导出中,感谢您的耐心等待!',
|
|
spinner: 'el-icon-loading',
|
|
background: COVER_LAYER_COLOR
|
|
});
|
|
axios.post(loc() + "/shopExport?projectId=" + this.pageForm.projectId, {}, {responseType: 'blob'})
|
|
.then((res) => {
|
|
const {data, headers} = res
|
|
const fileName = headers['content-disposition'].replace(/\w+;filename=(.*)/, '$1')
|
|
// 此处当返回json文件时需要先对data进行JSON.stringify处理,其他类型文件不用做处理
|
|
//const blob = new Blob([JSON.stringify(data)], ...)
|
|
const blob = new Blob([data], {type: headers['content-type']})
|
|
let dom = document.createElement('a')
|
|
let url = window.URL.createObjectURL(blob)
|
|
dom.href = url
|
|
dom.download = decodeURI(fileName)
|
|
dom.style.display = 'none'
|
|
document.body.appendChild(dom)
|
|
dom.click()
|
|
dom.parentNode.removeChild(dom)
|
|
window.URL.revokeObjectURL(url)
|
|
loading.close();
|
|
}).catch((err) => {
|
|
})
|
|
},
|
|
sendMsg() {
|
|
this.$confirm('您确定要向未领取人员发送短信提醒吗?', '提示', {
|
|
confirmButtonText: '确定',
|
|
cancelButtonText: '取消',
|
|
type: 'warning'
|
|
}).then(async () => {
|
|
const resp = await $.post('/sendMsg', {projectId: this.pageForm.projectId})
|
|
if (resp.code === 0) {
|
|
this.$message.success(resp.msg)
|
|
} else {
|
|
this.$message.error(resp.msg)
|
|
}
|
|
}).catch(() => {
|
|
|
|
});
|
|
},
|
|
},
|
|
created() {
|
|
this.init()
|
|
}
|
|
})
|
|
</script>
|
|
<!--#
|
|
}
|
|
#--> |