99e9b92ca345dc56028c9d8a20c402dff6d24d92.svn-base 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218
  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.groupsname" 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.groupscode }}</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.groupsname }}</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.emp }}</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.phone }}</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.pasturename" 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.pasturecode }}</span>
  79. </template>
  80. </el-table-column>
  81. <el-table-column label="牧场名称" min-width="130px" align="center">
  82. <template slot-scope="scope">
  83. <span>{{ scope.row.pasturename }}</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.groupsnames }}</span>
  89. </template>
  90. </el-table-column>
  91. </el-table>
  92. <pagination v-show="table2.total>0" :total="table2.total" :page.sync="table2.getdataListParm.offset" :limit.sync="table2.getdataListParm.pagecount" @pagination="getList2" />
  93. </div>
  94. </el-tab-pane>
  95. </el-tabs>
  96. </div>
  97. </template>
  98. <script>
  99. import { GetDataByName } from '@/api/common'
  100. import Pagination from '@/components/Pagination'
  101. import Cookies from 'js-cookie'
  102. export default {
  103. name: 'GroupInformation',
  104. components: { Pagination },
  105. data() {
  106. return {
  107. activeName: 'first',
  108. table: {
  109. getdataListParm: {
  110. name: 'getGroupsList',
  111. page: 1,
  112. offset: 1,
  113. pagecount: parseInt(Cookies.get('pageCount')),
  114. returntype: 'Map',
  115. parammaps: {
  116. groupsname: '',
  117. pastureid: Cookies.get('pastureid'),
  118. groupsid: ''
  119. }
  120. },
  121. tableKey: 0,
  122. list: [],
  123. total: 0,
  124. listLoading: true
  125. },
  126. table2: {
  127. getdataListParm: {
  128. name: 'getPastureListJT',
  129. page: 1,
  130. offset: 1,
  131. pagecount: parseInt(Cookies.get('pageCount')),
  132. returntype: 'Map',
  133. parammaps: {
  134. pasturename: '',
  135. pastureid: Cookies.get('pastureid'),
  136. groupsid: ''
  137. }
  138. },
  139. tableKey: 0,
  140. list: [],
  141. total: 0,
  142. listLoading: true
  143. },
  144. rowStyle: { maxHeight: 30 + 'px', height: 30 + '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. if (this.activeName == 'first') {
  181. this.getList()
  182. } else {
  183. this.getList2()
  184. }
  185. },
  186. getList2() {
  187. this.table2.listLoading = true
  188. GetDataByName(this.table2.getdataListParm).then(response => {
  189. console.log('牧场管理table数据', response.data.list)
  190. if (response.data.list !== null) {
  191. this.table2.list = response.data.list
  192. this.table2.pageNum = response.data.pageNum
  193. this.table2.pageSize = response.data.pageSize
  194. this.table2.total = response.data.total
  195. } else {
  196. this.table2.list = []
  197. }
  198. setTimeout(() => {
  199. this.table2.listLoading = false
  200. }, 100)
  201. })
  202. },
  203. handleSearch() {
  204. console.log('点击了牧场管理查询')
  205. this.getList()
  206. }
  207. }
  208. }
  209. </script>
  210. <style lang="scss" scoped>
  211. .table{margin-top:10px;}
  212. </style>