index.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  1. <template>
  2. <view class="content">
  3. <u-form :model="queryData" ref="uForm">
  4. <u-row>
  5. <u-col span="5">
  6. <u-form-item label="企业名称" label-width="80px">
  7. <u--input placeholder="请输入企业名称" border="surround" v-model="queryData.enterpriseName" />
  8. </u-form-item>
  9. </u-col>
  10. <u-col span="5">
  11. <u-form-item label="企业类型" label-width="80px">
  12. <uni-data-select placeholder="请选择企业类型" v-model="queryData.type" :localdata="range" />
  13. </u-form-item>
  14. </u-col>
  15. <u-col span="2">
  16. <u-form-item>
  17. <u-button type="primary" @click="getTableData">查询</u-button>
  18. <u-button type="info" @click="reset">重置</u-button>
  19. </u-form-item>
  20. </u-col>
  21. </u-row>
  22. </u-form>
  23. <view class="tableBox">
  24. <uni-table border stripe emptyText="暂无更多数据" :loading="this.loading">
  25. <!-- 表头行 -->
  26. <uni-tr>
  27. <uni-th align="center" width="60">序号</uni-th>
  28. <uni-th align="center">所属市州</uni-th>
  29. <uni-th align="center">应急网点名称</uni-th>
  30. <uni-th align="center">负责人</uni-th>
  31. <uni-th align="center">联系电话</uni-th>
  32. <uni-th align="center">企业类型</uni-th>
  33. <uni-th align="center">操作</uni-th>
  34. </uni-tr>
  35. <uni-tr v-for="(item,index) in tableData" :key="item.id">
  36. <uni-td align="center" width="60">{{index + 1}}</uni-td>
  37. <uni-td align="center">{{item.cityState}}</uni-td>
  38. <uni-td align="center">{{item.enterpriseName}}</uni-td>
  39. <uni-td align="center">{{item.enterpriseContact}}</uni-td>
  40. <uni-td align="center">{{item.contactNumber}}</uni-td>
  41. <uni-td align="center">{{filtrationData(item.type)}}</uni-td>
  42. <uni-td align="center" width="80">
  43. <u-button size='mini' type='primary' @click="lookDetails(item)">查看</u-button>
  44. </uni-td>
  45. </uni-tr>
  46. </uni-table>
  47. <uni-pagination show-icon="true" :total="queryData.total" :current="queryData.current"
  48. @change="changePage" />
  49. </view>
  50. </view>
  51. </template>
  52. <script>
  53. import * as api from "@/api/statisticalQuery.js"
  54. export default {
  55. data() {
  56. return {
  57. queryData: {
  58. total: 0,
  59. size: 10,
  60. current: 1,
  61. },
  62. tableData: [],
  63. loading: false,
  64. range: [{
  65. "value": 1,
  66. "text": "应急网点"
  67. }, {
  68. "value": 2,
  69. "text": "应急加工企业"
  70. }, {
  71. "value": 3,
  72. "text": "应急配送企业"
  73. }, {
  74. "value": 4,
  75. "text": "应急仓储企业"
  76. }]
  77. }
  78. },
  79. onLoad() {
  80. this.getTableData()
  81. },
  82. methods: {
  83. getTableData() {
  84. this.loading = true
  85. api.findEsNetworkEntryPage(this.queryData).then(res => {
  86. this.tableData = res.data.records
  87. this.queryData.total = res.data.total
  88. this.loading = false
  89. })
  90. },
  91. lookDetails(data) {
  92. uni.navigateTo({
  93. url: `/pages/queryStatistics/emergencyInfo/details?id=${data.id}&name=${data.enterpriseName}`
  94. })
  95. },
  96. filtrationData(code) {
  97. let str = ''
  98. this.range.map(item => {
  99. if (code == item.value) {
  100. str = item.text
  101. }
  102. })
  103. return str
  104. },
  105. changePage(page) {
  106. this.queryData.current = page.current
  107. this.getTableData()
  108. },
  109. reset() {
  110. this.queryData = {
  111. total: 0,
  112. size: 10,
  113. current: 1,
  114. }
  115. }
  116. }
  117. }
  118. </script>
  119. <style scoped lang="scss">
  120. .content {
  121. margin: 10px 20px;
  122. /deep/.u-form {
  123. margin-bottom: 20px;
  124. .u-form-item {
  125. .u-input {
  126. width: 220px;
  127. margin-right: 10px;
  128. }
  129. .uni-select {
  130. height: 38px;
  131. font-size: 15px;
  132. color: #303133;
  133. .uni-select__input-placeholder {
  134. font-size: 15px;
  135. color: #c1c4cc;
  136. }
  137. }
  138. .u-button {
  139. width: 80px;
  140. height: 35px;
  141. margin: 0 5px;
  142. }
  143. }
  144. }
  145. .tableBox {
  146. .uni-table {
  147. .uni-table-td {
  148. .u-button {
  149. width: 60px;
  150. float: left;
  151. margin: 0 5px;
  152. }
  153. }
  154. }
  155. .uni-pagination {
  156. float: right;
  157. margin: 10px 0;
  158. }
  159. }
  160. }
  161. </style>