InWarehouse.vue 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264
  1. <!-- 入库 -->
  2. <template>
  3. <div class="inWarehouse">
  4. <!-- <el-form label-width="100px">
  5. <el-row>
  6. <el-col :span="6">
  7. <el-form-item label="入库场景"
  8. ><el-select
  9. filterable
  10. placeholder="请选择"
  11. v-model="searchForm.bizScene"
  12. clearable
  13. >
  14. <el-option
  15. v-for="item in sceneState"
  16. :key="item.code"
  17. :value="item.code + ''"
  18. :label="item.label"
  19. ></el-option>
  20. </el-select>
  21. </el-form-item>
  22. </el-col>
  23. <el-col :span="6">
  24. <el-form-item label="入库单号" prop="bizNum">
  25. <el-input
  26. v-model="searchForm.bizNum"
  27. placeholder="请输入"
  28. size="small"
  29. ></el-input>
  30. </el-form-item>
  31. </el-col>
  32. <el-col :span="6">
  33. <el-form-item label="入库数量">
  34. <el-col :span="11">
  35. <el-input
  36. v-model="searchForm.warehouseStart"
  37. @blur="
  38. () => {
  39. if (!/^\d+(\.\d+)?$/.test(searchForm.warehouseStart)) {
  40. searchForm.warehouseStart = '';
  41. }
  42. }
  43. "
  44. placeholder="请输入"
  45. size="small"
  46. ></el-input
  47. ></el-col>
  48. <el-col :span="2" style="text-align: center">~</el-col>
  49. <el-col :span="11">
  50. <el-input
  51. v-model="searchForm.warehouseEnd"
  52. @blur="
  53. () => {
  54. if (!/^\d+(\.\d+)?$/.test(searchForm.warehouseEnd)) {
  55. searchForm.warehouseEnd = '';
  56. }
  57. }
  58. "
  59. placeholder="请输入"
  60. size="small"
  61. ></el-input
  62. ></el-col>
  63. </el-form-item>
  64. </el-col>
  65. <el-col :span="6">
  66. <el-form-item label="包装数量">
  67. <el-col :span="11">
  68. <el-input
  69. v-model="searchForm.packetStart"
  70. @blur="
  71. () => {
  72. if (!/^\d+(\.\d+)?$/.test(searchForm.packetStart)) {
  73. searchForm.packetStart = '';
  74. }
  75. }
  76. "
  77. placeholder="请输入"
  78. size="small"
  79. ></el-input
  80. ></el-col>
  81. <el-col :span="2" style="text-align: center">~</el-col>
  82. <el-col :span="11">
  83. <el-input
  84. v-model="searchForm.packetEnd"
  85. @blur="
  86. () => {
  87. if (!/^\d+(\.\d+)?$/.test(searchForm.packetEnd)) {
  88. searchForm.packetEnd = '';
  89. }
  90. }
  91. "
  92. placeholder="请输入"
  93. size="small"
  94. ></el-input
  95. ></el-col>
  96. </el-form-item>
  97. </el-col>
  98. <el-col :span="24" style="text-align: right; margin-bottom: 20px">
  99. <el-button
  100. @click="search"
  101. type="primary"
  102. icon="el-icon-search"
  103. size="small"
  104. >搜索</el-button
  105. >
  106. <el-button @click="reset" icon="el-icon-refresh-left" size="small"
  107. >重置</el-button
  108. >
  109. </el-col>
  110. </el-row>
  111. </el-form> -->
  112. <el-table
  113. class="table"
  114. :data="tableData"
  115. @cell-click="handleCellClick"
  116. :header-cell-style="{ background: '#EEEEEE', border: 'none' }"
  117. >
  118. <el-table-column width="80px" label="序号" type="index" />
  119. <el-table-column label="入库单号" prop="bizNo"></el-table-column>
  120. <el-table-column label="入库场景" prop="bizType">
  121. <template slot-scope="{ row }">{{
  122. getSceneState(+row.bizType)
  123. }}</template>
  124. </el-table-column>
  125. <el-table-column
  126. label="入库数量"
  127. prop="availableCountBase"
  128. ></el-table-column>
  129. <el-table-column label="计量单位" prop="measuringUnit"></el-table-column>
  130. <el-table-column label="包装数量" prop="packageNo"></el-table-column>
  131. <el-table-column label="包装单位" prop="packingUnit"></el-table-column>
  132. <el-table-column label="操作人" prop="createUserId">
  133. <template slot-scope="{ row }">
  134. {{ handleDeta(row.createUserId) }}
  135. </template>
  136. </el-table-column>
  137. <el-table-column label="审核人" prop="verifyName"></el-table-column>
  138. <el-table-column label="入库时间" prop="createTime"></el-table-column>
  139. </el-table>
  140. <Pagination
  141. class="pagination"
  142. :total="total"
  143. :page.sync="page"
  144. :size.sync="size"
  145. @pagination="handlePageChange"
  146. />
  147. <InWarehouseDialog
  148. ref="detailRef"
  149. :assetCode="baseInfo.assetCode"
  150. :baseInfo="baseInfo"
  151. />
  152. </div>
  153. </template>
  154. <script>
  155. import Pagination from '@/components/Pagination';
  156. // import { getInWarehouseDetail } from '@/api/stockManagement/stockLedger'
  157. import { sceneState } from '@/utils/dict/index';
  158. import InWarehouseDialog from './InWarehouseDialog';
  159. import { inventorybookPage } from '@/api/classifyManage/itemInformation';
  160. import { useDictLabel } from '@/utils/dict/index';
  161. import ouint from '@/api/warehouseManagement/outin';
  162. export default {
  163. components: { Pagination, InWarehouseDialog },
  164. props: {
  165. baseInfo: {
  166. type: Object,
  167. default: () => ({})
  168. },
  169. baseParams: {
  170. type: Object,
  171. default: () => ({})
  172. }
  173. },
  174. data() {
  175. return {
  176. sceneState,
  177. sceneState: [],
  178. searchForm: {
  179. bizNum: '',
  180. warehouseEnd: '',
  181. warehouseStart: '',
  182. packetEnd: '',
  183. packetStart: ''
  184. },
  185. tableData: [],
  186. size: 10,
  187. page: 1,
  188. total: 0,
  189. vuexUser: []
  190. };
  191. },
  192. created() {
  193. this.getList();
  194. },
  195. methods: {
  196. getSceneState: useDictLabel(sceneState),
  197. search() {
  198. this.page = 1;
  199. this.getList();
  200. },
  201. reset() {
  202. this.searchForm = {};
  203. this.search();
  204. },
  205. handleCellClick(row) {
  206. this.$refs.detailRef.open(row);
  207. },
  208. handlePageChange(v) {
  209. this.page = v.current;
  210. this.size = v.size;
  211. this.getList();
  212. },
  213. handleDeta(row) {
  214. for (const key in this.vuexUser) {
  215. if (this.vuexUser[key].id == row) {
  216. return this.vuexUser[key].name;
  217. }
  218. }
  219. },
  220. async getList() {
  221. const res = await ouint.getInventoryDetails({
  222. categoryId: this.$route.query.id,
  223. size: this.size,
  224. page: this.page,
  225. type: 1,
  226. ...this.baseParams
  227. // ...this.searchForm,
  228. // batchNum: this.baseParams.batchNum || this.searchForm.batchNum
  229. });
  230. if (res) {
  231. const list = this.$store.state.userPage.userList;
  232. this.vuexUser = list;
  233. this.tableData = res.list;
  234. this.total = res.count;
  235. }
  236. }
  237. }
  238. };
  239. </script>
  240. <style lang="scss" scoped>
  241. .inWarehouse {
  242. height: 100%;
  243. width: 100%;
  244. padding-top: 20px;
  245. box-sizing: border-box;
  246. display: flex;
  247. flex-direction: column;
  248. .table {
  249. flex: 1;
  250. display: flex;
  251. flex-direction: column;
  252. .el-table__body-wrapper {
  253. flex: 1;
  254. }
  255. }
  256. .pagination {
  257. flex: 0 0 50px;
  258. display: flex;
  259. align-items: center;
  260. }
  261. }
  262. </style>