com-score-bonus.php 3.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. <template id="com-score-bonus">
  2. <div class="com-score-bonus">
  3. <el-card class="edit-card" shadow="never">
  4. <el-form :model="form" size="small">
  5. <el-tabs v-model="activeName">
  6. <div v-for="(config,key) in form">
  7. <el-form-item label="是否独立设置" prop="is_alone">
  8. <el-switch :active-value="1" :inactive-value="0" v-model="config.is_alone"></el-switch>
  9. <div class="tips-text">开启后,该商品按独立设置的奖励分出,不受其它位置的配置影响</div>
  10. </el-form-item>
  11. <el-form-item v-if="config.is_alone==1" style="width: 500px;" label="" prop="calculate_type">
  12. <label slot="label">投放比例
  13. <el-tooltip class="item" effect="dark" content="平台营业额投放比例" placement="top">
  14. <i class="el-icon-info"></i>
  15. </el-tooltip>
  16. </label>
  17. <span style="color: #333;">
  18. 平台营业额
  19. <el-input type="number" size="small" style="width:150px; margin-left:5px; margin-right:5px;" v-model="config.detail.value">
  20. <template slot="append">%</template>
  21. </el-input>
  22. 投放到分红
  23. </span>
  24. <br />
  25. <div class="tips-text" style="line-height: 24px;">
  26. 分红池金额:营业额*N%=分红池金额
  27. </div>
  28. </el-form-item>
  29. </div>
  30. </el-tabs>
  31. </el-form>
  32. </el-card>
  33. </div>
  34. </template>
  35. <script>
  36. Vue.component('com-score-bonus', {
  37. template: "#com-score-bonus",
  38. props: {
  39. setting: {
  40. type: Object,
  41. default: () => {
  42. return {};
  43. }
  44. },
  45. commission_type_map: {
  46. type: Object,
  47. default: () => {
  48. return {};
  49. }
  50. }
  51. },
  52. data() {
  53. return {
  54. activeName: 'commission',
  55. form: {
  56. commission: {
  57. is_enable: 0,
  58. is_alone: 0,
  59. item_type: 'goods',
  60. commission_type: 'commission',
  61. detail: {
  62. calculate_type: 1,
  63. value: 0
  64. }
  65. }
  66. },
  67. }
  68. },
  69. watch: {
  70. setting: {
  71. deep: true,
  72. immediate: true,
  73. handler(value) {
  74. if (!isEmpty(value)) {
  75. this.form = value;
  76. }
  77. }
  78. },
  79. form: {
  80. deep: true,
  81. immediate: true,
  82. handler(value) {
  83. this.$emit("change", JSON.stringify(value), "ScoreBonus");
  84. }
  85. },
  86. },
  87. });
  88. </script>