first commit
This commit is contained in:
@@ -0,0 +1,194 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
|
||||
<style>
|
||||
|
||||
</style>
|
||||
|
||||
<div id="app">
|
||||
<guava>
|
||||
<el-card shadow="never" style="width: 60%;margin:auto">
|
||||
<template #header>
|
||||
<h3 style="color: #1867b0">设置年度人均的费用额度</h3>
|
||||
</template>
|
||||
<el-row>
|
||||
<el-input :placeholder="this.unionInput" v-model="formData.avglocalUnion"
|
||||
:disabled="unionDisabled"
|
||||
style="width:100%" clearable>
|
||||
<template slot="prepend">基层工会</template>
|
||||
</el-input>
|
||||
<!-- <el-button type="danger" @click="resetUnionIssues">重置本年下发</el-button>-->
|
||||
</el-row>
|
||||
<el-row class="mt10">
|
||||
<el-input :placeholder="this.clubInput" v-model="formData.avgAssociation"
|
||||
:disabled="clubDisabled"
|
||||
style="width:100%" clearable>
|
||||
<template slot="prepend">协 会</template>
|
||||
</el-input>
|
||||
<!-- <el-button type="danger" @click="resetClubIssues">重置本年下发</el-button>-->
|
||||
</el-row>
|
||||
<el-row class="text-right mt10">
|
||||
<el-button type="primary" v-loading="loading" @click="set">确认
|
||||
</el-button>
|
||||
</el-row>
|
||||
</el-card>
|
||||
</guava>
|
||||
</div>
|
||||
|
||||
|
||||
<script>
|
||||
|
||||
const vue = new Vue({
|
||||
el: "#app",
|
||||
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>
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
Reference in New Issue
Block a user