330 lines
17 KiB
HTML
330 lines
17 KiB
HTML
<!--#
|
|
layout("/layouts/platform.html"){
|
|
#-->
|
|
|
|
<style>
|
|
.applyForm .el-row--flex .el-form-item {
|
|
flex: auto;
|
|
}
|
|
|
|
.descriptions-form .el-form-item {
|
|
margin-bottom: 0;
|
|
}
|
|
|
|
.disabled-group .el-radio {
|
|
pointer-events: none;
|
|
}
|
|
|
|
.nowrap-select-tag .el-select__tags {
|
|
flex-wrap: nowrap;
|
|
overflow: hidden;
|
|
}
|
|
|
|
</style>
|
|
|
|
<div id="app" v-cloak>
|
|
<guava>
|
|
<el-card shadow="never">
|
|
<div slot="header" style="display: flex;justify-content: space-between">
|
|
<h3 style="color: rgb(24, 103, 176);">
|
|
教职工特困补助申请
|
|
</h3>
|
|
<el-button type="text" @click="viewSubsidyProgramme">补助方案</el-button>
|
|
</div>
|
|
|
|
<el-form :model="applyForm" ref="applyForm" label-width="120px" class="applyForm">
|
|
<el-descriptions border class="descriptions-form">
|
|
<el-descriptions-item label="姓名">
|
|
<el-form-item prop="userName" label-width="0"
|
|
:rules="[{required:true,message:'必填',trigger:['change','blur']}]">
|
|
<el-input :value="applyForm.userName" readonly></el-input>
|
|
</el-form-item>
|
|
</el-descriptions-item>
|
|
<el-descriptions-item label="性别">
|
|
<el-form-item prop="sex" label-width="0">
|
|
<el-radio-group v-model="applyForm.sex" size="small" class="disabled-group">
|
|
<el-radio label="男" border></el-radio>
|
|
<el-radio label="女" border></el-radio>
|
|
</el-radio-group>
|
|
</el-form-item>
|
|
</el-descriptions-item>
|
|
<el-descriptions-item label="年龄">
|
|
<el-form-item prop="age" label-width="0">
|
|
<el-input-number v-model="applyForm.age"></el-input-number>
|
|
</el-form-item>
|
|
</el-descriptions-item>
|
|
|
|
<el-descriptions-item label="所在部门">
|
|
<el-form-item prop="unitId" label-width="0">
|
|
<el-input v-model="applyForm.unitName" readonly></el-input>
|
|
</el-form-item>
|
|
</el-descriptions-item>
|
|
<el-descriptions-item label="工号" :span="2">
|
|
<el-form-item prop="loginName" label-width="0">
|
|
<el-input v-model="applyForm.loginName" readonly></el-input>
|
|
</el-form-item>
|
|
</el-descriptions-item>
|
|
|
|
<el-descriptions-item label="联系电话">
|
|
<el-form-item prop="mobile" label-width="0">
|
|
<el-input v-model="applyForm.mobile"></el-input>
|
|
</el-form-item>
|
|
</el-descriptions-item>
|
|
|
|
<el-descriptions-item label="家庭住址" :span="2">
|
|
<el-form-item prop="homeAddress" label-width="0"
|
|
:rules="[{required:true,message:'必填',trigger:['change','blur']}]">
|
|
<el-input v-model="applyForm.homeAddress"></el-input>
|
|
</el-form-item>
|
|
</el-descriptions-item>
|
|
|
|
|
|
<el-descriptions-item label="申请补助类别" :span="3">
|
|
<el-form-item prop="subsidyType" label-width="0"
|
|
:rules="[{required:true,message:'必填',trigger:['change','blur']}]">
|
|
<el-checkbox-group v-model="applyForm.subsidyType">
|
|
<el-checkbox v-for="item in projectInfo" :label="item.id">
|
|
{{item.projectName}}
|
|
</el-checkbox>
|
|
</el-checkbox-group>
|
|
</el-form-item>
|
|
</el-descriptions-item>
|
|
|
|
<el-descriptions-item label="住院记录" :span="3">
|
|
<el-table :data="applyForm.hospitalRecords" border>
|
|
<el-table-column label="就诊医院" prop="hospitalName">
|
|
<template scope="{row,$index}">
|
|
<el-form-item label-width="0"
|
|
:prop="'hospitalRecords.'+$index+'.hospitalName'"
|
|
:rules="[{required:true,message:'必填',trigger:['change','blur']}]">
|
|
<el-input v-model="row.hospitalName"></el-input>
|
|
</el-form-item>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column label="入院时间" prop="startDate">
|
|
<template scope="{row,$index}">
|
|
<el-form-item label-width="0"
|
|
:prop="'hospitalRecords.'+$index+'.startDate'"
|
|
:rules="[{required:true,message:'必填',trigger:['change','blur']}]">
|
|
<el-date-picker v-model="row.startDate" value-format="yyyy-MM-dd"
|
|
style="width: 100%"></el-date-picker>
|
|
</el-form-item>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column label="出院时间" prop="endDate">
|
|
<template scope="{row,$index}">
|
|
<el-form-item label-width="0"
|
|
:prop="'hospitalRecords.'+$index+'.endDate'"
|
|
:rules="[{required:true,message:'必填',trigger:['change','blur']}]">
|
|
<el-date-picker v-model="row.endDate" value-format="yyyy-MM-dd"
|
|
style="width: 100%"></el-date-picker>
|
|
</el-form-item>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column label="自费金额" prop="selfFundedAmount">
|
|
<template scope="{row,$index}">
|
|
<el-form-item label-width="0"
|
|
:prop="'hospitalRecords.'+$index+'.selfFundedAmount'"
|
|
:rules="[{required:true,message:'必填',trigger:['change','blur']}]">
|
|
<el-input-number v-model="row.selfFundedAmount"
|
|
style="width: 100%"></el-input-number>
|
|
</el-form-item>
|
|
</template>
|
|
</el-table-column>
|
|
|
|
<el-table-column label="住院事由" prop="subsidyType">
|
|
<template scope="{row,$index}">
|
|
<el-form-item label-width="0"
|
|
:prop="'hospitalRecords.'+$index+'.subsidyType'"
|
|
:rules="[{required:true,message:'必填',trigger:['change','blur']}]">
|
|
<el-select v-model="row.subsidyType" multiple collapse-tags style="width: 100%"
|
|
class="nowrap-select-tag">
|
|
<el-option
|
|
v-for="item in projectInfo.filter(v=>applyForm.subsidyType.includes(v.id))"
|
|
:key="item.id"
|
|
:label="item.projectName"
|
|
:value="item.id"></el-option>
|
|
</el-select>
|
|
</el-form-item>
|
|
</template>
|
|
</el-table-column>
|
|
|
|
<el-table-column label="疾病详情" prop="diseaseDetail">
|
|
<template scope="{row,$index}">
|
|
<el-form-item label-width="0"
|
|
:prop="'hospitalRecords.'+$index+'.diseaseDetail'"
|
|
:rules="[{required:false,message:'必填',trigger:['change','blur']}]">
|
|
<el-select v-model="row.diseaseDetail" multiple collapse-tags
|
|
class="nowrap-select-tag"
|
|
style="width: 100%">
|
|
<el-option-group
|
|
v-for="group in projectInfo.filter(v=>applyForm.subsidyType.includes(v.id))"
|
|
:key="group.id"
|
|
:label="group.projectName">
|
|
<el-option
|
|
v-for="item in group.diseaseTypeList"
|
|
:key="item.id"
|
|
:label="item.diseaseName"
|
|
:value="item.id">
|
|
</el-option>
|
|
</el-option-group>
|
|
</el-select>
|
|
</el-form-item>
|
|
</template>
|
|
</el-table-column>
|
|
|
|
|
|
<el-table-column label="备注" prop="notes">
|
|
<template scope="{row,$index}">
|
|
<el-form-item label-width="0"
|
|
:prop="'hospitalRecords.'+$index+'.notes'"
|
|
:rules="[{required:false,message:'必填',trigger:['change','blur']}]">
|
|
<el-input v-model="row.notes" maxlength="20" style="width: 100%"></el-input>
|
|
</el-form-item>
|
|
</template>
|
|
</el-table-column>
|
|
|
|
<el-table-column label="操作" width="150px">
|
|
<template #header scope="scope">
|
|
<el-button size="mini" type="primary"
|
|
@click="applyForm.hospitalRecords.push({subsidyType:[]})">增加住院记录
|
|
</el-button>
|
|
</template>
|
|
<template scope="scope">
|
|
<el-button size="mini" type="danger" icon="el-icon-delete"
|
|
@click="applyForm.hospitalRecords.splice(scope.$index,1)"></el-button>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table>
|
|
</el-descriptions-item>
|
|
|
|
<el-descriptions-item label="申请补助原因" :span="3">
|
|
<el-form-item prop="reason" label-width="0"
|
|
:rules="[{required:true,message:'必填',trigger:['change','blur']}]">
|
|
<el-input v-model="applyForm.reason" type="textarea" rows="5"></el-input>
|
|
</el-form-item>
|
|
</el-descriptions-item>
|
|
|
|
<el-descriptions-item label="证明材料" :span="3">
|
|
<el-form-item label-width="0"
|
|
:rules="[{required:true,message:'必填',trigger:['change','blur']}]" prop="files">
|
|
<file-upload :files.sync="applyForm.files"></file-upload>
|
|
</el-form-item>
|
|
</el-descriptions-item>
|
|
</el-descriptions>
|
|
|
|
<el-row type="flex" justify="end" align="center" style="padding: 20px">
|
|
<el-button @click="save" v-if="applyForm.stateId==null">保存</el-button>
|
|
<el-button @click="submit" type="primary">提交</el-button>
|
|
</el-row>
|
|
|
|
</el-form>
|
|
</el-card>
|
|
|
|
<el-dialog :visible.sync="subsidyProgrammeDialogVisible" top="50px">
|
|
<iframe :src="subsidyProgrammeUrl"
|
|
frameborder="0"
|
|
width="100%"
|
|
:height="(innerHeight - 200)+'px' "></iframe>
|
|
</el-dialog>
|
|
|
|
</guava>
|
|
</div>
|
|
|
|
<script>
|
|
var vue = new Vue({
|
|
el: '#app',
|
|
data() {
|
|
return {
|
|
applyForm: {
|
|
subsidyType: [],
|
|
hospitalRecords: [{subsidyType: []}]
|
|
},
|
|
projectInfo: [],
|
|
subsidyProgrammeDialogVisible: false,
|
|
subsidyProgrammeUrl: null
|
|
}
|
|
},
|
|
methods: {
|
|
//补助类别
|
|
async getProjectInfo() {
|
|
const resp = await $.post(loc() + '/projectInfo')
|
|
if (resp.code === 0) {
|
|
this.projectInfo = resp.data
|
|
}
|
|
},
|
|
async save() {
|
|
const resp = await $.post(loc() + '/save', {apply: JSON.stringify(this.applyForm)})
|
|
if (resp.code === 0) {
|
|
this.$notify({
|
|
title: '成功',
|
|
message: resp.msg,
|
|
type: 'success'
|
|
});
|
|
sublime.jumpPagePjax('/platform/difficultSubsidy/applyHistory')
|
|
} else {
|
|
this.$notify({
|
|
title: '警告',
|
|
message: resp.msg,
|
|
type: 'warning'
|
|
});
|
|
}
|
|
},
|
|
async submit() {
|
|
this.$refs['applyForm'].validate(async valid => {
|
|
if (valid) {
|
|
const resp = await $.post(loc() + '/submit', {apply: JSON.stringify(this.applyForm)})
|
|
if (resp.code === 0) {
|
|
this.$notify({
|
|
title: '成功',
|
|
message: resp.msg,
|
|
type: 'success'
|
|
});
|
|
sublime.jumpPagePjax('/platform/difficultSubsidy/applyHistory')
|
|
} else {
|
|
this.$notify({
|
|
title: '警告',
|
|
message: resp.msg,
|
|
type: 'warning'
|
|
});
|
|
}
|
|
}
|
|
})
|
|
},
|
|
init() {
|
|
console.log("${@shiro.getPrincipalProperty('username')}")
|
|
const id = GetQueryString('id')
|
|
if (id) {
|
|
$.post(loc() + '/findOne', {id}).then(res => {
|
|
this.applyForm = res.data
|
|
})
|
|
} else {
|
|
this.$set(this.applyForm, 'userName', "${@shiro.getPrincipalProperty('username')}")
|
|
this.$set(this.applyForm, 'sex', "${@shiro.getPrincipalProperty('sex')}")
|
|
const birthday = "${@shiro.getPrincipalProperty('birthday')}"
|
|
if (birthday) {
|
|
this.$set(this.applyForm, 'age', new Date().getFullYear() - birthday.split('-')[0])
|
|
}
|
|
this.$set(this.applyForm, 'unitName', "${@shiro.getPrincipalProperty('unit')!=null?@shiro.getPrincipalProperty('unit').getName():''}")
|
|
this.$set(this.applyForm, 'loginName', "${@shiro.getPrincipalProperty('loginname')}")
|
|
this.$set(this.applyForm, 'mobile', "${@shiro.getPrincipalProperty('mobile')}")
|
|
this.$set(this.applyForm, 'homeAddress', "${@shiro.getPrincipalProperty('homeAddress')}")
|
|
}
|
|
},
|
|
viewSubsidyProgramme() {
|
|
let pdfStreamUrl = encodeURIComponent(FILE_STREAM_PREVIEW_ADDRESS + '?id=cad5418aafd749b68c59946589dda6f0') //将路径转码
|
|
this.subsidyProgrammeUrl = '/assets/platform/plugins/pdfJs/web/viewer.html?file=' + pdfStreamUrl
|
|
this.subsidyProgrammeDialogVisible = true
|
|
}
|
|
|
|
},
|
|
async created() {
|
|
await this.getProjectInfo()
|
|
this.init()
|
|
}
|
|
})
|
|
</script>
|
|
|
|
<!--#
|
|
}
|
|
#--> |