setting.blade.php 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  1. @extends('layouts.base')
  2. @section('title', '自购省设置')
  3. @section('content')
  4. <section class="content" id="setting_data">
  5. <div class="right-titpos">
  6. <ul class="add-snav">
  7. <li class="active"><a href="#">自购省>基础设置</a></li>
  8. </ul>
  9. </div>
  10. <el-form ref="form" action="" method="post" id="setting_form" :model="setting_form" >
  11. <el-row :gutter="0" style="min-height: 30px">
  12. <el-col :span="20"><div><p> </p></div></el-col>
  13. </el-row>
  14. <el-row :gutter="10">
  15. <el-col :span="1"><div><p> </p></div></el-col>
  16. <el-col :span="3" >
  17. <label>开启自购省</label>
  18. </el-col>
  19. <el-col :span="10" >
  20. <template>
  21. <el-switch v-model="setting_form.open_state" active-value="1" inactive-value="0"></el-switch>
  22. <p></p>
  23. <p>自购省优先于满额减、优惠券、抵扣等计算</p><br>
  24. <p>自购省只支持自营商品、门店商品、收银台、聚合供应链商品、供应商商品</p>
  25. </template>
  26. </el-col>
  27. </el-row>
  28. <el-row :gutter="0" style="min-height: 30px">
  29. <el-col :span="20"><div><p> </p></div></el-col>
  30. </el-row>
  31. <el-row :gutter="10">
  32. <el-col :span="1"><div><p> </p></div></el-col>
  33. <el-col :span="3" >
  34. <label>自购省计算基数</label>
  35. </el-col>
  36. <el-col :span="10" >
  37. <template>
  38. <el-radio-group v-model="setting_form.cal_type" >
  39. <el-radio-button text-color="#66ffff" label="1">商品价格</el-radio-button>
  40. <el-radio-button text-color="#66ffff" label="2">商品利润</el-radio-button>
  41. </el-radio-group>
  42. <p></p>
  43. <p>平台自营、供应商、聚合供应链商品利润=商品现价-商品成本价;门店商品利润=平台提成金额</p>
  44. </template>
  45. </el-col>
  46. </el-row>
  47. <el-row :gutter="0" style="min-height: 30px">
  48. <el-col :span="20"><div><p> </p></div></el-col>
  49. </el-row>
  50. <el-row :gutter="10">
  51. <el-col :span="1"><div><p> </p></div></el-col>
  52. <el-col :span="3" >
  53. <label>自购省比例</label>
  54. </el-col>
  55. <el-col :span="8" >
  56. <template v-for="v in setting_form.rule">
  57. <el-input placeholder="请输入比例" v-model="v.discount_percent" type="number" >
  58. <template slot="prepend">@{{v.level_name}}</template>
  59. <template slot="append">%</template>
  60. </el-input>
  61. <p></p>
  62. </template>
  63. <p>按会员等级设置,比例计算优先级商品独立设置>自购省插件统一设置</p>
  64. </el-col>
  65. </el-row>
  66. <el-row :gutter="0" style="min-height: 30px">
  67. <el-col :span="20"><div><p> </p></div></el-col>
  68. </el-row>
  69. <el-row :gutter="10">
  70. <el-col :span="1"><div><p> </p></div></el-col>
  71. <el-col :span="3" >
  72. <label>商品自购省开关默认设置</label>
  73. </el-col>
  74. <el-col :span="10" >
  75. <template>
  76. <el-switch v-model="setting_form.goods_state" active-value="1" inactive-value="0"></el-switch>
  77. </template>
  78. </el-col>
  79. </el-row>
  80. <el-row :gutter="0" style="min-height: 30px">
  81. <el-col :span="20"><div><p> </p></div></el-col>
  82. </el-row>
  83. <el-row :gutter="10">
  84. <el-col :span="1"><div><p> </p></div></el-col>
  85. <el-col :span="3" >
  86. <label>自购省商品详情页显示</label>
  87. </el-col>
  88. <el-col :span="15" >
  89. <template>
  90. <el-switch v-model="setting_form.detail_show_state" active-value="1" inactive-value="0"></el-switch>
  91. </template>
  92. </el-col>
  93. <el-col :span="10" >
  94. <p></p>
  95. <el-checkbox-group v-model="setting_form.detail_choose_tab" >
  96. <el-checkbox-button v-for="tab in setting_form.detail_show_tab" :label="tab.key" :key="tab.key">@{{tab.name}}</el-checkbox-button>
  97. </el-checkbox-group>
  98. </el-col>
  99. </el-row>
  100. <el-row :gutter="0" style="min-height: 30px">
  101. <el-col :span="20"><div><p> </p></div></el-col>
  102. </el-row>
  103. <el-row :gutter="10">
  104. <el-col :span="1"><div><p> </p></div></el-col>
  105. <el-col :span="3" >
  106. <label></label>
  107. </el-col>
  108. <el-col :span="15" >
  109. <div class="confirm-btn">
  110. <el-button type="success" @click="onSubmit">提交</el-button>
  111. </div>
  112. </el-col>
  113. </el-row>
  114. </el-form>
  115. </section>
  116. <script textarea="javascript">
  117. var setting_data = new Vue({
  118. el: '#setting_data',
  119. data() {
  120. var setting = '{!! $setting !!}';
  121. setting = JSON.parse(setting);
  122. return {
  123. setting : setting,
  124. setting_form:{
  125. 'open_state' : setting.open_state.toString(),
  126. 'cal_type' : setting.cal_type.toString(),
  127. 'goods_state' : setting.goods_state.toString(),
  128. 'detail_show_state' : setting.detail_show_state.toString(),
  129. 'detail_show_tab' : setting.detail_show_tab,
  130. 'detail_choose_tab' : setting.detail_choose_tab,
  131. 'rule' : setting.rule
  132. }
  133. };
  134. },
  135. methods:{
  136. onSubmit:function(){
  137. let loading = this.$loading({target:document.querySelector(".content"),background: 'rgba(0, 0, 0, 0)'});
  138. let post_data = this.setting_form;
  139. this.$http.post('{!! yzWebFullUrl('plugin.selfbuy-discount.admin.setting.edit') !!}',post_data).then(function (response){
  140. if (response.data.result) {
  141. this.$message({message: response.data.msg,type: 'success'});
  142. loading.close();
  143. location.reload();
  144. }else {
  145. this.$message({message: response.data.msg,type: 'error'});
  146. loading.close();
  147. }
  148. },function (response) {
  149. this.$message({message: response.data.msg,type: 'error'});
  150. loading.close();
  151. })
  152. },
  153. }
  154. })
  155. </script>
  156. @endsection