Blame view

src/views/scm/couponRuleList.vue 2.46 KB
b25b036d   wuxw   v1.9 优化日期
1
  <template>
71def04c   wuxw   优化优惠
2
3
4
5
6
7
8
    <div class="coupon-rule-container">
      <el-row class="coupon-rule-wrapper">
        <el-col :span="4" class="left-panel">
          <coupon-rule-div ref="couponRuleDiv" @switch="handleSwitchCouponRule" />
        </el-col>
        <el-col :span="20" class="right-panel">
          <el-card class="box-card">
f52d2b06   wuxw   积分功能开发中
9
            <div slot="header" class="text-left">
71def04c   wuxw   优化优惠
10
11
12
              <h5>{{ currentCouponRule.ruleName }}</h5>
              <div class="role-context">{{ currentCouponRule.remark }}</div>
            </div>
f52d2b06   wuxw   积分功能开发中
13
            <el-tabs v-model="activeTab" @tab-click="handleTabClick(activeTab)">
71def04c   wuxw   优化优惠
14
              <el-tab-pane :label="$t('couponRule.coupon')" name="couponRuleCpps">
f52d2b06   wuxw   积分功能开发中
15
                <coupon-rule-cpps ref="couponRuleCpps" v-if="activeTab === 'couponRuleCpps'"  />
71def04c   wuxw   优化优惠
16
17
              </el-tab-pane>
              <el-tab-pane :label="$t('couponRule.fee')" name="couponRuleFee">
f52d2b06   wuxw   积分功能开发中
18
                <coupon-rule-fees ref="couponRuleFee" v-if="activeTab === 'couponRuleFee'"  />
71def04c   wuxw   优化优惠
19
20
21
22
23
24
              </el-tab-pane>
            </el-tabs>
          </el-card>
        </el-col>
      </el-row>
  
f52d2b06   wuxw   积分功能开发中
25
    
71def04c   wuxw   优化优惠
26
27
28
29
30
31
32
    </div>
  </template>
  
  <script>
  import CouponRuleDiv from '@/components/scm/CouponRuleDiv'
  import CouponRuleCpps from '@/components/scm/CouponRuleCpps'
  import CouponRuleFees from '@/components/scm/CouponRuleFees'
f52d2b06   wuxw   积分功能开发中
33
  
71def04c   wuxw   优化优惠
34
35
36
37
38
39
40
  
  export default {
    name: 'CouponRuleList',
    components: {
      CouponRuleDiv,
      CouponRuleCpps,
      CouponRuleFees,
f52d2b06   wuxw   积分功能开发中
41
  
71def04c   wuxw   优化优惠
42
43
44
45
46
47
48
49
50
51
52
53
54
55
    },
    data() {
      return {
        activeTab: 'couponRuleCpps',
        currentCouponRule: {
          ruleId: '',
          ruleName: '',
          remark: ''
        }
      }
    },
    methods: {
      handleSwitchCouponRule(rule) {
        this.currentCouponRule = rule
f52d2b06   wuxw   积分功能开发中
56
        this.handleTabClick(this.activeTab)
71def04c   wuxw   优化优惠
57
      },
f52d2b06   wuxw   积分功能开发中
58
  
71def04c   wuxw   优化优惠
59
      handleTabClick(tab) {
f52d2b06   wuxw   积分功能开发中
60
61
62
63
64
        this.activeTab = tab
        let _that = this;
        setTimeout(function(){
          _that.$refs[tab].open(_that.currentCouponRule.ruleId)
        },500)
71def04c   wuxw   优化优惠
65
      },
f52d2b06   wuxw   积分功能开发中
66
67
     
   
71def04c   wuxw   优化优惠
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
    }
  }
  </script>
  
  <style lang="scss" scoped>
  .coupon-rule-container {
    padding: 20px;
    height: 100%;
    
    .coupon-rule-wrapper {
      height: 100%;
      
      .left-panel {
        padding-right: 10px;
        height: 100%;
      }
      
      .right-panel {
        height: 100%;
        
        .box-card {
          height: 100%;
          
          .clearfix {
            h5 {
              margin: 0;
              font-size: 16px;
              font-weight: bold;
            }
            
            .role-context {
              margin-top: 5px;
              color: #999;
              font-size: 12px;
            }
          }
        }
      }
    }
  }
  </style>