details.vue 44 KB

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