ff9343106dfcb56b7c0f10de9064d9e47f8266ce.svn-base 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216
  1. <template>
  2. <div class="app-container">
  3. <div class="table">
  4. <el-table
  5. :key="table.tableKey"
  6. v-loading="table.listLoading"
  7. element-loading-text="给我一点时间"
  8. :data="table.list"
  9. border
  10. fit
  11. highlight-current-row
  12. style="width: 100%;"
  13. :cell-style="cellStyle"
  14. class="elTable table-fixed"
  15. :row-style="rowStyle"
  16. @cell-click="tabClick"
  17. >
  18. <el-table-column label="序号" align="center" type="index" width="50px">
  19. <template slot-scope="scope">
  20. <span>{{ scope.$index + (table.pageNum-1) * table.pageSize + 1 }}</span>
  21. </template>
  22. </el-table-column>
  23. <el-table-column label="饲料名称" min-width="130px" align="center">
  24. <template slot-scope="scope">
  25. <span>{{ scope.row.brandName }}</span>
  26. </template>
  27. </el-table-column>
  28. <el-table-column label="库存量(kg)" 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="110px" align="center">
  34. <template slot-scope="scope">
  35. <span>{{ scope.row.brandName }}</span>
  36. </template>
  37. </el-table-column>
  38. <el-table-column label="最近一次审核通过使用量(kg)" 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="110px" align="center">
  44. <template slot-scope="scope">
  45. <span>{{ scope.row.brandName }}</span>
  46. </template>
  47. </el-table-column>
  48. </el-table>
  49. </div>
  50. <el-dialog :title="textMap[see.dialogStatus]" :visible.sync="see.dialogFormVisible" :close-on-click-modal="false" width="90%">
  51. <div class="app-see">
  52. <el-form ref="temp" :rules="see.rules" :model="see.temp" label-position="right" label-width="110px" style="width: 100%;margin:0 auto">
  53. <el-row>
  54. <el-col :span="8">
  55. <el-form-item label="饲料名称:" prop="location">
  56. <span> {{ see.temp.location }}</span>
  57. </el-form-item>
  58. </el-col>
  59. </el-row>
  60. </el-form>
  61. <el-table
  62. :key="see.tableKey"
  63. v-loading="see.listLoading"
  64. element-loading-text="给我一点时间"
  65. :data="see.list"
  66. border
  67. fit
  68. highlight-current-row
  69. style="width: 100%;"
  70. :row-style="rowStyle"
  71. :cell-style="cellStyle"
  72. class="elTable table-fixed"
  73. >
  74. <el-table-column label="序号" align="center" type="index" width="50px">
  75. <template slot-scope="scope">
  76. <span>{{ scope.$index + (see.pageNum-1) * see.pageSize + 1 }}</span>
  77. </template>
  78. </el-table-column>
  79. <el-table-column label="库存量" min-width="130px" align="center">
  80. <template slot-scope="scope">
  81. <span>{{ scope.row.brandName }}</span>
  82. </template>
  83. </el-table-column>
  84. <el-table-column label="审核日期" min-width="130px" align="center">
  85. <template slot-scope="scope">
  86. <span>{{ scope.row.brandName }}</span>
  87. </template>
  88. </el-table-column>
  89. <el-table-column label="审核通过使用量" min-width="110px" align="center">
  90. <template slot-scope="scope">
  91. <span> {{ scope.row.pastureName }}</span>
  92. </template>
  93. </el-table-column>
  94. <el-table-column label="剩余使用天数" min-width="110px" align="center">
  95. <template slot-scope="scope">
  96. <span>{{ scope.row.brandName }}</span>
  97. </template>
  98. </el-table-column>
  99. </el-table>
  100. <pagination v-show="see.total>=0" style="margin-bottom: 50px;" :total="see.total" :page.sync="see.getdataListParm.offset" :limit.sync="see.getdataListParm.pagecount" @pagination="getSeeList" />
  101. <div slot="footer" class="dialog-footer">
  102. <el-button class="cancel" @click="see.dialogFormVisible = false; ">关闭</el-button>
  103. </div>
  104. </div>
  105. </el-dialog>
  106. </div>
  107. </template>
  108. <script>
  109. import { GetDataByName } from '@/api/common'
  110. import Pagination from '@/components/Pagination'
  111. export default {
  112. name: 'Warning',
  113. components: { Pagination },
  114. data() {
  115. return {
  116. table: {
  117. getdataListParm: {
  118. name: 'getAssetList',
  119. page: 1,
  120. offset: 1,
  121. pagecount: 10,
  122. returntype: 'Map',
  123. parammaps: {
  124. enable: '',
  125. inputDatetime: ''
  126. }
  127. },
  128. tableKey: 0,
  129. list: [],
  130. total: 0,
  131. listLoading: true
  132. },
  133. textMap: {
  134. see: '库存预警记录'
  135. },
  136. see: {
  137. dialogFormVisible: false,
  138. dialogStatus: '',
  139. temp: {},
  140. rules: {},
  141. getdataListParm: {
  142. name: 'getAssetList',
  143. page: 1,
  144. offset: 1,
  145. pagecount: 10,
  146. returntype: 'Map',
  147. parammaps: {
  148. enable: '',
  149. inputDatetime: ''
  150. }
  151. },
  152. tableKey: 0,
  153. list: [],
  154. total: 0,
  155. listLoading: true
  156. },
  157. isokDisable: false,
  158. rowStyle: { maxHeight: 50 + 'px', height: 45 + 'px' },
  159. cellStyle: { padding: 0 + 'px' }
  160. }
  161. },
  162. created() {
  163. this.getList()
  164. },
  165. methods: {
  166. getList() {
  167. this.table.listLoading = true
  168. GetDataByName(this.table.getdataListParm).then(response => {
  169. console.log('table数据', response.data.list)
  170. if (response.data.list !== null) {
  171. this.table.list = response.data.list
  172. this.table.pageNum = response.data.pageNum
  173. this.table.pageSize = response.data.pageSize
  174. this.table.total = response.data.total
  175. } else {
  176. this.table.list = []
  177. }
  178. setTimeout(() => {
  179. this.table.listLoading = false
  180. }, 100)
  181. })
  182. },
  183. tabClick(row, column) {
  184. this.see.dialogStatus = 'see'
  185. this.see.dialogFormVisible = true
  186. this.see.temp = Object.assign({}, row)
  187. this.see.list = []
  188. this.see.getdataListParm.offset = 1
  189. this.getSeeList()
  190. },
  191. getSeeList() {
  192. this.see.listLoading = true
  193. GetDataByName(this.see.getdataListParm).then(response => {
  194. console.log('table数据', response.data.list)
  195. if (response.data.list !== null) {
  196. this.see.list = response.data.list
  197. this.see.pageNum = response.data.pageNum
  198. this.see.pageSize = response.data.pageSize
  199. this.see.total = response.data.total
  200. } else {
  201. this.see.list = []
  202. }
  203. setTimeout(() => {
  204. this.see.listLoading = false
  205. }, 100)
  206. })
  207. }
  208. }
  209. }
  210. </script>