| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197 |
- <div id="app" v-cloak>
- <el-card class="box-card" v-loading="loading" shadow="never" style="border:0;min-width: 1250px;" body-style="background-color: #f3f3f3;padding: 10px 0 0;">
- <div class="form_body">
- <el-form :model="ruleForm" size="small" ref="ruleForm" label-width="150px">
- <el-card shadow="never">
- <div slot="header">
- <div>
- <span>基础设置</span>
- </div>
- </div>
- <div>
- <el-row>
- <el-col :span="16">
- <el-form-item label="是否启用插件" style="margin-bottom: 20px;">
- <div>
- <el-switch v-model="ruleForm.is_enable" :active-value="1" :inactive-value="0"></el-switch>
- </div>
- <br/>
- <div class="tips-text" style="line-height: 24px;">
- 启用亲友卡,会员升级才会赠送
- </div>
- </el-form-item>
- <el-form-item prop="settlement_method" label="佣金结算方式">
- <el-col :span="8" style="width: 100%;">
- <el-radio-group v-model="ruleForm.settlement_method" size="small">
- <el-radio :label="0" border>订单完成后</el-radio>
- <el-radio :label="1" border>订单付款后</el-radio>
- </el-radio-group>
- </el-col>
- <br/>
- <div class="tips-text" style="line-height: 24px;">
- 子卡消费,母卡能拿到的佣金结算方式
- </div>
- </el-form-item>
- <el-form-item label="提醒通知设置" style="margin-bottom: 20px;">
- <div>
- <el-switch v-model="ruleForm.is_remind" :active-value="1" :inactive-value="0"></el-switch>
- </div>
- </el-form-item>
- <el-form-item prop="remind_days" label="亲友卡剩余" v-if="ruleForm.is_remind">
- <el-col :span="20" style="display: flex;align-items: flex-start;">
- <el-input type="number" v-model="ruleForm.remind_days" :min="0" class="member-money" placeholder="" style="width: 200px;margin-right: 20px;">
- <template slot="append">天</template>
- </el-input>
- <div>发送提醒通知</div>
- </el-col>
- </el-form-item>
- <el-form-item label="领取说明" prop="description">
- <el-input type="textarea" :rows="3" placeholder="领取说明"
- v-model="ruleForm.description" maxlength="20" show-word-limit></el-input>
- </el-form-item>
- </el-col>
- </el-row>
- </div>
- </el-card>
- </el-form>
- <el-button :loading="btnLoading" class="button-item" type="primary" style="margin-top: 24px;"
- @click="store('ruleForm')" size="small">保存
- </el-button>
- </div>
- </el-card>
- </div>
- <script>
- const app = new Vue({
- el: '#app',
- data() {
- return {
- loading: false,
- btnLoading: false,
- ruleForm: {
- is_enable: 0,
- management_fee:0,
- settlement_method:0,
- is_remind:0,
- remind_days:0,
- description:'',
- },
- }
- },
- mounted: function () {
- this.loadData();
- },
- methods: {
- loadData() {
- this.loading = true;
- request({
- params: {
- r: 'members-card/default/setting',
- },
- method: 'get'
- }).then(e => {
- this.loading = false;
- if (e.data.code == 0 && !isEmpty(e.data.data)) {
- this.ruleForm = e.data.data;
- }
- }).catch(e => {
- this.loading = false;
- })
- },
- store(formName) {
- this.$refs[formName].validate((valid) => {
- if (valid) {
- this.btnLoading = true;
- request({
- params: {
- r: 'members-card/default/setting',
- },
- method: 'post',
- data: this.ruleForm
- }).then(e => {
- this.btnLoading = false;
- if (e.data.code == 0) {
- this.$message.success(e.data.msg);
- } else {
- this.$message.error(e.data.msg);
- }
- }).catch(e => {
- this.$message.error(e);
- this.btnLoading = false;
- })
- } else {
- this.btnLoading = false;
- console.log('error submit!!');
- return false;
- }
- });
- },
- }
- });
- </script>
- <style>
- .form-body {
- padding: 20px;
- background-color: #fff;
- margin-bottom: 20px;
- padding-right: 20%;
- min-width: 900px;
- }
- .form-body .el-form-item {
- padding-right: 25%;
- min-width: 850px;
- }
- .form-button {
- margin: 0;
- }
- .form-button .el-form-item__content {
- margin-left: 0 !important;
- }
- .button-item {
- padding: 9px 25px;
- }
- .check-group {
- font-size: 14px !important;
- }
- .check-group .el-col {
- display: flex;
- }
- .check-group .el-input {
- margin: 0 5px;
- }
- .check-group .el-col .el-checkbox {
- display: flex;
- align-items: center;
- }
- .check-group .el-col .el-input {
- width: 100px;
- }
- .check-group .el-col .el-input .el-input__inner {
- height: 30px;
- width: 100px;
- }
- .el-checkbox-group .el-col {
- margin-bottom: 10px;
- }
- .condition_common {
- display: flex;
- align-items: center;
- }
- .condition_common_five {
- display: flex;
- }
- </style>
|