index.php 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. <?php
  2. /**
  3. * @link:http://www.gdqijianshi.com/
  4. * @copyright: Copyright (c) 2020 广东七件事集团
  5. * Created by PhpStorm
  6. * Author: lun
  7. * Date: 2021-10-23
  8. * Time: 16:11
  9. */
  10. ?>
  11. <div id="app" v-cloak>
  12. <el-card class="box-card" v-loading="loading" shadow="never" style="border:0;min-width: 1500px;"
  13. body-style="background-color: #f3f3f3;padding: 10px 0 0;">
  14. <div slot="header">
  15. <div>
  16. <span>基础设置</span>
  17. </div>
  18. </div>
  19. <div class="form_box">
  20. <el-form :model="ruleForm" size="small" ref="ruleForm" label-width="150px">
  21. <el-card shadow="never">
  22. <div slot="header">
  23. <div>
  24. <span>股东设置</span>
  25. </div>
  26. </div>
  27. <div>
  28. <el-row>
  29. <el-col :span="16">
  30. <el-form-item label="启用股东提成" style="margin-bottom: 0">
  31. <div>
  32. <el-switch v-model="ruleForm.is_enable" :active-value="1" :inactive-value="0"></el-switch>
  33. </div>
  34. </el-form-item>
  35. </el-col>
  36. <el-col :span="16">
  37. <el-form-item label="推广中心显示" style="margin-bottom: 0">
  38. <div>
  39. <el-switch v-model="ruleForm.is_show_at_center" :active-value="1" :inactive-value="0"></el-switch>
  40. </div>
  41. </el-form-item>
  42. </el-col>
  43. </el-row>
  44. </div>
  45. </el-card>
  46. </el-form>
  47. <el-button :loading="btnLoading" class="button-item" type="primary" style="margin-top: 24px;"
  48. @click="store('ruleForm')" size="small">保存
  49. </el-button>
  50. </div>
  51. </el-card>
  52. </div>
  53. <script>
  54. const app = new Vue({
  55. el: '#app',
  56. data() {
  57. return {
  58. loading: false,
  59. btnLoading: false,
  60. ruleForm: {
  61. is_enable: 0,
  62. is_show_at_center: 1,
  63. // compute_type:0,//佣金计算方式
  64. // compute_period:1,//结算周期
  65. // settlement_method:0,//结算方式
  66. // settlement_period:0,//佣金结算周期
  67. // detail:''//股东分红说明
  68. },
  69. }
  70. },
  71. mounted: function () {
  72. this.loadData();
  73. },
  74. methods: {
  75. loadData() {
  76. this.loading = true;
  77. request({
  78. params: {
  79. r: 'boss-three/setting/index',
  80. },
  81. method: 'get'
  82. }).then(e => {
  83. this.loading = false;
  84. if (e.data.code == 0 && !isEmpty(e.data.data)) {
  85. this.ruleForm = e.data.data;
  86. }
  87. }).catch(e => {
  88. this.loading = false;
  89. })
  90. },
  91. store(formName) {
  92. this.$refs[formName].validate((valid) => {
  93. if (valid) {
  94. this.btnLoading = true;
  95. request({
  96. params: {
  97. r: 'boss-three/setting/index',
  98. },
  99. method: 'post',
  100. data: this.ruleForm
  101. }).then(e => {
  102. this.btnLoading = false;
  103. if (e.data.code == 0) {
  104. this.$message.success(e.data.msg);
  105. } else {
  106. this.$message.error(e.data.msg);
  107. }
  108. }).catch(e => {
  109. this.$message.error(e);
  110. this.btnLoading = false;
  111. })
  112. } else {
  113. this.btnLoading = false;
  114. console.log('error submit!!');
  115. return false;
  116. }
  117. });
  118. },
  119. }
  120. });
  121. </script>
  122. <style>
  123. .form_box {
  124. background-color: #f3f3f3;
  125. padding: 0 0 20px;
  126. }
  127. .button-item {
  128. margin-top: 12px;
  129. padding: 9px 25px;
  130. }
  131. .el-input-group__append {
  132. background-color: #fff;
  133. color: #353535;
  134. }
  135. </style>