fuliqi
2024-01-24 29c1e7eb5ac16e90d8991a86c1c071bc312ec8d9
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
<template>
  <div>
    <el-dialog :visible.sync="dialogShow" :loading="loading"  title="对账单详情" :close-on-click-modal="false" :modal-append-to-body="false">
      <el-table size="mini" :data="tableData" border>
        <el-table-column  label="业务流水号" prop="business">
        </el-table-column>
        <el-table-column  label="订单号" prop="orderId">
        </el-table-column>
        <el-table-column  label="数据来源" prop="orderSource">
        </el-table-column>
        <el-table-column  label="账单时间" width="160px" prop="acountDate">
        </el-table-column>
        <el-table-column  label="账户类型" prop="acountType">
        </el-table-column>
        <!-- <el-table-column  label="账户余额" prop="balance">
          <template slot-scope="scope">
            ¥ {{scope.row.balance}}
          </template>
        </el-table-column> -->
        <el-table-column  label="账单收入" prop="income">
          <template slot-scope="scope">
            ¥ {{scope.row.income}}
          </template>
        </el-table-column>
        <el-table-column  label="账单支出" prop="outgoings">
          <template slot-scope="scope">
            ¥ {{scope.row.outgoings}}
          </template>
        </el-table-column>
        <!-- <el-table-column  label="交易号" prop="dealSn">
        </el-table-column> -->
      </el-table>
      <div class="accountStatementText">对账单金额:¥ {{totalStatementAccount}}</div>
      <div slot="footer" class="buttonPosition dialog-footer">
        <el-button  size="mini" @click="closeDialog()">关闭</el-button>
      </div>
    </el-dialog>
  </div>
</template>
 
<script>
import BillingResources from '@/api/invoice/invoiceapi.js'
import orderSourceArr from '@/utils/constant/orderSourceArr'
export default {
  props: ['show'],
  watch: {
    /**
         * 监控外部显示变量变化
         * 传递到dialog组件
         */
    show: function (newShow, oldShow) {
      this.dialogShow = newShow
    },
    /**
     * 监控内部显示属性变化
     * 传递到外部调用变量
     */
    dialogShow: function (newDialogShow, oldDialogShow) {
      this.$emit('update:show', newDialogShow)
    }
  },
  data () {
    return {
      dialogShow: false,
      tableData: [],
      loading: false,
      orderSourceArr,
      totalStatementAccount: 0
    }
  },
  methods: {
    closeDialog () {
      this.dialogShow = false
      this.$emit('update:show', false)
    },
    // 查询对账单信息
    async accountStatementInfo (orderId) {
      try {
        this.loading = true
        const res = await BillingResources.queryStatementAccount(orderId)
        if (res.code === '0') {
          this.tableData = res.data
          this.totalStatementAccount = 0
          res.data.forEach(item => {
            this.totalStatementAccount += item.income
          })
          this.loading = false
        } else {
          this.loading = false
        }
      } catch (error) {
        this.loading = false
      }
    }
  }
}
</script>
 
<style>
.accountStatementText{
  text-align: right;
  margin-top: 20px;
}
</style>