client.vue 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. <template>
  2. <div class="hui-flex hui-content">
  3. <div class="hui-flex">
  4. <div class="hui-content-title">
  5. <div class="hui-title-item active">个人付款账单</div>
  6. </div>
  7. <div class="hui-flex-box hui-flex hui-table">
  8. <list-filter ref="billContract" type="billContract" @filter="filterInit"></list-filter>
  9. <div class="hui-flex-box">
  10. <el-table :data="tableData" row-key="id" border height="100%">
  11. <el-table-column label="序号" width="50">
  12. <template slot-scope="scope">
  13. <div style="text-align: center;">{{scope.$index + 1}}</div>
  14. </template>
  15. </el-table-column>
  16. <el-table-column label="合同编码" prop="contractCode"></el-table-column>
  17. <el-table-column label="账单期数" prop="code" width="100">
  18. <template slot-scope="scope">
  19. <span>{{'第' + scope.row.phase + '期'}}</span>
  20. </template>
  21. </el-table-column>
  22. <el-table-column label="账单日期" prop="code" width="200">
  23. <template slot-scope="scope">
  24. <span>{{scope.row.startDate}}至{{scope.row.endDate}}</span>
  25. </template>
  26. </el-table-column>
  27. <el-table-column label="金额">
  28. <template slot-scope="scope">
  29. <span>{{scope.row.amount + '元'}}</span>
  30. </template>
  31. </el-table-column>
  32. <el-table-column label="收款方" prop="organizationName"></el-table-column>
  33. <el-table-column label="付款方">
  34. <template slot-scope="scope">
  35. <span> {{scope.row.payMerchantName || scope.row.payClientName}}</span>
  36. </template>
  37. </el-table-column>
  38. <el-table-column label="状态" width="80">
  39. <template slot-scope="scope">
  40. <div class="hui-table-tag">
  41. <div class="hui-tag hui-tag-info" v-if="!scope.row.status">待付款</div>
  42. <div class="hui-tag hui-tag-warning" v-else-if="scope.row.status === 1">付款中</div>
  43. <div class="hui-tag hui-tag-success" v-else-if="scope.row.status === 2">已付款</div>
  44. </div>
  45. </template>
  46. </el-table-column>
  47. <el-table-column label="操作" width="80">
  48. <template slot-scope="scope">
  49. <div class="hui-table-operation">
  50. <span class="table-operation" @click="detailItem(scope.row)">
  51. 详情
  52. </span>
  53. </div>
  54. </template>
  55. </el-table-column>
  56. <template slot="empty">
  57. <empty description="暂无数据"></empty>
  58. </template>
  59. </el-table>
  60. </div>
  61. <div class="hui-content-pagination">
  62. <el-pagination :page-size="pageSize" :pager-count="9" layout="prev, pager, next" :total="totalCount"
  63. @current-change="currentChange">
  64. </el-pagination>
  65. </div>
  66. </div>
  67. </div>
  68. <el-drawer title="账单详情" :visible.sync="drawer" :size="400" :append-to-body="true">
  69. <detail v-if="drawer" :detailId="detailId" @reload="init" :showType="2"></detail>
  70. </el-drawer>
  71. </div>
  72. </template>
  73. <script>
  74. import detail from '@/components/work/bill/contract/detail'
  75. import listFilter from '@/components/common/listFilter'
  76. import {
  77. bindProjectDetail
  78. } from '@/httpApi/organization'
  79. import {
  80. getPaymentListByPage
  81. } from '@/httpApi/contract'
  82. export default {
  83. data() {
  84. return {
  85. tableData: [],
  86. currPage: 1,
  87. pageSize: 10,
  88. totalCount: 0,
  89. detailId: '',
  90. filterOption: {},
  91. drawer: false,
  92. clientId: ''
  93. }
  94. },
  95. created() {
  96. bindProjectDetail({
  97. userId: this.$store.getters.user.userId,
  98. projectId: this.$store.getters.project.id,
  99. identityId: 1
  100. }).then(res => {
  101. if (res.state) {
  102. if (res.data.length == 0) return;
  103. this.clientId = res.data[0].clientId;
  104. this.init();
  105. }
  106. })
  107. },
  108. methods: {
  109. init() {
  110. let postData = {
  111. currPage: this.currPage,
  112. pageSize: this.pageSize,
  113. projectId: this.$store.getters.project.id,
  114. payClientId: this.clientId
  115. }
  116. postData = Object.assign(postData, this.filterOption);
  117. getPaymentListByPage(postData).then(res => {
  118. if (res.state) {
  119. this.tableData = res.data.dataList;
  120. this.totalCount = res.data.totalCount;
  121. }
  122. })
  123. },
  124. filterInit(option) {
  125. this.filterOption = option;
  126. this.currPage = 1;
  127. this.init();
  128. },
  129. currentChange(currPage) {
  130. this.currPage = currPage;
  131. this.init();
  132. },
  133. detailItem(item) {
  134. this.detailId = item.id;
  135. this.drawer = true;
  136. },
  137. callback(type) {
  138. if (type === 'init') this.init();
  139. this.type = 'list';
  140. }
  141. },
  142. components: {
  143. detail,
  144. listFilter
  145. },
  146. }
  147. </script>
  148. <style>
  149. </style>