batchWarehousing.vue 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204
  1. <template>
  2. <div class="app-container">
  3. <h1><i class="el-icon-arrow-left" @click="goBack"></i>批次入库</h1>
  4. <el-form :inline="true" :model="listQuery" @keyup.enter.native="handleFilter()">
  5. <el-form-item label="批次号">
  6. <el-input v-model="listQuery.batchNum" placeholder="请输入批次号" clearable></el-input>
  7. </el-form-item>
  8. <div style="float: right;">
  9. <el-form-item>
  10. <el-button type="primary" @click="handleFilter()">搜索</el-button>
  11. </el-form-item>
  12. <el-form-item>
  13. <el-button @click="resetForm()">重置</el-button>
  14. </el-form-item>
  15. </div>
  16. </el-form>
  17. <el-table
  18. v-loading="loading"
  19. :data="data"
  20. element-loading-text="Loading"
  21. :header-cell-style="{background:'rgba(242, 242, 242, 1)',borderColor:'rgba(242, 242, 242, 1);',textAlign:'center'}"
  22. :cell-style="{'text-align':'center'}"
  23. fit
  24. highlight-current-row
  25. >
  26. <el-table-column label="批次编号" sortable="custom">
  27. <template slot-scope="scope">
  28. {{ scope.row.batch_num }}
  29. </template>
  30. </el-table-column>
  31. <el-table-column label="设备数量" prop="plateNumber">
  32. <template slot-scope="scope">
  33. {{ scope.row.total }}
  34. </template>
  35. </el-table-column>
  36. <el-table-column label="电池类型" prop="deptId">
  37. <template slot-scope="scope">
  38. {{ scope.row.type_title}}
  39. </template>
  40. </el-table-column>
  41. <el-table-column label="PACK厂">
  42. <template slot-scope="scope">
  43. {{ scope.row.pack_title }}
  44. </template>
  45. </el-table-column>
  46. <el-table-column label="已入库" width="80">
  47. <template slot-scope="scope">
  48. {{ scope.row.in_storage }}
  49. </template>
  50. </el-table-column>
  51. <el-table-column label="操作人">
  52. <template slot-scope="scope">
  53. {{ scope.row.operator }}
  54. </template>
  55. </el-table-column>
  56. <el-table-column label="发送地">
  57. <template slot-scope="scope">
  58. {{ scope.row.received_place }}
  59. </template>
  60. </el-table-column>
  61. <el-table-column align="center" label="发货时间">
  62. <template slot-scope="scope">
  63. <span>{{ scope.row.deliver_time }}</span>
  64. </template>
  65. </el-table-column>
  66. <el-table-column align="center" label="录入时间">
  67. <template slot-scope="scope">
  68. <span>{{ scope.row.add_time }}</span>
  69. </template>
  70. </el-table-column>
  71. <el-table-column align="center" label="操作" width="180">
  72. <template slot-scope="scope">
  73. <el-button v-if="scope.row.total - scope.row.in_storage > 0" @click="gotoHandle(scope.row)" type="text">入库</el-button>
  74. </template>
  75. </el-table-column>
  76. </el-table>
  77. <el-pagination style="float: right; margin-top: 30px;" :current-page="listQuery.index" :page-sizes="[10, 20, 50, 100]" :page-size="listQuery.length" :total="total"
  78. layout="total, sizes, prev, pager, next, jumper" @size-change="pageSizeChangeHandle"
  79. @current-change="pageCurrentChangeHandle">
  80. </el-pagination>
  81. </div>
  82. </template>
  83. <script>
  84. import { getBatchList } from '@/api/device/info'
  85. import Create from '@/views/device/storage/create.vue'
  86. export default {
  87. components: { Create },
  88. data() {
  89. return {
  90. //列表加载动画
  91. loading: false,
  92. //列表数据
  93. data: [],
  94. //总条数
  95. total: 0,
  96. /**查询条件对象 */
  97. listQuery: {
  98. index: 1,
  99. length: 20,
  100. importance: undefined,
  101. type: undefined,
  102. sort: '',
  103. batchNum: ''
  104. },
  105. }
  106. },
  107. created() {
  108. this.getDataList()
  109. },
  110. methods: {
  111. //返回上一页面
  112. goBack() {
  113. this.$store.dispatch('tagsView/delView', this.$route)
  114. this.$router.go(-1)
  115. },
  116. //搜索
  117. handleFilter() {
  118. this.listQuery.index = 1
  119. this.getDataList()
  120. },
  121. //重置
  122. resetForm() {
  123. this.listQuery = {
  124. index: 1,
  125. length: 20,
  126. importance: undefined,
  127. type: undefined,
  128. sort: '',
  129. batchNum: ''
  130. }
  131. this.getDataList()
  132. },
  133. /**请求列表数据 */
  134. getDataList() {
  135. this.loading = true
  136. getBatchList(this.listQuery).then(response => {
  137. if (response.code === 200) {
  138. this.data = response.data
  139. this.total = response.total
  140. this.loading = false
  141. } else {
  142. this.loading = false
  143. return this.$message.error(response.message)
  144. }
  145. })
  146. },
  147. // 分页, 每页条数
  148. pageSizeChangeHandle (val) {
  149. this.listQuery.index = 1
  150. this.listQuery.length = val
  151. this.getDataList()
  152. },
  153. // 分页, 当前页
  154. pageCurrentChangeHandle (val) {
  155. this.listQuery.index = val
  156. this.getDataList()
  157. },
  158. /**跳转入库页面 */
  159. gotoHandle(row) {
  160. this.$router.push({path:'/device/storage/warehousing',
  161. query: {
  162. batchId: row.batch_num,
  163. total: row.total,
  164. storage: row.in_storage
  165. }
  166. })
  167. }
  168. }
  169. }
  170. </script>
  171. <style lang="scss" scoped>
  172. .top-info {
  173. height: 53px;
  174. line-height: 53px;
  175. width: 100%;
  176. background-color: rgba(242, 242, 242, 1);
  177. box-shadow: none;
  178. text-align: left;
  179. color: #7F7F7F;
  180. font-size: 13px;
  181. padding-left: 20px;
  182. margin-bottom: 20px;
  183. >span {
  184. color: #0000FF;
  185. font-size: 13px;
  186. }
  187. }
  188. </style>