OutWarehouse.vue 15 KB

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