216 lines
7.6 KiB
HTML
216 lines
7.6 KiB
HTML
<!--#
|
|
layout("/layouts/platform.html"){
|
|
#-->
|
|
|
|
<style>
|
|
|
|
.text {
|
|
font-size: 14px;
|
|
}
|
|
|
|
.item {
|
|
margin-bottom: 18px;
|
|
}
|
|
|
|
.clearfix:before,
|
|
.clearfix:after {
|
|
display: table;
|
|
content: "";
|
|
}
|
|
|
|
.clearfix:after {
|
|
clear: both
|
|
}
|
|
|
|
.box-card {
|
|
width: 580px;
|
|
}
|
|
</style>
|
|
|
|
<div id="costs" style="min-height: 100%;display: flex;justify-content: center;margin-top: 50px">
|
|
<el-card class="box-card" style="height: 50vh;position: relative">
|
|
<div slot="header" class="clearfix">
|
|
<span>设置年度人均的费用额度</span>
|
|
</div>
|
|
<div style="padding-bottom: 50px;">
|
|
<el-row>
|
|
<el-input :placeholder="this.unionInput" v-model="formData.avglocalUnion"
|
|
:disabled="unionDisabled"
|
|
style="width:400px" clearable>
|
|
<template slot="prepend">院级工会</template>
|
|
</el-input>
|
|
<!-- <el-button type="danger" @click="resetUnionIssues">重置本年下发</el-button>-->
|
|
</el-row>
|
|
<el-row style="margin-top: 10px">
|
|
<el-input :placeholder="this.clubInput" v-model="formData.avgAssociation"
|
|
:disabled="clubDisabled"
|
|
style="width:400px" clearable>
|
|
<template slot="prepend">协 会</template>
|
|
</el-input>
|
|
<!-- <el-button type="danger" @click="resetClubIssues">重置本年下发</el-button>-->
|
|
</el-row>
|
|
|
|
|
|
<el-button style="position: absolute;right: 20px;bottom: 20px; padding: 3px 0; width: 80px;height: 50px"
|
|
type="primary" v-loading="loading" @click="set">确 认
|
|
</el-button>
|
|
</div>
|
|
</el-card>
|
|
</div>
|
|
|
|
|
|
<script>
|
|
|
|
const vue = new Vue({
|
|
el: "#costs",
|
|
data() {
|
|
return {
|
|
loading:"",
|
|
unionDisabled: false,
|
|
unionInput: "",
|
|
clubDisabled: false,
|
|
clubInput: "",
|
|
union: 2,
|
|
club: 3,
|
|
formData: {},
|
|
formRules: {
|
|
avglocalUnion: [{required: true, message: '请选择是否启用', trigger: ['blur', 'change']}],
|
|
avgAssociation: [{required: true, message: '请选择是否启用', trigger: ['blur', 'change']}],
|
|
}
|
|
}
|
|
|
|
},
|
|
methods: {
|
|
|
|
// 回显
|
|
async echo() {
|
|
const {data:{union_avg,club_avg}} = await $.get("/platform/jf/costsSet/costsSet/echo")
|
|
this.$set(this.formData,'avglocalUnion',union_avg)
|
|
this.unionInput = union_avg;
|
|
|
|
this.$set(this.formData,'avgAssociation',club_avg)
|
|
this.clubInput = union_avg;
|
|
|
|
},
|
|
|
|
// //重置工会年度下发
|
|
// async resetUnionIssues() {
|
|
// const resp = await $.get("/platform/jf/costsSet/costsSet/resetUnionIssues")
|
|
// requestLaterFun(resp, () => {
|
|
// this.$notify.success({title: '成功', message: resp.msg});
|
|
// window.location.href = '/platform/jf/costsSet/costsSet'
|
|
// }, () => {
|
|
// this.$notify.error({title: '失败', message: resp.msg});
|
|
// })
|
|
//
|
|
// },
|
|
//
|
|
//
|
|
// // 重置社团年度下发
|
|
// async resetClubIssues() {
|
|
// const resp = await $.get("/platform/jf/costsSet/costsSet/resetClubIssues")
|
|
// },
|
|
//
|
|
//
|
|
// //是否下发了
|
|
// async isSet() {
|
|
// const resp = await $.get("/platform/jf/costsSet/costsSet/isSet")
|
|
// // 工会已下发
|
|
// if (resp.data[0] == 200) {
|
|
// this.union = 0; // 修改状态用于判断是否发送请求
|
|
// this.unionInput = "本年度已下发,不可以设置人均额度" + this.unionAvg + "元" // 修改提示框内容
|
|
// this.unionDisabled = true // 输入框禁用
|
|
// }
|
|
// // 社团已下发
|
|
// if (resp.data[1] == 201) {
|
|
// this.club = 1;
|
|
// this.clubInput = "本年度已下发,不可以设置人均额度" + this.clubAvg + "元"
|
|
// this.clubDisabled = true
|
|
// }
|
|
// },
|
|
//
|
|
// 设置是否
|
|
async set() {
|
|
this.loading=true;
|
|
const resp = await $.post("/platform/jf/costsSet/costsSet/set", {
|
|
avglocalUnion: this.formData.avglocalUnion,
|
|
avgAssociation: this.formData.avgAssociation
|
|
})
|
|
console.log(resp)
|
|
if (resp.code == 0) {
|
|
this.loading=false;
|
|
|
|
this.$notify({
|
|
title: '成功',
|
|
message: '操作成功',
|
|
type: 'success'
|
|
});
|
|
} else {
|
|
this.$notify.error({
|
|
title: '错误',
|
|
message: '操作失败'
|
|
});
|
|
}
|
|
|
|
//await this.localUnion();
|
|
// await this.association();
|
|
|
|
// // await this.isSet();
|
|
// if (this.formData.avglocalUnion == null) {
|
|
// this.$notify({
|
|
// title: '警告',
|
|
// message: '人均的费用额度不能为空',
|
|
// type: 'warning'
|
|
// });
|
|
// return
|
|
// } else if (this.union != 0) {
|
|
// await this.localUnion();
|
|
// }
|
|
// if (this.club != 1) {
|
|
// if (this.formData.avgAssociation == null) {
|
|
// this.$notify({
|
|
// title: '警告',
|
|
// message: '人均的费用额度不能为空',
|
|
// type: 'warning'
|
|
// });
|
|
// return
|
|
// }
|
|
// await this.association();
|
|
// }
|
|
},
|
|
|
|
|
|
async localUnion() {
|
|
const resp = await $.post("/platform/jf/costsSet/costsSet/localUnion", {avglocalUnion: this.formData.avglocalUnion})
|
|
requestLaterMsgFun(vue, resp, async () => {
|
|
}, () => {
|
|
this.$notify.error({
|
|
title: '设置失败',
|
|
message: '设置所有基层工会会员年度人均费用额度失败'
|
|
});
|
|
}, () => {
|
|
})
|
|
},
|
|
|
|
async association() {
|
|
const resp = await $.post("/platform/jf/costsSet/costsSet/association", {avgAssociation: this.formData.avgAssociation})
|
|
requestLaterMsgFun(vue, resp, async () => {
|
|
}, () => {
|
|
this.$notify.error({
|
|
title: '设置失败',
|
|
message: '设置协会会员年度人均费用额度失败'
|
|
});
|
|
}, () => {
|
|
})
|
|
},
|
|
},
|
|
created() {
|
|
this.echo();
|
|
}
|
|
});
|
|
|
|
</script>
|
|
|
|
<!--#
|
|
}
|
|
#--> |