InWarehouse.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563
  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. <ele-pro-table class="table_list" ref="table" height="calc(100vh - 300px)" :columns="columns"
  113. :datasource="datasource" :pageSize="20" row-key="id">
  114. <!-- 展开内容 -->
  115. <!-- <template v-slot:expand="{ row, $index }">
  116. <div
  117. style="width: 100%; min-height: 60px"
  118. v-if="row.materialDetailResponseList"
  119. >
  120. <ele-pro-table
  121. :toolbar="false"
  122. toolsTheme="none"
  123. ref="table2"
  124. :need-page="false"
  125. :datasource="row.materialDetailResponseList"
  126. :columns="columns2"
  127. :key="row.code + '-' + $index"
  128. >
  129. </ele-pro-table>
  130. </div>
  131. </template> -->
  132. <template v-slot:bizNo="{ row }">
  133. <el-link type="primary" @click="handleCellClick(row)">
  134. {{ row.bizNo }}
  135. </el-link>
  136. </template>
  137. </ele-pro-table>
  138. <!-- <el-table
  139. class="table"
  140. :data="tableData"
  141. @cell-click="handleCellClick"
  142. :header-cell-style="{ background: '#EEEEEE', border: 'none' }"
  143. :tree-props="{
  144. children: 'children'
  145. }"
  146. >
  147. <el-table-column width="80px" label="序号" type="index" />
  148. <el-table-column
  149. width="200"
  150. label="入库单号"
  151. prop="bizNo"
  152. ></el-table-column>
  153. <el-table-column label="入库场景" prop="bizType">
  154. <template slot-scope="{ row }">{{
  155. getSceneState(+row.bizType)
  156. }}</template>
  157. </el-table-column>
  158. <el-table-column label="物品名称" prop="categoryName"></el-table-column>
  159. <el-table-column
  160. label="计量数量"
  161. prop="measureQuantity"
  162. ></el-table-column>
  163. <el-table-column label="计量单位" prop="measureUnit"></el-table-column>
  164. <el-table-column
  165. label="包装数量"
  166. prop="packingQuantity"
  167. ></el-table-column>
  168. <el-table-column label="包装单位" prop="packingUnit"></el-table-column>
  169. <el-table-column label="重量" prop="weight"></el-table-column>
  170. <el-table-column label="重量单位" prop="weightUnit"></el-table-column>
  171. <el-table-column
  172. width="200"
  173. label="仓库"
  174. prop="warehouseName"
  175. ></el-table-column>
  176. <el-table-column label="操作人" prop="createUserId">
  177. <template slot-scope="{ row }">
  178. {{ handleDeta(row.createUserId) }}
  179. </template>
  180. </el-table-column>
  181. <el-table-column label="审核人" prop="verifyName"></el-table-column>
  182. <el-table-column
  183. width="150"
  184. label="入库时间"
  185. prop="createTime"
  186. ></el-table-column>
  187. </el-table>
  188. <Pagination
  189. class="pagination"
  190. :total="total"
  191. :page.sync="pageNum"
  192. :size.sync="size"
  193. @pagination="handlePageChange"
  194. />
  195. <InWarehouseDialog
  196. ref="detailRef"
  197. :assetCode="baseInfo.assetCode"
  198. :baseInfo="baseInfo"
  199. /> -->
  200. </div>
  201. </template>
  202. <script>
  203. import Pagination from '@/components/Pagination';
  204. // import { getInWarehouseDetail } from '@/api/stockManagement/stockLedger'
  205. import { sceneState } from '@/utils/dict/index';
  206. import InWarehouseDialog from './InWarehouseDialog';
  207. import { inventorybookPage } from '@/api/classifyManage/itemInformation';
  208. import { useDictLabel } from '@/utils/dict/index';
  209. // import ouint from '@/api/warehouseManagement/outin';
  210. import storageApi from '@/api/warehouseManagement/index.js';
  211. import {
  212. qualityStatus,
  213. } from '@/utils/dict/index';
  214. export default {
  215. components: { Pagination, InWarehouseDialog },
  216. props: {
  217. baseInfo: {
  218. type: Object,
  219. default: () => ({})
  220. },
  221. baseParams: {
  222. type: Object,
  223. default: () => ({})
  224. }
  225. },
  226. data() {
  227. return {
  228. qualityStatus,
  229. columns: [
  230. // {
  231. // width: 45,
  232. // type: 'expand',
  233. // columnKey: 'materialDetailResponseList',
  234. // align: 'center',
  235. // slot: 'expand',
  236. // className: ''
  237. // },
  238. {
  239. width: 55,
  240. type: 'index',
  241. label: '序号',
  242. align: 'center',
  243. },
  244. {
  245. slot: 'bizNo',
  246. prop: 'bizNo',
  247. label: '入库单号',
  248. showOverflowTooltip: true,
  249. align: 'center',
  250. minWidth: 200
  251. },
  252. {
  253. prop: 'name',
  254. label: '入库场景',
  255. showOverflowTooltip: true,
  256. align: 'center',
  257. minWidth: 110,
  258. formatter: (_row) => {
  259. return this.getSceneState(Number(_row.bizType));
  260. }
  261. },
  262. {
  263. prop: 'categoryName',
  264. label: '物品名称',
  265. showOverflowTooltip: true,
  266. align: 'center',
  267. minWidth: 110
  268. },
  269. {
  270. prop: 'balanceBatchQuantity',
  271. label: '批次期末',
  272. showOverflowTooltip: true,
  273. align: 'center',
  274. minWidth: 110
  275. },
  276. {
  277. prop: 'balanceQuantity',
  278. label: '物品期末',
  279. showOverflowTooltip: true,
  280. align: 'center',
  281. minWidth: 110
  282. },
  283. {
  284. prop: 'batchNo',
  285. label: '批次号',
  286. showOverflowTooltip: true,
  287. align: 'center',
  288. minWidth: 110
  289. },
  290. {
  291. align: 'center',
  292. prop: 'measureQuantity',
  293. label: '计量数量',
  294. showOverflowTooltip: true,
  295. minWidth: 110
  296. },
  297. {
  298. align: 'center',
  299. prop: 'measureUnit',
  300. label: '计量单位',
  301. showOverflowTooltip: true,
  302. minWidth: 110
  303. },
  304. {
  305. prop: 'packingQuantity',
  306. label: '包装数量',
  307. align: 'center',
  308. showOverflowTooltip: true,
  309. minWidth: 110
  310. },
  311. {
  312. prop: 'packingUnit',
  313. label: '包装单位',
  314. align: 'center',
  315. showOverflowTooltip: true,
  316. minWidth: 110
  317. },
  318. {
  319. prop: 'weight',
  320. label: '重量',
  321. align: 'center',
  322. showOverflowTooltip: true,
  323. minWidth: 110
  324. },
  325. {
  326. prop: 'weightUnit',
  327. label: '重量单位',
  328. align: 'center',
  329. showOverflowTooltip: true,
  330. minWidth: 110
  331. },
  332. {
  333. prop: 'qualityControl',
  334. label: '质检状态',
  335. align: 'center',
  336. showOverflowTooltip: true,
  337. minWidth: 110,
  338. formatter: (_row) => {
  339. return this.qualityStatus[+_row.qualityControl];
  340. }
  341. },
  342. {
  343. prop: 'warehouseName',
  344. label: '仓库',
  345. align: 'center',
  346. showOverflowTooltip: true,
  347. minWidth: 110
  348. },
  349. {
  350. prop: 'verifyName',
  351. label: '审核人',
  352. align: 'center',
  353. showOverflowTooltip: true,
  354. minWidth: 110
  355. },
  356. {
  357. prop: 'storageTime',
  358. label: '入库时间',
  359. align: 'center',
  360. showOverflowTooltip: true,
  361. minWidth: 110
  362. }
  363. ],
  364. // 表格列配置
  365. // columns2: [
  366. // {
  367. // prop: 'materialCode',
  368. // label: '物料编码',
  369. // showOverflowTooltip: true,
  370. // align: 'center',
  371. // minWidth: 110
  372. // },
  373. // {
  374. // prop: 'barcodes',
  375. // label: '发货条码',
  376. // showOverflowTooltip: true,
  377. // align: 'center',
  378. // minWidth: 110
  379. // },
  380. // // {
  381. // // prop: 'measureQuantity',
  382. // // label: '计量数量',
  383. // // showOverflowTooltip: true,
  384. // // align: 'center',
  385. // // minWidth: 110,
  386. // // formatter: (_row) => {
  387. // // return 1;
  388. // // }
  389. // // },
  390. // // {
  391. // // prop: 'measureUnit',
  392. // // label: '计量单位',
  393. // // showOverflowTooltip: true,
  394. // // align: 'center',
  395. // // minWidth: 110,
  396. // // },
  397. // {
  398. // prop: 'materielDesignation',
  399. // label: '物料代号',
  400. // showOverflowTooltip: true,
  401. // align: 'center',
  402. // minWidth: 110
  403. // },
  404. // {
  405. // prop: 'clientCode',
  406. // label: '客户代号',
  407. // showOverflowTooltip: true,
  408. // align: 'center',
  409. // minWidth: 110
  410. // },
  411. // {
  412. // prop: 'engrave',
  413. // label: '刻码',
  414. // showOverflowTooltip: true,
  415. // align: 'center',
  416. // minWidth: 110
  417. // },
  418. // {
  419. // prop: 'weight',
  420. // label: '重量',
  421. // showOverflowTooltip: true,
  422. // align: 'center',
  423. // minWidth: 100
  424. // },
  425. // {
  426. // prop: 'weightUnit',
  427. // label: '重量单位',
  428. // showOverflowTooltip: true,
  429. // align: 'center',
  430. // minWidth: 100
  431. // },
  432. // {
  433. // prop: 'result',
  434. // label: '质检结果',
  435. // align: 'center',
  436. // showOverflowTooltip: true,
  437. // formatter: (_row) => {
  438. // return this.qualityResults[_row.result];
  439. // }
  440. // },
  441. // {
  442. // prop: 'status',
  443. // label: '质检状态',
  444. // align: 'center',
  445. // showOverflowTooltip: true,
  446. // formatter: (_row) => {
  447. // return this.qualityStatus[_row.result];
  448. // }
  449. // }
  450. // ],
  451. qualityResults: {
  452. 1: '合格',
  453. 2: '不合格'
  454. }, // 质检结果 1合格 2不合格
  455. sceneState,
  456. sceneState: [],
  457. searchForm: {
  458. bizNum: '',
  459. warehouseEnd: '',
  460. warehouseStart: '',
  461. packetEnd: '',
  462. packetStart: ''
  463. },
  464. tableData: [],
  465. size: 10,
  466. pageNum: 1,
  467. total: 0,
  468. vuexUser: []
  469. };
  470. },
  471. created() {
  472. this.getList();
  473. },
  474. methods: {
  475. async datasource({ page, limit, where, order }) {
  476. console.log(page);
  477. console.log(limit);
  478. this.pageNum = page;
  479. this.size = limit;
  480. return await this.getList();
  481. },
  482. getSceneState: useDictLabel(sceneState),
  483. search() {
  484. this.pageNum = 1;
  485. this.getList();
  486. },
  487. reset() {
  488. this.searchForm = {};
  489. this.search();
  490. },
  491. handleCellClick(row) {
  492. console.log(row);
  493. this.$router.push({
  494. path: '/warehouseManagement/stockManagement/details',
  495. query: {
  496. id: row.outInId
  497. }
  498. });
  499. },
  500. handlePageChange(v) {
  501. this.pageNum = v.current;
  502. this.size = v.size;
  503. this.getList();
  504. },
  505. handleDeta(row) {
  506. for (const key in this.vuexUser) {
  507. if (this.vuexUser[key].id == row) {
  508. return this.vuexUser[key].name;
  509. }
  510. }
  511. },
  512. async getList() {
  513. const res = await storageApi.outInRecordsPage({
  514. categoryId: this.$route.query.id,
  515. size: this.size,
  516. pageNum: this.pageNum,
  517. bizType: 1,
  518. ...this.baseParams
  519. // ...this.searchForm,
  520. // batchNum: this.baseParams.batchNum || this.searchForm.batchNum
  521. });
  522. if (res) {
  523. const list = this.$store.state.userPage.userList;
  524. this.vuexUser = list;
  525. // this.tableData = res.list;
  526. this.total = res.count;
  527. return res;
  528. } else {
  529. return {};
  530. }
  531. }
  532. }
  533. };
  534. </script>
  535. <style lang="scss" scoped>
  536. .inWarehouse {
  537. height: 100%;
  538. width: 100%;
  539. padding-top: 20px;
  540. box-sizing: border-box;
  541. display: flex;
  542. flex-direction: column;
  543. :deep(.table) {
  544. flex: 1;
  545. display: flex;
  546. flex-direction: column;
  547. .el-table__body-wrapper {
  548. flex: 1;
  549. }
  550. }
  551. .pagination {
  552. flex: 0 0 50px;
  553. display: flex;
  554. align-items: center;
  555. }
  556. }
  557. </style>