first commit
This commit is contained in:
@@ -0,0 +1,300 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
|
||||
|
||||
<div id="app" v-cloak>
|
||||
<guava ref="guava">
|
||||
<template>
|
||||
<el-card shadow="never">
|
||||
<div class="search">
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">年度:</div>
|
||||
<div class="search-item-option">
|
||||
<el-date-picker
|
||||
v-model="pageForm.year"
|
||||
type="year"
|
||||
value-format="yyyy" style="width: 100%"
|
||||
placeholder="选择年" @change="doSearch">
|
||||
</el-date-picker>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
|
||||
<el-card shadow="never" class="mt20">
|
||||
|
||||
<table-tool label="填报列表" :app="this">
|
||||
<template #func>
|
||||
<el-button icon="el-icon-s-promotion" type="primary" size="small"
|
||||
@click="openAdd">填报保育费
|
||||
</el-button>
|
||||
</template>
|
||||
</table-tool>
|
||||
|
||||
<el-table :data="tableData" style="width: 100%" row-key="id"
|
||||
@sort-change="pageOrder"
|
||||
v-loading="tableLoading" ref="table"
|
||||
:size="tableSize" class="vi-table">
|
||||
|
||||
<el-table-column align="center" header-align="center" width="80px" label="序号"
|
||||
type="index">
|
||||
<template scope="scope">
|
||||
<span>{{scope.$index+(pageForm.pageNumber - 1) * pageForm.pageSize + 1}} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column
|
||||
align="center"
|
||||
header-align="center"
|
||||
v-for="column in tableColumns"
|
||||
show-overflow-tooltip
|
||||
:label="column.label"
|
||||
:prop="column.prop"
|
||||
:sortable="column.sortable"
|
||||
>
|
||||
<template v-if="column.prop=='planDateTime'" scope="{row}">
|
||||
{{row.startDateTime}}-{{row.endDateTime}}
|
||||
</template>
|
||||
<template v-else-if="column.prop=='planType'" scope="{row}">
|
||||
{{row.planType===1?'保育费':'其它'}}
|
||||
</template>
|
||||
<template scope="{row}" v-else-if="column.prop==='state'">
|
||||
<span :style="'color:'+row.stateColor">{{row.stateName}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column prop="userOnline" align="center" header-align="center"
|
||||
label="操作"
|
||||
width="300px">
|
||||
<template slot-scope="{row}">
|
||||
<el-button size="mini" @click="openView(row)">
|
||||
查看
|
||||
</el-button>
|
||||
<el-button size="mini" type="primary" @click="openEdit(row)"
|
||||
:disabled="![6050,6054].includes(row.state)">
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button size="mini" type="danger" @click="doDelete(row.id)"
|
||||
:disabled="row.state!=6050">
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--#include("/layouts/pagination.html"){}#-->
|
||||
|
||||
</el-card>
|
||||
</template>
|
||||
|
||||
|
||||
<template #edit>
|
||||
<div style="margin-bottom: 50px">
|
||||
<h3 style="color: rgb(24, 103, 176);margin: 0;text-align: center">填写填报信息</h3>
|
||||
</div>
|
||||
|
||||
<el-form :model="formData" ref="form" :rules="formRules" label-width="86px">
|
||||
<el-row gutter="60">
|
||||
<el-col :span="24">
|
||||
<el-form-item label="填报类型" prop="planType">
|
||||
<el-radio v-for="i in planList" v-model="formData.planId"
|
||||
:label="i.id"
|
||||
style="margin-right: 60px;" border>
|
||||
{{i.planType===1?'保育费':'暂无'}}
|
||||
</el-radio>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="工  号">
|
||||
<el-input maxlength="100" placeholder="工号"
|
||||
disabled
|
||||
v-model="formData.loginName" style="width: 100%;"
|
||||
auto-complete="off" tabindex="4" type="text"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="职工姓名">
|
||||
<el-input maxlength="100" placeholder="职工姓名"
|
||||
disabled
|
||||
v-model="formData.userName" style="width: 100%;"
|
||||
auto-complete="off" tabindex="4" type="text"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="单  位">
|
||||
<el-input maxlength="100" placeholder="所属单位"
|
||||
disabled
|
||||
v-model="formData.unitName" style="width: 100%;"
|
||||
auto-complete="off" tabindex="4" type="text"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="基层工会">
|
||||
<el-input maxlength="100" placeholder="所属基层工会"
|
||||
disabled
|
||||
v-model="formData.unionName" style="width: 100%;"
|
||||
auto-complete="off" tabindex="4" type="text"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="报销金额" prop="money">
|
||||
<el-input maxlength="100" placeholder="报销金额"
|
||||
v-model="formData.money" style="width: 100%;"
|
||||
auto-complete="off" tabindex="4" type="text"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item prop="files" label="报销附件">
|
||||
<file-upload :files.sync="formData.files"
|
||||
card></file-upload>
|
||||
</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>
|
||||
|
||||
<div style="float: right;margin: 20px 0">
|
||||
<el-button type="primary" @click="doSubmit">提 交</el-button>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<template #view>
|
||||
<info ref="info"></info>
|
||||
</template>
|
||||
|
||||
|
||||
</guava>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
var vue = new Vue({
|
||||
el: '#app',
|
||||
mixins: [initTableMixins],
|
||||
data() {
|
||||
return {
|
||||
planList: [],
|
||||
pageForm: {
|
||||
year: moment().format('YYYY')
|
||||
},
|
||||
tableColumns: [
|
||||
{prop: 'loginName', label: '工号'},
|
||||
{prop: 'userName', label: '姓名'},
|
||||
{prop: 'unitName', label: '单位'},
|
||||
{prop: 'unionName', label: '工会'},
|
||||
{prop: 'money', label: '报销金额', sortable: true},
|
||||
{prop: 'applyDateTime', label: '报销申请时间'},
|
||||
{prop: 'state', label: '报销状态', sortable: true},
|
||||
],
|
||||
formRules: {
|
||||
money: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
files: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
}
|
||||
}
|
||||
},
|
||||
components: {
|
||||
'info': httpVueLoader('/components/childcareFees/info.vue?v=' + new Date().getTime()),
|
||||
},
|
||||
methods: {
|
||||
async getPlan() {
|
||||
const resp = await $.post('/platform/childcareFees/applyPlan/getPlan', {year: this.pageForm.year})
|
||||
this.planList = resp.data
|
||||
},
|
||||
openView(row) {
|
||||
this.$refs.info.getInfo(row.id)
|
||||
this.$refs.guava.view()
|
||||
},
|
||||
async openAdd() {
|
||||
this.formData = {money: 0, files: null}
|
||||
await this.getPlan()
|
||||
const sex = "${@shiro.getPrincipalProperty('sex')}"
|
||||
const now = moment().format("YYYY-MM-DD HH:mm:ss")
|
||||
if (!sex) {
|
||||
this.notifyWarning("系统中暂无您的性别请联系管理员")
|
||||
return
|
||||
}
|
||||
const sexPlanList = this.planList.filter(v => v.sex === sex && v.startDateTime < now && v.endDateTime > now)
|
||||
if (sexPlanList && sexPlanList.length === 0) {
|
||||
this.notifyWarning("您不在此次填报计划内,请联系管理员")
|
||||
return
|
||||
}
|
||||
const planList = sexPlanList.filter(v => v.startDateTime < now && v.endDateTime > now)
|
||||
if (sexPlanList && sexPlanList.length === 0) {
|
||||
this.notifyWarning("还未到填报时间暂时无法填报,请联系管理员")
|
||||
return
|
||||
}
|
||||
if (planList && planList.length === 1) {
|
||||
this.$set(this.formData, "planId", planList[0].id)
|
||||
}
|
||||
|
||||
this.planList = planList
|
||||
|
||||
this.$set(this.formData, 'loginName', "${@shiro.getPrincipalProperty('loginname')}")
|
||||
this.$set(this.formData, 'userName', '${@shiro.getPrincipalProperty("username")}')
|
||||
this.$set(this.formData, 'unitName', '${@shiro.getPrincipalProperty("unit").getName()}')
|
||||
this.$set(this.formData, 'unionName', '${@shiro.getPrincipalProperty("union").getUnionname()}')
|
||||
this.$refs.guava.edit()
|
||||
if (this.$refs["form"])
|
||||
this.$refs["form"].resetFields();
|
||||
},
|
||||
async doDelete(id) {
|
||||
const confirm = await this.$confirm('您确定要删除吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
})
|
||||
if (confirm === 'confirm') {
|
||||
const resp = await $.post(loc() + '/doDelete', {id: id})
|
||||
if (resp.code === 0) {
|
||||
this.notifySuccess(resp.msg)
|
||||
this.doSearch()
|
||||
}
|
||||
}
|
||||
},
|
||||
async openEdit(row) {
|
||||
await this.getPlan()
|
||||
const now = moment().format("YYYY-MM-DD HH:mm:ss")
|
||||
const planList = this.planList.filter(v => v.startDateTime < now && v.endDateTime > now)
|
||||
if (this.planList && this.planList.length === 0) {
|
||||
this.notifyWarning("还未到填报时间暂时无法填报,请联系管理员")
|
||||
return
|
||||
}
|
||||
row.files = JSON.parse(row.files)
|
||||
row.sign = row.signData
|
||||
this.formData = row
|
||||
this.planList = planList
|
||||
this.$refs.guava.edit()
|
||||
},
|
||||
doSubmit() {
|
||||
this.$refs["form"].validate(async (valid) => {
|
||||
if (valid) {
|
||||
const formData = clone(this.formData)
|
||||
formData.files = JSON.stringify(formData.files)
|
||||
const refs = await $.post(loc() + "/doSubmit", formData)
|
||||
if (refs.code === 0) {
|
||||
this.doSearch()
|
||||
this.$refs.guava.index()
|
||||
this.notifySuccess(refs.msg);
|
||||
} else {
|
||||
this.notifyWarning(refs.msg)
|
||||
}
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
async created() {
|
||||
this.pageData()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
Reference in New Issue
Block a user