9b6e764d94fd607e5da9b6a3623df0c85ce2a04b.svn-base 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214
  1. <template>
  2. <div class="app-container">
  3. <el-tabs v-model="activeName" @tab-click="handleTabClick">
  4. <el-tab-pane label="集团名称" name="first">
  5. <div class="search">
  6. <el-input v-model="table.getdataListParm.parammaps.assetCode" placeholder="驾驶员名称" style="width: 180px;" class="filter-item" clearable />
  7. <el-button class="successBorder" @click="handleSearch">查询</el-button>
  8. </div>
  9. <div class="table">
  10. <el-table
  11. :key="table.tableKey"
  12. v-loading="table.listLoading"
  13. element-loading-text="给我一点时间"
  14. :data="table.list"
  15. border
  16. fit
  17. highlight-current-row
  18. style="width: 100%;"
  19. :row-style="rowStyle"
  20. :cell-style="cellStyle"
  21. class="elTable table-fixed"
  22. >
  23. <el-table-column label="序号" align="center" type="index" width="50px">
  24. <template slot-scope="scope">
  25. <span>{{ scope.$index + (table.pageNum-1) * table.pageSize + 1 }}</span>
  26. </template>
  27. </el-table-column>
  28. <el-table-column label="集团ID" min-width="130px" align="center">
  29. <template slot-scope="scope">
  30. <span>{{ scope.row.brandName }}</span>
  31. </template>
  32. </el-table-column>
  33. <el-table-column label="集团名称" min-width="130px" align="center">
  34. <template slot-scope="scope">
  35. <span>{{ scope.row.brandName }}</span>
  36. </template>
  37. </el-table-column>
  38. <el-table-column label="联系人" min-width="130px" align="center">
  39. <template slot-scope="scope">
  40. <span>{{ scope.row.brandName }}</span>
  41. </template>
  42. </el-table-column>
  43. <el-table-column label="联系方式" min-width="130px" align="center">
  44. <template slot-scope="scope">
  45. <span>{{ scope.row.brandName }}</span>
  46. </template>
  47. </el-table-column>
  48. </el-table>
  49. <pagination v-show="table.total>0" :total="table.total" :page.sync="table.getdataListParm.offset" :limit.sync="table.getdataListParm.pagecount" @pagination="getList" />
  50. </div>
  51. </el-tab-pane>
  52. <el-tab-pane label="牧场管理" name="second">
  53. <div class="search">
  54. <el-input v-model="table.getdataListParm.parammaps.assetCode" placeholder="驾驶员名称" style="width: 180px;" class="filter-item" clearable />
  55. <el-button class="successBorder" @click="handleSearch">查询</el-button>
  56. </div>
  57. <div class="table">
  58. <el-table
  59. :key="table2.tableKey"
  60. v-loading="table2.listLoading"
  61. element-loading-text="给我一点时间"
  62. :data="table2.list"
  63. border
  64. fit
  65. highlight-current-row
  66. style="width: 100%;"
  67. :row-style="rowStyle"
  68. :cell-style="cellStyle"
  69. class="elTable table-fixed"
  70. >
  71. <el-table-column label="序号" align="center" type="index" width="50px">
  72. <template slot-scope="scope">
  73. <span>{{ scope.$index + (table2.pageNum-1) * table2.pageSize + 1 }}</span>
  74. </template>
  75. </el-table-column>
  76. <el-table-column label="集团ID" min-width="130px" align="center">
  77. <template slot-scope="scope">
  78. <span>{{ scope.row.brandName }}</span>
  79. </template>
  80. </el-table-column>
  81. <el-table-column label="牧场ID" min-width="130px" align="center">
  82. <template slot-scope="scope">
  83. <span>{{ scope.row.brandName }}</span>
  84. </template>
  85. </el-table-column>
  86. <el-table-column label="牧场名称" min-width="130px" align="center">
  87. <template slot-scope="scope">
  88. <span>{{ scope.row.brandName }}</span>
  89. </template>
  90. </el-table-column>
  91. <el-table-column label="牧场名称" min-width="130px" align="center">
  92. <template slot-scope="scope">
  93. <span>{{ scope.row.brandName }}</span>
  94. </template>
  95. </el-table-column>
  96. </el-table>
  97. <pagination v-show="table2.total>0" :total="table2.total" :page.sync="table2.getdataListParm.offset" :limit.sync="table2.getdataListParm.pagecount" @pagination="getList2" />
  98. </div>
  99. </el-tab-pane>
  100. </el-tabs>
  101. </div>
  102. </template>
  103. <script>
  104. import { GetDataByName } from '@/api/common'
  105. import Pagination from '@/components/Pagination'
  106. export default {
  107. name: 'GroupInformation',
  108. components: { Pagination },
  109. data() {
  110. return {
  111. activeName: 'first',
  112. table: {
  113. getdataListParm: {
  114. name: 'getAssetList',
  115. page: 1,
  116. offset: 1,
  117. pagecount: 10,
  118. returntype: 'Map',
  119. parammaps: {
  120. enable: ''
  121. }
  122. },
  123. tableKey: 0,
  124. list: [],
  125. total: 0,
  126. listLoading: true
  127. },
  128. table2: {
  129. getdataListParm: {
  130. name: 'getAssetList',
  131. page: 1,
  132. offset: 1,
  133. pagecount: 10,
  134. returntype: 'Map',
  135. parammaps: {
  136. enable: ''
  137. }
  138. },
  139. tableKey: 0,
  140. list: [],
  141. total: 0,
  142. listLoading: true
  143. },
  144. rowStyle: { maxHeight: 50 + 'px', height: 45 + 'px' },
  145. cellStyle: { padding: 0 + 'px' }
  146. }
  147. },
  148. created() {
  149. this.getList()
  150. this.activeName = 'first'
  151. },
  152. methods: {
  153. handleTabClick(val) {
  154. console.log(val)
  155. if (val.name === 'first') {
  156. this.getList()
  157. } else if (val.name === 'second') {
  158. this.getList2()
  159. }
  160. },
  161. getList() {
  162. this.table.listLoading = true
  163. GetDataByName(this.table.getdataListParm).then(response => {
  164. console.log('集团信息table数据', response.data.list)
  165. if (response.data.list !== null) {
  166. this.table.list = response.data.list
  167. this.table.pageNum = response.data.pageNum
  168. this.table.pageSize = response.data.pageSize
  169. this.table.total = response.data.total
  170. } else {
  171. this.table.list = []
  172. }
  173. setTimeout(() => {
  174. this.table.listLoading = false
  175. }, 100)
  176. })
  177. },
  178. handleSearch() {
  179. console.log('点击了集团信息查询')
  180. this.getList()
  181. },
  182. getList2() {
  183. this.table2.listLoading = true
  184. GetDataByName(this.table2.getdataListParm).then(response => {
  185. console.log('牧场管理table数据', response.data.list)
  186. if (response.data.list !== null) {
  187. this.table2.list = response.data.list
  188. this.table2.pageNum = response.data.pageNum
  189. this.table2.pageSize = response.data.pageSize
  190. this.table2.total = response.data.total
  191. } else {
  192. this.table2.list = []
  193. }
  194. setTimeout(() => {
  195. this.table2.listLoading = false
  196. }, 100)
  197. })
  198. },
  199. handleSearch() {
  200. console.log('点击了牧场管理查询')
  201. this.getList()
  202. }
  203. }
  204. }
  205. </script>
  206. <style lang="scss" scoped>
  207. .table{margin-top:10px;}
  208. </style>