setting.php 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  1. <?php
  2. use common\helpers\ComponentHelper;
  3. $diyPath = dirname(__DIR__) . '/components';
  4. ComponentHelper::loadComponentView('link-select', $diyPath);
  5. ?>
  6. <div id="app" v-cloak>
  7. <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;">
  8. <div class="form_body">
  9. <el-form :model="ruleForm" size="small" ref="ruleForm" label-width="150px">
  10. <el-card shadow="never">
  11. <div slot="header">
  12. <div>
  13. <span>基础设置</span>
  14. </div>
  15. </div>
  16. <div>
  17. <el-row>
  18. <el-col :span="16">
  19. <!-- <el-form-item label="云仓配货" style="margin-bottom: 20px;">
  20. <div>
  21. <el-switch v-model="ruleForm.is_enable" :active-value="1" :inactive-value="0"></el-switch>
  22. </div>
  23. </el-form-item> -->
  24. <el-form-item prop="management_fee" label="平台管理费">
  25. <el-col :span="20">
  26. <el-input type="number" v-model="ruleForm.management_fee" :min="0" class="member-money" placeholder="" style="width: 200px;margin-right: 20px;">
  27. <template slot="append">%</template>
  28. </el-input>
  29. <div>大区总裁向销售公司拿货,销售公司的货源由平台管理,销售公司需给相应的管理费,如:销售公司售价一个商品100元,大区总裁200元,大区总裁销售一件200元的货,销售公司得200-100的差价,同时平台扣除10%管理费,100-10=90,最终销售公司得90元。</div>
  30. </el-col>
  31. </el-form-item>
  32. </el-col>
  33. </el-row>
  34. </div>
  35. </el-card>
  36. </el-form>
  37. <el-button :loading="btnLoading" class="button-item" type="primary" style="margin-top: 24px;"
  38. @click="store('ruleForm')" size="small">保存
  39. </el-button>
  40. </div>
  41. </el-card>
  42. </div>
  43. <script>
  44. const app = new Vue({
  45. el: '#app',
  46. data() {
  47. return {
  48. loading: false,
  49. btnLoading: false,
  50. ruleForm: {
  51. // is_enable: 0,
  52. management_fee:0,
  53. },
  54. }
  55. },
  56. mounted: function () {
  57. this.loadData();
  58. },
  59. methods: {
  60. loadData() {
  61. this.loading = true;
  62. request({
  63. params: {
  64. r: 'sales-company/default/setting',
  65. },
  66. method: 'get'
  67. }).then(e => {
  68. this.loading = false;
  69. if (e.data.code == 0 && !isEmpty(e.data.data)) {
  70. this.ruleForm = e.data.data;
  71. this.link_name = e.data.data.link_name;
  72. }
  73. }).catch(e => {
  74. this.loading = false;
  75. })
  76. },
  77. store(formName) {
  78. this.$refs[formName].validate((valid) => {
  79. if (valid) {
  80. this.btnLoading = true;
  81. request({
  82. params: {
  83. r: 'sales-company/default/setting',
  84. },
  85. method: 'post',
  86. data: this.ruleForm
  87. }).then(e => {
  88. this.btnLoading = false;
  89. if (e.data.code == 0) {
  90. this.$message.success(e.data.msg);
  91. } else {
  92. this.$message.error(e.data.msg);
  93. }
  94. }).catch(e => {
  95. this.$message.error(e);
  96. this.btnLoading = false;
  97. })
  98. } else {
  99. this.btnLoading = false;
  100. console.log('error submit!!');
  101. return false;
  102. }
  103. });
  104. },
  105. }
  106. });
  107. </script>
  108. <style>
  109. .form-body {
  110. padding: 20px;
  111. background-color: #fff;
  112. margin-bottom: 20px;
  113. padding-right: 20%;
  114. min-width: 900px;
  115. }
  116. .form-body .el-form-item {
  117. padding-right: 25%;
  118. min-width: 850px;
  119. }
  120. .form-button {
  121. margin: 0;
  122. }
  123. .form-button .el-form-item__content {
  124. margin-left: 0 !important;
  125. }
  126. .button-item {
  127. padding: 9px 25px;
  128. }
  129. .check-group {
  130. font-size: 14px !important;
  131. }
  132. .check-group .el-col {
  133. display: flex;
  134. }
  135. .check-group .el-input {
  136. margin: 0 5px;
  137. }
  138. .check-group .el-col .el-checkbox {
  139. display: flex;
  140. align-items: center;
  141. }
  142. .check-group .el-col .el-input {
  143. width: 100px;
  144. }
  145. .check-group .el-col .el-input .el-input__inner {
  146. height: 30px;
  147. width: 100px;
  148. }
  149. .el-checkbox-group .el-col {
  150. margin-bottom: 10px;
  151. }
  152. .condition_common {
  153. display: flex;
  154. align-items: center;
  155. }
  156. .condition_common_five {
  157. display: flex;
  158. }
  159. </style>