index.vue 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  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.orgName" />
  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.planType" :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-th align="center">计划完成百分比</uni-th>
  35. <uni-th align="center" width="80">操作</uni-th>
  36. </uni-tr>
  37. <uni-tr v-for="(item,index) in tableData" :key="item.id">
  38. <uni-td align="center" width="60">{{index + 1}}</uni-td>
  39. <uni-td align="center">{{item.currentDate}}</uni-td>
  40. <uni-td align="center">{{item.orgName}}</uni-td>
  41. <uni-td align="center">{{item.storehouseName}}</uni-td>
  42. <uni-td align="center">{{filtrationData(item.planType)}}</uni-td>
  43. <uni-td align="center">{{item.planQuantity}}</uni-td>
  44. <uni-td align="center">{{item.completedQuantity}}</uni-td>
  45. <uni-td align="center">{{percentile(item.completedQuantity,item.planQuantity)}}</uni-td>
  46. <uni-td align="center">
  47. <u-button size='mini' type='primary' @click="lookDetails(item)">查看</u-button>
  48. </uni-td>
  49. </uni-tr>
  50. </uni-table>
  51. <uni-pagination show-icon="true" :total="queryData.total" :current="queryData.current"
  52. @change="changePage" />
  53. </view>
  54. </view>
  55. </template>
  56. <script>
  57. import * as api from "@/api/statisticalQuery.js"
  58. export default {
  59. data() {
  60. return {
  61. queryData: {
  62. total: 0,
  63. size: 10,
  64. current: 1,
  65. },
  66. loading: false,
  67. tableData: [],
  68. range: [{
  69. "value": 1,
  70. "text": "粮食轮换计划"
  71. }, {
  72. "value": 2,
  73. "text": "油料轮换计划"
  74. }]
  75. }
  76. },
  77. onLoad() {
  78. this.getTableData()
  79. },
  80. methods: {
  81. getTableData() {
  82. this.loading = true
  83. api.findCurrentPlanPage(this.queryData).then(res => {
  84. this.tableData = res.data.records
  85. this.queryData.total = res.data.total
  86. this.loading = false
  87. })
  88. },
  89. lookDetails(data) {
  90. uni.navigateTo({
  91. url: `/pages/queryStatistics/todayInfo/details?id=${data.id}&warehouseId=${data.warehouseId}`
  92. })
  93. },
  94. filtrationData(code) {
  95. let str = ''
  96. this.range.map(item => {
  97. if (code == item.value) {
  98. str = item.text
  99. }
  100. })
  101. return str
  102. },
  103. percentile(val1, val2) {
  104. let num = ''
  105. num = (val1 / val2) * 100 + '%'
  106. return num
  107. },
  108. changePage(page) {
  109. this.queryData.current = page.current
  110. this.getTableData()
  111. },
  112. reset() {
  113. this.queryData = {
  114. total: 0,
  115. size: 10,
  116. current: 1,
  117. }
  118. }
  119. }
  120. }
  121. </script>
  122. <style scoped lang="scss">
  123. .content {
  124. margin: 10px 20px;
  125. /deep/.u-form {
  126. margin-bottom: 20px;
  127. .u-form-item {
  128. .u-input {
  129. margin-right: 10px;
  130. }
  131. .uni-select {
  132. height: 38px;
  133. font-size: 15px;
  134. color: #303133;
  135. .uni-select__input-placeholder {
  136. font-size: 15px;
  137. color: #c1c4cc;
  138. }
  139. }
  140. .u-button {
  141. width: 80px;
  142. height: 35px;
  143. margin: 0 5px;
  144. }
  145. }
  146. }
  147. .tableBox {
  148. .uni-table {
  149. .uni-table-td {
  150. .u-button {
  151. width: 60px;
  152. float: left;
  153. margin: 0 5px;
  154. }
  155. }
  156. }
  157. .uni-pagination {
  158. float: right;
  159. margin: 10px 0;
  160. }
  161. }
  162. }
  163. </style>