first commit

This commit is contained in:
2026-09-08 19:49:21 +08:00
commit ebffbab428
7320 changed files with 1477614 additions and 0 deletions
@@ -0,0 +1,683 @@
<!--#
layout("/layouts/platform.html"){
#-->
<div id="app" v-cloak>
<guava ref="guava">
<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
placeholder="选择年度"
style="width: 100%"
type="year"
v-model="pageForm.year"
value-format="yyyy">
</el-date-picker>
</div>
</div>
<div class="search-item">
<div class="search-item-label">关键字:</div>
<div class="search-item-option">
<el-input clearable maxlength="20" v-model.trim="pageForm.keyword"></el-input>
</div>
</div>
<div class="search-item"
v-if="${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')||@shiro.hasRole('H03')}">
<div class="search-item-label">所属工会:</div>
<div class="search-item-option">
<el-select placeholder="所属工会" v-model="pageForm.unionId" style="width: 100%;"
clearable="true"
@change="flushUnits" @clear="flushUnits"
filterable="true">
<el-option v-for="item in unions" :label="item.unionname" :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 placeholder="所属单位" v-model="pageForm.unitId" style="width: 100%;"
clearable="true"
filterable="true">
<el-option v-for="item in units" :label="item.name" :value="item.id"></el-option>
</el-select>
</div>
</div>
<div class="search-query">
<el-button @click="doSearch" icon="el-icon-search" type="primary">搜索</el-button>
</div>
</div>
</el-card>
<el-card class="mt10" shadow="never">
<table-tool :app="this" label="审核列表">
<template #func>
<!--<el-radio-group @change="doSearch()" size="small" v-model="pageForm.auditState">
<el-radio-button label="0">全部</el-radio-button>
<el-radio-button label="1">已审核</el-radio-button>
<el-radio-button label="-1">未审核</el-radio-button>
</el-radio-group>-->
<el-button type="primary" size="small" class="ml10" @click="batchApply">批量申请
</el-button>
<el-button type="primary" size="small" class="ml10" @click="batchExportApplyPaper">批量导出个人申请表
</el-button>
<el-button type="primary" size="small" @click="exportSummary">导出汇总表</el-button>
<el-button type="primary" size="small" icon="el-icon-edit" @click="openUnitMove" class="ml5">
单位调整
</el-button>
</template>
</table-tool>
<el-table :data="tableData" :size="tableSize" @sort-change="pageOrder"
ref="table"
align="center" header-align="center">
<el-table-column type="selection"></el-table-column>
<el-table-column align="center" header-align="center" label="序号" type="index" width="80">
<template scope="scope">
<span>{{ scope.$index + (pageForm.pageNumber - 1) * pageForm.pageSize + 1 }} </span>
</template>
</el-table-column>
<el-table-column
:label="column.label"
:prop="column.prop"
:sortable="column.sortable"
:width="column.width"
align="center"
header-align="center"
show-overflow-tooltip
v-for="column in tableColumns"
>
<template scope="{row}" v-if="column.prop=='isMeetRequirements'">
<span class="text-success" v-if="row.isMeetRequirements">
符合
</span>
<span class="text-danger" v-else>
不符合
</span>
</template>
<template scope="{row}" v-else-if="column.prop==='isAccept'">
<span v-if="row.isAccept !== null"
:class="{'text-success': row.isAccept, 'text-danger': !row.isAccept}">
{{ row.isAccept ? '申请' : '放弃' }}
</span>
<span v-else class="text-info"></span>
</template>
</el-table-column>
<el-table-column label="操作" width="350" fixed="right">
<template scope="{row}">
<el-button @click="openView(row.id)" size="mini" type="primary">查看</el-button>
<!--<el-button :disabled="row.stateCode!=100" @click="openAudit(row.id)" size="mini" type="primary">
审核
</el-button>
<el-button :disabled="row.stateCode<300" @click="doRevoke(row.id)" size="mini" type="danger">
撤回
</el-button>-->
<el-button @click="exportApplyPaper(row.id)" size="mini" type="primary">导出</el-button>
<el-button :disabled="row.isAccept!=null || !row.isMeetRequirements || row.stateCode > 210"
@click="applySubsidy(row)" size="mini"
type="primary">申请
</el-button>
<el-button :disabled="!row.isMeetRequirements || row.stateCode >210 || row.isAccept==0"
@click="userHandler(row.id,row.isAccept,false)"
size="mini"
type="danger">放弃
</el-button>
</template>
</el-table-column>
</el-table>
<!--#include("/layouts/pagination.html"){}#-->
</el-card>
<template #view>
<sick-help-info ref="sickView"></sick-help-info>
</template>
<template #edit>
<sick-help-info ref="sickAudit">
<template #audit>
<el-tab-pane label="审核" name="999">
<vi-title title="基层工会审核"></vi-title>
<el-form :model="formData" :rules="rules" label-width="120px" ref="form">
<el-row gutter="20">
<el-col :span="12">
<el-form-item label="审核人" prop="username">
<el-input readonly v-model="formData.username"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="审核时间" prop="auditTime">
<el-input readonly v-model="formData.auditTime"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-form-item label="审核意见" prop="auditOpinion">
<el-input maxlength="1000"
placeholder="请填写您的意见"
rows="4"
type="textarea"
v-model="formData.auditOpinion"></el-input>
</el-form-item>
<el-form-item label="基层工会签字" prop="auditSign">
<sign :qz.sync="formData.auditSign"></sign>
</el-form-item>
</el-form>
<el-row justify="end" type="flex">
<el-button @click="doAudit(false)" type="danger">拒绝</el-button>
<el-button @click="doAudit(true)" type="primary">通过</el-button>
</el-row>
</el-tab-pane>
</template>
</sick-help-info>
</template>
<el-dialog :close-on-click-modal="false" :visible.sync="applyDialog" title="申请补助" width="60%">
<el-form :model="formData" :rules="rules" label-width="auto" ref="form">
<el-row :gutter="10">
<el-col :lg="12" :md="24" :sm="24" :xl="12" :xs="24">
<el-form-item label="姓名" prop="userName">
<el-input :value="formData.userName" readonly></el-input>
</el-form-item>
</el-col>
<el-col :lg="12" :md="24" :sm="24" :xl="12" :xs="24">
<el-form-item label="性别" prop="sex">
<el-radio-group v-model="formData.sex" size="mini">
<el-radio label="男" border></el-radio>
<el-radio label="女" border></el-radio>
</el-radio-group>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="10">
<el-col :lg="12" :md="24" :sm="24" :xl="12" :xs="24">
<el-form-item label="出生年月" prop="birthday">
<el-date-picker
style="width: 100%"
type="date"
v-model="formData.birthday"
value-format="yyyy-MM-dd">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :lg="12" :md="24" :sm="24" :xl="12" :xs="24">
<el-form-item label="入会时间" prop="mutualGoldStartTime">
<el-date-picker
readonly
style="width: 100%"
type="year"
v-model="formData.mutualGoldStartTime"
value-format="yyyy-MM-dd">
</el-date-picker>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="10">
<el-col :lg="12" :md="24" :sm="24" :xl="12" :xs="24">
<el-form-item label="分工会" prop="unionId">
<el-select v-model="formData.unionId" clearable @change="formUnionIdChange"
style="width: 100%;">
<el-option v-for="item in unions" :label="item.unionname" :value="item.id"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :lg="12" :md="24" :sm="24" :xl="12" :xs="24">
<el-form-item label="工作单位" prop="unitName">
<!-- <el-input :value="formData.unitName"></el-input>-->
<el-select placeholder="所属单位" v-model="formData.unitName" style="width: 100%;"
clearable="true"
filterable="true">
<el-option v-for="item in units" :label="item.name" :value="item.name"></el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-form-item label="家庭住址" prop="homeAddress">
<el-input v-model="formData.homeAddress"></el-input>
</el-form-item>
</el-row>
<el-form-item label="申请理由" prop="applyReason">
<el-input
:autosize="{ minRows: 3, maxRows: 5}"
autosize
placeholder="请输入申报补助理由(患何种疾病)"
type="textarea"
v-model="formData.applyReason">
</el-input>
</el-form-item>
<el-row :gutter="10">
<el-col :lg="12" :md="24" :sm="24" :xl="12" :xs="24">
<el-form-item label="个人支付金额">
<el-input-number :max="99999999.99" :min="0" :precision="2"
readonly
style="width: 100%" v-model="formData.selfPayMoney"></el-input-number>
</el-form-item>
</el-col>
<el-col :lg="12" :md="24" :sm="24" :xl="12" :xs="24">
<el-form-item label="补助金额">
<el-input-number :max="99999999.99" :min="0" :precision="2"
readonly
style="width: 100%" v-model="formData.subsidyMoney"></el-input-number>
</el-form-item>
</el-col>
</el-row>
<el-form-item label="申请人签字" prop="applyUserSign">
<sign :qz.sync="formData.applyUserSign"></sign>
</el-form-item>
<el-row class="mt10" justify="end" type="flex">
<el-button @click="applyDialog=false">取消</el-button>
<el-button @click="doApply" type="primary">提交</el-button>
</el-row>
</el-form>
</el-dialog>
<el-drawer
title="单位调整"
:visible.sync="unitMoveVisibile"
:before-close="handleClose" size="1000px">
<el-row class="text-primary p20">
选择新单位
</el-row>
<el-row type="flex" :gutter="20" class="pl20 pr20">
<el-col :span="12">
<el-select placeholder="所属工会" v-model="unitMoveFormData.unionId" style="width: 100%;"
clearable="true"
@change="moveUnionsChange"
filterable="true">
<el-option v-for="item in unitMoveUnions" :label="item.unionname" :value="item.id"></el-option>
</el-select>
</el-col>
<el-col :span="12">
<el-select v-model="unitMoveFormData.unitId" style="width: 100%" filterable clearable
@change="moveUnitChange"
placeholder="请选择单位">
<el-option
v-for="item in unitMoveUnits"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</el-col>
</el-row>
<el-row class="mt10">
<el-table :data="checkUsers" style="width: 100%;padding: 20px" class="vi-table"
border
height="70vh">
<el-table-column show-overflow-tooltip align="center" header-align="center" prop="loginName"
width="120"
label="工号"></el-table-column>
<el-table-column show-overflow-tooltip align="center" header-align="center" prop="userName"
width="120"
label="姓名"></el-table-column>
<el-table-column show-overflow-tooltip align="center" header-align="center" prop="unitName"
label="当前单位"></el-table-column>
<el-table-column show-overflow-tooltip align="center" header-align="center" prop="unionName"
label="当前工会"></el-table-column>
<el-table-column show-overflow-tooltip align="center" header-align="center"
label="新单位">
<template slot-scope="{row}">
<span>{{unitMoveFormData.unitName}}</span>
</template>
</el-table-column>
<el-table-column show-overflow-tooltip align="center" header-align="center"
label="新分工会">
<template slot-scope="{row}">
<span>{{unitMoveFormData.unionName}}</span>
</template>
</el-table-column>
</el-table>
</el-row>
<span style="position: absolute;bottom: 20px;right: 20px">
<el-button @click="unitMoveVisibile = false">取 消</el-button>
<el-button type="primary" @click="doUnitMove">确定</el-button>
</span>
</el-drawer>
</guava>
</div>
<script>
var vue = new Vue({
el: '#app',
mixins: [initTableMixins],
components: {
'SickHelpInfo': httpVueLoader('/components/sickHelp/SickHelpInfo.vue'),
},
data() {
return {
pageForm: {
auditState: 0,
year: (new Date().getFullYear() - 1).toString(),
unionId: "",
unitId: "",
keyword: ""
},
tableColumns: [
{prop: 'userName', label: '姓名'},
{prop: 'loginName', label: '工号', width: 100},
{prop: 'unionName', label: '分工会', sortable: true, width: 150},
{prop: 'unitName', label: '单位', sortable: true, width: 150},
{prop: 'year', label: '年度', sortable: true},
{prop: 'selfPayMoney', label: '个人支付金额(元)', sortable: true, width: 150},
{prop: 'subsidyMoney', label: '补助金额(元)', sortable: true, width: 150},
{prop: 'subsidyMoney', label: '计算金额(元)', sortable: true, width: 150},
// {prop: 'subsidyRatio', label: '补助比例', sortable: true},
// {prop: 'remarks', label: '备注'},
{prop: 'isMeetRequirements', label: '是否符合申请要求'},
{prop: 'isAccept', label: '是否申请补助'},
{prop: 'stateName', label: '审核状态', width: 120}
],
formData: {
/* username: "${@shiro.getPrincipalProperty('username')}",
loginname: "${@shiro.getPrincipalProperty('loginname')}",
auditTime: moment().format('YYYY-MM-DD'),
auditOpinion: '',
auditSign: '',
auditPass: true*/
},
/*rules: {
auditSign: [{required: true, message: '请签字', trigger: ['change', 'blur']}],
auditOpinion: [{required: true, message: '请输入审核意见', trigger: ['change', 'blur']}]
},*/
unions: [],
units: [],
// formData: {},
rules: {
applyUserSign: [{required: false, message: '请签字', trigger: ['change', 'blur']}],
applyReason: [{required: false, message: '请输入申请理由', trigger: ['change', 'blur']}],
sex: [{required: false, message: '请选择性别', trigger: ['change', 'blur']}],
birthday: [{required: false, message: '请输入出生年月', trigger: ['change', 'blur']}],
mutualGoldStartTime: [{
required: true,
message: '请输入参加大病医疗互助时间',
trigger: ['change', 'blur']
}],
unitName: [{required: false, message: '请输入工作单位', trigger: ['change', 'blur']}],
homeAddress: [{required: false, message: '请输入家庭住址', trigger: ['change', 'blur']}],
},
applyDialog: false,
unitMoveVisibile: false,
unitMoveUnions: [],
unitMoveUnits: [],
unitMoveFormData: {
unitId: '',
unionId: '',
unitName: '',
unionName: ''
},
checkUsers: []
}
},
methods: {
async moveUnionsChange(val) {
if (val) {
this.unitMoveUnits = await getUnits(val)
this.$set(this.unitMoveFormData, 'unionName', this.unitMoveUnions.find(v => v.id === val).unionname)
this.$set(this.unitMoveFormData, 'unitId', '')
this.$set(this.unitMoveFormData, 'unitName', '')
} else {
this.$set(this.unitMoveFormData, 'unitId', '')
this.$set(this.unitMoveFormData, 'unitName', '')
this.$set(this.unitMoveFormData, 'unionName', '')
this.unitMoveUnits = []
}
},
moveUnitChange(val) {
if (val) {
this.$set(this.unitMoveFormData, 'unitName', this.unitMoveUnits.find(v => v.id === val).name)
} else {
this.$set(this.unitMoveFormData, 'unitName', '')
}
},
applySubsidy(row) {
this.formData = clone(row)
this.applyDialog = true
this.getApplyUserInfo(row.loginName)
},
async getApplyUserInfo(loginName) {
const resp = await $.get('/platform/sickHelp/mySubsidyRecord/getApplyUserInfo', {loginName})
if (resp.code === 0) {
const {
userName,
loginName,
unitName,
unionId,
sex,
homeAddress,
birthday,
mutualGoldStartTime
} = resp.data
this.$set(this.formData, 'userName', userName)
this.$set(this.formData, 'loginName', loginName)
this.$set(this.formData, 'unitName', unitName)
this.$set(this.formData, 'unionId', unionId)
this.$set(this.formData, 'sex', sex)
this.$set(this.formData, 'homeAddress', homeAddress)
this.$set(this.formData, 'birthday', birthday)
this.$set(this.formData, 'mutualGoldStartTime', mutualGoldStartTime)
}
},
async doApply() {
const valid = await this.$refs['form'].validate()
if (!valid) return
const resp = await $.post(loc() + '/doApply', this.formData)
if (resp.code === 0) {
this.applyDialog = false
this.notifySuccess(resp.msg)
this.doSearch()
} else {
this.notifyWarning(resp.msg)
}
},
async userHandler(id, isAccept, userChoice) {
if (isAccept) return
const msg = '您确认要' + (userChoice ? '接受' : '放弃') + '该用户的补助申请吗?'
const confirm = await this.$confirm(msg, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
if ('confirm' !== confirm) return
const resp = await $.post('/platform/sickHelp/mySubsidyRecord/acceptSubsidy', {
id,
isAccept: userChoice
})
if (resp.code === 0) {
this.notifySuccess(resp.msg)
this.pageData()
} else {
this.notifyError(resp.msg)
}
},
batchExportApplyPaper() {
const selections = this.$refs.table.selection
if (selections.length === 0) {
this.notifyWarning('请先勾选需要导出的记录')
return
}
const ids = selections.map(v => v.id)
window.open(loc() + '/batchExportApplyPaper?ids=' + JSON.stringify(ids))
},
async batchApply() {
const selections = this.$refs.table.selection
if (selections.length === 0) {
this.notifyWarning('请先勾选需要批量申请的记录')
return
}
const confirm = await this.$confirm('您确定要将勾选的记录申请补助吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
if (confirm !== 'confirm') return
const ids = selections.map(v => v.id)
const resp = await $.post(loc() + '/batchApply', {ids: JSON.stringify(ids)})
if (resp.code === 0) {
this.notifySuccess(resp.msg)
this.pageData()
this.$refs.table.clearSelection()
} else {
this.notifyWarning(resp.msg)
}
},
openUnitMove() {
const selections = this.$refs.table.selection
if (selections.length === 0) {
this.notifyWarning('请先勾选需要调整的数据')
return
}
this.checkUsers = selections
this.unitMoveVisibile = true
this.unitMoveFormData = {
unitId: '',
unionId: '',
unitName: '',
unionName: ''
}
},
handleClose(done) {
this.$confirm('确认关闭?')
.then(_ => {
done();
})
.catch(_ => {
});
},
async doUnitMove() {
if (this.unitMoveFormData.unitId === '') {
this.notifyWarning('请选择新单位!')
return
}
const selections = this.$refs.table.selection
const params = {
unitId: this.unitMoveFormData.unitId,
loginName: selections.map(v => v.loginName)
}
const resp = await $.post('/platform/sickHelp/retireesAudit/userUnitMove', params)
if (resp.code === 0) {
this.pageData()
this.$refs.table.clearSelection()
this.unitMoveVisibile = false
this.notifySuccess(resp.msg)
}
},
exportSummary() {
const {year, unionId, unitId} = this.pageForm
if (!year) {
this.notifyWarning('请先选择年度')
return
}
window.open(loc() + '/exportSummary?year=' + year + '&unionId=' + unionId + '&unitId=' + unitId)
},
exportApplyPaper(id) {
window.open('/platform/sickHelp/mySubsidyRecord/exportApplyPaper?id=' + id)
},
/*async doAudit(flag) {
const valid = await this.$refs['form'].validate()
if (!valid) return
const r = flag ? '通过' : '拒绝';
const confirm = await this.$confirm('你确定要' + r + '吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
if ('confirm' !== confirm) return
this.formData.auditPass = flag
const resp = await $.post(loc() + '/doAudit', this.formData)
if (resp.code === 0) {
this.$refs.guava.index()
this.doSearch()
} else {
this.notifyWarning(resp.msg)
}
},
async doRevoke(id) {
const confirm = await this.$confirm('你确定要撤回吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
if ('confirm' !== confirm) return
const resp = await $.post(loc() + '/doRevoke/' + id)
if (resp.code === 0) {
this.doSearch()
this.notifySuccess(resp.msg)
} else {
this.notifyWarning(resp.msg)
}
},*/
openView(id) {
this.$refs.guava.view()
this.$refs.sickView.openView(id)
},
async openAudit(id) {
this.$refs.guava.edit()
this.$refs.sickAudit.openAudit(id)
this.$set(this.formData, 'id', id)
this.$set(this.formData, 'auditOpinion', null)
},
async flushUnits() {
this.$set(this.pageForm, "unitId", "")
if ("${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')||@shiro.hasRole('H03')}" === 'true') {
this.units = await getUnits(this.pageForm.unionId)
} else {
this.units = await getUnits("${@shiro.getPrincipalProperty('unit').getUnionid()}")
}
},
async formUnionIdChange() {
this.$set(this.formData, "unitName", null)
if ("${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')||@shiro.hasRole('H03')}" === 'true') {
this.units = await getUnits(this.formData.unionId)
} else {
this.units = await getUnits("${@shiro.getPrincipalProperty('unit').getUnionid()}")
}
}
},
async created() {
this.pageData()
this.unions = await getUnions(null)
this.flushUnits()
this.unitMoveUnions = [...this.unions]
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,262 @@
<!--#
layout("/layouts/platform.html"){
#-->
<div id="app" v-cloak>
<guava ref="guava">
<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
placeholder="选择年度"
style="width: 100%"
type="year"
v-model="pageForm.year"
value-format="yyyy">
</el-date-picker>
</div>
</div>
<div class="search-item">
<div class="search-item-label">姓名工号:</div>
<div class="search-item-option">
<el-input clearable maxlength="20" v-model.trim="pageForm.keyword"></el-input>
</div>
</div>
<div class="search-item"
v-if="${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')||@shiro.hasRole('H03')}">
<div class="search-item-label">所属工会:</div>
<div class="search-item-option">
<el-select placeholder="所属工会" v-model="pageForm.unionId" style="width: 100%;"
clearable="true"
@change="flushUnits" @clear="flushUnits"
filterable="true">
<el-option v-for="item in unions" :label="item.unionname" :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 placeholder="所属单位" v-model="pageForm.unitId" style="width: 100%;"
clearable="true"
filterable="true">
<el-option v-for="item in units" :label="item.name" :value="item.id"></el-option>
</el-select>
</div>
</div>
<div class="search-query">
<el-button @click="doSearch" icon="el-icon-search" type="primary">搜索</el-button>
</div>
</div>
</el-card>
<el-card class="mt10" shadow="never">
<table-tool :app="this" label="审核列表">
<template #func>
<el-radio-group @change="doSearch()" size="small" v-model="pageForm.auditState">
<el-radio-button label="0">全部</el-radio-button>
<el-radio-button label="1">已审核</el-radio-button>
<el-radio-button label="-1">未审核</el-radio-button>
</el-radio-group>
</template>
</table-tool>
<el-table :data="tableData" :size="tableSize" @sort-change="pageOrder"
align="center" header-align="center">
<el-table-column align="center" header-align="center" label="序号" type="index" width="80">
<template scope="scope">
<span>{{ scope.$index + (pageForm.pageNumber - 1) * pageForm.pageSize + 1 }} </span>
</template>
</el-table-column>
<el-table-column
:label="column.label"
:prop="column.prop"
:sortable="column.sortable"
:width="column.width"
align="center"
header-align="center"
show-overflow-tooltip
v-for="column in tableColumns"
>
</el-table-column>
<el-table-column label="操作" width="250">
<template scope="{row}">
<el-button @click="openView(row.id)" size="mini" type="primary">查看</el-button>
<el-button :disabled="row.stateCode!=300" @click="openAudit(row.id)" size="mini" type="primary">
审核
</el-button>
<el-button :disabled="![400,500].includes(row.stateCode)"
@click="doRevoke(row.id,row.stateCode)" size="mini" type="danger">
撤回
</el-button>
</template>
</el-table-column>
</el-table>
<!--#include("/layouts/pagination.html"){}#-->
</el-card>
<template #view>
<sick-help-info ref="sickView"></sick-help-info>
</template>
<template #edit>
<sick-help-info ref="sickAudit">
<template #audit>
<el-tab-pane label="审核" name="999">
<vi-title title="校医院审核"></vi-title>
<el-form :model="formData" :rules="rules" label-width="120px" ref="form">
<el-row gutter="20">
<el-col :span="12">
<el-form-item label="审核人" prop="username">
<el-input readonly v-model="formData.username"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="审核时间" prop="auditTime">
<el-input readonly v-model="formData.auditTime"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-form-item label="审核意见" prop="auditOpinion">
<el-input maxlength="1000"
placeholder="请填写您的意见"
rows="4"
type="textarea"
v-model="formData.auditOpinion"></el-input>
</el-form-item>
<el-form-item label="校医院签字" prop="auditSign">
<sign :qz.sync="formData.auditSign"></sign>
</el-form-item>
</el-form>
<el-row justify="end" type="flex">
<el-button @click="doAudit(false)" type="danger">拒绝</el-button>
<el-button @click="doAudit(true)" type="primary">通过</el-button>
</el-row>
</el-tab-pane>
</template>
</sick-help-info>
</template>
</guava>
</div>
<script>
var vue = new Vue({
el: '#app',
mixins: [initTableMixins],
components: {
'SickHelpInfo': httpVueLoader('/components/sickHelp/SickHelpInfo.vue'),
},
data() {
return {
pageForm: {
auditState: 0,
year: (new Date().getFullYear() - 1).toString()
},
tableColumns: [
{prop: 'userName', label: '姓名'},
{prop: 'loginName', label: '工号'},
{prop: 'unitName', label: '单位', sortable: true},
// {prop: 'unionName', label: '分工会', sortable: true},
{prop: 'year', label: '年度', sortable: true},
{prop: 'selfPayMoney', label: '支付金额', sortable: true},
{prop: 'subsidyMoney', label: '补助金额', sortable: true},
// {prop: 'subsidyRatio', label: '补助比例', sortable: true},
{prop: 'remarks', label: '备注'},
// {prop: 'isMeetRequirements', label: '是否符合申请要求'},
// {prop: 'isAccept', label: '是否接受补助'},
{prop: 'stateName', label: '审核状态'}
],
formData: {
username: "${@shiro.getPrincipalProperty('username')}",
loginname: "${@shiro.getPrincipalProperty('loginname')}",
auditTime: moment().format('YYYY-MM-DD'),
auditOpinion: '',
auditSign: '',
auditPass: true
},
rules: {
auditSign: [{required: true, message: '请签字', trigger: ['change', 'blur']}],
auditOpinion: [{required: true, message: '请输入审核意见', trigger: ['change', 'blur']}]
},
unions: [],
units: []
}
},
methods: {
async doAudit(flag) {
const valid = await this.$refs['form'].validate()
if (!valid) return
const r = flag ? '通过' : '拒绝';
const confirm = await this.$confirm('你确定要' + r + '吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
if ('confirm' !== confirm) return
this.formData.auditPass = flag
const resp = await $.post(loc() + '/doAudit', this.formData)
if (resp.code === 0) {
this.$refs.guava.index()
this.doSearch()
} else {
this.notifyWarning(resp.msg)
}
},
async doRevoke(id, stateCode) {
if (![400, 500].includes(stateCode)) return
const confirm = await this.$confirm('你确定要撤回吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
if ('confirm' !== confirm) return
const resp = await $.post(loc() + '/doRevoke/' + id)
if (resp.code === 0) {
this.doSearch()
this.notifySuccess(resp.msg)
} else {
this.notifyWarning(resp.msg)
}
},
openView(id) {
this.$refs.guava.view()
this.$refs.sickView.openView(id)
},
async openAudit(id) {
this.$refs.guava.edit()
this.$refs.sickAudit.openAudit(id)
this.$set(this.formData, 'id', id)
this.$set(this.formData, 'auditOpinion', null)
},
async flushUnits() {
this.$set(this.pageForm, "unitId", "")
if ("${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')||@shiro.hasRole('H03')}" === 'true') {
this.units = await getUnits(this.pageForm.unionId)
} else {
this.units = await getUnits("${@shiro.getPrincipalProperty('unit').getUnionid()}")
}
},
},
async created() {
this.pageData()
this.unions = await getUnions(null)
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,646 @@
<!--#
layout("/layouts/platform.html"){
#-->
<div id="app" v-cloak>
<guava ref="guava">
<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
placeholder="选择年度"
style="width: 100%"
type="year"
v-model="pageForm.year"
value-format="yyyy">
</el-date-picker>
</div>
</div>
<div class="search-item">
<div class="search-item-label">关键字:</div>
<div class="search-item-option">
<el-input clearable maxlength="20" v-model.trim="pageForm.keyword"></el-input>
</div>
</div>
<div class="search-item"
v-if="${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')||@shiro.hasRole('H03')}">
<div class="search-item-label">所属工会:</div>
<div class="search-item-option">
<el-select placeholder="所属工会" v-model="pageForm.unionId" style="width: 100%;"
clearable="true"
@change="flushUnits" @clear="flushUnits"
filterable="true">
<el-option v-for="item in unions" :label="item.unionname" :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 placeholder="所属单位" v-model="pageForm.unitId" style="width: 100%;"
clearable="true"
filterable="true">
<el-option v-for="item in units" :label="item.name" :value="item.id"></el-option>
</el-select>
</div>
</div>
<div class="search-query">
<el-button @click="doSearch" icon="el-icon-search" type="primary">搜索</el-button>
</div>
</div>
</el-card>
<el-card class="mt10" shadow="never">
<table-tool :app="this" label="审核列表">
<template #func>
<!--<el-radio-group @change="doSearch()" size="small" v-model="pageForm.auditState">
<el-radio-button label="0">全部</el-radio-button>
<el-radio-button label="1">已审核</el-radio-button>
<el-radio-button label="-1">未审核</el-radio-button>
</el-radio-group>-->
<el-button type="primary" size="small" class="ml10" @click="batchApply">批量申请
</el-button>
<el-button type="primary" size="small" class="ml10" @click="batchExportApplyPaper">批量导出个人表
</el-button>
<el-button type="primary" size="small" @click="exportSummary">导出汇总表</el-button>
<el-button type="primary" size="small" icon="el-icon-edit" @click="openUnitMove" class="ml5">
单位调整
</el-button>
</template>
</table-tool>
<el-table :data="tableData" :size="tableSize" @sort-change="pageOrder"
ref="table"
align="center" header-align="center">
<el-table-column type="selection"></el-table-column>
<el-table-column align="center" header-align="center" label="序号" type="index" width="80">
<template scope="scope">
<span>{{ scope.$index + (pageForm.pageNumber - 1) * pageForm.pageSize + 1 }} </span>
</template>
</el-table-column>
<el-table-column
:label="column.label"
:prop="column.prop"
:sortable="column.sortable"
:width="column.width"
align="center"
header-align="center"
show-overflow-tooltip
v-for="column in tableColumns"
>
<template scope="{row}" v-if="column.prop=='isMeetRequirements'">
<span class="text-success" v-if="row.isMeetRequirements">
符合
</span>
<span class="text-danger" v-else>
不符合
</span>
</template>
<template scope="{row}" v-else-if="column.prop==='isAccept'">
<span v-if="row.isAccept !== null"
:class="{'text-success': row.isAccept, 'text-danger': !row.isAccept}">
{{ row.isAccept ? '申请' : '放弃' }}
</span>
<span v-else class="text-info"></span>
</template>
</el-table-column>
<el-table-column label="操作" width="350">
<template scope="{row}">
<el-button @click="openView(row.id)" size="mini" type="primary">查看</el-button>
<!--<el-button :disabled="row.stateCode!=100" @click="openAudit(row.id)" size="mini" type="primary">
审核
</el-button>
<el-button :disabled="row.stateCode<300" @click="doRevoke(row.id)" size="mini" type="danger">
撤回
</el-button>-->
<el-button @click="exportApplyPaper(row.id)" size="mini" type="primary">导出</el-button>
<el-button :disabled="row.isAccept!=null || !row.isMeetRequirements || row.stateCode > 210"
@click="applySubsidy(row)" size="mini"
type="primary">申请
</el-button>
<el-button :disabled="!row.isMeetRequirements || row.stateCode >210 || row.isAccept==0"
@click="userHandler(row.id,row.isAccept,false)"
size="mini"
type="danger">放弃
</el-button>
</template>
</el-table-column>
</el-table>
<!--#include("/layouts/pagination.html"){}#-->
</el-card>
<template #view>
<sick-help-info ref="sickView"></sick-help-info>
</template>
<template #edit>
<sick-help-info ref="sickAudit">
<template #audit>
<el-tab-pane label="审核" name="999">
<vi-title title="基层工会审核"></vi-title>
<el-form :model="formData" :rules="rules" label-width="120px" ref="form">
<el-row gutter="20">
<el-col :span="12">
<el-form-item label="审核人" prop="username">
<el-input readonly v-model="formData.username"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="审核时间" prop="auditTime">
<el-input readonly v-model="formData.auditTime"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-form-item label="审核意见" prop="auditOpinion">
<el-input maxlength="1000"
placeholder="请填写您的意见"
rows="4"
type="textarea"
v-model="formData.auditOpinion"></el-input>
</el-form-item>
<el-form-item label="基层工会签字" prop="auditSign">
<sign :qz.sync="formData.auditSign"></sign>
</el-form-item>
</el-form>
<el-row justify="end" type="flex">
<el-button @click="doAudit(false)" type="danger">拒绝</el-button>
<el-button @click="doAudit(true)" type="primary">通过</el-button>
</el-row>
</el-tab-pane>
</template>
</sick-help-info>
</template>
<el-dialog :close-on-click-modal="false" :visible.sync="applyDialog" title="申请补助" width="60%">
<el-form :model="formData" :rules="rules" label-width="auto" ref="form">
<el-row :gutter="10">
<el-col :lg="12" :md="24" :sm="24" :xl="12" :xs="24">
<el-form-item label="姓名" prop="userName">
<el-input :value="formData.userName" readonly></el-input>
</el-form-item>
</el-col>
<el-col :lg="12" :md="24" :sm="24" :xl="12" :xs="24">
<el-form-item label="性别" prop="sex">
<el-radio-group v-model="formData.sex" size="mini">
<el-radio label="男" border></el-radio>
<el-radio label="女" border></el-radio>
</el-radio-group>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="10">
<el-col :lg="12" :md="24" :sm="24" :xl="12" :xs="24">
<el-form-item label="出生年月" prop="birthday">
<el-date-picker
style="width: 100%"
type="date"
v-model="formData.birthday"
value-format="yyyy-MM-dd">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :lg="12" :md="24" :sm="24" :xl="12" :xs="24">
<el-form-item label="入会时间" prop="mutualGoldStartTime">
<el-date-picker
readonly
style="width: 100%"
type="date"
v-model="formData.mutualGoldStartTime"
value-format="yyyy-MM-dd">
</el-date-picker>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="10">
<el-col :lg="12" :md="24" :sm="24" :xl="12" :xs="24">
<el-form-item label="工作单位" prop="unitName">
<el-input :value="formData.unitName"></el-input>
</el-form-item>
</el-col>
<el-col :lg="12" :md="24" :sm="24" :xl="12" :xs="24">
<el-form-item label="家庭住址" prop="homeAddress">
<el-input v-model="formData.homeAddress"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-form-item label="申请理由" prop="applyReason">
<el-input
:autosize="{ minRows: 3, maxRows: 5}"
autosize
placeholder="请输入申报补助理由(患何种疾病)"
type="textarea"
v-model="formData.applyReason">
</el-input>
</el-form-item>
<el-row :gutter="10">
<el-col :lg="12" :md="24" :sm="24" :xl="12" :xs="24">
<el-form-item label="个人支付金额">
<el-input-number :max="99999999.99" :min="0" :precision="2"
readonly
style="width: 100%" v-model="formData.selfPayMoney"></el-input-number>
</el-form-item>
</el-col>
<el-col :lg="12" :md="24" :sm="24" :xl="12" :xs="24">
<el-form-item label="补助金额">
<el-input-number :max="99999999.99" :min="0" :precision="2"
readonly
style="width: 100%" v-model="formData.subsidyMoney"></el-input-number>
</el-form-item>
</el-col>
</el-row>
<el-form-item label="申请人签字" prop="applyUserSign">
<sign :qz.sync="formData.applyUserSign"></sign>
</el-form-item>
<el-row class="mt10" justify="end" type="flex">
<el-button @click="applyDialog=false">取消</el-button>
<el-button @click="doApply" type="primary">提交</el-button>
</el-row>
</el-form>
</el-dialog>
<el-drawer
title="单位调整"
:visible.sync="unitMoveVisibile"
:before-close="handleClose" size="1000px">
<el-row class="text-primary p20">
选择新单位
</el-row>
<el-row type="flex" :gutter="20" class="pl20 pr20">
<el-col :span="12">
<el-select placeholder="所属工会" v-model="unitMoveFormData.unionId" style="width: 100%;"
clearable="true"
@change="moveUnionsChange"
filterable="true">
<el-option v-for="item in unitMoveUnions" :label="item.unionname" :value="item.id"></el-option>
</el-select>
</el-col>
<el-col :span="12">
<el-select v-model="unitMoveFormData.unitId" style="width: 100%" filterable clearable
@change="moveUnitChange"
placeholder="请选择单位">
<el-option
v-for="item in unitMoveUnits"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</el-col>
</el-row>
<el-row class="mt10">
<el-table :data="checkUsers" style="width: 100%;padding: 20px" class="vi-table"
border
height="70vh">
<el-table-column show-overflow-tooltip align="center" header-align="center" prop="loginName"
width="120"
label="工号"></el-table-column>
<el-table-column show-overflow-tooltip align="center" header-align="center" prop="userName"
width="120"
label="姓名"></el-table-column>
<el-table-column show-overflow-tooltip align="center" header-align="center" prop="unitName"
label="当前单位"></el-table-column>
<el-table-column show-overflow-tooltip align="center" header-align="center" prop="unionName"
label="当前工会"></el-table-column>
<el-table-column show-overflow-tooltip align="center" header-align="center"
label="新单位">
<template slot-scope="{row}">
<span>{{unitMoveFormData.unitName}}</span>
</template>
</el-table-column>
<el-table-column show-overflow-tooltip align="center" header-align="center"
label="新分工会">
<template slot-scope="{row}">
<span>{{unitMoveFormData.unionName}}</span>
</template>
</el-table-column>
</el-table>
</el-row>
<span style="position: absolute;bottom: 20px;right: 20px">
<el-button @click="unitMoveVisibile = false">取 消</el-button>
<el-button type="primary" @click="doUnitMove">确定</el-button>
</span>
</el-drawer>
</guava>
</div>
<script>
var vue = new Vue({
el: '#app',
mixins: [initTableMixins],
components: {
'SickHelpInfo': httpVueLoader('/components/sickHelp/SickHelpInfo.vue'),
},
data() {
return {
pageForm: {
auditState: 0,
year: (new Date().getFullYear() - 1).toString(),
unionId: "",
unitId: "",
keyword: ""
},
tableColumns: [
{prop: 'userName', label: '姓名'},
{prop: 'loginName', label: '工号'},
{prop: 'unitName', label: '单位', sortable: true},
// {prop: 'unionName', label: '分工会', sortable: true},
{prop: 'year', label: '年度', sortable: true},
{prop: 'selfPayMoney', label: '支付金额', sortable: true},
{prop: 'subsidyMoney', label: '补助金额', sortable: true},
// {prop: 'subsidyRatio', label: '补助比例', sortable: true},
{prop: 'isMeetRequirements', label: '是否符合申请要求'},
{prop: 'isAccept', label: '是否申请补助'},
{prop: 'stateName', label: '审核状态'}
],
formData: {
/*username: "${@shiro.getPrincipalProperty('username')}",
loginname: "${@shiro.getPrincipalProperty('loginname')}",
auditTime: moment().format('YYYY-MM-DD'),
auditOpinion: '',
auditSign: '',
auditPass: true*/
},
/*rules: {
auditSign: [{required: true, message: '请签字', trigger: ['change', 'blur']}],
auditOpinion: [{required: true, message: '请输入审核意见', trigger: ['change', 'blur']}]
},*/
unions: [],
units: [],
rules: {
applyUserSign: [{required: false, message: '请签字', trigger: ['change', 'blur']}],
applyReason: [{required: false, message: '请输入申请理由', trigger: ['change', 'blur']}],
sex: [{required: false, message: '请选择性别', trigger: ['change', 'blur']}],
birthday: [{required: false, message: '请输入出生年月', trigger: ['change', 'blur']}],
mutualGoldStartTime: [{
required: true,
message: '请输入参加大病医疗互助时间',
trigger: ['change', 'blur']
}],
unitName: [{required: true, message: '请输入工作单位', trigger: ['change', 'blur']}],
homeAddress: [{required: false, message: '请输入家庭住址', trigger: ['change', 'blur']}],
},
applyDialog: false,
unitMoveVisibile: false,
unitMoveUnions: [],
unitMoveUnits: [],
unitMoveFormData: {
unitId: '',
unionId: '',
unitName: '',
unionName: ''
},
checkUsers: []
}
},
methods: {
async moveUnionsChange(val) {
if (val) {
this.unitMoveUnits = await getUnits(val)
this.$set(this.unitMoveFormData, 'unionName', this.unitMoveUnions.find(v => v.id === val).unionname)
this.$set(this.unitMoveFormData, 'unitId', '')
this.$set(this.unitMoveFormData, 'unitName', '')
} else {
this.$set(this.unitMoveFormData, 'unitId', '')
this.$set(this.unitMoveFormData, 'unitName', '')
this.$set(this.unitMoveFormData, 'unionName', '')
this.unitMoveUnits = []
}
},
moveUnitChange(val) {
if (val) {
this.$set(this.unitMoveFormData, 'unitName', this.unitMoveUnits.find(v => v.id === val).name)
} else {
this.$set(this.unitMoveFormData, 'unitName', '')
}
},
async applySubsidy(row) {
this.applyDialog = true
this.formData = clone(row)
await this.getApplyUserInfo(row.loginName)
},
async getApplyUserInfo(loginName) {
const resp = await $.get(loc() + '/getApplyUserInfo', {loginName})
if (resp.code === 0) {
const {userName, loginName, unitName, sex, homeAddress, birthday, mutualGoldStartTime} = resp.data
this.$set(this.formData, 'userName', userName)
this.$set(this.formData, 'loginName', loginName)
this.$set(this.formData, 'unitName', unitName)
this.$set(this.formData, 'sex', sex)
this.$set(this.formData, 'homeAddress', homeAddress)
this.$set(this.formData, 'birthday', birthday)
this.$set(this.formData, 'mutualGoldStartTime', mutualGoldStartTime)
}
},
async doApply() {
const valid = await this.$refs['form'].validate()
if (!valid) return
const resp = await $.post(loc() + '/doApply', this.formData)
if (resp.code === 0) {
this.applyDialog = false
this.notifySuccess(resp.msg)
this.doSearch()
} else {
this.notifyWarning(resp.msg)
}
},
async userHandler(id, isAccept, userChoice) {
if (isAccept) return
const msg = '您确认要' + (userChoice ? '接受' : '放弃') + '该用户的补助申请吗?'
const confirm = await this.$confirm(msg, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
if ('confirm' !== confirm) return
const resp = await $.post('/platform/sickHelp/mySubsidyRecord/acceptSubsidy', {
id,
isAccept: userChoice
})
if (resp.code === 0) {
this.notifySuccess(resp.msg)
this.pageData()
} else {
this.notifyError(resp.msg)
}
},
batchExportApplyPaper() {
const selections = this.$refs.table.selection
if (selections.length === 0) {
this.notifyWarning('请先勾选需要导出的数据')
return
}
const ids = selections.map(v => v.id)
window.open(loc() + '/batchExportApplyPaper?ids=' + JSON.stringify(ids))
},
async batchApply() {
const selections = this.$refs.table.selection
if (selections.length === 0) {
this.notifyWarning('请先勾选需要批量申请的记录')
return
}
const confirm = await this.$confirm('您确定要将勾选的记录申请补助吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
if (confirm !== 'confirm') return
const ids = selections.map(v => v.id)
const resp = await $.post(loc() + '/batchApply', {ids: JSON.stringify(ids)})
if (resp.code === 0) {
this.notifySuccess(resp.msg)
this.pageData()
this.$refs.table.clearSelection()
} else {
this.notifyWarning(resp.msg)
}
},
openUnitMove() {
const selections = this.$refs.table.selection
if (selections.length === 0) {
this.notifyWarning('请先勾选需要调整的数据')
return
}
this.checkUsers = selections
this.unitMoveVisibile = true
this.unitMoveFormData = {
unitId: '',
unionId: '',
unitName: '',
unionName: ''
}
},
handleClose(done) {
this.$confirm('确认关闭?')
.then(_ => {
done();
})
.catch(_ => {
});
},
async doUnitMove() {
if (this.unitMoveFormData.unitId === '') {
this.notifyWarning('请选择新单位!')
return
}
const selections = this.$refs.table.selection
const params = {
unitId: this.unitMoveFormData.unitId,
loginName: selections.map(v => v.loginName)
}
const resp = await $.post(loc() + '/userUnitMove', params)
if (resp.code === 0) {
this.pageData()
this.$refs.table.clearSelection()
this.unitMoveVisibile = false
this.notifySuccess(resp.msg)
}
},
exportSummary() {
const {year, unionId, unitId} = this.pageForm
if (!year) {
this.notifyWarning('请先选择年度')
return
}
window.open(loc() + '/exportSummary?year=' + year + '&unionId=' + unionId + '&unitId=' + unitId)
},
exportApplyPaper(id) {
window.open('/platform/sickHelp/mySubsidyRecord/exportApplyPaper?id=' + id)
},
/*async doAudit(flag) {
const valid = await this.$refs['form'].validate()
if (!valid) return
const r = flag ? '通过' : '拒绝';
const confirm = await this.$confirm('你确定要' + r + '吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
if ('confirm' !== confirm) return
this.formData.auditPass = flag
const resp = await $.post(loc() + '/doAudit', this.formData)
if (resp.code === 0) {
this.$refs.guava.index()
this.doSearch()
} else {
this.notifyWarning(resp.msg)
}
},
async doRevoke(id) {
const confirm = await this.$confirm('你确定要撤回吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
if ('confirm' !== confirm) return
const resp = await $.post(loc() + '/doRevoke/' + id)
if (resp.code === 0) {
this.doSearch()
this.notifySuccess(resp.msg)
} else {
this.notifyWarning(resp.msg)
}
},*/
openView(id) {
this.$refs.guava.view()
this.$refs.sickView.openView(id)
},
async openAudit(id) {
this.$refs.guava.edit()
this.$refs.sickAudit.openAudit(id)
this.$set(this.formData, 'id', id)
this.$set(this.formData, 'auditOpinion', null)
},
async flushUnits() {
this.$set(this.pageForm, "unitId", "")
if ("${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')||@shiro.hasRole('H03')}" === 'true') {
this.units = await getUnits(this.pageForm.unionId)
} else {
this.units = await getUnits("${@shiro.getPrincipalProperty('unit').getUnionid()}")
}
},
},
async created() {
this.pageData()
this.unions = await getUnions(null)
this.flushUnits()
this.unitMoveUnions = [...this.unions]
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,334 @@
<!--#
layout("/layouts/platform.html"){
#-->
<div id="app" v-cloak>
<guava ref="guava">
<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
placeholder="选择年度"
style="width: 100%"
type="year"
v-model="pageForm.year"
value-format="yyyy">
</el-date-picker>
</div>
</div>
<div class="search-item">
<div class="search-item-label">姓名工号:</div>
<div class="search-item-option">
<el-input clearable maxlength="20" v-model.trim="pageForm.keyword"></el-input>
</div>
</div>
<div class="search-item"
v-if="${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')||@shiro.hasRole('H03')}">
<div class="search-item-label">所属工会:</div>
<div class="search-item-option">
<el-select placeholder="所属工会" v-model="pageForm.unionId" style="width: 100%;"
clearable="true"
@change="flushUnits" @clear="flushUnits"
filterable="true">
<el-option v-for="item in unions" :label="item.unionname" :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 placeholder="所属单位" v-model="pageForm.unitId" style="width: 100%;"
clearable="true"
filterable="true">
<el-option v-for="item in units" :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 clearable filterable style="width: 100%"
v-model="pageForm.isMember">
<el-option label="全部" :value="null"></el-option>
<el-option label="是" :value="1"></el-option>
<el-option label="否" :value="0"></el-option>
</el-select>
</div>
</div>
<div class="search-query">
<el-button @click="doSearch" icon="el-icon-search" type="primary">搜索</el-button>
</div>
</div>
</el-card>
<el-card class="mt10" shadow="never">
<table-tool :app="this" label="审核列表">
<template #func>
<el-button size="small" type="primary" class="mr5" @click="batchAudit">批量审核</el-button>
<el-button size="small" type="primary" class="mr5" @click="doExport">导出汇总表</el-button>
<el-radio-group @change="doSearch()" size="small" v-model="pageForm.auditState">
<el-radio-button label="0">全部</el-radio-button>
<el-radio-button label="1">已审核</el-radio-button>
<el-radio-button label="-1">未审核</el-radio-button>
</el-radio-group>
<el-radio-group @change="doSearch()" size="small" v-model="pageForm.isAccept" class="ml10">
<el-radio-button label="null">全部</el-radio-button>
<el-radio-button label="1">申请</el-radio-button>
<el-radio-button label="0">放弃</el-radio-button>
</el-radio-group>
</template>
</table-tool>
<el-table :data="tableData" :size="tableSize" @sort-change="pageOrder"
row-key="id"
ref="table"
align="center" header-align="center">
<el-table-column type="selection" reserve-selection
:selectable="(row)=>{return row.stateCode===500}"></el-table-column>
<el-table-column align="center" header-align="center" label="序号" type="index" width="80">
<template scope="scope">
<span>{{ scope.$index + (pageForm.pageNumber - 1) * pageForm.pageSize + 1 }} </span>
</template>
</el-table-column>
<el-table-column
:label="column.label"
:prop="column.prop"
:sortable="column.sortable"
:width="column.width"
align="center"
header-align="center"
show-overflow-tooltip
v-for="column in tableColumns"
>
<template scope="{row}" v-if="column.prop==='isAccept'">
<span v-if="row.isAccept !== null"
:class="{'text-success': row.isAccept, 'text-danger': !row.isAccept}">
{{ row.isAccept ? '申请' : '放弃' }}
</span>
<span v-else class="text-info"></span>
</template>
<template scope="{row}" v-else-if="column.prop==='stateName'">
<vi-table-state :state="row"></vi-table-state>
</template>
</el-table-column>
<el-table-column label="操作" width="250">
<template scope="{row}">
<el-button @click="openView(row.id)" size="mini" type="primary">查看</el-button>
<el-button :disabled="row.stateCode!=500" @click="openAudit(row.id)" size="mini" type="primary">
审核
</el-button>
<el-button :disabled="![600,700].includes(row.stateCode)"
@click="doRevoke(row.id,row.stateCode)" size="mini" type="danger">
撤回
</el-button>
</template>
</el-table-column>
</el-table>
<!--#include("/layouts/pagination.html"){}#-->
</el-card>
<template #view>
<sick-help-info ref="sickView"></sick-help-info>
</template>
<template #edit>
<sick-help-info ref="sickAudit">
<template #audit>
<el-tab-pane label="审核" name="999">
<vi-title title="校工会审核"></vi-title>
<el-form :model="formData" :rules="rules" label-width="120px" ref="form">
<el-row gutter="20">
<el-col :span="12">
<el-form-item label="审核人" prop="username">
<el-input readonly v-model="formData.username"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="审核时间" prop="auditTime">
<el-input readonly v-model="formData.auditTime"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-form-item label="审核意见" prop="auditOpinion">
<el-input maxlength="1000"
placeholder="请填写您的意见"
rows="4"
type="textarea"
v-model="formData.auditOpinion"></el-input>
</el-form-item>
<el-form-item label="校工会签字" prop="auditSign">
<sign :qz.sync="formData.auditSign"></sign>
</el-form-item>
</el-form>
<el-row justify="end" type="flex">
<!-- <el-button @click="doAudit(false)" type="danger">拒绝</el-button>-->
<el-button @click="doAudit(true)" type="primary">通过</el-button>
</el-row>
</el-tab-pane>
</template>
</sick-help-info>
</template>
</guava>
</div>
<script>
var vue = new Vue({
el: '#app',
mixins: [initTableMixins],
components: {
'SickHelpInfo': httpVueLoader('/components/sickHelp/SickHelpInfo.vue'),
},
data() {
return {
pageForm: {
auditState: 0,
year: (new Date().getFullYear() - 1).toString(),
isMember: null,
isAccept: null
},
tableColumns: [
{prop: 'userName', label: '姓名'},
{prop: 'loginName', label: '工号'},
{prop: 'unitName', label: '单位', sortable: true},
// {prop: 'unionName', label: '分工会', sortable: true},
{prop: 'year', label: '年度', sortable: true},
{prop: 'selfPayMoney', label: '个人支付金额(元)', sortable: true},
{prop: 'subsidyMoney', label: '补助金额(元)', sortable: true},
// {prop: 'subsidyRatio', label: '补助比例', sortable: true},
// {prop: 'isMeetRequirements', label: '是否符合申请要求'},
// {prop: 'isAccept', label: '是否接受补助'},
{prop: 'isAccept', label: '是否申请补助'},
{prop: 'stateName', label: '审核状态'},
{prop: 'remarks', label: '备注'}
],
formData: {
username: "${@shiro.getPrincipalProperty('username')}",
loginname: "${@shiro.getPrincipalProperty('loginname')}",
auditTime: moment().format('YYYY-MM-DD'),
auditOpinion: '',
auditSign: '',
auditPass: true
},
rules: {
auditSign: [{required: false, message: '请签字', trigger: ['change', 'blur']}],
auditOpinion: [{required: true, message: '请输入审核意见', trigger: ['change', 'blur']}]
},
unions: [],
units: [],
selections: []
}
},
methods: {
async doAudit(flag) {
const valid = await this.$refs['form'].validate()
if (!valid) return
const r = flag ? '通过' : '拒绝';
const confirm = await this.$confirm('你确定要' + r + '吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
if ('confirm' !== confirm) return
this.formData.auditPass = flag
const resp = await $.post(loc() + '/doAudit', this.formData)
if (resp.code === 0) {
this.$refs.guava.index()
this.doSearch()
} else {
this.notifyWarning(resp.msg)
}
},
async doRevoke(id, stateCode) {
if (![600, 700].includes(stateCode)) return
const confirm = await this.$confirm('你确定要撤回吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
if ('confirm' !== confirm) return
const resp = await $.post(loc() + '/doRevoke/' + id)
if (resp.code === 0) {
this.doSearch()
this.notifySuccess(resp.msg)
} else {
this.notifyWarning(resp.msg)
}
},
openView(id) {
this.$refs.guava.view()
this.$refs.sickView.openView(id)
},
async openAudit(id) {
this.$refs.guava.edit()
this.$refs.sickAudit.openAudit(id)
this.$set(this.formData, 'id', id)
this.$set(this.formData, 'auditOpinion', '同意')
},
async flushUnits() {
this.$set(this.pageForm, "unitId", "")
if ("${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')||@shiro.hasRole('H03')}" === 'true') {
this.units = await getUnits(this.pageForm.unionId)
} else {
this.units = await getUnits("${@shiro.getPrincipalProperty('unit').getUnionid()}")
}
},
doExport() {
const {year, auditState} = this.pageForm
if (!year) {
this.notifyWarning('请先选择年度')
return
}
window.open(loc() + '/doExport?year=' + year + '&auditState=' + auditState)
},
async batchAudit() {
const selection = this.$refs.table.selection
if (selection.length === 0) {
this.notifyWarning('请选择需要批量审核的记录')
return
}
const confirm = await this.$confirm('你确定要通过勾选的记录吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
if ('confirm' !== confirm) return
const ids = selection.map(v => v.id)
const resp = await $.post(loc() + '/batchAudit', {ids: JSON.stringify(ids)})
if (resp.code === 0) {
this.doSearch()
this.$refs.table.clearSelection()
} else {
this.notifyWarning(resp.msg)
}
}
},
async created() {
this.pageData()
this.unions = await getUnions(null)
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,276 @@
<!--#
layout("/layouts/platform.html"){
#-->
<style>
.sickCountCard {
cursor: pointer;
transition: all linear 0.5s;
line-height: 2;
border-radius: 6px;
display: flex;
justify-content: space-between;
padding: 20px;
min-width: 220px;
margin: 5px;
background-color: #0e78c5;
color: #FFFFFF;
}
.sickCountCard .info-label {
font-size: 20px;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.sickCountCard .info-label::before {
content: '';
border-left: 3px solid #FFFFFF;
margin-right: 5px;
}
.sickCountCard .info-num {
font-size: 35px;
}
@media only screen and (max-width: 767px) {
}
</style>
<div id="app" v-cloak>
<guava ref="guava">
<div style="min-width: 500px">
<el-row :gutter="20" ref="sickCountDom" style="flex-wrap: wrap;" type="flex">
<el-col :lg="12" :md="12" :sm="24" :xl="6" :xs="24">
<div class="sickCountCard">
<div class="info-label">总补助次数</div>
<div class="info-num">{{sickCount.servedCount}}</div>
</div>
</el-col>
<el-col :lg="12" :md="12" :sm="24" :xl="6" :xs="24">
<div class="sickCountCard">
<div class="info-label">总补助教师人数</div>
<div class="info-num">{{sickCount.servedUserCount}}</div>
</div>
</el-col>
<el-col :lg="12" :md="12" :sm="24" :xl="6" :xs="24">
<div class="sickCountCard">
<div class="info-label">总补助金额</div>
<div class="info-num">{{sickCount.subsidyMoneySum}}</div>
</div>
</el-col>
<el-col :lg="12" :md="12" :sm="24" :xl="6" :xs="24">
<div class="sickCountCard">
<div class="info-label">当年补助金额</div>
<div class="info-num">{{sickCount.currentYearSubsidyMoneySum}}</div>
</div>
</el-col>
</el-row>
<el-row :gutter="20" :style="{height:chartRowHeight,position:'relative'}" class="mt20" id="chart-row">
<el-col :lg="12" :xs="24">
<el-card class="mb10" shadow="never">
<vi-title title="年度补助人数趋势"></vi-title>
<div :style="{height: chartHeight}" id="yearUser"></div>
</el-card>
</el-col>
<el-col :lg="12" :xs="24">
<el-card class="mb10" shadow="never">
<vi-title title="年度补助金额趋势"></vi-title>
<div :style="{height: chartHeight}" id="yearSubsidyMoney"></div>
</el-card>
</el-col>
</el-row>
</div>
</guava>
</div>
<script>
let yearUserChart, yearSubsidyMoneyChart = null
var vue = new Vue({
el: '#app',
mixins: [initTableMixins],
data() {
return {
sickCount: {},
yearData: [],
chartRowHeight: null,
chartHeight: null
}
},
methods: {
async getSickCount() {
const resp = await $.get(loc() + '/getSickCountData')
this.sickCount = resp.data
},
async getYearCount() {
const resp = await $.get(loc() + '/getYearCountData')
this.yearData = resp.data
this.$nextTick(async () => {
await this.calcChartRowHeightHeight()
console.log('----')
this.renderYearUser()
this.renderYearSubsidyMoney()
})
},
renderYearUser() {
console.log('开始渲染')
const chartDom = document.getElementById('yearUser')
yearUserChart = echarts.init(chartDom)
const option = {
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'shadow'
}
},
xAxis: {
name: '年度',
type: 'category',
data: this.yearData.map(v => v.year)
},
yAxis: {
name: '补助人数(人)',
type: 'value'
},
series: [
{
data: this.yearData.map(v => v.userCount),
type: 'bar',
showBackground: true,
backgroundStyle: {
color: 'rgba(180, 180, 180, 0.2)'
},
itemStyle: {
normal: {
label: {
formatter: '{c}' + '人',
show: true,
position: 'top',
textStyle: {
fontWeight: 'bolder',
fontSize: '15'
},
width: 30,
overflow: 'break'
}
}
}
}
],
dataZoom: [
{
type: "slider",
show: true,
xAxisIndex: [0],
startValue: new Date().getFullYear() - 5,
endValue: new Date().getFullYear(),
textStyle: {
color: "#ccd7d7"
}
},
],
}
yearUserChart.setOption(option)
},
renderYearSubsidyMoney() {
const chartDom = document.getElementById('yearSubsidyMoney')
yearSubsidyMoneyChart = echarts.init(chartDom)
const option = {
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'shadow'
}
},
xAxis: {
name: '年度',
type: 'category',
data: this.yearData.map(v => v.year)
},
yAxis: {
name: '补助金额(元)',
type: 'value'
},
series: [
{
data: this.yearData.map(v => v.subsidyMoneySum),
type: 'bar',
barWidth: 30,
showBackground: true,
backgroundStyle: {
color: 'rgba(180, 180, 180, 0.2)'
},
itemStyle: {
normal: {
label: {
formatter: '{c}' + '元',
show: true,
position: 'top',
textStyle: {
fontWeight: 'bolder',
fontSize: '15'
},
width: 80,
overflow: 'break'
}
}
}
}
],
dataZoom: [
{
type: "slider",
show: true,
xAxisIndex: [0],
startValue: new Date().getFullYear() - 5,
endValue: new Date().getFullYear(),
textStyle: {
color: "#ccd7d7"
}
},
],
}
yearSubsidyMoneyChart.setOption(option)
},
calcChartRowHeightHeight() {
return new Promise(resolve => {
this.$nextTick(() => {
const top = document.getElementById('chart-row').getBoundingClientRect().top
this.chartRowHeight = (window.innerHeight - top - 10) + 'px'
this.chartHeight = (window.innerHeight - top - 10 - 20 - 20 - 50) + 'px'
console.log('高度获取完毕')
resolve()
})
})
},
onResize() {
window.onresize = async () => {
if (window.innerWidth < 1200) {
this.chartRowHeight = '720px'
this.chartHeight = '630px'
} else {
await this.calcChartRowHeightHeight()
}
yearUserChart.resize()
yearSubsidyMoneyChart.resize()
}
}
},
mounted() {
this.getSickCount()
this.getYearCount()
this.onResize()
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,290 @@
<!--#
layout("/layouts/platform.html"){
#-->
<style>
.downLoadTemplate {
position: absolute;
right: 0;
top: 0;
}
.dividing-line {
display: flex;
justify-content: center;
position: relative;
margin: 10px 0;
}
.dividing-line::after {
content: '';
position: absolute;
border-bottom: 1px solid #ebeef5;
width: calc(100% + 40px);
bottom: 0;
}
</style>
<div id="app" v-cloak>
<guava>
<el-card shadow="never" style="position: relative">
<template #header>
<h3 style="color: rgb(24, 103, 176);">补助计算(excel批量导入)</h3>
</template>
<el-row justify="center" style="position: relative" type="flex">
<div class="downLoadTemplate">
<el-button @click="downLoadTemplate" size="small"
type="primary">
下载模板
</el-button>
</div>
<el-upload
:action="uploadUrl"
:auto-upload="true"
:file-list="files"
:limit="1"
:on-error="handleError"
:on-exceed="()=>{this.notifyWarning('只能上传一个文件')}"
:on-progress="handleProgress"
:on-remove="(f,fl)=>{fileList = fl;tableData=[];globalYear=null;}"
:on-success="handleSuccess"
accept=".xls,.xlsx"
drag
ref="excelUpload">
<i class="el-icon-upload"></i>
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
</el-upload>
</el-row>
<div class="dividing-line"></div>
<div class="mt20" id="excel-table-container">
<vi-title2 title="计算结果">
<template #func>
<el-button :disabled="tableData.length===0" @click="checkAgain" size="small" type="primary">
重新校验
</el-button>
<el-button :disabled="tableData.length===0" @click="doImport" size="small" type="primary">导入数据
</el-button>
</template>
</vi-title2>
<el-table :data="tableData" :summary-method="summaryMethod" max-height="887" ref="table"
show-summary
v-loading="tableLoading"
v-sticky="{top: 0,parent: '#app'}">
<el-table-column label="序号" type="index"></el-table-column>
<el-table-column label="校验" prop="validMsg" show-overflow-tooltip>
<template scope="{row}">
<span :class="row.valid?'text-success':'text-danger'">{{row.validMsg.join('、')}}</span>
</template>
</el-table-column>
<el-table-column label="工号" prop="loginName" width="150">
<!-- <template scope="{row}">-->
<!-- <el-input v-model="row.loginName" maxlength="10" size="small"></el-input>-->
<!-- </template>-->
</el-table-column>
<el-table-column label="姓名" prop="userName" width="150">
<!-- <template scope="{row}">-->
<!-- <el-input v-model="row.userName" maxlength="10" size="small"></el-input>-->
<!-- </template>-->
</el-table-column>
<el-table-column label="单位" prop="unitName" show-overflow-tooltip width="150">
<!-- <template scope="{row}">-->
<!-- <el-input v-model="row.unitName" maxlength="10" size="small"></el-input>-->
<!-- </template>-->
</el-table-column>
<el-table-column label="个人支付金额(元)" prop="selfPayMoney" width="200">
<!-- <template scope="{row}">-->
<!-- <el-input-number v-model="row.selfPayMoney" :min="0" :max="999999"-->
<!-- :precision="2" size="small" style="width: 100%"></el-input-number>-->
<!-- </template>-->
</el-table-column>
<el-table-column label="计算金额(员)" prop="noLimitSubsidyMoney" width="200"></el-table-column>
<el-table-column label="补助金额(元)" prop="subsidyMoney" width="200">
<!-- <template scope="{row}">-->
<!-- <el-input-number v-model="row.subsidyMoney" :min="0" :max="999999"-->
<!-- :precision="2" size="small" style="width: 100%"></el-input-number>-->
<!-- </template>-->
</el-table-column>
<el-table-column label="年度" prop="year" width="100">
<!-- <template #header>-->
<!-- <div style="display: flex;align-items: center">-->
<!-- <div style="width: 50px">-->
<!-- 年度-->
<!-- </div>-->
<!-- <el-date-picker-->
<!-- v-model="globalYear"-->
<!-- @change="globalYearChange"-->
<!-- type="year"-->
<!-- placeholder="一键选择年度"-->
<!-- value-format="yyyy"-->
<!-- size="small"-->
<!-- style="width: calc(200px - 50px)">-->
<!-- </el-date-picker>-->
<!-- </div>-->
<!-- </template>-->
<!-- <template scope="{row}">-->
<!-- <el-date-picker-->
<!-- v-model="row.year"-->
<!-- type="year"-->
<!-- placeholder="选择年度"-->
<!-- value-format="yyyy"-->
<!-- size="small"-->
<!-- style="width: 100%">-->
<!-- </el-date-picker>-->
<!-- </template>-->
</el-table-column>
<el-table-column label="上一次补助年度" prop="lastTimeSubsidyYear" width="150"></el-table-column>
<!-- <el-table-column label="自费金额补助比例" prop="selfPaySubsidyRatio" width="150">-->
<!-- <template scope="{row}">-->
<!-- {{row.selfPaySubsidyRatio * 1000 / 10 + '%'}}-->
<!-- </template>-->
<!-- </el-table-column>-->
<el-table-column label="额外补助比例" prop="otherSubsidyRatio" width="150">
<template scope="{row}">
{{row.otherSubsidyRatio * 1000 / 10 + '%'}}
</template>
</el-table-column>
<!-- <el-table-column label="总补助比例" prop="totalSubsidyRatio" width="150">-->
<!-- <template scope="{row}">-->
<!-- {{row.totalSubsidyRatio * 1000 / 10 + '%'}}-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column label="入会年限∕是否享受过补助" prop="subsidyDesc" width="200">-->
<!-- </el-table-column>-->
<el-table-column label="备注" prop="remarks">
<!-- <template scope="{row}">-->
<!-- <el-input v-model="formData.remarks" maxlength="20" size="small"></el-input>-->
<!-- </template>-->
</el-table-column>
</el-table>
<!-- <el-backtop target="#excel-table-container" :bottom="100"></el-backtop>-->
</div>
</el-card>
</guava>
</div>
<script>
</script>
<script>
var vue = new Vue({
el: '#app',
mixins: [initTableMixins],
data() {
return {
files: [],
globalYear: null,
uploadUrl: '/platform/sickHelp/import/readExcel',
tableHeight: null
}
},
methods: {
handleProgress() {
this.tableLoading = true
},
handleSuccess(resp) {
console.log('ok')
this.tableLoading = false
this.tableData = resp.data
},
handleError(err) {
console.log(err)
},
beforeUpload(file, files) {
const fileSuffix = file.name.substring(file.name.lastIndexOf(".") + 1);
const whiteList = ['xls', 'xlsx']
if (!whiteList.includes(fileSuffix)) {
this.files = []
this.$message.warning('上传文件只能是' + whiteList.join(',') + '格式')
return false
}
this.files = files
},
async checkAgain() {
this.tableLoading = true
const resp = await $.post('/platform/sickHelp/import/checkData', {sickHelps: JSON.stringify(this.tableData)})
console.log('ok....')
this.tableLoading = false
if (resp.code === 0) {
// resp.data.forEach(v => {
// v['year'] = v['year'] ? v['year'].toString() : null
// })
this.tableData = resp.data
} else {
this.notifyWarning(resp.msg)
}
},
async doImport() {
const hasErrorData = this.tableData.some(v => !v.valid)
if (hasErrorData) {
this.notifyWarning('数据校验不合格,无法导入')
return
}
const resp = await $.post('/platform/sickHelp/import/doImport', {sickHelps: JSON.stringify(this.tableData)})
if (resp.code === 0) {
this.tableData = []
this.globalYear = null
this.notifySuccess(resp.msg)
this.$refs.excelUpload.clearFiles()
}
},
globalYearChange(val) {
this.tableData.forEach(v => {
v['year'] = val
})
},
downLoadTemplate() {
window.open('/platform/sickHelp/import/downLoadTemplate')
},
summaryMethod(param) {
const {columns, data} = param
const sums = [];
columns.forEach((column, index) => {
if (index === 0) {
sums[index] = '合计'
return
}
if (['selfPayMoney', 'subsidyMoney'].includes(column.property)) {
const values = data.map(item => Number(item[column.property]))
const sum = values.reduce((sum, value) => sum + value, 0)
sums[index] = sum.toFixed(2)
} else {
sums[index] = null
}
})
return sums
}
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,415 @@
<!--#
layout("/layouts/platform.html"){
#-->
<style>
.calcRow {
display: flex;
justify-content: center;
position: relative;
top: 20px;
padding: 20px 0;
}
.calcRow::before {
content: '';
position: absolute;
border-top: 1px solid #ebeef5;
width: calc(100% + 40px);
top: 0;
}
.calcRow button {
/*width: 10%;*/
}
.historySubsidy {
position: relative;
padding: 20px 0 0 0;
}
.historySubsidy::before {
content: '';
position: absolute;
border-top: 1px solid #ebeef5;
width: calc(100% + 40px);
top: 0;
}
.el-table__empty-block {
min-height: 240px !important;
background-size: unset !important;
}
.overflow-form-item .el-form-item__label {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.dividing-line {
display: flex;
justify-content: center;
position: relative;
margin: 10px 0;
}
.dividing-line::after {
content: '';
position: absolute;
border-bottom: 1px solid #ebeef5;
width: calc(100% + 40px);
bottom: 0;
}
</style>
<div id="app" v-cloak>
<guava>
<el-card shadow="never">
<template #header>
<h3 style="color: rgb(24, 103, 176);">{{cardTitle}}</h3>
</template>
<el-form :model="formData" :rules="formRules" label-width="120px" ref="form">
<vi-title2 title="填写补助数据"></vi-title2>
<el-row>
<el-col :lg="8" :xs="24">
<el-form-item label="工号" prop="loginName">
<el-select :disabled="formDisabled"
:remote-method="searchUser"
@change="userChange"
clearable
filterable
placeholder="输入工号或者姓名查询"
remote
reserve-keyword
style="width: 100%"
v-model="formData.loginName">
<el-option
:key="item.loginName"
:label="item.userName+'('+item.loginName+')'"
:value="item.loginName"
v-for="item in userList"
></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :lg="8" :xs="24">
<el-form-item label="姓名" prop="userName">
<el-input :disabled="!this.formData.id"
placeholder="输入工号之后自动显示"
v-model="formData.userName"></el-input>
</el-form-item>
</el-col>
<el-col :lg="8" :xs="24">
<el-form-item label="单位" prop="unitName">
<el-input placeholder="输入工号之后自动显示"
v-model="formData.unitName"></el-input>
</el-form-item>
</el-col>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :lg="8" :xs="24">
<el-form-item label="个人支付金额" prop="selfPayMoney">
<el-input-number :max="99999999.99" :min="3000.00"
:precision="2"
:step="1"
placeholder="请输入个人支付金额"
readonly
style="width: 100%"
v-model="formData.selfPayMoney"></el-input-number>
</el-form-item>
</el-col>
<el-col :lg="8" :xs="24">
<el-form-item label="申报年度" prop="year">
<el-date-picker
@change="applyYearChange"
:disabled="formDisabled"
:picker-options="pickerOptions"
placeholder="选择申报年度"
style="width: 100%"
type="year"
v-model="formData.year"
value-format="yyyy">
</el-date-picker>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :lg="24" :xs="24">
<el-form-item label="备注" prop="remarks">
<el-input
:rows="3"
maxlength="50"
placeholder="可输入备注"
type="textarea"
v-model="formData.remarks">
</el-input>
</el-form-item>
</el-col>
</el-row>
<div class="dividing-line"></div>
<vi-title2 title="计算结果"></vi-title2>
<el-row :gutter="20">
<!-- <el-col :lg="8" :xs="24">-->
<!-- <el-form-item label="自费金额补助比例" prop="selfPaySubsidyRatio" class="overflow-form-item">-->
<!-- <template #label>-->
<!-- <el-tooltip effect="dark" content="自费金额补助比例" placement="top-start">-->
<!-- <span>自费金额补助比例</span>-->
<!-- </el-tooltip>-->
<!-- </template>-->
<!-- <el-input :value="selfPaySubsidyRatioPercent" readonly></el-input>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<el-col :lg="8" :xs="24">
<el-form-item label="额外补助比例" prop="otherSubsidyRatio">
<el-input :value="otherSubsidyRatioPercent" readonly></el-input>
</el-form-item>
</el-col>
<!-- <el-col :lg="8" :xs="24">-->
<!-- <el-form-item label="总补助比例" prop="totalSubsidyRatio">-->
<!-- <el-input :value="totalSubsidyRatioPercent" readonly></el-input>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
</el-row>
<el-row :gutter="20">
<el-col :lg="8" :xs="24">
<el-form-item label="上一次补助年度" prop="lastTimeSubsidyYear">
<el-input readonly
v-model="formData.lastTimeSubsidyYear"></el-input>
</el-form-item>
</el-col>
<el-col :lg="8" :xs="24">
<el-form-item class="overflow-form-item" label="入会年限∕是否享受过补助" prop="subsidyDesc">
<template #label>
<el-tooltip content="入会年限∕是否享受过补助" effect="dark" placement="top-start">
<span>入会年限∕是否享受过补助</span>
</el-tooltip>
</template>
<el-input readonly v-model="formData.subsidyDesc"></el-input>
</el-form-item>
</el-col>
<el-col :lg="8" :xs="24">
<el-form-item label="补助金额" prop="subsidyMoney">
<el-input-number :max="99999999.99" :min="0" :precision="2"
readonly
style="width: 100%" v-model="formData.subsidyMoney"></el-input-number>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div class="historySubsidy">
<vi-title2 title="历史申请记录"></vi-title2>
<el-table :data="tableData" max-height="360">
<el-table-column label="年度" prop="year"></el-table-column>
<el-table-column label="个人支付金额" prop="selfPayMoney"></el-table-column>
<el-table-column label="个人支付金额补助比例" prop="selfPaySubsidyRatio">
<template scope="{row}">
{{row.selfPaySubsidyRatio ? row.selfPaySubsidyRatio * 1000 / 10 + '%' : null}}
</template>
</el-table-column>
<el-table-column label="额外补助比例" prop="otherSubsidyRatio">
<template scope="{row}">
{{row.otherSubsidyRatio!=null ? row.otherSubsidyRatio * 1000 / 10 + '%' : null}}
</template>
</el-table-column>
<el-table-column label="总补助比例" prop="totalSubsidyRatio">
<template scope="{row}">
{{row.totalSubsidyRatio ? row.totalSubsidyRatio * 1000 / 10 + '%' : null}}
</template>
</el-table-column>
<el-table-column label="补助金额" prop="subsidyMoney"></el-table-column>
<el-table-column label="上一次补助年度" prop="lastTimeSubsidyYear"></el-table-column>
<el-table-column label="备注" prop="remarks"></el-table-column>
<!-- <el-table-column label="是否接受补助" prop="isAccept">-->
<!-- <template scope="{row}">-->
<!-- <template v-if="row.isAccept!=null">-->
<!-- <span v-if="row.isAccept" class="text-success">-->
<!-- 接受-->
<!-- </span>-->
<!-- <span v-else class="text-danger">-->
<!-- 拒绝-->
<!-- </span>-->
<!-- </template>-->
<!-- <template v-else>-->
<!-- <span class="text-info">无</span>-->
<!-- </template>-->
<!-- </template>-->
<!-- </el-table-column>-->
</el-table>
</div>
<div class="calcRow">
<el-button v-if="formData.id" @click="sublime.jumpPagePjax('/platform/sickHelp/list')">返回补助台账
</el-button>
<el-button @click="calcSubsidy" type="primary">计算补助结果</el-button>
<el-button :disabled="!valid" @click="submitSubsidy" type="primary">提交补助结果</el-button>
</div>
</el-card>
</guava>
</div>
<script>
var vue = new Vue({
el: '#app',
mixins: [initTableMixins],
data() {
return {
userList: [],
formData: {},
formRules: {
loginName: [{required: true, message: '请输入工号或者姓名查询用户', trigger: ['change', 'blur']}],
selfPayMoney: [{required: true, message: '请输入个人支付金额', trigger: ['change', 'blur']}],
year: [{required: true, message: '请选择申报年度', trigger: ['change', 'blur']}],
},
valid: false
}
},
computed: {
subsidyRatio() {
const subsidyRatio = this.formData.subsidyRatio
if (subsidyRatio) {
return subsidyRatio * 1000 / 10 + '%'
}
return null
},
pickerOptions() {
return {
disabledDate(time) {
return time.getTime() > Date.now()
}
}
},
selfPaySubsidyRatioPercent() {
if (this.formData.selfPaySubsidyRatio) {
return this.formData.selfPaySubsidyRatio * 1000 / 10 + '%'
}
return '0%'
},
otherSubsidyRatioPercent() {
if (this.formData.otherSubsidyRatio) {
return this.formData.otherSubsidyRatio * 1000 / 10 + '%'
}
return '0%'
},
totalSubsidyRatioPercent() {
if (this.formData.totalSubsidyRatio) {
return this.formData.totalSubsidyRatio * 1000 / 10 + '%'
}
return '0%'
},
cardTitle() {
return this.formData.id ? '编辑补助记录' : '新增补助记录'
},
formDisabled() {
return this.formData.id
}
},
methods: {
async calcSubsidy() {
try {
const valid = await this.$refs.form.validate()
if (!valid) return
const formData = clone(this.formData)
formData.selfPayMoney = formData.selfPayMoney.toFixed(2).toString()
const resp = await $.post('/platform/sickHelp/import/checkData', {sickHelps: JSON.stringify([formData])})
if (resp.code === 0) {
if (resp.data) {
const resp_data = resp.data[0]
if (resp_data.valid) {
this.valid = resp_data.valid
this.$set(this.formData, 'selfPaySubsidyRatio', resp_data.selfPaySubsidyRatio)
this.$set(this.formData, 'otherSubsidyRatio', resp_data.otherSubsidyRatio)
this.$set(this.formData, 'totalSubsidyRatio', resp_data.totalSubsidyRatio)
this.$set(this.formData, 'lastTimeSubsidyYear', resp_data.lastTimeSubsidyYear)
this.$set(this.formData, 'subsidyDesc', resp_data.subsidyDesc)
this.$set(this.formData, 'subsidyMoney', resp_data.subsidyMoney)
this.$set(this.formData, 'unitName', resp_data.unitName)
this.notifySuccess(resp_data.validMsg.join('、'))
} else {
this.notifyWarning(resp_data.validMsg.join('、'))
}
}
} else {
this.notifyWarning(resp.msg)
}
} catch (e) {
console.log(e)
}
},
async submitSubsidy() {
await this.calcSubsidy()
if (!this.valid) {
this.notifyWarning('数据校验不合格,无法提交')
return
}
const formData = clone(this.formData)
const resp = await $.post('/platform/sickHelp/import/doImport', {sickHelps: JSON.stringify([formData])})
if (resp.code === 0) {
this.notifySuccess(resp.msg)
this.$refs.form.resetFields()
this.tableData = []
} else {
this.notifyError(resp.msg)
}
},
async searchUser(key) {
const resp = await $.post('/platform/sickHelp/import/searchUser/' + key)
this.userList = resp.data
},
async userChange(val) {
debugger
const user = this.userList.find(v => v.loginName === val)
this.$set(this.formData, 'userName', user.userName)
this.$set(this.formData, 'unitName', user.unitName)
this.$set(this.formData, 'loginName', user.loginName)
await this.getHistoryApplyRecords(user.loginName, this.formData.year)
},
async getHistoryApplyRecords(loginName, year) {
const resp = await $.get('/platform/sickHelp/import/getHistorySubsidyByUser/' + loginName + '/' + year)
if (resp.code === 0) {
this.tableData = resp.data
}
},
applyYearChange() {
const {loginName, year} = this.formData
if (loginName && year) {
this.getHistoryApplyRecords(loginName, year)
}
},
async checkEdit() {
const id = GetQueryString("id")
if (!id) {
this.$set(this.formData, 'year', new Date().getFullYear() + '')
return
}
const resp = await $.get('/platform/sickHelp/import/findOne/' + id)
const loginName = resp.data.loginName
await this.searchUser(loginName)
resp.data.year = resp.data.year.toString()
this.formData = resp.data
await this.getHistoryApplyRecords(loginName, this.formData.year)
}
},
created() {
this.checkEdit()
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,393 @@
<!--#
layout("/layouts/platform.html"){
#-->
<style>
.downLoadTemplate {
position: absolute;
right: 0;
top: 0;
}
.dividing-line {
display: flex;
justify-content: center;
position: relative;
margin: 10px 0;
}
.dividing-line::after {
content: '';
position: absolute;
border-bottom: 1px solid #ebeef5;
width: calc(100% + 40px);
bottom: 0;
}
</style>
<div id="app" v-cloak>
<guava ref="guava">
<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
placeholder="选择年度"
style="width: 100%"
type="year"
v-model="pageForm.year"
value-format="yyyy">
</el-date-picker>
</div>
</div>
<div class="search-item">
<div class="search-item-label">补助人:</div>
<div class="search-item-option">
<el-input clearable maxlength="10" placeholder="可输入补助人的工号或姓名进行查询"
v-model.trim="pageForm.subsidyUser"></el-input>
</div>
</div>
<div class="search-item"
v-if="${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')||@shiro.hasRole('H03')}">
<div class="search-item-label">所属工会:</div>
<div class="search-item-option">
<el-select placeholder="所属工会" v-model="pageForm.unionId" style="width: 100%;"
clearable="true"
@change="flushUnits" @clear="flushUnits"
filterable="true">
<el-option v-for="item in unions" :label="item.unionname" :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 clearable filterable style="width: 100%"
v-model="pageForm.unitName">
<el-option :label="item.name"
:value="item.name"
v-for="item in units"></el-option>
</el-select>
</div>
</div>
<div class="search-item">
<div class="search-item-label">是否会员:</div>
<div class="search-item-option">
<el-select clearable filterable style="width: 100%"
v-model="pageForm.isMember">
<el-option label="全部" :value="null"></el-option>
<el-option label="是" :value="1"></el-option>
<el-option label="否" :value="0"></el-option>
</el-select>
</div>
</div>
<div class="search-query">
<el-button @click="doSearch" icon="el-icon-search" type="primary">搜索</el-button>
</div>
</div>
</el-card>
<el-card class="mt10" shadow="never">
<table-tool :app="this" label="补助列表">
<template #func>
<el-button @click="oneKeyUpdateIsMeetRequirements" size="small" type="primary">一键设为符合申请
</el-button>
<el-button @click="importHistoryData" size="small" type="primary">导入历史数据</el-button>
<el-button @click="exportData" size="small" type="primary">导出补助汇总表</el-button>
</template>
</table-tool>
<el-table :data="tableData" :size="tableSize" @sort-change="pageOrder"
align="center" header-align="center">
<el-table-column align="center" header-align="center" label="序号" type="index" width="80">
<template scope="scope">
<span>{{ scope.$index + (pageForm.pageNumber - 1) * pageForm.pageSize + 1 }} </span>
</template>
</el-table-column>
<el-table-column
:label="column.label"
:prop="column.prop"
:sortable="column.sortable"
:width="column.width"
align="center"
header-align="center"
show-overflow-tooltip
v-for="column in tableColumns"
>
<template scope="{row}" v-if="column.prop=='selfPaySubsidyRatio'">
{{row.selfPaySubsidyRatio * 1000 / 10 + '%'}}
</template>
<template scope="{row}" v-else-if="column.prop=='otherSubsidyRatio'">
{{row.otherSubsidyRatio * 1000 / 10 + '%'}}
</template>
<template scope="{row}" v-else-if="column.prop=='totalSubsidyRatio'">
{{row.totalSubsidyRatio * 1000 / 10 + '%'}}
</template>
<template scope="{row}" v-else-if="column.prop=='isMeetRequirements'">
<el-switch
@change="(val)=>{isMeetRequirementsChange(row.id,val)}"
active-color="#13ce66"
inactive-color="#ff4949"
v-model="row.isMeetRequirements">
</el-switch>
</template>
<template scope="{row}" v-else-if="column.prop=='isMember'">
<span v-if="row.isMember==true" class="text-success"></span>
<span v-if="row.isMember==false" class="text-danger"></span>
<span v-if="row.isMember==null"></span>
</template>
</el-table-column>
<el-table-column fixed="right" label="操作" width="200">
<template scope="{row}">
<el-button @click="openEdit(row)" size="mini" type="primary">编辑</el-button>
<el-button @click="doDelete(row.id)" size="mini" type="danger">删除</el-button>
</template>
</el-table-column>
</el-table>
<!--#include("/layouts/pagination.html"){}#-->
</el-card>
<template #public>
<el-row class="file-upload-container" justify="center" style="position: relative" type="flex">
<div class="downLoadTemplate">
<el-button @click="downLoadTemplate" size="small"
type="primary">
下载模板
</el-button>
</div>
<el-upload
:action="uploadUrl"
:auto-upload="true"
:file-list="files"
:limit="1"
:on-error="handleError"
:on-exceed="()=>{this.notifyWarning('只能上传一个文件')}"
:on-remove="(f,fl)=>{fileList = fl;excelTableData=[];}"
:on-success="handleSuccess"
accept=".xls,.xlsx"
drag
ref="excelUpload">
<i class="el-icon-upload"></i>
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
</el-upload>
</el-row>
<div class="dividing-line"></div>
<vi-title2 class="vi-title-top-border" title="excel数据">
<template #func>
<el-button @click="importData" class="importData" size="small" type="primary">导入数据</el-button>
</template>
</vi-title2>
<el-table :data="excelTableData" :size="tableSize"
@sort-change="pageOrder" header-align="center">
<el-table-column header-align="center" label="序号" type="index" width="80">
</el-table-column>
<el-table-column
:label="column.label"
:prop="column.prop"
:sortable="column.sortable"
:width="column.width"
align="center"
header-align="center"
show-overflow-tooltip
v-for="column in tableColumns"
>
<template scope="{row}" v-if="column.prop=='selfPaySubsidyRatio'">
{{row.selfPaySubsidyRatio * 1000 / 10 + '%'}}
</template>
<template scope="{row}" v-else-if="column.prop=='otherSubsidyRatio'">
{{row.otherSubsidyRatio * 1000 / 10 + '%'}}
</template>
<template scope="{row}" v-else-if="column.prop=='totalSubsidyRatio'">
{{row.totalSubsidyRatio * 1000 / 10 + '%'}}
</template>
</el-table-column>
</el-table>
<el-backtop :bottom="100" target="#app"></el-backtop>
</template>
</guava>
</div>
<script>
var vue = new Vue({
el: '#app',
mixins: [initTableMixins],
data() {
return {
tableColumns: [
{prop: 'year', label: '年度', sortable: true},
{prop: 'userName', label: '姓名'},
{prop: 'loginName', label: '工号'},
{prop: 'unionName', label: '分工会', sortable: true, width: 150},
{prop: 'unitName', label: '单位', sortable: true, width: 150},
{prop: 'selfPayMoney', label: '个人支付金额(元)', sortable: true, width: 150},
{prop: 'noLimitSubsidyMoney', label: '计算金额(元)', sortable: true, width: 150},
{prop: 'subsidyMoney', label: '补助金额(元)', sortable: true, width: 150},
{prop: 'isMember', label: '是否会员', sortable: true, width: 100},
// {prop: 'selfPaySubsidyRatio', label: '个人支付金额补助比例', sortable: true, width: 160},
// {prop: 'otherSubsidyRatio', label: '额外补助比例', sortable: true, width: 155},
// {prop: 'totalSubsidyRatio', label: '总补助比例', sortable: true, width: 155},
{prop: 'lastTimeSubsidyYear', label: '最近年度', sortable: true, width: 155},
// {prop: 'subsidyDesc', label: '入会年限∕是否享受过补助', width: 220},
{prop: 'isMeetRequirements', label: '是否符合申请要求', width: 220},
],
pageForm: {
year: (new Date().getFullYear() - 1).toString(),
isMember: null
},
unions: [],
units: [],
files: [],
uploadUrl: loc() + '/readExcelData',
excelTableData: []
}
},
methods: {
async importData() {
if (this.excelTableData.length === 0) {
this.notifyWarning('无数据')
return
}
const confirm = await this.$confirm('确定导入吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
const loading = this.$loading({
lock: true,
text: '导入中',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
})
if ('confirm' !== confirm) return
const resp = await $.post(loc() + '/importHistoryData', {data: JSON.stringify(this.excelTableData)})
loading.close()
if (resp.code === 0) {
this.notifySuccess(resp.msg)
this.excelTableData = []
this.files = []
} else {
this.notifyWarning(resp.msg)
}
},
handleError(err) {
console.log(err)
},
handleSuccess(resp) {
if (resp.code === 0) {
this.excelTableData = resp.data
} else {
this.notifyWarning(resp.msg)
}
},
importHistoryData() {
this.$refs.guava.public()
},
downLoadTemplate() {
window.open(loc() + '/downLoadTemplate')
},
beforeUpload(file, files) {
const fileSuffix = file.name.substring(file.name.lastIndexOf(".") + 1);
const whiteList = ['xlsx']
if (!whiteList.includes(fileSuffix)) {
this.files = []
this.$message.warning('上传文件只能是' + whiteList.join(',') + '格式')
return false
}
this.files = files
},
async doDelete(id) {
const confirm = await this.$confirm('删除后补助数据可能会受到影响,您确定要删除吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
if ('confirm' !== confirm) return
const resp = await $.post(loc() + '/doDelete/' + id)
if (resp.code === 0) {
this.doSearch()
this.notifySuccess(resp.msg)
} else {
this.notifyWarning(resp.msg)
}
},
openEdit(row) {
sublime.jumpPagePjax('/platform/sickHelp/importByForm?id=' + row.id)
},
exportData() {
const {year, unitName} = this.pageForm
window.open(loc() + '/exportData?year=' + year + '&unitName=' + unitName)
},
async isMeetRequirementsChange(id, isMeetRequirements) {
const resp = await $.post(loc() + '/updateIsMeetRequirements', {id, isMeetRequirements})
if (resp.code === 0) {
this.pageData()
this.notifySuccess(resp.msg)
} else {
this.notifyWarning(resp.msg)
}
},
async oneKeyUpdateIsMeetRequirements() {
const {year} = this.pageForm
if (!year) {
this.notifyWarning('请先选择年度')
return
}
const confirm = await this.$confirm('确认要将' + year + '的申请记录全部设为符合申请吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
if ('confirm' !== confirm) return
const resp = await $.post(loc() + '/oneKeyUpdateIsMeetRequirements', {year})
if (resp.code === 0) {
this.pageData()
this.notifySuccess(resp.msg)
} else {
this.notifyWarning(resp.msg)
}
},
async flushUnits() {
this.$set(this.pageForm, "unitId", "")
if ("${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')||@shiro.hasRole('H03')}" === 'true') {
this.units = await getUnits(this.pageForm.unionId)
} else {
this.units = await getUnits("${@shiro.getPrincipalProperty('unit').getUnionid()}")
}
},
},
async created() {
this.flushUnits()
this.unions = await getUnions(null)
this.pageData()
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,166 @@
<!--#
layout("/layouts/platform.html"){
#-->
<style>
.downLoadTemplate {
position: absolute;
right: 0;
top: 0;
}
.dividing-line {
display: flex;
justify-content: center;
position: relative;
margin: 10px 0;
}
.dividing-line::after {
content: '';
position: absolute;
border-bottom: 1px solid #ebeef5;
width: calc(100% + 40px);
bottom: 0;
}
</style>
<div id="app" v-cloak>
<guava ref="guava">
<el-card shadow="never">
<template #header>
<h3 style="color: rgb(24, 103, 176);">大病医疗互助会员数据导入</h3>
</template>
<el-row justify="center" style="position: relative" type="flex">
<div class="downLoadTemplate">
<el-button @click="downLoadTemplate" size="small"
type="primary">
下载模板
</el-button>
</div>
<el-upload
:action="uploadUrl"
:auto-upload="true"
:file-list="files"
:limit="1"
:on-error="handleError"
:on-exceed="()=>{this.notifyWarning('只能上传一个文件')}"
:on-remove="(f,fl)=>{fileList = fl;excelTableData=[];}"
:on-success="handleSuccess"
accept=".xls,.xlsx"
drag
ref="excelUpload">
<i class="el-icon-upload"></i>
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
</el-upload>
</el-row>
<div class="dividing-line"></div>
<vi-title2 title="excel数据">
<template #func>
<el-button @click="importData" size="small" type="primary">导入数据</el-button>
</template>
</vi-title2>
<el-table :data="excelTableData" :size="tableSize"
@sort-change="pageOrder"
header-align="center"
height="480" max-height="480">
<el-table-column header-align="center" label="序号" type="index" width="80">
</el-table-column>
<el-table-column
:label="column.label"
:prop="column.prop"
:sortable="column.sortable"
:width="column.width"
align="center"
header-align="center"
show-overflow-tooltip
v-for="column in tableColumns"
>
<template scope="{row}" v-if="column.prop=='tips'">
<span class="text-warning" v-if="row.id">
数据库已存在该用户信息
</span>
</template>
</el-table-column>
</el-table>
</el-card>
</guava>
</div>
<script>
var vue = new Vue({
el: '#app',
mixins: [initTableMixins],
data() {
return {
excelTableData: [],
tableColumns: [
{prop: 'userName', label: '姓名'},
{prop: 'loginName', label: '工号'},
{prop: 'sex', label: '性别'},
{prop: 'unitName', label: '单位'},
{prop: 'userState', label: '状态'},
{prop: 'mutualGoldStartTime', label: '入会时间'},
{prop: 'tips', label: '提示'},
],
files: [],
uploadUrl: loc() + '/readExcelData',
}
},
methods: {
handleError(err) {
console.log(err)
},
handleSuccess(resp) {
this.excelTableData = resp.data
},
downLoadTemplate() {
window.open(loc() + '/downLoadTemplate')
},
beforeUpload(file, files) {
const fileSuffix = file.name.substring(file.name.lastIndexOf(".") + 1);
const whiteList = ['xlsx']
if (!whiteList.includes(fileSuffix)) {
this.files = []
this.$message.warning('上传文件只能是' + whiteList.join(',') + '格式')
return false
}
this.files = files
},
async importData() {
if (!this.excelTableData.length) {
this.notifyWarning('无数据')
return
}
const confirm = await this.$confirm('您确定导入吗,新数据将覆盖旧数据?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
if ('confirm' !== confirm) return
const loading = this.$loading({
lock: true,
text: '导入中',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
})
const resp = await $.post(loc() + '/doImport', {data: JSON.stringify(this.excelTableData)})
loading.close()
if (resp.code === 0) {
this.notifySuccess(resp.msg)
this.excelTableData = []
this.files = []
} else {
this.notifyWarning(resp.msg)
}
}
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,298 @@
<!--#
layout("/layouts/platform.html"){
#-->
<style>
</style>
<div id="app" v-cloak>
<guava ref="guava">
<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
placeholder="选择入会时间"
style="width: 100%"
type="year"
v-model="pageForm.mutualGoldStartTime"
value-format="yyyy">
</el-date-picker>
</div>
</div>
<div class="search-item">
<div class="search-item-label">工号姓名:</div>
<div class="search-item-option">
<el-input clearable maxlength="10" placeholder="可输入会员的工号或姓名进行查询"
v-model.trim="pageForm.keyWord"></el-input>
</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="flushUnits" @clear="flushUnits"
filterable="true">
<el-option v-for="item in unions" :label="item.unionname" :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 placeholder="所属单位" v-model="pageForm.unitId" style="width: 100%;"
clearable="true"
filterable="true">
<el-option v-for="item in units" :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-input clearable maxlength="200" placeholder="可输入单位进行查询"-->
<!-- v-model.trim="pageForm.unitName"></el-input>-->
<!-- </div>-->
<!-- </div>-->
<div class="search-item">
<div class="search-item-label">状态:</div>
<div class="search-item-option">
<el-input clearable maxlength="200" placeholder="可输入状态进行查询"
v-model.trim="pageForm.userState"></el-input>
</div>
</div>
<div class="search-query">
<el-button @click="doSearch" icon="el-icon-search" type="primary">搜索</el-button>
</div>
</div>
</el-card>
<el-card class="mt10" shadow="never">
<table-tool :app="this" label="大病医疗互助会员">
<template #func>
<el-button type="primary" size="small" @click="openAdd">新增</el-button>
</template>
</table-tool>
<el-table :data="tableData" :size="tableSize"
@sort-change="pageOrder" header-align="center">
<el-table-column align="center" header-align="center" label="序号" width="120px">
<template scope="scope">
<span>{{scope.$index+(pageForm.pageNumber - 1) * pageForm.pageSize + 1}} </span>
</template>
</el-table-column>
<el-table-column
:label="column.label"
:prop="column.prop"
:sortable="column.sortable"
:width="column.width"
align="center"
header-align="center"
show-overflow-tooltip
v-for="column in tableColumns"
>
<template scope="{row}" v-if="column.prop=='subsidyRatio'">
{{row.subsidyRatio * 100 + '%'}}
</template>
<template scope="{row}" v-else-if="column.prop=='isMember'">
<span v-if="row.isMember==true"></span>
<span v-if="row.isMember==false"></span>
<span v-if="row.isMember==null"></span>
</template>
</el-table-column>
<el-table-column label="操作" width="200">
<template scope="{row}">
<el-button @click="openEdit(row)" size="mini" type="primary">编辑</el-button>
<el-button @click="doDelete(row.id)" size="mini" type="danger">删除</el-button>
</template>
</el-table-column>
</el-table>
<!--#include("/layouts/pagination.html"){}#-->
</el-card>
</guava>
<el-dialog :close-on-click-modal="false" :visible.sync="editDialogVisible" title="编辑">
<el-form :model="formData" :rules="rules" label-width="120px" ref="form">
<el-form-item label="姓名" prop="userName">
<el-input maxlength="10" v-model.trim="formData.userName"></el-input>
</el-form-item>
<el-form-item label="工号" prop="loginName">
<el-input maxlength="10" v-model.trim="formData.loginName"></el-input>
</el-form-item>
<el-form-item label="性别" prop="sex">
<el-radio-group v-model="formData.sex" size="small">
<el-radio-button label="男"></el-radio-button>
<el-radio-button label="女"></el-radio-button>
</el-radio-group>
</el-form-item>
<el-form-item label="单位" prop="unitId">
<el-select clearable filterable style="width: 100%"
v-model="formData.unitId">
<el-option :label="item.name"
:value="item.id"
v-for="item in units"></el-option>
</el-select>
</el-form-item>
<el-form-item label="是否会员" prop="isMember">
<el-radio-group v-model="formData.isMember" size="small">
<el-radio-button :label="true"></el-radio-button>
<el-radio-button :label="false"></el-radio-button>
</el-radio-group>
</el-form-item>
<el-form-item label="状态" prop="userState">
<!-- <el-select v-model="formData.userState">-->
<!-- <el-option v-for="item in units"-->
<!-- ></el-option>-->
<!-- </el-select>-->
<el-input maxlength="10" v-model.trim="formData.userState"></el-input>
</el-form-item>
<el-form-item label="入会时间" prop="mutualGoldStartTime">
<el-date-picker
:picker-options="pickerOptions"
placeholder="入会时间"
style="width: 100%"
type="date"
v-model="formData.mutualGoldStartTime"
value-format="yyyy-MM-dd">
</el-date-picker>
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="formData.remark" maxlength="100" type="textarea"></el-input>
</el-form-item>
</el-form>
<el-row justify="end" type="flex">
<el-button @click="editDialogVisible=false">取消</el-button>
<el-button @click="doHandle" type="primary">确定</el-button>
</el-row>
</el-dialog>
</div>
<script>
var vue = new Vue({
el: '#app',
mixins: [initTableMixins],
data() {
return {
tableColumns: [
{prop: 'userName', label: '姓名', sortable: true},
{prop: 'loginName', label: '工号', sortable: true},
{prop: 'sex', label: '性别', sortable: true},
{prop: 'unitName', label: '单位', sortable: true},
{prop: 'isMember', label: '是否会员', sortable: true},
{prop: 'userState', label: '状态', sortable: true},
{prop: 'mutualGoldStartTime', label: '入会时间', sortable: true},
{prop: 'remark', label: '备注', sortable: true},
],
units: [],
rules: {
loginName: [{required: true, message: '请输入工号', trigger: ['change', 'blur']}],
userName: [{required: true, message: '请输入姓名', trigger: ['change', 'blur']}],
sex: [{required: true, message: '请选择性别', trigger: ['change', 'blur']}],
unitName: [{required: false, message: '请输入单位', trigger: ['change', 'blur']}],
unitId: [{required: true, message: '请选择单位', trigger: ['change', 'blur']}],
isMember: [{required: true, message: '请选择是否会员', trigger: ['change', 'blur']}],
userState: [{required: true, message: '请输入状态', trigger: ['change', 'blur']}],
mutualGoldStartTime: [{required: true, message: '请输入入会时间', trigger: ['change', 'blur']}],
},
editDialogVisible: false,
pageForm: {
unitName: ''
},
formData: {
userName: null,
loginName: null,
sex: null,
unitName: null,
unitId: null,
isMember: null,
userState: null,
mutualGoldStartTime: null
},
unions: [],
units: []
}
},
computed: {
pickerOptions() {
return {
disabledDate(time) {
return time.getTime() > Date.now()
}
}
}
},
methods: {
async doDelete(id) {
const confirm = await this.$confirm('删除后补助数据可能会受到影响,您确定要删除吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
if ('confirm' !== confirm) return
const resp = await $.post(loc() + '/doDelete/' + id)
if (resp.code === 0) {
this.doSearch()
this.notifySuccess(resp.msg)
} else {
this.notifyWarning(resp.msg)
}
},
openEdit(row) {
this.editDialogVisible = true
this.$nextTick(() => {
this.formData = {...row}
this.formData.unitId = this.formData.unitId.toString()
console.log(this.formData)
})
},
async doHandle() {
const valid = await this.$refs.form.validate()
if (!valid) return
const url = this.formData.id ? '/doEdit' : '/doAdd'
const resp = await $.post(loc() + url, this.formData)
if (resp.code === 0) {
this.pageData()
this.editDialogVisible = false
this.notifySuccess(resp.msg)
} else {
this.notifyWarning(resp.msg)
}
},
openAdd() {
this.editDialogVisible = true
this.$nextTick(() => {
this.$refs.form.resetFields()
})
},
async flushUnits() {
this.$set(this.pageForm, "unitId", null)
this.units = await getUnits(this.pageForm.unionId)
},
},
created() {
this.pageData()
getUnions(null).then(res => this.unions = res)
getUnits(null).then(res => this.units = res)
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,296 @@
<!--#
layout("/layouts/platform.html"){
#-->
<div id="app" v-cloak>
<guava ref="guava">
<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
placeholder="选择年度"
style="width: 100%"
type="year"
v-model="pageForm.year"
value-format="yyyy">
</el-date-picker>
</div>
</div>
<div class="search-query">
<el-button @click="doSearch" icon="el-icon-search" type="primary">搜索</el-button>
</div>
</div>
</el-card>
<el-card class="mt10" shadow="never">
<table-tool :app="this" label="我的补助列表">
<template #func>
</template>
</table-tool>
<el-table :data="tableData" :size="tableSize" @sort-change="pageOrder"
align="center" header-align="center">
<el-table-column align="center" header-align="center" label="序号" type="index" width="80">
<template scope="scope">
<span>{{ scope.$index + (pageForm.pageNumber - 1) * pageForm.pageSize + 1 }} </span>
</template>
</el-table-column>
<el-table-column
:label="column.label"
:prop="column.prop"
:sortable="column.sortable"
:width="column.width"
align="center"
header-align="center"
show-overflow-tooltip
v-for="column in tableColumns"
>
<template scope="{row}" v-if="column.prop=='isMeetRequirements'">
<span class="text-success" v-if="row.isMeetRequirements">
符合
</span>
<span class="text-danger" v-else>
不符合
</span>
</template>
<template scope="{row}" v-else-if="column.prop==='isAccept'">
<span v-if="row.isAccept !== null"
:class="{'text-success': row.isAccept, 'text-danger': !row.isAccept}">
{{ row.isAccept ? '申请' : '放弃' }}
</span>
<span v-else class="text-info"></span>
</template>
</el-table-column>
<el-table-column label="操作" width="400">
<template scope="{row}">
<el-button @click="openView(row.id)" size="mini" type="primary">查看</el-button>
<el-button @click="exportApplyPaper(row.id)" size="mini" type="primary">导出</el-button>
<el-button :disabled="row.isAccept!=null || !row.isMeetRequirements || row.stateCode > 210"
@click="applySubsidy(row)" size="mini"
type="primary">申请
</el-button>
<el-button :disabled="!row.isMeetRequirements || row.stateCode > 210 || row.isAccept==0"
@click="userHandler(row.id,row.isAccept,false)"
size="mini"
type="danger">放弃
</el-button>
</template>
</el-table-column>
</el-table>
<!--#include("/layouts/pagination.html"){}#-->
</el-card>
<template #view>
<sick-help-info ref="sickView"></sick-help-info>
</template>
</guava>
<el-dialog :close-on-click-modal="false" :visible.sync="applyDialog" title="申请补助" width="60%">
<el-form :model="formData" :rules="rules" label-width="auto" ref="form">
<el-row :gutter="10">
<el-col :lg="12" :md="24" :sm="24" :xl="12" :xs="24">
<el-form-item label="姓名" prop="userName">
<el-input :value="formData.userName" readonly></el-input>
</el-form-item>
</el-col>
<el-col :lg="12" :md="24" :sm="24" :xl="12" :xs="24">
<el-form-item label="性别" prop="sex">
<el-radio-group v-model="formData.sex" size="mini">
<el-radio label="男" border></el-radio>
<el-radio label="女" border></el-radio>
</el-radio-group>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="10">
<el-col :lg="12" :md="24" :sm="24" :xl="12" :xs="24">
<el-form-item label="出生年月" prop="birthday">
<el-date-picker
style="width: 100%"
type="date"
v-model="formData.birthday"
value-format="yyyy-MM-dd">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :lg="12" :md="24" :sm="24" :xl="12" :xs="24">
<el-form-item label="参加大病医疗互助时间" prop="mutualGoldStartTime">
<el-date-picker
readonly
style="width: 100%"
type="year"
v-model="formData.mutualGoldStartTime"
value-format="yyyy-MM-dd">
</el-date-picker>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="10">
<el-col :lg="12" :md="24" :sm="24" :xl="12" :xs="24">
<el-form-item label="工作单位" prop="unitName">
<el-input :value="formData.unitName"></el-input>
</el-form-item>
</el-col>
<el-col :lg="12" :md="24" :sm="24" :xl="12" :xs="24">
<el-form-item label="家庭住址" prop="homeAddress">
<el-input v-model="formData.homeAddress"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-form-item label="申请理由" prop="applyReason">
<el-input
:autosize="{ minRows: 3, maxRows: 5}"
autosize
placeholder="请输入申报补助理由(患何种疾病)"
type="textarea"
v-model="formData.applyReason">
</el-input>
</el-form-item>
<el-row :gutter="10">
<el-col :lg="12" :md="24" :sm="24" :xl="12" :xs="24">
<el-form-item label="个人支付金额">
<el-input-number :max="99999999.99" :min="0" :precision="2"
readonly
style="width: 100%" v-model="formData.selfPayMoney"></el-input-number>
</el-form-item>
</el-col>
<el-col :lg="12" :md="24" :sm="24" :xl="12" :xs="24">
<el-form-item label="补助金额">
<el-input-number :max="99999999.99" :min="0" :precision="2"
readonly
style="width: 100%" v-model="formData.subsidyMoney"></el-input-number>
</el-form-item>
</el-col>
</el-row>
<el-form-item label="申请人签字" prop="applyUserSign">
<sign :qz.sync="formData.applyUserSign"></sign>
</el-form-item>
<el-row class="mt10" justify="end" type="flex">
<el-button @click="applyDialog=false">取消</el-button>
<el-button @click="doApply" type="primary">提交</el-button>
</el-row>
</el-form>
</el-dialog>
</div>
<script>
var vue = new Vue({
el: '#app',
mixins: [initTableMixins],
components: {
'SickHelpInfo': httpVueLoader('/components/sickHelp/SickHelpInfo.vue'),
},
data() {
return {
tableColumns: [
{prop: 'userName', label: '姓名'},
{prop: 'loginName', label: '工号'},
{prop: 'unitName', label: '单位', sortable: true},
// {prop: 'unionName', label: '分工会', sortable: true},
{prop: 'year', label: '年度', sortable: true},
{prop: 'selfPayMoney', label: '个人支付金额', sortable: true},
{prop: 'subsidyMoney', label: '补助金额', sortable: true},
// {prop: 'subsidyRatio', label: '补助比例', sortable: true},
{prop: 'remarks', label: '备注'},
{prop: 'isMeetRequirements', label: '是否符合申请要求'},
{prop: 'isAccept', label: '是否接受补助'},
{prop: 'stateName', label: '审核状态'}
],
pageForm: {
year: null
},
formData: {},
rules: {
applyUserSign: [{required: true, message: '请签字', trigger: ['change', 'blur']}],
applyReason: [{required: true, message: '请输入申请理由', trigger: ['change', 'blur']}],
sex: [{required: true, message: '请选择性别', trigger: ['change', 'blur']}],
birthday: [{required: true, message: '请输入出生年月', trigger: ['change', 'blur']}],
mutualGoldStartTime: [{required: true, message: '请输入参加大病医疗互助时间', trigger: ['change', 'blur']}],
unitName: [{required: true, message: '请输入工作单位', trigger: ['change', 'blur']}],
homeAddress: [{required: true, message: '请输入家庭住址', trigger: ['change', 'blur']}],
},
applyDialog: false
}
},
methods: {
openView(id) {
this.$refs.guava.view()
this.$refs.sickView.openView(id)
},
async userHandler(id, isAccept, userChoice) {
if (isAccept) return
const msg = '您确认要' + (userChoice ? '接受' : '放弃') + '该补助吗?'
const confirm = await this.$confirm(msg, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
if ('confirm' !== confirm) return
const resp = await $.post(loc() + '/acceptSubsidy', {id, isAccept: userChoice})
if (resp.code === 0) {
this.notifySuccess(resp.msg)
this.pageData()
} else {
this.notifyError(resp.msg)
}
},
//申请补助
applySubsidy(row) {
this.formData = clone(row)
this.applyDialog = true
this.getApplyUserInfo(row.loginName)
},
async getApplyUserInfo(loginName) {
const resp = await $.get(loc() + '/getApplyUserInfo', {loginName})
if (resp.code === 0) {
const {userName, loginName, unitName, sex, homeAddress, birthday, mutualGoldStartTime} = resp.data
this.$set(this.formData, 'userName', userName)
this.$set(this.formData, 'loginName', loginName)
this.$set(this.formData, 'unitName', unitName)
this.$set(this.formData, 'sex', sex)
this.$set(this.formData, 'homeAddress', homeAddress)
this.$set(this.formData, 'birthday', birthday)
this.$set(this.formData, 'mutualGoldStartTime', mutualGoldStartTime)
}
},
async doApply() {
const valid = await this.$refs['form'].validate()
if (!valid) return
const resp = await $.post(loc() + '/doApply', this.formData)
if (resp.code === 0) {
this.applyDialog = false
this.notifySuccess(resp.msg)
this.doSearch()
} else {
this.notifyWarning(resp.msg)
}
},
exportApplyPaper(id) {
window.open(loc() + '/exportApplyPaper?id=' + id)
}
},
async created() {
this.pageData()
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,219 @@
<!--#
layout("/layouts/platform.html"){
#-->
<div id="app" v-cloak>
<guava ref="guava">
<el-card shadow="never">
<div class="search">
<div class="search-item">
<div class="search-item-label">年度查询:</div>
<div class="search-item-option" style="display: flex;column-gap: 10px">
<el-date-picker
placeholder="选择开始年度"
style="width: 50%"
type="year"
value-format="yyyy"
v-model="pageForm.startYear">
</el-date-picker>
<el-date-picker
placeholder="选择结束年度"
style="width: 50%"
type="year"
value-format="yyyy"
v-model="pageForm.endYear">
</el-date-picker>
</div>
</div>
<div class="search-item">
<div class="search-item-label">职工信息:</div>
<div class="search-item-option">
<el-input placeholder="请输入内容" v-model="pageForm.searchKeyword">
<el-select v-model="pageForm.searchName" slot="prepend" placeholder="查询类型"
style="width: 80px;">
<el-option label="工号" value="u.loginname"></el-option>
<el-option label="姓名" value="u.username"></el-option>
</el-select>
</el-input>
</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="flushUnits" @clear="flushUnits"
v-if="${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')||@shiro.hasRole('H03')}"
filterable="true">
<el-option v-for="item in unions" :label="item.unionname" :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 placeholder="所属单位" v-model="pageForm.unitId" style="width: 100%;"
clearable="true"
filterable="true">
<el-option v-for="item in units" :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-radio-group @change="doSearch" v-model="pageForm.isAccept">
<el-radio-button :label="0">全部</el-radio-button>
<el-radio-button :label="1">申请</el-radio-button>
<el-radio-button :label="-1">放弃</el-radio-button>
</el-radio-group>
</div>
</div>
<div class="search-query">
<el-button @click="doSearch" icon="el-icon-search" type="primary">搜索</el-button>
</div>
</div>
</el-card>
<el-card class="mt10" shadow="never">
<table-tool :app="this" label="补助汇总列表">
<template #func>
<el-button @click="exportSubsidiesAmountTable" size="small" type="primary">导出补助金额情况表
</el-button>
</template>
</table-tool>
<el-table :data="tableData" :size="tableSize" @sort-change="pageOrder"
align="center" header-align="center">
<el-table-column align="center" header-align="center" label="序号" type="index" width="80">
<template scope="scope">
<span>{{ scope.$index + (pageForm.pageNumber - 1) * pageForm.pageSize + 1 }} </span>
</template>
</el-table-column>
<el-table-column
:label="column.label"
:prop="column.prop"
:sortable="column.sortable"
:width="column.width"
align="center"
header-align="center"
show-overflow-tooltip
v-for="column in tableColumns"
>
<template scope="{row}" v-if="column.prop==='isAccept'">
<span v-if="row.isAccept !== null"
:class="{'text-success': row.isAccept, 'text-danger': !row.isAccept}">
{{ row.isAccept ? '申请' : '放弃' }}
</span>
<span v-else class="text-info"></span>
</template>
</el-table-column>
<el-table-column label="操作" width="250">
<template scope="{row}">
<el-button @click="openView(row.id)" size="mini" type="primary">查看</el-button>
</template>
</el-table-column>
</el-table>
<!--#include("/layouts/pagination.html"){}#-->
</el-card>
<template #view>
<sick-help-info ref="sickView"></sick-help-info>
</template>
</guava>
</div>
<script>
var vue = new Vue({
el: '#app',
mixins: [initTableMixins],
components: {
'SickHelpInfo': httpVueLoader('/components/sickHelp/SickHelpInfo.vue'),
},
data() {
return {
tableColumns: [
{prop: 'userName', label: '姓名'},
{prop: 'loginName', label: '工号'},
{prop: 'unitName', label: '单位', sortable: true},
// {prop: 'unionName', label: '分工会', sortable: true},
{prop: 'year', label: '年度', sortable: true},
{prop: 'selfPayMoney', label: '个人支付金额(元)', sortable: true},
{prop: 'subsidyMoney', label: '补助金额(元)', sortable: true},
// {prop: 'subsidyRatio', label: '补助比例', sortable: true},
// {prop: 'isMeetRequirements', label: '是否符合申请要求'},
{prop: 'isAccept', label: '是否接受补助'},
{prop: 'stateName', label: '审核状态'},
// {prop: 'remarks', label: '备注'},
],
pageForm: {
startYear: (new Date().getFullYear() - 1).toString(),
endYear: (new Date().getFullYear()).toString(),
searchName: 'u.username',
isAccept: 1
},
unions: [],
units: [],
formData: {},
rules: {
applyUserSign: [{required: true, message: '请签字', trigger: ['change', 'blur']}],
applyReason: [{required: true, message: '请输入申请理由', trigger: ['change', 'blur']}],
sex: [{required: true, message: '请选择性别', trigger: ['change', 'blur']}],
birthday: [{required: true, message: '请输入出生年月', trigger: ['change', 'blur']}],
mutualGoldStartTime: [{
required: true,
message: '请输入参加大病医疗互助时间',
trigger: ['change', 'blur']
}],
unitName: [{required: true, message: '请输入工作单位', trigger: ['change', 'blur']}],
homeAddress: [{required: true, message: '请输入家庭住址', trigger: ['change', 'blur']}],
},
applyDialog: false
}
},
methods: {
openView(id) {
this.$refs.guava.view()
this.$refs.sickView.openView(id)
},
async flushUnits() {
this.$set(this.pageForm, "unitId", "")
if ("${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')||@shiro.hasRole('H03')}" === 'true') {
this.units = await getUnits(this.pageForm.unionId)
} else {
this.units = await getUnits("${@shiro.getPrincipalProperty('unit').getUnionid()}")
}
},
exportSubsidiesAmountTable() {
const {startYear, endYear} = this.pageForm
if (!startYear && !endYear) {
this.notifyWarning('请先选择需要导出的年度')
return
}
window.open(loc() + '/exportSubsidiesAmountTable?startYear=' + startYear + '&endYear=' + endYear)
}
},
async created() {
this.pageData()
this.unions = await getUnions()
this.flushUnits()
}
})
</script>
<!--#
}
#-->