index.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. <template>
  2. <div>
  3. <add class="inline-16" :data="mainData" @onSuccess="queryfinancialinfo"></add>
  4. <el-input
  5. style="width:300px"
  6. placeholder="请输入内容"
  7. v-model="search"
  8. clearable
  9. @clear="clearData()"
  10. size="small"
  11. @keyup.enter.native="queryClick()">
  12. <i slot="prefix" class="el-icon-search" @click="queryClick()"></i>
  13. </el-input>
  14. <el-table
  15. :header-cell-style="{background:'#EEEEEE',color:'#333'}"
  16. :data="tableData"
  17. stripe
  18. size="mini"
  19. style="width: 100%"
  20. border>
  21. <el-table-column
  22. prop="address"
  23. label="开票地址">
  24. <template slot-scope="scope">
  25. {{scope.row.address}}&nbsp;<i style="color:red" v-if="scope.row.isdefault === 1" class="el-icon-place"></i>
  26. </template>
  27. </el-table-column>
  28. <el-table-column
  29. prop="enterprisename"
  30. label="抬头">
  31. </el-table-column>
  32. <el-table-column
  33. prop="taxno"
  34. label="税号">
  35. </el-table-column>
  36. <el-table-column
  37. prop="bank"
  38. label="开户行">
  39. </el-table-column>
  40. <el-table-column
  41. prop="bankcardno"
  42. label="开户账号">
  43. </el-table-column>
  44. <el-table-column
  45. prop="phonenumber"
  46. label="联系电话">
  47. </el-table-column>
  48. <el-table-column
  49. prop="remarks"
  50. label="备注说明">
  51. </el-table-column>
  52. <el-table-column
  53. label="操作"
  54. width="100">
  55. <template slot-scope="scope">
  56. <edit class="inline-16" :data="scope.row" @onSuccess="queryfinancialinfo"></edit>
  57. <el-button type="text" size="mini" @click="deleteRow(scope.row)">删 除</el-button>
  58. </template>
  59. </el-table-column>
  60. </el-table>
  61. <div class="container normal-panel" style="text-align:right">
  62. <el-pagination
  63. background
  64. small
  65. @size-change="handleSizeChange"
  66. @current-change="handleCurrentChange"
  67. :current-page="currentPage"
  68. :page-sizes="[20, 50, 100, 200]"
  69. layout="total,sizes, prev, pager, next, jumper"
  70. :total="total">
  71. </el-pagination>
  72. </div>
  73. </div>
  74. </template>
  75. <script>
  76. import add from './modules/add.vue'
  77. import edit from './modules/edit.vue'
  78. export default {
  79. props:['mainData'],
  80. data () {
  81. return {
  82. search:'',
  83. tableData:[],
  84. param:{
  85. "id": 20221013160602,
  86. "content": {
  87. "sys_enterpriseid":0,
  88. "pageNumber": 1,
  89. "pageSize": 20,
  90. "where": {
  91. "condition": ""
  92. }
  93. },
  94. },
  95. total:0,
  96. currentPage:0
  97. }
  98. },
  99. components:{
  100. add,
  101. edit
  102. },
  103. methods:{
  104. async queryfinancialinfo () {
  105. this.param.content.sys_enterpriseid = this.mainData.sys_enterpriseid
  106. const res = await this.$api.requested(this.param)
  107. this.tableData = res.data
  108. this.total = res.total
  109. this.currentPage = res.pageNumber
  110. },
  111. handleSizeChange(val) {
  112. // console.log(`每页 ${val} 条`);
  113. this.param.content.pageSize = val
  114. this.queryfinancialinfo()
  115. },
  116. handleCurrentChange(val) {
  117. // console.log(`当前页: ${val}`);
  118. this.param.content.pageNumber = val
  119. this.queryfinancialinfo()
  120. },
  121. async deleteRow (row) {
  122. const res = await this.$api.requested({
  123. "id": 20221013160502,
  124. "content": {
  125. "sys_enterprise_financeids": [row.sys_enterprise_financeid]
  126. },
  127. })
  128. this.tool.showMessage(res,()=>{
  129. this.queryfinancialinfo()
  130. })
  131. },
  132. clearData(){
  133. this.search = ""
  134. this.queryfinancialinfo()
  135. },
  136. queryClick(){
  137. this.param.content.where.condition = this.search
  138. this.param.content.pageNumber = 1
  139. this.queryfinancialinfo()
  140. }
  141. },
  142. mounted () {
  143. this.queryfinancialinfo()
  144. }
  145. }
  146. </script>
  147. <style scoped>
  148. /deep/.el-input__prefix {
  149. display: flex;
  150. align-items: center;
  151. }
  152. </style>