Blame view

src/views/scm/communityIntegralList.vue 5 KB
b25b036d   wuxw   v1.9 优化日期
1
  <template>
27dcfde5   wuxw   系统全面测试完成
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
    <div class="community-integral-container ">
      <el-card >
        <div class="white-bg padding-lg padding-top border-radius">
          <div class="flex justify-between">
            <h3>{{ $t('communityIntegral.title') }}</h3>
          </div>
  
          <!-- 业主信息 -->
          <div class="margin-top">
            <el-row>
              <el-col :span="8">
                <div class="form-group">
                  <label class="col-form-label">
                    {{ $t('communityIntegral.accountId') }}
                  </label>
                  <label>{{ communityIntegralInfo.integralId }}</label>
                </div>
              </el-col>
              <el-col :span="8">
                <div class="form-group">
                  <label class="col-form-label">
                    {{ $t('communityIntegral.accountName') }}
                  </label>
                  <label>{{ communityIntegralInfo.integralName }}</label>
                </div>
              </el-col>
              <el-col :span="8">
                <div class="form-group">
                  <label class="col-form-label">
                    {{ $t('communityIntegral.points') }}
                  </label>
                  <label>
                    {{ communityIntegralInfo.amount }}
                    <el-link type="primary" @click="openApplyWithholdIntegral">{{ $t('communityIntegral.withdraw')
6ed9faf1   wuxw   开发完成优惠下的积分功能
36
                    }}</el-link>
27dcfde5   wuxw   系统全面测试完成
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
                  </label>
                </div>
              </el-col>
            </el-row>
          </div>
  
          <divider></divider>
  
          <div class="margin-top-sm">
            <el-tabs v-model="communityIntegralInfo._currentTab"
              @tab-click="changeTab(communityIntegralInfo._currentTab)">
              <el-tab-pane :label="$t('communityIntegral.transactionDetails')" name="communityIntegralDetail">
                <community-integral-detail v-if="communityIntegralInfo._currentTab === 'communityIntegralDetail'"
                  ref="communityIntegralDetail" />
              </el-tab-pane>
              <el-tab-pane :label="$t('communityIntegral.pointsWithdrawal')" name="applyWithholdIntegral">
                <apply-withhold-integral v-if="communityIntegralInfo._currentTab === 'applyWithholdIntegral'"
                  ref="applyWithholdIntegral" />
              </el-tab-pane>
            </el-tabs>
          </div>
6ed9faf1   wuxw   开发完成优惠下的积分功能
58
59
        </div>
  
27dcfde5   wuxw   系统全面测试完成
60
61
62
        <withhold-integral ref="withholdIntegral" @success="handleWithdrawSuccess" />
      </el-card>
    </div>
6ed9faf1   wuxw   开发完成优惠下的积分功能
63
64
65
66
67
68
69
70
  </template>
  
  <script>
  import { getCommunityId } from '@/api/community/communityApi'
  import { queryCommunityIntegral } from '@/api/scm/communityIntegralApi'
  import CommunityIntegralDetail from '@/components/scm/communityIntegralDetail'
  import ApplyWithholdIntegral from '@/components/scm/applyWithholdIntegral'
  import WithholdIntegral from '@/components/scm/withholdIntegral'
27dcfde5   wuxw   系统全面测试完成
71
  import divider from '@/components/system/divider'
6ed9faf1   wuxw   开发完成优惠下的积分功能
72
73
74
75
76
77
  
  export default {
    name: 'CommunityIntegralList',
    components: {
      CommunityIntegralDetail,
      ApplyWithholdIntegral,
27dcfde5   wuxw   系统全面测试完成
78
79
      WithholdIntegral,
      divider
6ed9faf1   wuxw   开发完成优惠下的积分功能
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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
    },
    data() {
      return {
        communityIntegralInfo: {
          integralId: "",
          integralName: '',
          amount: "",
          communityName: "",
          communityId: "",
          _currentTab: 'communityIntegralDetail'
        }
      }
    },
    created() {
      this.communityIntegralInfo.communityId = getCommunityId()
      this.loadCommunityIntegralInfo()
    },
    methods: {
      async loadCommunityIntegralInfo() {
        try {
          const params = {
            page: 1,
            row: 1,
            communityId: this.communityIntegralInfo.communityId
          }
          const { data } = await queryCommunityIntegral(params)
          if (data && data.length > 0) {
            this.communityIntegralInfo = {
              ...this.communityIntegralInfo,
              ...data[0]
            }
            this.changeTab(this.communityIntegralInfo._currentTab)
          }
        } catch (error) {
          console.error('Failed to load community integral info:', error)
        }
      },
      changeTab(tab) {
        this.communityIntegralInfo._currentTab = tab
        setTimeout(() => {
          this.$refs[tab].open(this.communityIntegralInfo.curIntegralRule)
        }, 500);
      },
      openApplyWithholdIntegral() {
        this.$refs.withholdIntegral.open({
          integralId: this.communityIntegralInfo.integralId,
          amount: this.communityIntegralInfo.amount,
          communityId: this.communityIntegralInfo.communityId
        })
      },
      handleWithdrawSuccess() {
        this.communityIntegralInfo._currentTab = 'applyWithholdIntegral'
        this.changeTab(this.communityIntegralInfo._currentTab)
        this.loadCommunityIntegralInfo()
      }
    }
  }
  </script>
  
  <style scoped>
27dcfde5   wuxw   系统全面测试完成
140
  .community-integral-container {padding: 20px;}
6ed9faf1   wuxw   开发完成优惠下的积分功能
141
142
143
144
145
146
  
  .white-bg {
    background-color: #fff;
  }
  
  .padding-lg {
27dcfde5   wuxw   系统全面测试完成
147
    
6ed9faf1   wuxw   开发完成优惠下的积分功能
148
149
150
  }
  
  .padding-top {
27dcfde5   wuxw   系统全面测试完成
151
    
6ed9faf1   wuxw   开发完成优惠下的积分功能
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
  }
  
  .border-radius {
    border-radius: 4px;
  }
  
  .margin-top {
    margin-top: 20px;
  }
  
  .margin-top-sm {
    margin-top: 10px;
  }
  
  .flex {
    display: flex;
  }
  
  .justify-between {
    justify-content: space-between;
  }
  
  .form-group {
    margin-bottom: 20px;
  }
  
  .col-form-label {
    font-weight: bold;
    margin-right: 10px;
  }
  </style>