index.vue 4.1 KB

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