Blame view

src/views/scm/integralRuleList.vue 2.5 KB
f52d2b06   wuxw   积分功能开发中
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
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
109
110
111
  <template>
    <div class="integral-rule-container">
      <el-row :gutter="20">
        <el-col :span="4" class="left-panel">
          <integral-rule-div ref="integralRuleDiv" @switch="handleSwitchRule" />
        </el-col>
        <el-col :span="20" class="right-panel">
          <el-card class="box-card">
            <div slot="header" class="text-left">
              <h5>{{ integralRuleInfo.curIntegralRule.ruleName }}</h5>
              <div class="role-context">{{ integralRuleInfo.curIntegralRule.remark }}</div>
            </div>
            <el-tabs v-model="integralRuleInfo.tabName" @tab-click="handleTabClick(integralRuleInfo.tabName)">
              <el-tab-pane label="积分标准" name="integralRuleConfig">
                <integral-rule-config  ref="integralRuleConfig" v-if="integralRuleInfo.tabName === 'integralRuleConfig'"
                  />
              </el-tab-pane>
              <el-tab-pane label="缴费时间" name="integralRuleFee">
                <integral-rule-fees ref="integralRuleFee" v-if="integralRuleInfo.tabName === 'integralRuleFee'"
                  />
              </el-tab-pane>
            </el-tabs>
          </el-card>
        </el-col>
      </el-row>
  
  
    </div>
  </template>
  
  <script>
  import IntegralRuleDiv from '@/components/scm/integralRuleDiv'
  import IntegralRuleConfig from '@/components/scm/integralRuleConfig'
  import IntegralRuleFees from '@/components/scm/integralRuleFees'
  
  
  export default {
    name: 'IntegralRuleList',
    components: {
      IntegralRuleDiv,
      IntegralRuleConfig,
      IntegralRuleFees,
  
    },
    data() {
      return {
        integralRuleInfo: {
          curIntegralRule: {},
          tabName: 'integralRuleConfig'
        }
      }
    },
    methods: {
      handleSwitchRule(rule) {
        this.integralRuleInfo.curIntegralRule = rule
        this.handleTabClick(this.integralRuleInfo.tabName)
      },
      handleTabClick(tab) {
        this.integralRuleInfo.tabName = tab
        setTimeout(() => {
          this.$refs[tab].open(this.integralRuleInfo.curIntegralRule)
        }, 500);
      },
  
    
    }
  }
  </script>
  
  <style lang="scss" scoped>
  .integral-rule-container {
    padding: 20px;
    height: 100%;
  
    .left-panel {
      padding-right: 0;
    }
  
    .right-panel {
      padding-left: 20px;
    }
  
    .box-card {
      height: 100%;
  
      .clearfix {
  
        &:before,
        &:after {
          display: table;
          content: "";
        }
  
        &:after {
          clear: both;
        }
      }
  
      .role-title {
        margin: 0;
        font-size: 16px;
        font-weight: bold;
      }
  
      .role-context {
        margin-top: 10px;
        color: #666;
      }
    }
  }
  </style>