Blame view

src/components/fee/viewFeeDetailDiscount.vue 2.35 KB
24d3590f   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
  <template>
    <el-dialog
      :title="$t('viewFeeDetailDiscount.discount')"
      :visible.sync="visible"
      width="70%"
      center
    >
      <el-table
        :data="viewFeeDetailDiscountInfo.feeDetailDiscounts"
        border
        stripe
        style="width: 100%"
      >
        <el-table-column 
          prop="discountName" 
          :label="$t('viewFeeDetailDiscount.discountName')" 
          align="center"
        />
        <el-table-column 
          :label="$t('viewFeeDetailDiscount.discountType')" 
          align="center"
        >
          <template slot-scope="scope">
            {{ scope.row.discountType === '1001' ? $t('viewFeeDetailDiscount.discount') : $t('viewFeeDetailDiscount.breach') }}
          </template>
        </el-table-column>
        <el-table-column 
          prop="ruleName" 
          :label="$t('viewFeeDetailDiscount.ruleName')" 
          align="center"
        />
        <el-table-column 
          :label="$t('viewFeeDetailDiscount.discountRule')" 
          align="center"
        >
          <template slot-scope="scope">
            <div v-for="(item,index) in scope.row.feeDiscountSpecs" :key="index">
              {{item.specName}}:{{item.specValue}}
            </div>
          </template>
        </el-table-column>
        <el-table-column 
          prop="discountPrice" 
          :label="$t('viewFeeDetailDiscount.discountAmount')" 
          align="center"
        />
      </el-table>
    </el-dialog>
  </template>
  
  <script>
  import { getCommunityId } from '@/api/community/communityApi'
  import { queryFeeDetailDiscount } from '@/api/fee/propertyFeeApi'
  
  export default {
    name: 'ViewFeeDetailDiscount',
    data() {
      return {
        visible: false,
        viewFeeDetailDiscountInfo: {
          feeDetailDiscounts: []
        },
        communityId: ''
      }
    },
    created() {
      this.communityId = getCommunityId()
    },
    methods: {
      open(params) {
        this.visible = true
        this._loadAllFeeDetailDiscountInfo(params)
      },
      async _loadAllFeeDetailDiscountInfo(params) {
        try {
          const res = await queryFeeDetailDiscount({
            page: 1,
            row: 30,
            communityId: this.communityId,
            detailId: params.detailId
          })
          
          this.viewFeeDetailDiscountInfo.feeDetailDiscounts = res.data || []
        } catch (error) {
          console.error('加载折扣信息失败:', error)
        }
      }
    }
  }
  </script>
  
  <style scoped>
  .el-table {
    margin-top: 15px;
  }
  </style>