Files
UNION_NSI/target/classes/views/platform/childcareFees/unionApply.html
T
2026-09-08 19:49:21 +08:00

326 lines
13 KiB
HTML

<!--#
layout("/layouts/platform.html"){
#-->
<style>
.el-transfer-panel {
text-align: left;
width: calc(50% - 91px);
height: 53vh;
}
.el-transfer-panel__list.is-filterable {
height: calc(50vh - 110px);
}
.transfer {
display: flex;
height: 100%;
width: 100%;
align-items: center;
padding: 0 10px;
}
.transfer .el-checkbox {
display: inline-block !important;
margin: 0 10px !important;
}
</style>
<div id="app" v-cloak>
<guava ref="guava">
<template>
<el-card shadow="never">
<div class="search">
<div class="search-item">
<div class="search-item-label">年度:</div>
<div class="search-item-option">
<el-date-picker
@change="getPlan"
placeholder="选择年"
style="width: 100%" type="year"
v-model="pageForm.year" value-format="yyyy">
</el-date-picker>
</div>
</div>
</div>
</el-card>
<el-card class="mt20" shadow="never">
<table-tool :app="this" label="填报列表">
<template #func>
</template>
</table-tool>
<el-table :data="planList" :size="tableSize" class="vi-table"
ref="table" row-key="id"
style="width: 100%" v-loading="tableLoading">
<el-table-column align="center" header-align="center" label="序号" type="index"
width="80px">
<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"
align="center"
header-align="center"
show-overflow-tooltip
v-for="column in tableColumns"
>
<template scope="{row}" v-if="column.prop=='planDateTime'">
{{row.startDateTime}}-{{row.endDateTime}}
</template>
<template scope="{row}" v-else-if="column.prop=='planType'">
{{row.planType===1?'保育费':'其它'}}
</template>
</el-table-column>
<el-table-column align="center" header-align="center" label="操作"
prop="userOnline"
width="300px">
<template slot-scope="{row}">
<el-button @click="openView(row)" size="mini" type="primary">
查看
</el-button>
<el-button @click="openEdit(row)"
size="mini" type="primary"
v-if="moment().unix()>moment(row.startDateTime).unix()
&&moment().unix()<moment(row.endDateTime).unix()">
上报
</el-button>
<el-button @click="exportByUnion(row)" size="small" type="primary">
导出
</el-button>
</template>
</el-table-column>
</el-table>
</el-card>
</template>
<template #edit>
<el-form :model="formData" :rules="formRules" label-width="86px" ref="form">
<el-row gutter="60">
<el-col :span="24">
<el-form-item>
<el-card shadow="never">
<el-transfer
:data="leftData"
:filter-method="filterMethod"
:props="{key: 'loginName',label: 'names'}"
:titles="['可报人员名单', '当前选择']"
filterable
ref="transfer"
v-model="rightData">
<template #left-footer>
<div></div>
</template>
</el-transfer>
</el-card>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item>
<el-card class="mt10" shadow="never">
<el-table :data="escalationTableData" max-height="500px" >
<el-table-column
align="center" header-align="center" label="序号"
type="index"
width="100">
</el-table-column>
<el-table-column align="center" header-align="center" label="姓名"
prop="userName"></el-table-column>
<el-table-column align="center" header-align="center"
label="教工号"
prop="loginName"></el-table-column>
<el-table-column align="center" header-align="center" label="单位"
prop="unitname"
sortable></el-table-column>
<el-table-column align="center" header-align="center"
label="报销金额(元)"
prop="money"
sortable>
<template scope="{$index,row}">
<el-input-number
step-strictly
:max="10000"
:step="100"
:precision="0"
:min="1" style="width: 100%;"
v-model="row.money"></el-input-number>
</template>
</el-table-column>
<el-table-column align="center" header-align="center" label="操作"
sortable>
<template scope="{$index,row}">
<el-button @click="rightData.splice($index,1)"
size="mini"
type="danger">删除
</el-button>
</template>
</el-table-column>
</el-table>
</el-card>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="签字" prop="sign">
<sign :qz.sync="formData.sign" prefix="sign"></sign>
</el-form-item>
</el-col>
</el-row>
</el-form>
<el-row class="mt10 text-right">
<el-button @click="doAdd" class="mt10" type="primary" v-loading="submitLoading">
提交
</el-button>
</el-row>
</template>
<template #view>
<school-info :plan_id="planId" :state="6056" :union_id="pageForm.union_id"
:year="pageForm.year"
ref="schoolInfo"></school-info>
</template>
</guava>
</div>
<script>
const vue = new Vue({
el: '#app',
mixins: [initTableMixins],
data() {
return {
planList: [],
pageForm: {
union_id:"${@shiro.getPrincipalProperty('unit').getUnionid()}",
year: moment().format('YYYY')
},
tableColumns: [
{prop: 'year', label: '计划年度'},
{prop: 'planName', label: '计划名称'},
{prop: 'planType', label: '计划类型'},
{prop: 'sex', label: '计划报销对象'},
{prop: 'planDateTime', label: '计划报销时间'},
],
leftData: [],
rightData: [],
planId: "",
formRules: {
sign: [{required: true, message: '必填', trigger: ['blur', 'change']}],
}
}
},
computed: {
escalationTableData() {
return this.leftData.filter(v => this.rightData.includes(v.loginName))
}
},
components: {
'school-info': httpVueLoader('/components/childcareFees/schoolInfo.vue?v=' + new Date().getTime()),
},
methods: {
exportByUnion(row) {
window.open('/platform/childcareFees/schoolAudit/exportByUnion?planId=' + row.id)
},
filterMethod(query, item) {
return item.userName.indexOf(query) > -1;
},
async getPlan() {
const resp = await $.post('/platform/childcareFees/applyPlan/getPlan', {year: this.pageForm.year})
this.planList = resp.data
},
openView() {
this.$refs.guava.view()
this.$nextTick(()=>{
this.$refs.schoolInfo.userTrueNumPageData()
})
},
doAdd() {
this.$refs["form"].validate(async (valid) => {
if (valid) {
this.$confirm('您确定要提交吗?如需修改请在规定时间内进行修改!', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(async () => {
if (this.rightData && this.rightData.length === 0) {
this.notifyWarning("请选择需要上报的教职工")
return
}
let userList = this.escalationTableData
const moneys = userList.map(u => u.money)
if (moneys.includes(0)) {
this.notifyWarning("请填写报销金额")
return
}
const {code, msg} = await $.post(loc() + '/doAdd', {
userList: JSON.stringify(userList),
planId: this.planId,
sign: this.formData.sign
})
if (code === 0) {
this.notifySuccess(msg)
this.$refs.guava.index()
} else {
this.notifyWarning(msg)
}
})
}
})
},
async openEdit(row) {
this.planId = row.id
this.$refs.guava.edit()
const {data} = await $.get(loc() + '/selfUnionUsers', {planId: row.id})
const {data: rightData} = await $.get(loc() + '/getReportedUser', {
planId: row.id
})
const rightLoginNameData = rightData.map(r => r.loginName)
data.map(l => {
const right = rightData.find(r => r.loginName === l.loginName)
if (right) {
l.money = right.money
} else {
l.money = 0
}
})
this.leftData = data
this.rightData = rightLoginNameData
},
},
async created() {
this.getPlan()
}
})
</script>
<!--#
}
#-->