setting.php 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198
  1. <?php
  2. use common\helpers\ComponentHelper;
  3. // ComponentHelper::loadComponentView('com-dialog-select');
  4. // ComponentHelper::loadComponentView('com-select-cat');
  5. // ComponentHelper::loadComponentView('components/user-select', __DIR__);
  6. ?>
  7. <div id="app" v-cloak>
  8. <el-card class="box-card" v-loading="loading" shadow="never" style="border:0;min-width: 1500px;" body-style="background-color: #f3f3f3;padding: 10px 0 0;">
  9. <!-- <el-tabs v-model="tabName" @tab-click="handleChangeTab">
  10. <el-tab-pane label="基本设置" name="basic"> -->
  11. <div slot="header">
  12. <div>
  13. <span>基础设置</span>
  14. </div>
  15. </div>
  16. <div class="form_box">
  17. <el-form :model="ruleForm" size="small" ref="ruleForm" label-width="180px">
  18. <el-card shadow="never">
  19. <div>
  20. <el-row>
  21. <el-col :span="16">
  22. <el-form-item label="统计方式" style="margin-bottom: 0">
  23. <div>
  24. <el-radio-group v-model="ruleForm.settle_type">
  25. <el-radio :label="1">支付完成</el-radio>
  26. <el-radio :label="2">订单完成</el-radio>
  27. </el-radio-group>
  28. </div>
  29. <div class="tips-text" style="line-height: 24px;">
  30. 统计方式只针对前端【推广中心-我的客户】里面的订单数量和消费金额,默认支付完成
  31. </div>
  32. </el-form-item>
  33. <el-form-item label="是否扣除已退款售后数量:" style="margin-bottom: 0">
  34. <div>
  35. <el-radio-group v-model="ruleForm.is_sub_refund">
  36. <el-radio :label="0">否</el-radio>
  37. <el-radio :label="1">是</el-radio>
  38. </el-radio-group>
  39. </div>
  40. <!-- <div class="tips-text" style="line-height: 24px;">
  41. 统计方式只针对前端【推广中心-我的客户】里面的订单数量和消费金额,默认支付完成
  42. </div> -->
  43. </el-form-item>
  44. </el-col>
  45. </el-row>
  46. </div>
  47. </el-card>
  48. </el-form>
  49. <el-button :loading="btnLoading" class="button-item" type="primary" style="margin-top: 24px;"
  50. @click="submit(ruleForm)" size="small">保存
  51. </el-button>
  52. </div>
  53. <!-- </el-tab-pane>
  54. </el-tabs> -->
  55. </el-card>
  56. </div>
  57. <script>
  58. const app = new Vue({
  59. el: '#app',
  60. data() {
  61. return {
  62. loading: false,
  63. btnLoading: false,
  64. tabName: 'basic',
  65. ruleForm: {
  66. settle_type: 1,
  67. is_sub_refund:0,
  68. },
  69. levels:[],
  70. listLoading:false,
  71. show:false,
  72. }
  73. },
  74. mounted: function () {
  75. this.loadData();
  76. },
  77. methods: {
  78. loadData() {
  79. this.loading = true;
  80. request({
  81. params: {
  82. r: 'team-data/default/setting',
  83. },
  84. method: 'get'
  85. }).then(e => {
  86. this.loading = false;
  87. if (e.data.code == 0) {
  88. this.ruleForm = { ...this.ruleForm, ...e.data.data.basic }
  89. this.levels = e.data.data.levels;
  90. console.log(this.levels);
  91. }
  92. }).catch(e => {
  93. this.loading = false;
  94. })
  95. },
  96. submit(formName) {
  97. let self = this;
  98. this.$refs['ruleForm'].validate((valid) => {
  99. if (valid) {
  100. this.btnLoading = true;
  101. request({
  102. params: {
  103. r: 'team-data/default/setting',
  104. },
  105. method: 'post',
  106. data: this.ruleForm
  107. }).then(e => {
  108. this.btnLoading = false;
  109. if (e.data.code == 0) {
  110. this.$message.success(e.data.msg);
  111. } else {
  112. this.$message.error(e.data.msg);
  113. }
  114. }).catch(e => {
  115. this.$message.error(e);
  116. this.btnLoading = false;
  117. })
  118. } else {
  119. this.btnLoading = false;
  120. console.log('error submit!!');
  121. return false;
  122. }
  123. });
  124. },
  125. }
  126. });
  127. </script>
  128. <style>
  129. .form_box {
  130. background-color: #f3f3f3;
  131. padding: 0 0 20px;
  132. }
  133. .button-item {
  134. margin-top: 12px;
  135. padding: 9px 25px;
  136. }
  137. .el-input-group__append {
  138. background-color: #fff;
  139. color: #353535;
  140. }
  141. .equal-computing {
  142. display: flex;
  143. flex-direction: column;
  144. }
  145. .equal-computing .el-radio-group{
  146. margin-top: 10px;
  147. display: flex;
  148. border: 1px solid #ebebeb;
  149. border-radius: 3px;
  150. padding: 10px;
  151. position: relative;
  152. }
  153. .equal-computing .el-radio-group::before {
  154. content: "";
  155. position: absolute;
  156. top: -5px;
  157. left: 10px;
  158. border-right: 1px solid #ebebeb;
  159. border-top: 1px solid #ebebeb;
  160. height: 8px;
  161. width: 8px;
  162. -webkit-transform: rotate(315deg);
  163. transform: rotate(315deg);
  164. border-left: 1px solid transparent;
  165. border-bottom: 1px solid transparent;
  166. background-color: #FFF;
  167. }
  168. .equal-computing .el-switch {
  169. height: 32px;
  170. place-self: flex-start;
  171. }
  172. .input-number-box{
  173. /* margin-left: 10px; */
  174. display: inline-block;
  175. }
  176. .input-number-box .el-input-number{
  177. margin: 0 8px;
  178. }
  179. .input-number-box,.input-number-box span{
  180. vertical-align: middle;
  181. }
  182. </style>