details.vue 44 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450
  1. <template>
  2. <div class="ele-body">
  3. <el-card shadow="never">
  4. <div class="page-title">
  5. <PageHeader title="入库单详情"></PageHeader>
  6. </div>
  7. <div>
  8. <div class="stepsStatus">
  9. <el-steps :active="active" align-center>
  10. <el-step title="创建"></el-step>
  11. <el-step title="待审核"></el-step>
  12. <el-step :title="stepsTitle" :status="stepsStatus"></el-step>
  13. </el-steps>
  14. </div>
  15. <div class="content-detail">
  16. <header-title title="基本信息" size="16px"></header-title>
  17. <div class="mt20">
  18. <el-form label-width="120px">
  19. <el-col :span="8">
  20. <el-form-item label="入库单:">
  21. <span>{{ infoData.bizNo }}</span>
  22. </el-form-item>
  23. </el-col>
  24. <el-col :span="8">
  25. <el-form-item label="入库物品类型:">
  26. <span>{{ handleAssetType(extInfo.assetType) }}</span>
  27. </el-form-item>
  28. </el-col>
  29. <el-col :span="8">
  30. <el-form-item label="入库场景:">
  31. <span>{{ getSceneState(infoData.bizType) }}</span>
  32. </el-form-item>
  33. </el-col>
  34. <el-col :span="8">
  35. <el-form-item label="关联订单:">
  36. <span>{{ infoData.sourceBizNo }}</span>
  37. </el-form-item>
  38. </el-col>
  39. <el-col :span="8">
  40. <el-form-item label="权属部门:">
  41. <span>{{ extInfo.deptName }}</span>
  42. </el-form-item>
  43. </el-col>
  44. <el-col :span="8">
  45. <el-form-item label="入库登记人:">
  46. <span>{{ extInfo.createUserName }}</span>
  47. </el-form-item>
  48. </el-col>
  49. <el-col :span="8">
  50. <el-form-item label="入库时间:">
  51. <span>{{ infoData.storageTime }}</span>
  52. </el-form-item>
  53. </el-col>
  54. <el-col :span="8">
  55. <el-form-item label="状态:">
  56. <span>{{ stepsTitle }}</span>
  57. </el-form-item>
  58. </el-col>
  59. <el-col :span="8">
  60. <el-form-item label="审核人:">
  61. <span>{{ infoData.verifyName }}</span>
  62. </el-form-item>
  63. </el-col>
  64. <el-col :span="8">
  65. <el-form-item label="客户:">
  66. <span>{{ infoData.clientName }}</span>
  67. </el-form-item>
  68. </el-col>
  69. <el-col :span="8">
  70. <el-form-item label="供应商:">
  71. <span>{{ extInfo.supplierName }}</span>
  72. </el-form-item>
  73. </el-col>
  74. <!-- <el-col :span="8">
  75. <el-form-item label="送货人:">
  76. <span>{{ infoData.fromUser }}</span>
  77. </el-form-item>
  78. </el-col>
  79. <el-col :span="8">
  80. <el-form-item label="送货人联系方式:">
  81. <span>{{ extInfo.deliveryPhone }}</span>
  82. </el-form-item>
  83. </el-col> -->
  84. <el-col :span="8">
  85. <el-form-item label="附件:">
  86. <el-link
  87. type="primary"
  88. v-for="item in infoData.qualityFile"
  89. @click="download(item)"
  90. :key="item.name"
  91. >{{ item.name }}</el-link
  92. >
  93. </el-form-item>
  94. </el-col>
  95. <el-col :span="24">
  96. <el-form-item label="备注:">
  97. <span>{{ infoData.remark }}</span>
  98. </el-form-item>
  99. </el-col>
  100. </el-form>
  101. </div>
  102. </div>
  103. <div class="content-detail mt20">
  104. <header-title title="产品信息" size="16px"> </header-title>
  105. <el-table
  106. ref="productListTable"
  107. :data="productList"
  108. tooltip-effect="dark"
  109. border
  110. :max-height="300"
  111. :header-cell-style="rowClass"
  112. >
  113. <el-table-column label="序号" type="index" width="50">
  114. </el-table-column>
  115. <el-table-column
  116. label="编码"
  117. prop="categoryCode"
  118. align="center"
  119. :show-overflow-tooltip="true"
  120. ></el-table-column>
  121. <el-table-column
  122. label="名称"
  123. align="center"
  124. prop="categoryName"
  125. :show-overflow-tooltip="true"
  126. ></el-table-column>
  127. <el-table-column
  128. label="二维码"
  129. width="120"
  130. :show-overflow-tooltip="true"
  131. v-if="$route.query.verifyStatus === '2'"
  132. >
  133. <template slot-scope="{ row }">
  134. <el-link type="primary" @click="openQRCode(row, 2)">
  135. 查看
  136. </el-link>
  137. </template>
  138. </el-table-column>
  139. <el-table-column
  140. v-if="clientEnvironmentId == 4"
  141. label="级别"
  142. prop="level"
  143. align="center"
  144. >
  145. </el-table-column>
  146. <el-table-column
  147. label="型号"
  148. align="center"
  149. prop="categoryModel"
  150. :show-overflow-tooltip="true"
  151. ></el-table-column>
  152. <el-table-column
  153. label="规格"
  154. align="center"
  155. prop="specification"
  156. :show-overflow-tooltip="true"
  157. ></el-table-column>
  158. <el-table-column
  159. label="牌号"
  160. align="center"
  161. prop="brandNum"
  162. :show-overflow-tooltip="true"
  163. ></el-table-column>
  164. <el-table-column
  165. v-for="(item, index) in newColumns"
  166. :label="item.label"
  167. :align="item.align"
  168. :prop="item.prop"
  169. :show-overflow-tooltip="item.showOverflowTooltip"
  170. ></el-table-column>
  171. <el-table-column
  172. label="库存状态"
  173. align="center"
  174. prop="qualityControl"
  175. :show-overflow-tooltip="true"
  176. v-if="this.stepsStatus == 'success'"
  177. >
  178. <template slot-scope="{ row }">
  179. {{ row.qualityControl == 1 ? '预入库' : '已入库' }}
  180. </template>
  181. </el-table-column>
  182. <el-table-column
  183. label="批次号"
  184. prop="batchNo"
  185. align="center"
  186. :show-overflow-tooltip="true"
  187. >
  188. </el-table-column>
  189. <el-table-column label="数量" prop="packingQuantity" align="center">
  190. <template slot-scope="{ row, $index }">
  191. {{ row.packingQuantity }}
  192. </template>
  193. </el-table-column>
  194. <el-table-column
  195. label="单位"
  196. align="center"
  197. width="120"
  198. prop="packingUnit"
  199. >
  200. </el-table-column>
  201. <el-table-column
  202. label="计量数量"
  203. prop="measureQuantity"
  204. width="100"
  205. align="center"
  206. >
  207. </el-table-column>
  208. <el-table-column label="计量单位" prop="measureUnit" align="center">
  209. </el-table-column>
  210. <el-table-column
  211. label="单重"
  212. prop="singleWeight"
  213. align="center"
  214. :show-overflow-tooltip="true"
  215. >
  216. </el-table-column>
  217. <el-table-column
  218. label="总重"
  219. prop="weight"
  220. align="center"
  221. :show-overflow-tooltip="true"
  222. >
  223. </el-table-column>
  224. <el-table-column
  225. label="重量单位"
  226. prop="weightUnit"
  227. align="center"
  228. :show-overflow-tooltip="true"
  229. >
  230. </el-table-column>
  231. <el-table-column
  232. label="单价"
  233. prop="unitPrice"
  234. align="center"
  235. v-if="isPrice == 1"
  236. >
  237. <template slot-scope="{ row }">
  238. <template>
  239. {{ row.unitPrice ? row.unitPrice + '/元' : '' }}
  240. </template>
  241. </template>
  242. </el-table-column>
  243. <el-table-column
  244. label="金额"
  245. align="center"
  246. prop="contentImage"
  247. v-if="isPrice == 1"
  248. :show-overflow-tooltip="true"
  249. >
  250. <template slot-scope="{ row, $index }">
  251. {{ row.totalMoney ? row.totalMoney : 0 }}
  252. </template>
  253. </el-table-column>
  254. <el-table-column
  255. v-if="clientEnvironmentId == 4"
  256. label="采购原因"
  257. align="center"
  258. prop="purpose"
  259. :show-overflow-tooltip="true"
  260. ></el-table-column>
  261. <el-table-column
  262. label="供应商"
  263. prop="supplierName"
  264. :show-overflow-tooltip="true"
  265. width="120"
  266. >
  267. </el-table-column>
  268. <el-table-column
  269. width="120"
  270. label="供应商代号"
  271. prop="supplierCode"
  272. :show-overflow-tooltip="true"
  273. >
  274. </el-table-column>
  275. <el-table-column
  276. label="产地"
  277. align="center"
  278. prop="provenance"
  279. :show-overflow-tooltip="true"
  280. width="120"
  281. >
  282. <template slot-scope="{ row, $index }">
  283. {{
  284. row.provenance &&
  285. row.provenance
  286. .map((item) => getDictValue('产地', item))
  287. .join(',')
  288. }}
  289. </template>
  290. </el-table-column>
  291. <el-table-column label="机型" prop="modelKey" width="200">
  292. </el-table-column>
  293. <el-table-column label="颜色" prop="colorKey" width="200">
  294. </el-table-column>
  295. <el-table-column
  296. label="仓库"
  297. prop="warehouseName"
  298. :show-overflow-tooltip="true"
  299. >
  300. </el-table-column>
  301. <el-table-column
  302. label="生产日期"
  303. prop="detailProductionDate"
  304. :show-overflow-tooltip="true"
  305. >
  306. </el-table-column>
  307. <el-table-column
  308. label="采购日期"
  309. prop="detailPurchaseDate"
  310. :show-overflow-tooltip="true"
  311. >
  312. </el-table-column>
  313. <el-table-column
  314. label="失效日期"
  315. prop="detailExpireDate"
  316. :show-overflow-tooltip="true"
  317. >
  318. </el-table-column>
  319. <el-table-column
  320. v-if="infoData.verifyStatus == 2"
  321. label="操作"
  322. width="200"
  323. fixed="right"
  324. align="center"
  325. >
  326. <template slot-scope="{ row, $index }">
  327. <el-button
  328. v-if="isUpper(row)"
  329. type="text"
  330. @click="shelvesWarehouse(row, $index, '产品')"
  331. >下架</el-button
  332. >
  333. <el-button
  334. v-else
  335. type="text"
  336. @click="handleWareHouse(row, $index, '产品')"
  337. >上架</el-button
  338. >
  339. </template>
  340. </el-table-column>
  341. </el-table>
  342. </div>
  343. <div class="mt20">
  344. <!-- {{ this.packingList }} -->
  345. <header-title :title="`包装明细`" size="16px">
  346. <el-button
  347. v-for="item in mergeOptions"
  348. size="mini"
  349. type="primary"
  350. @click="openMergeDialog(item)"
  351. >合并成{{ item.conversionUnit }}</el-button
  352. >
  353. <el-button
  354. v-for="item in splitOptions"
  355. size="mini"
  356. type="primary"
  357. @click="openSplitDialog(item)"
  358. >拆分到{{ item.packageUnit }}</el-button
  359. >
  360. </header-title>
  361. <el-table
  362. ref="showPackingListTable"
  363. :data="packingList"
  364. tooltip-effect="dark"
  365. :max-height="300"
  366. border
  367. :row-class-name="tableRowClassName"
  368. :header-cell-style="rowClass"
  369. @selection-change="productSplit"
  370. >
  371. <el-table-column
  372. v-if="infoData.verifyStatus == 2"
  373. key="selection"
  374. label="选择"
  375. type="selection"
  376. width="55"
  377. align="center"
  378. fixed="left"
  379. >
  380. </el-table-column>
  381. <el-table-column label="序号" type="index" width="50">
  382. </el-table-column>
  383. <el-table-column
  384. label="批次号"
  385. prop="batchNo"
  386. width="80"
  387. :show-overflow-tooltip="true"
  388. ></el-table-column>
  389. <el-table-column
  390. label="包装编码"
  391. prop="packageNo"
  392. width="130"
  393. :show-overflow-tooltip="true"
  394. ></el-table-column>
  395. <el-table-column
  396. label="名称"
  397. prop="categoryName"
  398. width="120"
  399. :show-overflow-tooltip="true"
  400. ></el-table-column>
  401. <el-table-column
  402. label="编码"
  403. prop="categoryCode"
  404. width="120"
  405. :show-overflow-tooltip="true"
  406. ></el-table-column>
  407. <el-table-column
  408. label="二维码"
  409. width="120"
  410. :show-overflow-tooltip="true"
  411. v-if="$route.query.verifyStatus === '2'"
  412. >
  413. <template slot-scope="{ row }">
  414. <el-link type="primary" @click="openQRCode(row, 3)">
  415. 查看
  416. </el-link>
  417. </template>
  418. </el-table-column>
  419. <el-table-column
  420. label="型号"
  421. prop="categoryModel"
  422. width="80"
  423. :show-overflow-tooltip="true"
  424. ></el-table-column>
  425. <el-table-column
  426. label="规格"
  427. prop="specification"
  428. width="80"
  429. :show-overflow-tooltip="true"
  430. ></el-table-column>
  431. <el-table-column
  432. label="牌号"
  433. prop="brandNum"
  434. width="80"
  435. :show-overflow-tooltip="true"
  436. ></el-table-column>
  437. <el-table-column
  438. label="发货条码"
  439. prop="barcodes"
  440. :show-overflow-tooltip="true"
  441. ></el-table-column>
  442. <el-table-column
  443. label="包装数量"
  444. prop="packingQuantity"
  445. :show-overflow-tooltip="true"
  446. ></el-table-column>
  447. <el-table-column
  448. label="包装单位"
  449. prop="packingUnit"
  450. :show-overflow-tooltip="true"
  451. ></el-table-column>
  452. <el-table-column
  453. label="计量数量"
  454. prop="measureQuantity"
  455. :show-overflow-tooltip="true"
  456. ></el-table-column>
  457. <el-table-column
  458. label="计量单位"
  459. prop="measureUnit"
  460. :show-overflow-tooltip="true"
  461. ></el-table-column>
  462. <el-table-column
  463. label="物料代号"
  464. prop="materielDesignation"
  465. :show-overflow-tooltip="true"
  466. >
  467. </el-table-column>
  468. <el-table-column
  469. label="刻码"
  470. prop="engrave"
  471. :show-overflow-tooltip="true"
  472. >
  473. </el-table-column>
  474. <el-table-column
  475. label="客户代号"
  476. prop="clientCode"
  477. :show-overflow-tooltip="true"
  478. >
  479. </el-table-column>
  480. <el-table-column
  481. label="供应商"
  482. prop="supplierName"
  483. :show-overflow-tooltip="true"
  484. width="120"
  485. >
  486. </el-table-column>
  487. <el-table-column
  488. label="供应商代号"
  489. prop="supplierCode"
  490. :show-overflow-tooltip="true"
  491. width="120"
  492. >
  493. </el-table-column>
  494. <el-table-column
  495. label="总重"
  496. prop="weight"
  497. :show-overflow-tooltip="true"
  498. >
  499. </el-table-column>
  500. <el-table-column
  501. label="重量单位"
  502. prop="weightUnit"
  503. :show-overflow-tooltip="true"
  504. >
  505. </el-table-column>
  506. <el-table-column label="机型" prop="modelKey" width="200">
  507. </el-table-column>
  508. <el-table-column label="颜色" prop="colorKey" width="200">
  509. </el-table-column>
  510. <el-table-column
  511. label="质检结果"
  512. prop="result"
  513. :show-overflow-tooltip="true"
  514. >
  515. <template slot-scope="{ row }">
  516. <span>{{ qualityResults[row.result] }}</span>
  517. </template>
  518. </el-table-column>
  519. <el-table-column
  520. label="质检状态"
  521. prop="status"
  522. :show-overflow-tooltip="true"
  523. >
  524. <template slot-scope="{ row }">
  525. <span>{{ qualityStatus[row.status] }}</span>
  526. </template>
  527. </el-table-column>
  528. <el-table-column
  529. label="仓库"
  530. prop="warehouseName"
  531. :show-overflow-tooltip="true"
  532. >
  533. </el-table-column>
  534. <el-table-column
  535. label="货区"
  536. prop="areaName"
  537. :show-overflow-tooltip="true"
  538. >
  539. </el-table-column>
  540. <el-table-column
  541. label="货架"
  542. prop="goodsShelfName"
  543. :show-overflow-tooltip="true"
  544. >
  545. </el-table-column>
  546. <el-table-column
  547. label="货位"
  548. prop="goodsAllocationName"
  549. :show-overflow-tooltip="true"
  550. >
  551. </el-table-column>
  552. <el-table-column
  553. label="生产日期"
  554. prop="productionDate"
  555. :show-overflow-tooltip="true"
  556. >
  557. </el-table-column>
  558. <el-table-column
  559. label="采购日期"
  560. prop="purchaseDate"
  561. :show-overflow-tooltip="true"
  562. >
  563. </el-table-column>
  564. <el-table-column
  565. label="失效日期"
  566. prop="expireDate"
  567. :show-overflow-tooltip="true"
  568. >
  569. </el-table-column>
  570. <el-table-column
  571. v-if="infoData.verifyStatus == 2"
  572. label="操作"
  573. width="200"
  574. fixed="right"
  575. align="center"
  576. >
  577. <template slot-scope="{ row, $index }">
  578. <el-button
  579. v-if="row.areaId != null"
  580. type="text"
  581. @click="shelvesWarehouse(row, $index, '包装')"
  582. >下架</el-button
  583. >
  584. <el-button
  585. v-else
  586. type="text"
  587. @click="handleWareHouse(row, $index, '包装')"
  588. >上架</el-button
  589. >
  590. {{ row.areaId }}
  591. </template>
  592. </el-table-column>
  593. </el-table>
  594. <el-pagination
  595. background
  596. layout="total, sizes, prev, pager, next, jumper"
  597. :total="total"
  598. :page-sizes="[5, 10, 20, 30]"
  599. :page-size.sync="pages.size"
  600. :current-page.sync="pages.pageNum"
  601. @current-change="handleCurrentChange"
  602. @size-change="handleSizeChange"
  603. >
  604. </el-pagination>
  605. </div>
  606. </div>
  607. </el-card>
  608. <WareHouseDailog
  609. ref="wareHouseDailogRef"
  610. @houseData="houseData"
  611. ></WareHouseDailog>
  612. <mergeDetails
  613. ref="mergeDetailsRef"
  614. @refresh="getPackingList"
  615. ></mergeDetails>
  616. <splitDetails ref="splitDetailsRef"></splitDetails>
  617. <printQRCode
  618. ref="printQRCodeRef"
  619. :assetType="extInfo.assetType"
  620. ></printQRCode>
  621. </div>
  622. </template>
  623. <script>
  624. import mergeDetails from './mergeDetails.vue';
  625. import splitDetails from './splitDetails.vue';
  626. import WareHouseDailog from '../components/warehouseShelvesDialog.vue';
  627. import elTableInfiniteScroll from 'el-table-infinite-scroll';
  628. import { getFile } from '@/api/system/file/index.js';
  629. import PageHeader from '@/components/PageHeader';
  630. import storageApi from '@/api/warehouseManagement';
  631. import { getCode } from '@/api/codeManagement/index.js';
  632. import { allCategoryLevel } from '@/api/classifyManage';
  633. import {
  634. useDictLabel,
  635. sceneState,
  636. qualityStatus,
  637. qualityResults
  638. } from '@/utils/dict/index';
  639. import { mapGetters, mapActions } from 'vuex';
  640. import { parameterGetByCode } from '@/api/sys/index.js';
  641. import printQRCode from './components/printQRCode.vue';
  642. export default {
  643. components: {
  644. PageHeader,
  645. WareHouseDailog,
  646. mergeDetails,
  647. splitDetails,
  648. printQRCode
  649. },
  650. directives: {
  651. 'el-table-infinite-scroll': elTableInfiniteScroll
  652. },
  653. data() {
  654. return {
  655. total: 0,
  656. pages: { pageNum: 1, size: 10 },
  657. oldSelectionList: [],
  658. selectionList: [],
  659. mergeOptions: [],
  660. splitOptions: [],
  661. currentId: '',
  662. newColumns: [], // 动态表头
  663. qualityStatus,
  664. qualityResults,
  665. // qualityStatus: {
  666. // 0: '未质检',
  667. // 1: '已质检'
  668. // }, // 质检状态 0未检 1已检
  669. // qualityResults: {
  670. // 1: '合格',
  671. // 2: '不合格'
  672. // }, // 质检结果 1合格 2不合格
  673. productList: [], // 产品列表
  674. showPackingList: [], // 展示的包装列表
  675. packingList: [], // 包装列表
  676. showMaterialList: [], // 展示物料列表
  677. materialList: [], // 物料列表
  678. extInfo: {}, // 扩展信息
  679. pageSize: 20,
  680. pickingPageNum: 1,
  681. materielPageNum: 1,
  682. codeList: [],
  683. infoData: {},
  684. stepsTitle: '已完成',
  685. stepsStatus: 'success',
  686. active: 0,
  687. verifyStatus: '',
  688. rowData: {},
  689. isPrice: 1
  690. };
  691. },
  692. watch: {
  693. 'infoData.verifyStatus': {
  694. immediate: true,
  695. handler(val) {
  696. if (val == 0) {
  697. this.active = 1;
  698. this.stepsTitle = '未审核';
  699. this.stepsStatus = 'wait';
  700. } else if (val == 1) {
  701. this.active = 2;
  702. this.stepsTitle = '审核中';
  703. this.stepsStatus = 'process';
  704. } else if (val == 2) {
  705. this.active = 2;
  706. this.stepsTitle = '审核通过';
  707. this.stepsStatus = 'success';
  708. } else if (val == 3) {
  709. this.active = 2;
  710. this.stepsTitle = '驳回';
  711. this.stepsStatus = 'error';
  712. }
  713. }
  714. },
  715. packingList: {
  716. handler(newVal) {
  717. console.log('包装列表', newVal);
  718. console.log('当前包装列表加载页数', this.pickingPageNum);
  719. this.showPackingList = newVal.slice(
  720. 0,
  721. this.pageSize * (this.pickingPageNum > 0 ? this.pickingPageNum : 1)
  722. );
  723. },
  724. deep: true
  725. },
  726. materialList: {
  727. handler(newVal) {
  728. console.log('物料列表', newVal);
  729. console.log('当前物料列表加载页数', this.materielPageNum);
  730. this.showMaterialList = newVal.slice(
  731. 0,
  732. this.pageSize *
  733. (this.materielPageNum > 0 ? this.materielPageNum : 1)
  734. );
  735. },
  736. deep: true
  737. }
  738. },
  739. computed: {
  740. ...mapGetters(['getDictValue']),
  741. clientEnvironmentId() {
  742. return this.$store.state.user.info.clientEnvironmentId;
  743. }
  744. },
  745. created() {
  746. this.getFieldModel();
  747. this.requestDict('类型用途');
  748. this.requestDict('不拆物料层规格');
  749. this.requestDict('产地');
  750. //仓库出入库是否显示金额(0:不显示 1:显示)
  751. parameterGetByCode({
  752. code: 'wms_price'
  753. }).then((res) => {
  754. this.isPrice = res.value;
  755. });
  756. this.getAllCategoryType();
  757. this._getInfo();
  758. this.verifyStatus = this.$route.query.verifyStatus;
  759. },
  760. methods: {
  761. openMergeDialog(dimensionRow) {
  762. this.$refs.mergeDetailsRef.open(dimensionRow, this.selectionList);
  763. },
  764. openSplitDialog(dimensionRow) {
  765. this.$refs.splitDetailsRef.open(dimensionRow, this.selectionList);
  766. },
  767. productSplit(selectionList) {
  768. console.log(selectionList);
  769. let isUnification = selectionList.every(
  770. (item) =>
  771. item.packingUnit == selectionList[0].packingUnit &&
  772. item.categoryId == selectionList[0].categoryId
  773. );
  774. if (isUnification) {
  775. if (selectionList.length > 0) {
  776. this.selectionList = selectionList;
  777. this.oldSelectionList = selectionList;
  778. if (this.mergeOptions.length == 0) {
  779. storageApi
  780. .getCategoryPackageDisposition({
  781. categoryIds: [this.selectionList[0].categoryId]
  782. })
  783. .then((data) => {
  784. console.log(data);
  785. console.log(this.selectionList[0]);
  786. // 形成合并按钮
  787. let mergeIndex = data.findIndex(
  788. (item) =>
  789. item.packageUnit == this.selectionList[0].packingUnit &&
  790. item.packageUnit != item.conversionUnit
  791. );
  792. console.log(mergeIndex);
  793. this.mergeOptions = data.filter(
  794. (item) => item.sort == data[mergeIndex].sort
  795. );
  796. // 形成拆分按钮
  797. let splitIndex = data.findIndex(
  798. (item) =>
  799. item.conversionUnit ==
  800. this.selectionList[0].packingUnit &&
  801. item.packageUnit != item.conversionUnit
  802. );
  803. this.splitOptions = data.filter(
  804. (item) => item.sort == data[splitIndex].sort
  805. );
  806. });
  807. }
  808. } else {
  809. this.mergeOptions = [];
  810. this.splitOptions = [];
  811. }
  812. } else {
  813. this.$message.error('请选择相同物品和包装装单位');
  814. this.$refs.showPackingListTable.clearSelection();
  815. }
  816. console.log(isUnification);
  817. },
  818. // 获取动态表头
  819. getFieldModel() {
  820. storageApi.fieldModel({ fieldModel: 't_main_category' }).then((res) => {
  821. let newRes = res.map((m) => {
  822. return {
  823. prop: 'extField.' + m.prop,
  824. label: m.label,
  825. align: 'center',
  826. showOverflowTooltip: true
  827. };
  828. });
  829. this.newColumns = [...newRes];
  830. });
  831. },
  832. isUpper(row) {
  833. if (
  834. !row.outInDetailRecordRequestList ||
  835. row.outInDetailRecordRequestList.length === 0
  836. ) {
  837. return false;
  838. }
  839. return row.outInDetailRecordRequestList.some(
  840. (item) => item.areaId && item.goodsShelfId && item.goodsAllocationId
  841. );
  842. },
  843. formDataData() {
  844. // 处理包装数据
  845. this.packingList = this.packingList.map((packingItem) => {
  846. return {
  847. ...packingItem,
  848. materialDetailList: this.materialList.filter(
  849. (item) => item.parentIndex === packingItem.index
  850. )
  851. };
  852. });
  853. // 处理产品数据
  854. this.productList = this.productList.map((productItem) => {
  855. return {
  856. ...productItem,
  857. outInDetailRecordRequestList: this.packingList.filter(
  858. (item) => item.parentIndex === productItem.index
  859. )
  860. };
  861. });
  862. this.infoData.outInDetailList = this.productList;
  863. },
  864. houseData(argum, idx, type) {
  865. console.log('-argum-------------------', argum);
  866. switch (type) {
  867. case '产品':
  868. this.packingList.forEach((item) => {
  869. console.log(item, 'item');
  870. console.log(this.productList[idx], 'index');
  871. if (
  872. item.batchNo === this.productList[idx].batchNo &&
  873. item.categoryId === this.productList[idx].categoryId &&
  874. item.categoryName === this.productList[idx].categoryName
  875. ) {
  876. this.$set(item, 'areaId', argum[0].areaId);
  877. this.$set(item, 'areaName', argum[0].areaName);
  878. this.$set(item, 'goodsShelfId', argum[0].shelfId);
  879. this.$set(item, 'goodsShelfName', argum[0].shelfCode);
  880. this.$set(item, 'goodsAllocationId', argum[0].cargoSpaceId);
  881. this.$set(item, 'goodsAllocationName', argum[0].cargoSpaceCode);
  882. }
  883. });
  884. break;
  885. case '包装':
  886. this.$set(this.packingList[idx], 'areaId', argum[0].areaId);
  887. this.$set(this.packingList[idx], 'areaName', argum[0].areaName);
  888. this.$set(this.packingList[idx], 'goodsShelfId', argum[0].shelfId);
  889. this.$set(
  890. this.packingList[idx],
  891. 'goodsShelfName',
  892. argum[0].shelfCode
  893. );
  894. this.$set(
  895. this.packingList[idx],
  896. 'goodsAllocationId',
  897. argum[0].cargoSpaceId
  898. );
  899. this.$set(
  900. this.packingList[idx],
  901. 'goodsAllocationName',
  902. argum[0].cargoSpaceCode
  903. );
  904. break;
  905. }
  906. const data2 = this.packingList.filter((item) => item.areaId);
  907. this.formDataData();
  908. for (let i = 0; i < this.infoData.outInDetailList.length; i++) {
  909. const batchNo = this.infoData.outInDetailList[i].batchNo;
  910. const categoryId = this.infoData.outInDetailList[i].categoryId;
  911. const categoryName = this.infoData.outInDetailList[i].categoryName;
  912. if (
  913. this.rowData.batchNo == batchNo &&
  914. this.rowData.categoryId == categoryId &&
  915. this.rowData.categoryName == categoryName
  916. ) {
  917. this.infoData.outInDetailList[i].outInDetailRecordRequestList =
  918. data2;
  919. }
  920. }
  921. storageApi
  922. .upperLowerShelves(this.infoData)
  923. .then((data) => {
  924. console.log(data);
  925. this._getInfo();
  926. this.$message.success('上架成功');
  927. })
  928. .catch(() => {
  929. this.$message.error('上架失败');
  930. });
  931. },
  932. handleWareHouse(row, idx, type) {
  933. console.log(row, 'kkkkk');
  934. this.rowData = row;
  935. this.$refs.wareHouseDailogRef.open(row, idx, type);
  936. },
  937. shelvesWarehouse(row, idx, type) {
  938. if (type == '产品') {
  939. for (let i = 0; i < this.infoData.outInDetailList.length; i++) {
  940. const batchNo = this.infoData.outInDetailList[i].batchNo;
  941. const categoryId = this.infoData.outInDetailList[i].categoryId;
  942. const categoryName = this.infoData.outInDetailList[i].categoryName;
  943. if (
  944. row.batchNo == batchNo &&
  945. row.categoryId == categoryId &&
  946. row.categoryName == categoryName
  947. ) {
  948. let data12 = row.outInDetailRecordRequestList.map((item) => ({
  949. ...item,
  950. areaId: '',
  951. areaName: '',
  952. goodsShelfId: '',
  953. goodsShelfName: '',
  954. goodsAllocationId: '',
  955. goodsAllocationName: ''
  956. }));
  957. this.$set(
  958. this.infoData.outInDetailList[i],
  959. 'outInDetailRecordRequestList',
  960. data12
  961. );
  962. }
  963. }
  964. } else {
  965. for (let i = 0; i < this.infoData.outInDetailList.length; i++) {
  966. const batchNo = this.infoData.outInDetailList[i].batchNo;
  967. const categoryId = this.infoData.outInDetailList[i].categoryId;
  968. const categoryName = this.infoData.outInDetailList[i].categoryName;
  969. if (
  970. this.packingList[idx].batchNo == batchNo &&
  971. this.packingList[idx].categoryId == categoryId &&
  972. this.packingList[idx].categoryName == categoryName
  973. ) {
  974. let dataList = this.infoData.outInDetailList[
  975. i
  976. ].outInDetailRecordRequestList.filter((item) => item.areaId);
  977. for (let j = 0; j < dataList.length; j++) {
  978. const idd = dataList[j].id;
  979. if (this.packingList[idx].id == idd) {
  980. this.$set(dataList[j], 'areaId', '');
  981. this.$set(dataList[j], 'areaName', '');
  982. this.$set(dataList[j], 'goodsShelfId', '');
  983. this.$set(dataList[j], 'goodsShelfName', '');
  984. this.$set(dataList[j], 'goodsAllocationId', '');
  985. this.$set(dataList[j], 'goodsAllocationName', '');
  986. }
  987. }
  988. }
  989. console.log(this.packingList[idx].id, 'this.packingList[idx].id');
  990. }
  991. }
  992. // this.formDataData();
  993. storageApi
  994. .upperLowerShelves(this.infoData)
  995. .then((data) => {
  996. console.log(data);
  997. this._getInfo();
  998. this.$message.success('下架成功');
  999. })
  1000. .catch(() => {
  1001. this.$message.error('下架失败');
  1002. });
  1003. },
  1004. pickingHandleScroll() {
  1005. console.log('---------pickingHandleScroll------------');
  1006. if (this.showPackingList.length < this.packingList.length) {
  1007. if (this.packingList.length > this.pageSize) {
  1008. this.pickingPageNum += 1;
  1009. }
  1010. this.pickingFetchData();
  1011. }
  1012. },
  1013. pickingFetchData() {
  1014. const start = (this.pickingPageNum - 1) * this.pageSize;
  1015. const end = start + this.pageSize;
  1016. this.showPackingList = this.showPackingList.concat(
  1017. this.packingList.slice(start, end)
  1018. );
  1019. },
  1020. materielHandleScroll() {
  1021. console.log('---------materielHandleScroll------------');
  1022. if (this.showMaterialList.length < this.materialList.length) {
  1023. if (this.materialList.length > this.pageSize) {
  1024. this.materielPageNum += 1;
  1025. }
  1026. this.materielFetchData();
  1027. }
  1028. },
  1029. materielFetchData() {
  1030. const start = (this.materielPageNum - 1) * this.pageSize;
  1031. const end = start + this.pageSize;
  1032. this.showMaterialList = this.showMaterialList.concat(
  1033. this.materialList.slice(start, end)
  1034. );
  1035. console.log(this.showMaterialList);
  1036. },
  1037. ...mapActions('dict', ['requestDict']),
  1038. getSceneState: useDictLabel(sceneState),
  1039. handleAssetType(r) {
  1040. let arr = r?.split(',');
  1041. const filteredData = this.codeList.filter((item) =>
  1042. arr?.includes(item.dictCode)
  1043. );
  1044. return filteredData.map((item) => item.dictValue).join(',');
  1045. },
  1046. tableRowClassName({ row, rowIndex }) {
  1047. if (row.result == 2) {
  1048. return 'warning-row';
  1049. } else {
  1050. return '';
  1051. }
  1052. },
  1053. goBack() {
  1054. this.$router.go(-1);
  1055. },
  1056. rowClass({ row, column, rowIndex, columnIndex }) {
  1057. if (rowIndex === 1) {
  1058. return {
  1059. display: 'none',
  1060. background: '#EEEEEE'
  1061. };
  1062. }
  1063. return { background: '#0000' };
  1064. },
  1065. async getAllCategoryType() {
  1066. const { data } = await allCategoryLevel();
  1067. this.codeList = data.map((item) => {
  1068. return { dictCode: item.id, dictValue: item.name };
  1069. });
  1070. },
  1071. getDeptName() {
  1072. if (this.extInfo.createUserId) {
  1073. storageApi.getGroupById(this.extInfo.createUserId).then((res) => {
  1074. this.extInfo.deptName = res?.groupName;
  1075. });
  1076. }
  1077. },
  1078. async _getInfo() {
  1079. const res = await storageApi.getInboundDetailsById(
  1080. this.$route.query.id
  1081. );
  1082. console.log('==============================res', res);
  1083. this.infoData = res;
  1084. this.extInfo = res.extInfo;
  1085. //根据createUserId查部门
  1086. this.getDeptName();
  1087. this.productList = res.outInDetailList.map(
  1088. (productItem, productIndex) => {
  1089. return {
  1090. ...productItem,
  1091. index: this.productList.length + productIndex,
  1092. outInDetailRecordRequestList:
  1093. productItem.outInDetailRecordRequestList.map(
  1094. (packingItem, packingIndex) => {
  1095. return {
  1096. ...packingItem,
  1097. index:
  1098. this.productList.length +
  1099. productIndex +
  1100. '-' +
  1101. packingIndex, // 包装索引
  1102. parentIndex: this.productList.length + productIndex, // 物品索引
  1103. categoryName: productItem.categoryName,
  1104. categoryCode: productItem.categoryCode,
  1105. materialDetailList: packingItem.materialDetailList.map(
  1106. (materialItem, materialIndex) => {
  1107. return {
  1108. ...materialItem,
  1109. index:
  1110. this.productList.length +
  1111. productIndex +
  1112. '-' +
  1113. packingIndex +
  1114. '——' +
  1115. materialIndex, // 包装索引
  1116. parentIndex:
  1117. this.productList.length +
  1118. productIndex +
  1119. '-' +
  1120. packingIndex, // 物品索引
  1121. categoryName: productItem.categoryName,
  1122. categoryCode: productItem.categoryCode
  1123. };
  1124. }
  1125. )
  1126. };
  1127. }
  1128. )
  1129. };
  1130. }
  1131. );
  1132. this.getPackingList();
  1133. // // 获取包装维度数据
  1134. // const arr = [];
  1135. // for (const key in this.productList) {
  1136. // for (const k in this.productList[key].outInDetailRecordRequestList) {
  1137. // arr.push({
  1138. // ...this.productList[key].outInDetailRecordRequestList[k]
  1139. // });
  1140. // }
  1141. // }
  1142. // this.packingList = arr;
  1143. // // 获取物料维度数据
  1144. // let iArr = [];
  1145. // arr.forEach((item) => {
  1146. // item.materialDetailList.forEach((ele) => {
  1147. // iArr.push({ ...ele });
  1148. // });
  1149. // });
  1150. // this.materialList = iArr;
  1151. // console.log(this.packingList);
  1152. // console.log(this.materialList);
  1153. // this.pickingFetchData();
  1154. // this.materielFetchData();
  1155. },
  1156. download(row) {
  1157. if (row.storePath) {
  1158. getFile({ objectName: row.storePath }, row.name);
  1159. }
  1160. },
  1161. handleCurrentChange(e) {
  1162. this.getPackingList();
  1163. },
  1164. handleSizeChange(e) {
  1165. this.pages.pageNum = 1;
  1166. this.getPackingList();
  1167. },
  1168. getPackingList() {
  1169. storageApi
  1170. .getOutInRecordsPage({
  1171. ...this.pages,
  1172. outInId: this.$route.query.id
  1173. })
  1174. .then((data) => {
  1175. this.total = data.count;
  1176. console.log(data.list, 'data.list');
  1177. this.packingList = data.list;
  1178. });
  1179. },
  1180. /**
  1181. *
  1182. *
  1183. * 以下二维码功能
  1184. */
  1185. openQRCode(row, type) {
  1186. this.$refs.printQRCodeRef.open(row, type);
  1187. }
  1188. }
  1189. };
  1190. </script>
  1191. <style lang="scss" scoped>
  1192. ::v-deep .warning-row {
  1193. color: red;
  1194. }
  1195. ::v-deep .page-title {
  1196. border-bottom: none;
  1197. }
  1198. ::v-deep .page-title-div {
  1199. width: 100%;
  1200. }
  1201. .stepsStatus {
  1202. width: 40%;
  1203. margin: 0 auto;
  1204. }
  1205. .el-form-item {
  1206. margin-bottom: 10px;
  1207. }
  1208. .p20 {
  1209. padding: 20px;
  1210. }
  1211. .flex {
  1212. display: flex;
  1213. }
  1214. .title {
  1215. justify-content: space-between;
  1216. border-bottom: 1px solid #ccc;
  1217. padding-bottom: 5px;
  1218. span {
  1219. font-size: 16px;
  1220. }
  1221. .col {
  1222. padding-left: 40px;
  1223. font-size: 14px;
  1224. color: #aaaaaa;
  1225. }
  1226. }
  1227. .degree {
  1228. margin-right: 10px;
  1229. padding: 0px 15px;
  1230. color: #fff;
  1231. font-size: 13px;
  1232. line-height: 23px;
  1233. border-radius: 23px;
  1234. display: flex;
  1235. align-items: center;
  1236. justify-content: space-between;
  1237. span {
  1238. width: 5px;
  1239. height: 5px;
  1240. border-radius: 100%;
  1241. margin-right: 6px;
  1242. background-color: #fff;
  1243. }
  1244. }
  1245. .red {
  1246. background-color: rgb(163, 0, 20);
  1247. }
  1248. .blue {
  1249. background-color: #1989fa;
  1250. }
  1251. .createdInfo {
  1252. justify-content: space-around;
  1253. margin-top: 10px;
  1254. font-size: 14px;
  1255. .col {
  1256. color: #6e6e6e;
  1257. padding-right: 10px;
  1258. }
  1259. }
  1260. .mt40 {
  1261. margin-top: 40px;
  1262. }
  1263. .custSteps {
  1264. margin-top: 20px;
  1265. margin-left: 70px;
  1266. .box {
  1267. width: 158px;
  1268. border: 1px solid #ccc;
  1269. padding: 10px;
  1270. flex-direction: row;
  1271. flex-wrap: wrap;
  1272. // justify-content: space-between;
  1273. font-size: 12px;
  1274. color: #9e9e9e;
  1275. .x {
  1276. width: 20px;
  1277. height: 15px;
  1278. margin-right: 5px;
  1279. }
  1280. .q {
  1281. background-color: #d0e4d5;
  1282. }
  1283. .b {
  1284. background-color: #1989fa;
  1285. }
  1286. .g {
  1287. background-color: #157a2c;
  1288. }
  1289. .r {
  1290. background-color: #a30014;
  1291. }
  1292. .a {
  1293. align-items: center;
  1294. margin-bottom: 10px;
  1295. }
  1296. .mr10 {
  1297. margin-right: 10px;
  1298. }
  1299. .mb0 {
  1300. margin-bottom: 0;
  1301. }
  1302. }
  1303. .stepsInfo {
  1304. // flex: 1;
  1305. width: 483px;
  1306. }
  1307. }
  1308. .mt20 {
  1309. margin-top: 20px;
  1310. }
  1311. .content-detail {
  1312. overflow: hidden;
  1313. }
  1314. .executor {
  1315. font-size: 14px;
  1316. .col {
  1317. color: #6e6e6e;
  1318. padding-right: 10px;
  1319. }
  1320. }
  1321. .result {
  1322. justify-content: space-around;
  1323. }
  1324. .mr20 {
  1325. margin-right: 20px;
  1326. }
  1327. .details {
  1328. font-size: 14px;
  1329. margin-bottom: 10px;
  1330. }
  1331. .customSteps {
  1332. margin-top: 40px;
  1333. font-size: 14px;
  1334. margin-left: 80px;
  1335. .time {
  1336. font-size: 12px;
  1337. color: #6e6e6e;
  1338. margin-right: 20px;
  1339. position: relative;
  1340. &::after {
  1341. content: '';
  1342. width: 1px;
  1343. height: 100%;
  1344. background-color: #157a2c;
  1345. position: absolute;
  1346. right: -26px;
  1347. }
  1348. }
  1349. .flex:last-child {
  1350. .time {
  1351. &::after {
  1352. display: none;
  1353. }
  1354. }
  1355. }
  1356. .round {
  1357. margin-right: 20px;
  1358. width: 10px;
  1359. height: 10px;
  1360. border-radius: 100%;
  1361. background-color: #157a2c;
  1362. position: relative;
  1363. span {
  1364. position: absolute;
  1365. top: 50%;
  1366. left: 50%;
  1367. width: 4px;
  1368. height: 4px;
  1369. background-color: #fff;
  1370. border-radius: 100%;
  1371. transform: translate(-2px, -2px);
  1372. }
  1373. }
  1374. .text {
  1375. .info {
  1376. margin-top: 10px;
  1377. width: 955px;
  1378. background-color: #f0f3f3;
  1379. overflow: hidden;
  1380. padding: 10px;
  1381. margin-bottom: 10px;
  1382. }
  1383. }
  1384. }
  1385. .switch_left li {
  1386. border-right: 1px solid rgba(222, 222, 222, 1);
  1387. border-left: 1px solid rgba(222, 222, 222, 1);
  1388. }
  1389. </style>