2021-05-13 10:56:04 +08:00
|
|
|
<template>
|
|
|
|
|
<div class="layout">
|
|
|
|
|
|
|
|
|
|
<Form ref="formValidate" :label-width="150" label-position="right" :model="formValidate" :rules="ruleValidate">
|
|
|
|
|
<FormItem label="提现审核是否开启">
|
|
|
|
|
<i-switch v-model="formValidate.apply" style="margin-top:7px;"><span slot="open">开</span>
|
|
|
|
|
<span slot="close">关</span>
|
|
|
|
|
</i-switch>
|
|
|
|
|
|
|
|
|
|
</FormItem>
|
|
|
|
|
<div class="label-btns">
|
|
|
|
|
<Button type="primary" @click="submit('formValidate')">保存</Button>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
</Form>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
<script>
|
|
|
|
|
import { setSetting } from "@/api/index";
|
|
|
|
|
import { handleSubmit } from "./validate";
|
|
|
|
|
export default {
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
2021-05-14 12:01:24 +08:00
|
|
|
formValidate: { // 表单数据
|
2021-05-13 10:56:04 +08:00
|
|
|
apply: true,
|
|
|
|
|
},
|
|
|
|
|
|
2021-05-14 12:01:24 +08:00
|
|
|
switchTitle: "提现审核是否开启", // 切换title
|
2021-05-13 10:56:04 +08:00
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
created() {
|
|
|
|
|
this.init();
|
|
|
|
|
},
|
|
|
|
|
props: ["res", "type"],
|
|
|
|
|
methods: {
|
|
|
|
|
submit(name) {
|
|
|
|
|
let that = this;
|
|
|
|
|
if( handleSubmit(that, name )){
|
|
|
|
|
this.setupSetting()
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
setupSetting() {
|
|
|
|
|
setSetting(this.type, this.formValidate).then((res) => {
|
2021-05-17 16:04:36 +08:00
|
|
|
if (res.success) {
|
2021-05-13 10:56:04 +08:00
|
|
|
this.$Message.success("保存成功!");
|
|
|
|
|
} else {
|
|
|
|
|
this.$Message.error("保存失败!");
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
// 实例化数据
|
|
|
|
|
init() {
|
|
|
|
|
this.res = JSON.parse(this.res);
|
|
|
|
|
this.$set(this, "formValidate", { ...this.res });
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
|
@import "./style.scss";
|
|
|
|
|
/deep/ .ivu-form-item-content{
|
|
|
|
|
align-items: center;
|
2021-05-14 17:28:01 +08:00
|
|
|
padding-bottom: 5px;
|
2021-05-13 10:56:04 +08:00
|
|
|
}
|
|
|
|
|
</style>
|