details.vue 45 KB

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