details.vue 36 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043
  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" v-if="infoData.bizType == 2">
  65. <el-form-item label="客户:">
  66. <span>{{ infoData.clientName }}</span>
  67. </el-form-item>
  68. </el-col>
  69. <el-col :span="8" v-if="infoData.bizType == 2">
  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 type="primary" v-for="item in infoData.qualityFile" @click="download(item)"
  87. :key="item.name">{{ item.name }}</el-link>
  88. </el-form-item>
  89. </el-col>
  90. <el-col :span="24">
  91. <el-form-item label="备注:">
  92. <span>{{ infoData.remark }}</span>
  93. </el-form-item>
  94. </el-col>
  95. </el-form>
  96. </div>
  97. </div>
  98. <div class="content-detail mt20">
  99. <header-title title="产品信息" size="16px"> </header-title>
  100. <el-table ref="productListTable" :data="productList" tooltip-effect="dark" border :max-height="300"
  101. :header-cell-style="rowClass">
  102. <el-table-column label="序号" type="index" width="50">
  103. </el-table-column>
  104. <el-table-column label="编码" prop="categoryCode" align="center"
  105. :show-overflow-tooltip="true"></el-table-column>
  106. <el-table-column label="名称" align="center" prop="categoryName"
  107. :show-overflow-tooltip="true"></el-table-column>
  108. <el-table-column v-if="clientEnvironmentId == 4" label="级别" prop="level" align="center">
  109. </el-table-column>
  110. <el-table-column label="型号" align="center" prop="categoryModel"
  111. :show-overflow-tooltip="true"></el-table-column>
  112. <el-table-column label="规格" align="center" prop="specification"
  113. :show-overflow-tooltip="true"></el-table-column>
  114. <el-table-column label="牌号" align="center" prop="brandNum" :show-overflow-tooltip="true"></el-table-column>
  115. <el-table-column v-for="(item, index) in newColumns" :label="item.label" :align="item.align"
  116. :prop="item.prop" :show-overflow-tooltip="item.showOverflowTooltip"></el-table-column>
  117. <el-table-column label="库存状态" align="center" prop="qualityControl" :show-overflow-tooltip="true"
  118. v-if="this.stepsStatus == 'success'">
  119. <template slot-scope="{ row }">
  120. {{ row.qualityControl == 1 ? '预入库' : '已入库' }}
  121. </template>
  122. </el-table-column>
  123. <el-table-column label="批次号" prop="batchNo" align="center" :show-overflow-tooltip="true">
  124. </el-table-column>
  125. <el-table-column label="数量" prop="packingQuantity" align="center">
  126. <template slot-scope="{ row, $index }">
  127. {{ row.packingQuantity }}
  128. </template>
  129. </el-table-column>
  130. <el-table-column label="单位" align="center" width="120" prop="packingUnit">
  131. </el-table-column>
  132. <el-table-column label="计量数量" prop="measureQuantity" width="100" align="center">
  133. </el-table-column>
  134. <el-table-column label="计量单位" prop="measureUnit" align="center">
  135. </el-table-column>
  136. <el-table-column label="单重" prop="singleWeight" align="center" :show-overflow-tooltip="true">
  137. </el-table-column>
  138. <el-table-column label="总重" prop="weight" align="center" :show-overflow-tooltip="true">
  139. </el-table-column>
  140. <el-table-column label="重量单位" prop="weightUnit" align="center" :show-overflow-tooltip="true">
  141. </el-table-column>
  142. <el-table-column label="单价" prop="unitPrice" align="center">
  143. <template slot-scope="{ row }">
  144. <template>
  145. {{ row.unitPrice ? row.unitPrice + '/元' : '' }}
  146. </template>
  147. </template>
  148. </el-table-column>
  149. <el-table-column label="金额" align="center" prop="contentImage" :show-overflow-tooltip="true">
  150. <template slot-scope="{ row, $index }">
  151. {{ row.totalMoney ? row.totalMoney : 0 }}
  152. </template>
  153. </el-table-column>
  154. <el-table-column v-if="clientEnvironmentId == 4" label="采购原因" align="center" prop="purpose"
  155. :show-overflow-tooltip="true"></el-table-column>
  156. <el-table-column label="供应商" prop="supplierName" :show-overflow-tooltip="true" width="120">
  157. </el-table-column>
  158. <el-table-column width="120" label="供应商代号" prop="supplierCode" :show-overflow-tooltip="true">
  159. </el-table-column>
  160. <el-table-column label="产地" prop="provenance" :show-overflow-tooltip="true">
  161. </el-table-column>
  162. <el-table-column label="仓库" prop="warehouseName" :show-overflow-tooltip="true">
  163. </el-table-column>
  164. <el-table-column
  165. label="生产日期"
  166. prop="detailProductionDate"
  167. :show-overflow-tooltip="true"
  168. >
  169. </el-table-column>
  170. <el-table-column
  171. label="采购日期"
  172. prop="detailPurchaseDate"
  173. :show-overflow-tooltip="true"
  174. >
  175. </el-table-column>
  176. <el-table-column
  177. label="失效日期"
  178. prop="detailExpireDate"
  179. :show-overflow-tooltip="true"
  180. >
  181. </el-table-column>
  182. <el-table-column v-if="infoData.verifyStatus == 2" label="操作" width="200" fixed="right" align="center">
  183. <template slot-scope="{ row, $index }">
  184. <el-button v-if="isUpper(row)" type="text" @click="shelvesWarehouse(row, $index, '产品')">下架</el-button>
  185. <el-button v-else type="text" @click="handleWareHouse(row, $index, '产品')">上架</el-button>
  186. </template>
  187. </el-table-column>
  188. </el-table>
  189. </div>
  190. <div class="mt20">
  191. <!-- {{ this.packingList }} -->
  192. <header-title :title="`包装明细`" size="16px">
  193. <el-button v-for="item in mergeOptions" size="mini" type="primary" @click="openMergeDialog(item)">合并成{{
  194. item.conversionUnit }}</el-button>
  195. <el-button v-for="item in splitOptions" size="mini" type="primary" @click="openSplitDialog(item)">拆分到{{
  196. item.packageUnit }}</el-button>
  197. </header-title>
  198. <el-table ref="showPackingListTable" :data="packingList" tooltip-effect="dark" :max-height="300" border
  199. :row-class-name="tableRowClassName" :header-cell-style="rowClass" @selection-change="productSplit">
  200. <el-table-column v-if="infoData.verifyStatus == 2" key="selection" label="选择" type="selection" width="55"
  201. align="center" fixed="left">
  202. </el-table-column>
  203. <el-table-column label="序号" type="index" width="50">
  204. </el-table-column>
  205. <el-table-column label="批次号" prop="batchNo" width="80" :show-overflow-tooltip="true"></el-table-column>
  206. <el-table-column label="包装编码" prop="packageNo" width="130" :show-overflow-tooltip="true"></el-table-column>
  207. <el-table-column label="名称" prop="categoryName" width="120" :show-overflow-tooltip="true"></el-table-column>
  208. <el-table-column label="编码" prop="categoryCode" width="120" :show-overflow-tooltip="true"></el-table-column>
  209. <el-table-column label="型号" prop="categoryModel" width="80" :show-overflow-tooltip="true"></el-table-column>
  210. <el-table-column label="规格" prop="specification" width="80" :show-overflow-tooltip="true"></el-table-column>
  211. <el-table-column label="牌号" prop="brandNum" width="80" :show-overflow-tooltip="true"></el-table-column>
  212. <el-table-column label="发货条码" prop="barcodes" :show-overflow-tooltip="true"></el-table-column>
  213. <el-table-column label="包装数量" prop="packingQuantity" :show-overflow-tooltip="true"></el-table-column>
  214. <el-table-column label="包装单位" prop="packingUnit" :show-overflow-tooltip="true"></el-table-column>
  215. <el-table-column label="计量数量" prop="measureQuantity" :show-overflow-tooltip="true"></el-table-column>
  216. <el-table-column label="计量单位" prop="measureUnit" :show-overflow-tooltip="true"></el-table-column>
  217. <el-table-column label="物料代号" prop="materielDesignation" :show-overflow-tooltip="true">
  218. </el-table-column>
  219. <el-table-column label="刻码" prop="engrave" :show-overflow-tooltip="true">
  220. </el-table-column>
  221. <el-table-column label="客户代号" prop="clientCode" :show-overflow-tooltip="true">
  222. </el-table-column>
  223. <el-table-column label="供应商" prop="supplierName" :show-overflow-tooltip="true" width="120">
  224. </el-table-column>
  225. <el-table-column label="供应商代号" prop="supplierCode" :show-overflow-tooltip="true" width="120">
  226. </el-table-column>
  227. <el-table-column label="总重" prop="weight" :show-overflow-tooltip="true">
  228. </el-table-column>
  229. <el-table-column label="重量单位" prop="weightUnit" :show-overflow-tooltip="true">
  230. </el-table-column>
  231. <el-table-column label="质检结果" prop="result" :show-overflow-tooltip="true">
  232. <template slot-scope="{ row }">
  233. <span>{{ qualityResults[row.result] }}</span>
  234. </template>
  235. </el-table-column>
  236. <el-table-column label="质检状态" prop="status" :show-overflow-tooltip="true">
  237. <template slot-scope="{ row }">
  238. <span>{{ qualityStatus[row.status] }}</span>
  239. </template>
  240. </el-table-column>
  241. <el-table-column label="仓库" prop="warehouseName" :show-overflow-tooltip="true">
  242. </el-table-column>
  243. <el-table-column label="货区" prop="areaName" :show-overflow-tooltip="true">
  244. </el-table-column>
  245. <el-table-column label="货架" prop="goodsShelfName" :show-overflow-tooltip="true">
  246. </el-table-column>
  247. <el-table-column label="货位" prop="goodsAllocationName" :show-overflow-tooltip="true">
  248. </el-table-column>
  249. <el-table-column label="生产日期" prop="productionDate" :show-overflow-tooltip="true">
  250. </el-table-column>
  251. <el-table-column label="采购日期" prop="purchaseDate" :show-overflow-tooltip="true">
  252. </el-table-column>
  253. <el-table-column
  254. label="失效日期"
  255. prop="expireDate"
  256. :show-overflow-tooltip="true"
  257. >
  258. </el-table-column>
  259. <el-table-column v-if="infoData.verifyStatus == 2" label="操作" width="200" fixed="right" align="center">
  260. <template slot-scope="{ row, $index }">
  261. <el-button v-if="row.areaId != null" type="text"
  262. @click="shelvesWarehouse(row, $index, '包装')">下架</el-button>
  263. <el-button v-else type="text" @click="handleWareHouse(row, $index, '包装')">上架</el-button>
  264. {{ row.areaId }}
  265. </template>
  266. </el-table-column>
  267. </el-table>
  268. <el-pagination background layout="total, sizes, prev, pager, next, jumper" :total="total"
  269. :page-sizes="[5, 10, 20, 30]" :page-size.sync="pages.size" :current-page.sync="pages.pageNum"
  270. @current-change="handleCurrentChange" @size-change="handleSizeChange">
  271. </el-pagination>
  272. </div>
  273. </div>
  274. </el-card>
  275. <WareHouseDailog ref="wareHouseDailogRef" @houseData="houseData"></WareHouseDailog>
  276. <mergeDetails ref="mergeDetailsRef" @refresh="getPackingList"></mergeDetails>
  277. <splitDetails ref="splitDetailsRef"></splitDetails>
  278. </div>
  279. </template>
  280. <script>
  281. import mergeDetails from './mergeDetails.vue';
  282. import splitDetails from './splitDetails.vue';
  283. import WareHouseDailog from '../components/warehouseShelvesDialog.vue';
  284. import elTableInfiniteScroll from 'el-table-infinite-scroll';
  285. import { getFile } from '@/api/system/file/index.js';
  286. import PageHeader from '@/components/PageHeader';
  287. import storageApi from '@/api/warehouseManagement';
  288. import { getCode } from '@/api/codeManagement/index.js';
  289. import { allCategoryLevel } from '@/api/classifyManage';
  290. import {
  291. useDictLabel, sceneState, qualityStatus, qualityResults
  292. } from '@/utils/dict/index';
  293. import { mapGetters, mapActions } from 'vuex';
  294. export default {
  295. components: { PageHeader, WareHouseDailog, mergeDetails, splitDetails },
  296. directives: {
  297. 'el-table-infinite-scroll': elTableInfiniteScroll
  298. },
  299. data() {
  300. return {
  301. total: 0,
  302. pages: { pageNum: 1, size: 10 },
  303. oldSelectionList: [],
  304. selectionList: [],
  305. mergeOptions: [],
  306. splitOptions: [],
  307. currentId: '',
  308. newColumns: [], // 动态表头
  309. qualityStatus,
  310. qualityResults,
  311. // qualityStatus: {
  312. // 0: '未质检',
  313. // 1: '已质检'
  314. // }, // 质检状态 0未检 1已检
  315. // qualityResults: {
  316. // 1: '合格',
  317. // 2: '不合格'
  318. // }, // 质检结果 1合格 2不合格
  319. productList: [], // 产品列表
  320. showPackingList: [], // 展示的包装列表
  321. packingList: [], // 包装列表
  322. showMaterialList: [], // 展示物料列表
  323. materialList: [], // 物料列表
  324. extInfo: {}, // 扩展信息
  325. pageSize: 20,
  326. pickingPageNum: 1,
  327. materielPageNum: 1,
  328. codeList: [],
  329. infoData: {},
  330. stepsTitle: '已完成',
  331. stepsStatus: 'success',
  332. active: 0,
  333. verifyStatus: '',
  334. rowData: {}
  335. };
  336. },
  337. watch: {
  338. 'infoData.verifyStatus': {
  339. immediate: true,
  340. handler(val) {
  341. if (val == 0) {
  342. this.active = 1;
  343. this.stepsTitle = '未审核';
  344. this.stepsStatus = 'wait';
  345. } else if (val == 1) {
  346. this.active = 2;
  347. this.stepsTitle = '审核中';
  348. this.stepsStatus = 'process';
  349. } else if (val == 2) {
  350. this.active = 2;
  351. this.stepsTitle = '审核通过';
  352. this.stepsStatus = 'success';
  353. } else if (val == 3) {
  354. this.active = 2;
  355. this.stepsTitle = '驳回';
  356. this.stepsStatus = 'error';
  357. }
  358. }
  359. },
  360. packingList: {
  361. handler(newVal) {
  362. console.log('包装列表', newVal);
  363. console.log('当前包装列表加载页数', this.pickingPageNum);
  364. this.showPackingList = newVal.slice(
  365. 0,
  366. this.pageSize * (this.pickingPageNum > 0 ? this.pickingPageNum : 1)
  367. );
  368. },
  369. deep: true
  370. },
  371. materialList: {
  372. handler(newVal) {
  373. console.log('物料列表', newVal);
  374. console.log('当前物料列表加载页数', this.materielPageNum);
  375. this.showMaterialList = newVal.slice(
  376. 0,
  377. this.pageSize *
  378. (this.materielPageNum > 0 ? this.materielPageNum : 1)
  379. );
  380. },
  381. deep: true
  382. }
  383. },
  384. computed: {
  385. ...mapGetters(['getDictValue']),
  386. clientEnvironmentId() {
  387. return this.$store.state.user.info.clientEnvironmentId;
  388. }
  389. },
  390. created() {
  391. this.getFieldModel();
  392. this.requestDict('类型用途');
  393. this.requestDict('不拆物料层规格');
  394. this.getAllCategoryType();
  395. this._getInfo();
  396. this.verifyStatus = this.$route.query.verifyStatus;
  397. },
  398. methods: {
  399. openMergeDialog(dimensionRow) {
  400. this.$refs.mergeDetailsRef.open(dimensionRow, this.selectionList);
  401. },
  402. openSplitDialog(dimensionRow) {
  403. this.$refs.splitDetailsRef.open(dimensionRow, this.selectionList);
  404. },
  405. productSplit(selectionList) {
  406. console.log(selectionList);
  407. let isUnification = selectionList.every(
  408. (item) =>
  409. item.packingUnit == selectionList[0].packingUnit &&
  410. item.categoryId == selectionList[0].categoryId
  411. );
  412. if (isUnification) {
  413. if (selectionList.length > 0) {
  414. this.selectionList = selectionList;
  415. this.oldSelectionList = selectionList;
  416. if (this.mergeOptions.length == 0) {
  417. storageApi
  418. .getCategoryPackageDisposition({
  419. categoryIds: [this.selectionList[0].categoryId]
  420. })
  421. .then((data) => {
  422. console.log(data);
  423. console.log(this.selectionList[0]);
  424. // 形成合并按钮
  425. let mergeIndex = data.findIndex(
  426. (item) =>
  427. item.packageUnit == this.selectionList[0].packingUnit &&
  428. item.packageUnit != item.conversionUnit
  429. );
  430. console.log(mergeIndex);
  431. this.mergeOptions = data.filter(
  432. (item) => item.sort == data[mergeIndex].sort
  433. );
  434. // 形成拆分按钮
  435. let splitIndex = data.findIndex(
  436. (item) =>
  437. item.conversionUnit ==
  438. this.selectionList[0].packingUnit &&
  439. item.packageUnit != item.conversionUnit
  440. );
  441. this.splitOptions = data.filter(
  442. (item) => item.sort == data[splitIndex].sort
  443. );
  444. });
  445. }
  446. } else {
  447. this.mergeOptions = [];
  448. this.splitOptions = [];
  449. }
  450. } else {
  451. this.$message.error('请选择相同物品和包装装单位');
  452. this.$refs.showPackingListTable.clearSelection();
  453. }
  454. console.log(isUnification);
  455. },
  456. // 获取动态表头
  457. getFieldModel() {
  458. storageApi.fieldModel({ fieldModel: 't_main_category' }).then((res) => {
  459. let newRes = res.map((m) => {
  460. return {
  461. prop: 'extField.' + m.prop,
  462. label: m.label,
  463. align: 'center',
  464. showOverflowTooltip: true
  465. };
  466. });
  467. this.newColumns = [...newRes];
  468. });
  469. },
  470. isUpper(row) {
  471. if (!row.outInDetailRecordRequestList || row.outInDetailRecordRequestList.length === 0) {
  472. return false;
  473. }
  474. return row.outInDetailRecordRequestList.some(item =>
  475. item.areaId && item.goodsShelfId && item.goodsAllocationId
  476. );
  477. },
  478. formDataData() {
  479. // 处理包装数据
  480. this.packingList = this.packingList.map((packingItem) => {
  481. return {
  482. ...packingItem,
  483. materialDetailList: this.materialList.filter(
  484. (item) => item.parentIndex === packingItem.index
  485. )
  486. };
  487. });
  488. // 处理产品数据
  489. this.productList = this.productList.map((productItem) => {
  490. return {
  491. ...productItem,
  492. outInDetailRecordRequestList: this.packingList.filter(
  493. (item) => item.parentIndex === productItem.index
  494. )
  495. };
  496. });
  497. this.infoData.outInDetailList = this.productList;
  498. },
  499. houseData(argum, idx, type) {
  500. console.log('-argum-------------------', argum);
  501. switch (type) {
  502. case '产品':
  503. this.packingList.forEach((item) => {
  504. console.log(item, 'item');
  505. console.log(this.productList[idx], 'index')
  506. if (item.batchNo === this.productList[idx].batchNo && item.categoryId === this.productList[idx].categoryId && item.categoryName === this.productList[idx].categoryName) {
  507. this.$set(item, 'areaId', argum[0].areaId);
  508. this.$set(item, 'areaName', argum[0].areaName);
  509. this.$set(item, 'goodsShelfId', argum[0].shelfId);
  510. this.$set(item, 'goodsShelfName', argum[0].shelfCode);
  511. this.$set(item, 'goodsAllocationId', argum[0].cargoSpaceId);
  512. this.$set(item, 'goodsAllocationName', argum[0].cargoSpaceCode);
  513. }
  514. });
  515. break;
  516. case '包装':
  517. this.$set(this.packingList[idx], 'areaId', argum[0].areaId);
  518. this.$set(this.packingList[idx], 'areaName', argum[0].areaName);
  519. this.$set(this.packingList[idx], 'goodsShelfId', argum[0].shelfId);
  520. this.$set(
  521. this.packingList[idx],
  522. 'goodsShelfName',
  523. argum[0].shelfCode
  524. );
  525. this.$set(
  526. this.packingList[idx],
  527. 'goodsAllocationId',
  528. argum[0].cargoSpaceId
  529. );
  530. this.$set(
  531. this.packingList[idx],
  532. 'goodsAllocationName',
  533. argum[0].cargoSpaceCode
  534. );
  535. break;
  536. }
  537. const data2 = this.packingList.filter(item => item.areaId)
  538. this.formDataData();
  539. for (let i = 0; i < this.infoData.outInDetailList.length; i++) {
  540. const batchNo = this.infoData.outInDetailList[i].batchNo;
  541. const categoryId = this.infoData.outInDetailList[i].categoryId;
  542. const categoryName = this.infoData.outInDetailList[i].categoryName;
  543. if (this.rowData.batchNo == batchNo && this.rowData.categoryId == categoryId && this.rowData.categoryName == categoryName) {
  544. this.infoData.outInDetailList[i].outInDetailRecordRequestList = data2
  545. }
  546. }
  547. storageApi
  548. .upperLowerShelves(this.infoData)
  549. .then((data) => {
  550. console.log(data);
  551. this._getInfo();
  552. this.$message.success('上架成功');
  553. })
  554. .catch(() => {
  555. this.$message.error('上架失败');
  556. });
  557. },
  558. handleWareHouse(row, idx, type) {
  559. console.log(row, 'kkkkk');
  560. this.rowData = row;
  561. this.$refs.wareHouseDailogRef.open(row, idx, type);
  562. },
  563. shelvesWarehouse(row, idx, type) {
  564. if (type == '产品') {
  565. for (let i = 0; i < this.infoData.outInDetailList.length; i++) {
  566. const batchNo = this.infoData.outInDetailList[i].batchNo;
  567. const categoryId = this.infoData.outInDetailList[i].categoryId;
  568. const categoryName = this.infoData.outInDetailList[i].categoryName;
  569. if (row.batchNo == batchNo && row.categoryId == categoryId && row.categoryName == categoryName) {
  570. let data12 = row.outInDetailRecordRequestList.map(item => ({ ...item, areaId: '', areaName: '', goodsShelfId: '', goodsShelfName: '', goodsAllocationId: '', goodsAllocationName: '' }));
  571. this.$set(this.infoData.outInDetailList[i], 'outInDetailRecordRequestList', data12)
  572. }
  573. }
  574. } else {
  575. for (let i = 0; i < this.infoData.outInDetailList.length; i++) {
  576. const batchNo = this.infoData.outInDetailList[i].batchNo;
  577. const categoryId = this.infoData.outInDetailList[i].categoryId;
  578. const categoryName = this.infoData.outInDetailList[i].categoryName;
  579. if (this.packingList[idx].batchNo == batchNo && this.packingList[idx].categoryId == categoryId && this.packingList[idx].categoryName == categoryName) {
  580. let dataList = this.infoData.outInDetailList[i].outInDetailRecordRequestList.filter(item => item.areaId)
  581. for (let j = 0; j < dataList.length; j++) {
  582. const idd = dataList[j].id;
  583. if (this.packingList[idx].id == idd) {
  584. this.$set(dataList[j], 'areaId', '');
  585. this.$set(dataList[j], 'areaName', '');
  586. this.$set(dataList[j], 'goodsShelfId', '');
  587. this.$set(dataList[j], 'goodsShelfName', '');
  588. this.$set(dataList[j], 'goodsAllocationId', '');
  589. this.$set(dataList[j], 'goodsAllocationName', '');
  590. }
  591. }
  592. }
  593. console.log(this.packingList[idx].id, 'this.packingList[idx].id')
  594. }
  595. }
  596. // this.formDataData();
  597. storageApi
  598. .upperLowerShelves(this.infoData)
  599. .then((data) => {
  600. console.log(data);
  601. this._getInfo();
  602. this.$message.success('下架成功');
  603. })
  604. .catch(() => {
  605. this.$message.error('下架失败');
  606. });
  607. },
  608. pickingHandleScroll() {
  609. console.log('---------pickingHandleScroll------------');
  610. if (this.showPackingList.length < this.packingList.length) {
  611. if (this.packingList.length > this.pageSize) {
  612. this.pickingPageNum += 1;
  613. }
  614. this.pickingFetchData();
  615. }
  616. },
  617. pickingFetchData() {
  618. const start = (this.pickingPageNum - 1) * this.pageSize;
  619. const end = start + this.pageSize;
  620. this.showPackingList = this.showPackingList.concat(
  621. this.packingList.slice(start, end)
  622. );
  623. },
  624. materielHandleScroll() {
  625. console.log('---------materielHandleScroll------------');
  626. if (this.showMaterialList.length < this.materialList.length) {
  627. if (this.materialList.length > this.pageSize) {
  628. this.materielPageNum += 1;
  629. }
  630. this.materielFetchData();
  631. }
  632. },
  633. materielFetchData() {
  634. const start = (this.materielPageNum - 1) * this.pageSize;
  635. const end = start + this.pageSize;
  636. this.showMaterialList = this.showMaterialList.concat(
  637. this.materialList.slice(start, end)
  638. );
  639. console.log(this.showMaterialList);
  640. },
  641. ...mapActions('dict', ['requestDict']),
  642. getSceneState: useDictLabel(sceneState),
  643. handleAssetType(r) {
  644. let arr = r?.split(',');
  645. const filteredData = this.codeList.filter((item) =>
  646. arr?.includes(item.dictCode)
  647. );
  648. return filteredData.map((item) => item.dictValue).join(',');
  649. },
  650. tableRowClassName({ row, rowIndex }) {
  651. if (row.result == 2) {
  652. return 'warning-row';
  653. } else {
  654. return '';
  655. }
  656. },
  657. goBack() {
  658. this.$router.go(-1);
  659. },
  660. rowClass({ row, column, rowIndex, columnIndex }) {
  661. if (rowIndex === 1) {
  662. return {
  663. display: 'none',
  664. background: '#EEEEEE'
  665. };
  666. }
  667. return { background: '#0000' };
  668. },
  669. async getAllCategoryType() {
  670. const { data } = await allCategoryLevel();
  671. this.codeList = data.map((item) => {
  672. return { dictCode: item.id, dictValue: item.name };
  673. });
  674. },
  675. getDeptName() {
  676. if (this.extInfo.createUserId) {
  677. storageApi.getGroupById(this.extInfo.createUserId).then((res) => {
  678. this.extInfo.deptName = res?.groupName
  679. });
  680. }
  681. },
  682. async _getInfo() {
  683. const res = await storageApi.getInboundDetailsById(
  684. this.$route.query.id
  685. );
  686. console.log('==============================res', res);
  687. this.infoData = res;
  688. this.extInfo = res.extInfo;
  689. //根据createUserId查部门
  690. this.getDeptName()
  691. this.productList = res.outInDetailList.map(
  692. (productItem, productIndex) => {
  693. return {
  694. ...productItem,
  695. index: this.productList.length + productIndex,
  696. outInDetailRecordRequestList:
  697. productItem.outInDetailRecordRequestList.map(
  698. (packingItem, packingIndex) => {
  699. return {
  700. ...packingItem,
  701. index:
  702. this.productList.length +
  703. productIndex +
  704. '-' +
  705. packingIndex, // 包装索引
  706. parentIndex: this.productList.length + productIndex, // 物品索引
  707. categoryName: productItem.categoryName,
  708. categoryCode: productItem.categoryCode,
  709. materialDetailList: packingItem.materialDetailList.map(
  710. (materialItem, materialIndex) => {
  711. return {
  712. ...materialItem,
  713. index:
  714. this.productList.length +
  715. productIndex +
  716. '-' +
  717. packingIndex +
  718. '——' +
  719. materialIndex, // 包装索引
  720. parentIndex:
  721. this.productList.length +
  722. productIndex +
  723. '-' +
  724. packingIndex, // 物品索引
  725. categoryName: productItem.categoryName,
  726. categoryCode: productItem.categoryCode
  727. };
  728. }
  729. )
  730. };
  731. }
  732. )
  733. };
  734. }
  735. );
  736. this.getPackingList();
  737. // // 获取包装维度数据
  738. // const arr = [];
  739. // for (const key in this.productList) {
  740. // for (const k in this.productList[key].outInDetailRecordRequestList) {
  741. // arr.push({
  742. // ...this.productList[key].outInDetailRecordRequestList[k]
  743. // });
  744. // }
  745. // }
  746. // this.packingList = arr;
  747. // // 获取物料维度数据
  748. // let iArr = [];
  749. // arr.forEach((item) => {
  750. // item.materialDetailList.forEach((ele) => {
  751. // iArr.push({ ...ele });
  752. // });
  753. // });
  754. // this.materialList = iArr;
  755. // console.log(this.packingList);
  756. // console.log(this.materialList);
  757. // this.pickingFetchData();
  758. // this.materielFetchData();
  759. },
  760. download(row) {
  761. if (row.storePath) {
  762. getFile({ objectName: row.storePath }, row.name);
  763. }
  764. },
  765. handleCurrentChange(e) {
  766. this.getPackingList();
  767. },
  768. handleSizeChange(e) {
  769. this.pages.pageNum = 1;
  770. this.getPackingList();
  771. },
  772. getPackingList() {
  773. storageApi
  774. .getOutInRecordsPage({
  775. ...this.pages,
  776. outInId: this.$route.query.id
  777. })
  778. .then((data) => {
  779. this.total = data.count;
  780. console.log(data.list,'data.list')
  781. this.packingList = data.list;
  782. });
  783. }
  784. }
  785. };
  786. </script>
  787. <style lang="scss" scoped>
  788. ::v-deep .warning-row {
  789. color: red;
  790. }
  791. ::v-deep .page-title {
  792. border-bottom: none;
  793. }
  794. ::v-deep .page-title-div {
  795. width: 100%;
  796. }
  797. .stepsStatus {
  798. width: 40%;
  799. margin: 0 auto;
  800. }
  801. .el-form-item {
  802. margin-bottom: 10px;
  803. }
  804. .p20 {
  805. padding: 20px;
  806. }
  807. .flex {
  808. display: flex;
  809. }
  810. .title {
  811. justify-content: space-between;
  812. border-bottom: 1px solid #ccc;
  813. padding-bottom: 5px;
  814. span {
  815. font-size: 16px;
  816. }
  817. .col {
  818. padding-left: 40px;
  819. font-size: 14px;
  820. color: #aaaaaa;
  821. }
  822. }
  823. .degree {
  824. margin-right: 10px;
  825. padding: 0px 15px;
  826. color: #fff;
  827. font-size: 13px;
  828. line-height: 23px;
  829. border-radius: 23px;
  830. display: flex;
  831. align-items: center;
  832. justify-content: space-between;
  833. span {
  834. width: 5px;
  835. height: 5px;
  836. border-radius: 100%;
  837. margin-right: 6px;
  838. background-color: #fff;
  839. }
  840. }
  841. .red {
  842. background-color: rgb(163, 0, 20);
  843. }
  844. .blue {
  845. background-color: #1989fa;
  846. }
  847. .createdInfo {
  848. justify-content: space-around;
  849. margin-top: 10px;
  850. font-size: 14px;
  851. .col {
  852. color: #6e6e6e;
  853. padding-right: 10px;
  854. }
  855. }
  856. .mt40 {
  857. margin-top: 40px;
  858. }
  859. .custSteps {
  860. margin-top: 20px;
  861. margin-left: 70px;
  862. .box {
  863. width: 158px;
  864. border: 1px solid #ccc;
  865. padding: 10px;
  866. flex-direction: row;
  867. flex-wrap: wrap;
  868. // justify-content: space-between;
  869. font-size: 12px;
  870. color: #9e9e9e;
  871. .x {
  872. width: 20px;
  873. height: 15px;
  874. margin-right: 5px;
  875. }
  876. .q {
  877. background-color: #d0e4d5;
  878. }
  879. .b {
  880. background-color: #1989fa;
  881. }
  882. .g {
  883. background-color: #157a2c;
  884. }
  885. .r {
  886. background-color: #a30014;
  887. }
  888. .a {
  889. align-items: center;
  890. margin-bottom: 10px;
  891. }
  892. .mr10 {
  893. margin-right: 10px;
  894. }
  895. .mb0 {
  896. margin-bottom: 0;
  897. }
  898. }
  899. .stepsInfo {
  900. // flex: 1;
  901. width: 483px;
  902. }
  903. }
  904. .mt20 {
  905. margin-top: 20px;
  906. }
  907. .content-detail {
  908. overflow: hidden;
  909. }
  910. .executor {
  911. font-size: 14px;
  912. .col {
  913. color: #6e6e6e;
  914. padding-right: 10px;
  915. }
  916. }
  917. .result {
  918. justify-content: space-around;
  919. }
  920. .mr20 {
  921. margin-right: 20px;
  922. }
  923. .details {
  924. font-size: 14px;
  925. margin-bottom: 10px;
  926. }
  927. .customSteps {
  928. margin-top: 40px;
  929. font-size: 14px;
  930. margin-left: 80px;
  931. .time {
  932. font-size: 12px;
  933. color: #6e6e6e;
  934. margin-right: 20px;
  935. position: relative;
  936. &::after {
  937. content: '';
  938. width: 1px;
  939. height: 100%;
  940. background-color: #157a2c;
  941. position: absolute;
  942. right: -26px;
  943. }
  944. }
  945. .flex:last-child {
  946. .time {
  947. &::after {
  948. display: none;
  949. }
  950. }
  951. }
  952. .round {
  953. margin-right: 20px;
  954. width: 10px;
  955. height: 10px;
  956. border-radius: 100%;
  957. background-color: #157a2c;
  958. position: relative;
  959. span {
  960. position: absolute;
  961. top: 50%;
  962. left: 50%;
  963. width: 4px;
  964. height: 4px;
  965. background-color: #fff;
  966. border-radius: 100%;
  967. transform: translate(-2px, -2px);
  968. }
  969. }
  970. .text {
  971. .info {
  972. margin-top: 10px;
  973. width: 955px;
  974. background-color: #f0f3f3;
  975. overflow: hidden;
  976. padding: 10px;
  977. margin-bottom: 10px;
  978. }
  979. }
  980. }
  981. .switch_left li {
  982. border-right: 1px solid rgba(222, 222, 222, 1);
  983. border-left: 1px solid rgba(222, 222, 222, 1);
  984. }
  985. </style>