payment.vue 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  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="invoice" type="invoice" @filter="filterInit"></list-filter>
  9. <!-- <div class="hui-content-insert">
  10. <el-button type="primary" size="medium" @click="insertItem">开具发票</el-button>
  11. </div> -->
  12. <div class="hui-flex-box">
  13. <el-table :data="tableData" row-key="id" border height="100%">
  14. <el-table-column label="序号" width="50">
  15. <template slot-scope="scope">
  16. <div style="text-align: center;">{{scope.$index + 1}}</div>
  17. </template>
  18. </el-table-column>
  19. <el-table-column label="发票名称" prop="name"></el-table-column>
  20. <el-table-column label="发票类型" prop="code" width="200">
  21. <template slot-scope="scope">
  22. <span>{{$field.findTypeName('invoiceType',scope.row.type)}}</span>
  23. </template>
  24. </el-table-column>
  25. <el-table-column label="发票代码" prop="code"></el-table-column>
  26. <el-table-column label="发票号码" prop="number"></el-table-column>
  27. <el-table-column label="货物名称" prop="cargoName"></el-table-column>
  28. <el-table-column label="状态" width="80">
  29. <template slot-scope="scope">
  30. <div class="hui-table-tag">
  31. <div class="hui-tag hui-tag-success" v-if="!scope.row.status">正常</div>
  32. <div class="hui-tag hui-tag-warning" v-else-if="scope.row.status === 1">作废</div>
  33. </div>
  34. </template>
  35. </el-table-column>
  36. <el-table-column label="操作" width="80">
  37. <template slot-scope="scope">
  38. <div class="hui-table-operation">
  39. <span class="table-operation" @click="detailItem(scope.row)">
  40. 详情
  41. </span>
  42. </div>
  43. </template>
  44. </el-table-column>
  45. <template slot="empty">
  46. <empty description="暂无数据"></empty>
  47. </template>
  48. </el-table>
  49. </div>
  50. <div class="hui-content-pagination">
  51. <el-pagination :page-size="pageSize" :pager-count="9" layout="prev, pager, next" :total="totalCount"
  52. @current-change="currentChange">
  53. </el-pagination>
  54. </div>
  55. </div>
  56. </div>
  57. <el-dialog :close-on-click-modal="false" :title="isUpdate?'编辑':'新增'" :visible.sync="visible" width="900px"
  58. :append-to-body="true">
  59. <edit v-if="visible" @callback="callback" :isUpdate="isUpdate" :detailId="detailId"></edit>
  60. </el-dialog>
  61. <el-drawer title="发票详情" :visible.sync="drawer" :size="400" :append-to-body="true">
  62. <detail v-if="drawer" :detailId="detailId" @reload="init"></detail>
  63. </el-drawer>
  64. </div>
  65. </template>
  66. <script>
  67. import detail from '@/components/work/invoice/detail'
  68. import edit from '@/components/work/invoice/edit'
  69. import listFilter from '@/components/common/listFilter'
  70. import {
  71. getInvoiceListByPage
  72. } from '@/httpApi/invoice'
  73. export default {
  74. data() {
  75. return {
  76. tableData: [],
  77. currPage: 1,
  78. pageSize: 10,
  79. totalCount: 0,
  80. detailId: '',
  81. isUpdate: false,
  82. filterOption: {},
  83. drawer: false,
  84. visible: false
  85. }
  86. },
  87. created() {
  88. this.init();
  89. },
  90. methods: {
  91. init() {
  92. let postData = {
  93. currPage: this.currPage,
  94. pageSize: this.pageSize,
  95. projectId: this.$store.getters.project.id,
  96. organizationId: this.$store.getters.organization.id,
  97. type: 2
  98. }
  99. postData = Object.assign(postData, this.filterOption);
  100. getInvoiceListByPage(postData).then(res => {
  101. if (res.state) {
  102. this.tableData = res.data.dataList;
  103. this.totalCount = res.data.totalCount;
  104. }
  105. })
  106. },
  107. filterInit(option) {
  108. this.filterOption = option;
  109. this.currPage = 1;
  110. this.init();
  111. },
  112. currentChange(currPage) {
  113. this.currPage = currPage;
  114. this.init();
  115. },
  116. insertItem() {
  117. this.isUpdate = false;
  118. this.visible = true;
  119. },
  120. updateItem(item) {
  121. this.detailId = item.id;
  122. this.isUpdate = true;
  123. this.visible = true;
  124. },
  125. detailItem(item) {
  126. this.detailId = item.id;
  127. this.drawer = true;
  128. },
  129. callback(type) {
  130. if (type === 'init') this.init();
  131. this.visible = false;
  132. }
  133. },
  134. components: {
  135. detail,
  136. listFilter,
  137. edit
  138. },
  139. }
  140. </script>
  141. <style>
  142. </style>