detailDialog.vue 54 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655
  1. <template>
  2. <div class="ele-body">
  3. <el-card shadow="never">
  4. <div>
  5. <div class="content-detail">
  6. <header-title title="基本信息" size="16px"></header-title>
  7. <div class="mt20">
  8. <el-form label-width="120px">
  9. <el-col :span="8">
  10. <el-form-item label="入库单:">
  11. <span>{{ infoData.bizNo }}</span>
  12. </el-form-item>
  13. </el-col>
  14. <el-col :span="8">
  15. <el-form-item label="入库物品类型:">
  16. <span>{{ handleAssetType(extInfo.assetType) }}</span>
  17. </el-form-item>
  18. </el-col>
  19. <el-col :span="8">
  20. <el-form-item label="入库场景:">
  21. <span>{{ getSceneState(infoData.bizType) }}</span>
  22. </el-form-item>
  23. </el-col>
  24. <el-col :span="8">
  25. <el-form-item label="销售订单:">
  26. <span>{{ extInfo.documentSource }}</span>
  27. </el-form-item>
  28. </el-col>
  29. <el-col :span="8">
  30. <el-form-item label="权属部门:">
  31. <span>{{ extInfo.deptName }}</span>
  32. </el-form-item>
  33. </el-col>
  34. <el-col :span="8">
  35. <el-form-item label="入库登记人:">
  36. <span>{{ extInfo.createUserName }}</span>
  37. </el-form-item>
  38. </el-col>
  39. <!-- <el-col :span="8">
  40. <el-form-item label="创建时间:">
  41. <span>{{ infoData.createTime }}</span>
  42. </el-form-item>
  43. </el-col> -->
  44. <el-col :span="8">
  45. <el-form-item label="入库时间:">
  46. <span>{{ infoData.createTime }}</span>
  47. </el-form-item>
  48. </el-col>
  49. <el-col :span="8">
  50. <el-form-item label="状态:">
  51. <span>{{ getAuditStatus(infoData.verifyStatus) }}</span>
  52. </el-form-item>
  53. </el-col>
  54. <el-col :span="8">
  55. <el-form-item label="审核人:">
  56. <span>{{ infoData.verifyName }}</span>
  57. </el-form-item>
  58. </el-col>
  59. <el-col :span="8" v-if="infoData.bizType == 2">
  60. <el-form-item label="客户:">
  61. <span>{{ infoData.clientName }}</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.clientCode }}</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" v-if="infoData.bizType != 2">
  75. <el-form-item label="供应商代码:">
  76. <span>{{ extInfo.supplierCode }}</span>
  77. </el-form-item>
  78. </el-col> -->
  79. <el-col :span="8">
  80. <el-form-item label="送货人:">
  81. <span>{{ infoData.fromUser }}</span>
  82. </el-form-item>
  83. </el-col>
  84. <el-col :span="8">
  85. <el-form-item label="送货人联系方式:">
  86. <span>{{ extInfo.deliveryPhone }}</span>
  87. </el-form-item>
  88. </el-col>
  89. <el-col :span="8">
  90. <el-form-item label="附件:">
  91. <!-- <el-link
  92. type="primary"
  93. v-for="(item, index) in infoData.contentImage"
  94. @click="contentImageDownload(item)"
  95. :key="item.name"
  96. >{{ item.name }}</el-link
  97. > -->
  98. </el-form-item>
  99. </el-col>
  100. <el-col :span="8">
  101. <el-form-item
  102. prop="qualityFile"
  103. label="回执附件"
  104. :rules="{
  105. required: true,
  106. trigger: 'blur'
  107. }"
  108. >
  109. <fileUpload
  110. v-model="qualityFile"
  111. module="main"
  112. :showLib="false"
  113. :limit="10"
  114. />
  115. </el-form-item>
  116. </el-col>
  117. <el-col :span="24">
  118. <el-form-item label="备注:">
  119. <span>{{ infoData.remark }}</span>
  120. </el-form-item>
  121. </el-col>
  122. </el-form>
  123. </div>
  124. </div>
  125. <div class="content-detail mt20">
  126. <header-title title="物品信息" size="16px"></header-title>
  127. <!-- =={{ warehousingMaterialList }} -->
  128. <div class="mt20">
  129. <div class="mt10">
  130. <el-form
  131. ref="warehousingMaterialListRef"
  132. :model="{ warehousingMaterialList: warehousingMaterialList }"
  133. :show-message="false"
  134. >
  135. <el-table
  136. ref="multipleTable"
  137. :data="warehousingMaterialList"
  138. tooltip-effect="dark"
  139. :key="infoData.assetType"
  140. style="width: 100%"
  141. stripe
  142. :header-cell-style="rowClass"
  143. >
  144. <el-table-column label="序号" type="index" width="50">
  145. </el-table-column>
  146. <el-table-column
  147. label="编码"
  148. prop="categoryCode"
  149. align="center"
  150. width="150"
  151. ></el-table-column>
  152. <el-table-column
  153. label="名称"
  154. align="center"
  155. width="170"
  156. prop="name"
  157. ></el-table-column>
  158. <el-table-column
  159. v-for="(item, index) in tableHeader"
  160. :key="index"
  161. align="center"
  162. :label="item.label"
  163. width="150"
  164. :prop="item.prop"
  165. >
  166. <template slot-scope="{ row }">
  167. <template v-if="item.formatter">{{
  168. item.formatter(row)
  169. }}</template>
  170. <template v-else>{{ row[item.prop] }}</template>
  171. </template>
  172. </el-table-column>
  173. <el-table-column
  174. label="批次号"
  175. prop="batchNo"
  176. width="70"
  177. align="center"
  178. >
  179. </el-table-column>
  180. <el-table-column
  181. label="最小包装单元"
  182. align="center"
  183. prop="minPackingCount"
  184. width="100"
  185. >
  186. <el-table-column
  187. label=""
  188. prop="minPackingCount"
  189. width="100"
  190. align="center"
  191. >
  192. <template slot-scope="{ row, $index }">
  193. <template v-if="row.isSave">
  194. {{ row.minPackingCount }}
  195. </template>
  196. <el-form-item
  197. v-else
  198. :prop="`warehousingMaterialList.${$index}.minPackingCount`"
  199. required
  200. >
  201. <el-input
  202. v-model="row.minPackingCount"
  203. @input="
  204. (value) =>
  205. (row.minPackingCount = value.replace(
  206. /^(0+)|[^\d]+/g,
  207. ''
  208. ))
  209. "
  210. >
  211. </el-input>
  212. </el-form-item>
  213. </template>
  214. </el-table-column>
  215. <el-table-column label="" prop="minPackingCount">
  216. <template slot-scope="{ row, $index }">
  217. {{ handleRowUnit(row) }} /{{ row.packingUnit }}
  218. </template>
  219. </el-table-column>
  220. </el-table-column>
  221. <el-table-column
  222. label="包装数量"
  223. prop="packingCount"
  224. width="130"
  225. align="center"
  226. >
  227. <!-- <template slot-scope="{ row, $index }">
  228. {{ row.packingCount }} {{ row.packingUnit }}
  229. </template> -->
  230. <template slot-scope="{ row, $index }">
  231. <template v-if="row.isSave">
  232. {{ row.packingCount }} {{ row.packingUnit }}
  233. </template>
  234. <el-form-item
  235. v-else
  236. :prop="`warehousingMaterialList.${$index}.packingCount`"
  237. required
  238. >
  239. <el-input
  240. v-model="row.packingCount"
  241. @input="packNum(row, $event)"
  242. >
  243. <template slot="append">
  244. {{ row.packingUnit ? row.packingUnit : '/' }}
  245. </template>
  246. </el-input>
  247. </el-form-item>
  248. </template>
  249. </el-table-column>
  250. <el-table-column
  251. label="计量数量"
  252. prop="batchNo"
  253. width="100"
  254. align="center"
  255. >
  256. <template slot-scope="{ row, $index }">
  257. <template>
  258. {{ row.minPackingCount * row.packingCount }}
  259. </template>
  260. </template>
  261. </el-table-column>
  262. <el-table-column
  263. label="计量单位"
  264. prop="batchNo"
  265. width="100"
  266. align="center"
  267. >
  268. <template slot-scope="{ row, $index }">
  269. <template>
  270. {{ row.measuringUnit }}
  271. </template>
  272. </template>
  273. </el-table-column>
  274. <el-table-column
  275. label="重量"
  276. prop="count"
  277. width="100"
  278. align="center"
  279. >
  280. <template slot-scope="{ row, $index }">
  281. {{ row.weight }}
  282. </template>
  283. </el-table-column>
  284. <el-table-column
  285. label="重量单位"
  286. prop="count"
  287. width="100"
  288. align="center"
  289. >
  290. <template slot-scope="{ row, $index }">
  291. {{ row.weightUnit }}
  292. </template>
  293. </el-table-column>
  294. <el-table-column
  295. label="单价"
  296. prop="price"
  297. width="190"
  298. align="center"
  299. >
  300. <template slot-scope="{ row, $index }">
  301. <template v-if="row.isSave">
  302. {{ row.price }}
  303. </template>
  304. <el-form-item v-else>
  305. <el-input
  306. v-model="row.price"
  307. placeholder="非必填"
  308. @input="
  309. (value) =>
  310. (row.price = value.replace(/[^0-9.]+/g, ''))
  311. "
  312. >
  313. <template slot="append">
  314. 元/{{ handleRowUnit(row) }}
  315. </template>
  316. </el-input>
  317. </el-form-item>
  318. </template>
  319. </el-table-column>
  320. <el-table-column
  321. label="金额"
  322. align="center"
  323. prop="contentImage"
  324. :show-overflow-tooltip="true"
  325. width="100"
  326. >
  327. <template slot-scope="{ row, $index }">
  328. <!-- // calcSum(
  329. // row.outInNum,
  330. // row.univalenceUnit,
  331. // row.univalence,
  332. // row
  333. // ) -->
  334. {{
  335. calcSumTotal(
  336. row.packingCount,
  337. row.minPackingCount,
  338. row.price,
  339. row
  340. )
  341. }}
  342. </template>
  343. </el-table-column>
  344. <el-table-column
  345. label="货位"
  346. prop="position"
  347. :show-overflow-tooltip="true"
  348. width="200"
  349. >
  350. <template slot-scope="{ row, $index }">
  351. <template v-if="row.isSave">
  352. {{ row.position }}
  353. </template>
  354. <el-form-item
  355. v-else
  356. :prop="`warehousingMaterialList.${$index}.position`"
  357. :required="true"
  358. >
  359. <span @click="handleWareHouse(row, $index)">
  360. {{ row.position }}</span
  361. >
  362. </el-form-item>
  363. </template>
  364. </el-table-column>
  365. <el-table-column
  366. label="操作"
  367. width="200"
  368. fixed="right"
  369. align="center"
  370. >
  371. <template slot-scope="{ row, $index }">
  372. <el-button
  373. type="text"
  374. v-show="!row.isSave"
  375. @click="listSave(row, $index)"
  376. >保存</el-button
  377. >
  378. <el-button
  379. type="text"
  380. v-show="row.isSave"
  381. @click="listEdit(row, $index)"
  382. >编辑</el-button
  383. >
  384. </template>
  385. </el-table-column>
  386. </el-table>
  387. </el-form>
  388. </div>
  389. </div>
  390. </div>
  391. <div class="mt20">
  392. <!-- =={{ getDictValue('类型用途', infoData.assetType) }} -->
  393. <!-- ${handleAssetType(extInfo.assetType)} -->
  394. <header-title :title="`包装明细`" size="16px"></header-title>
  395. <el-table
  396. ref="multipleTable"
  397. :data="detailList"
  398. tooltip-effect="dark"
  399. :header-cell-style="rowClass"
  400. style="width: 100%"
  401. stripe
  402. >
  403. <el-table-column label="序号" type="index" width="50">
  404. </el-table-column>
  405. <el-table-column label="编码" prop="categoryCode"></el-table-column>
  406. <el-table-column label="名称" prop="name"></el-table-column>
  407. <el-table-column label="批次号" prop="batchNo"></el-table-column>
  408. <el-table-column label="包装编码" prop="code"></el-table-column>
  409. <el-table-column
  410. label="包装数量"
  411. prop="packingCount"
  412. width="80"
  413. ></el-table-column>
  414. <el-table-column
  415. label="包装单位"
  416. prop="packingUnit"
  417. ></el-table-column>
  418. <el-table-column
  419. label="计量数量"
  420. prop="minPackingCount"
  421. ></el-table-column>
  422. <el-table-column
  423. label="计量单位"
  424. prop="measuringUnit"
  425. ></el-table-column>
  426. <el-table-column
  427. v-if="infoData.bizType == 2 || infoData.bizType == 1"
  428. label="物料代号"
  429. prop="materielCode"
  430. >
  431. <template slot-scope="{ row }">
  432. <el-input
  433. v-show="!row.isPack"
  434. v-model="row.materielCode"
  435. ></el-input>
  436. <span v-show="row.isPack">{{ row.materielCode }}</span>
  437. </template>
  438. </el-table-column>
  439. <el-table-column
  440. v-if="infoData.bizType == 2 || infoData.bizType == 1"
  441. label="客户代号"
  442. prop="clientCode"
  443. >
  444. <template slot-scope="{ row }">
  445. <el-input
  446. v-show="!row.isPack"
  447. v-model="row.clientCode"
  448. ></el-input>
  449. <span v-show="row.isPack">{{ row.clientCode }}</span>
  450. </template>
  451. </el-table-column>
  452. <!-- v-if="infoData.bizType == 1" -->
  453. <el-table-column label="刻码" prop="engrave">
  454. <template slot-scope="{ row }">
  455. <el-input v-show="!row.isPack" v-model="row.engrave"></el-input>
  456. <span v-show="row.isPack">{{ row.engrave }}</span>
  457. </template>
  458. </el-table-column>
  459. <el-table-column label="重量" prop="weight">
  460. <template slot-scope="{ row }">
  461. <el-input v-show="!row.isPack" v-model="row.weight"></el-input>
  462. <span v-show="row.isPack">{{ row.weight }}</span>
  463. </template>
  464. </el-table-column>
  465. <el-table-column label="重量单位" prop="weightUtil">
  466. <template slot-scope="{ row }">
  467. {{ row.weightUtil }}
  468. </template>
  469. </el-table-column>
  470. <el-table-column label="质检结果" prop="result" width="120">
  471. <template slot-scope="{ row }">
  472. <DictSelection
  473. dictName="质检结果"
  474. clearable
  475. v-model="row.result"
  476. v-show="!row.isPack"
  477. @itemChange="packItem($event, row)"
  478. />
  479. <span v-if="row.isPack">
  480. <span v-if="row.result == 0">合格</span>
  481. <span v-else-if="row.result == 1">不合格</span>
  482. <span v-else-if="row.result == 3">让步接收</span>
  483. <span v-else-if="row.result == null"></span>
  484. </span>
  485. </template>
  486. </el-table-column>
  487. <el-table-column label="质检状态" prop="status" width="120">
  488. <template slot-scope="{ row }">
  489. <DictSelection
  490. dictName="质检状态"
  491. clearable
  492. v-model="row.status"
  493. v-show="!row.isPack"
  494. />
  495. <span v-if="row.isPack">
  496. <span v-if="row.status == 0">未检</span>
  497. <span v-if="row.status == 1">已检</span>
  498. <span v-if="row.status == null"></span>
  499. </span>
  500. </template>
  501. </el-table-column>
  502. <el-table-column label="日期" prop="createTime" width="200">
  503. <template slot="header" slot-scope="scope">
  504. {{ dateTypes == 1 ? '采购日期' : '生产日期' }}
  505. </template>
  506. <template slot-scope="{ row }">
  507. {{ row.createTime }}
  508. </template>
  509. </el-table-column>
  510. <el-table-column
  511. label="操作"
  512. width="100"
  513. fixed="right"
  514. align="center"
  515. >
  516. <template slot-scope="{ row, $index }">
  517. <el-button
  518. type="text"
  519. v-show="!row.isPack"
  520. @click="packSave(row, $index)"
  521. >保存</el-button
  522. >
  523. <el-button
  524. type="text"
  525. v-show="row.isPack"
  526. @click="packEdit(row, $index)"
  527. >编辑</el-button
  528. >
  529. </template>
  530. </el-table-column>
  531. </el-table>
  532. </div>
  533. <div class="mt20">
  534. <header-title :title="`物料明细`" size="16px"> </header-title>
  535. <el-table
  536. ref="multipleTable"
  537. :data="metailList"
  538. tooltip-effect="dark"
  539. :header-cell-style="rowClass"
  540. style="width: 100%"
  541. stripe
  542. >
  543. <el-table-column label="序号" type="index" width="50">
  544. </el-table-column>
  545. <el-table-column label="编码" prop="assetCode"></el-table-column>
  546. <el-table-column
  547. label="名称"
  548. prop="assetName"
  549. width="200"
  550. ></el-table-column>
  551. <el-table-column
  552. label="批次号"
  553. prop="batchNo"
  554. width="80"
  555. ></el-table-column>
  556. <el-table-column
  557. label="物料编码"
  558. prop="no"
  559. width="200"
  560. ></el-table-column>
  561. <el-table-column
  562. label="计量数量"
  563. prop="minPackingCount"
  564. width="90"
  565. ></el-table-column>
  566. <el-table-column
  567. width="80"
  568. label="计量单位"
  569. prop="measuringUnit"
  570. ></el-table-column>
  571. <el-table-column
  572. v-if="infoData.bizType == 2"
  573. label="物料代号"
  574. prop="materielCode"
  575. >
  576. <template slot-scope="{ row }">
  577. {{ row.materielCode }}
  578. </template>
  579. </el-table-column>
  580. <el-table-column
  581. v-if="infoData.bizType == 2 || infoData.bizType == 1"
  582. label="客户代号"
  583. prop="clientCode"
  584. >
  585. <template slot-scope="{ row }">
  586. {{ row.clientCode }}
  587. </template>
  588. </el-table-column>
  589. <!-- v-if="infoData.bizType == 1" -->
  590. <el-table-column label="刻码" prop="engrave">
  591. <template slot-scope="{ row }">
  592. {{ row.engrave }}
  593. </template>
  594. </el-table-column>
  595. <el-table-column width="100" label="重量" prop="weight">
  596. <template slot-scope="{ row }">
  597. {{ row.weight }}
  598. </template>
  599. </el-table-column>
  600. <el-table-column label="重量单位" prop="weightUnit">
  601. <template slot-scope="{ row }">
  602. {{ row.weightUnit }}
  603. </template>
  604. </el-table-column>
  605. <el-table-column label="质检结果" prop="result" width="120">
  606. <template slot-scope="{ row }">
  607. <span>
  608. <span v-if="row.result == 0">合格</span>
  609. <span v-else-if="row.result == 1">不合格</span>
  610. <span v-else-if="row.result == 3">让步接收</span>
  611. <span v-else-if="row.result == null"></span>
  612. </span>
  613. </template>
  614. </el-table-column>
  615. <el-table-column label="质检状态" prop="status" width="120">
  616. <template slot-scope="{ row }">
  617. <span>
  618. <span v-if="row.status == 0">未检</span>
  619. <span v-if="row.status == 1">已检</span>
  620. <span v-if="row.status == null"></span>
  621. </span>
  622. </template>
  623. </el-table-column>
  624. <el-table-column
  625. label="操作"
  626. width="80"
  627. v-if="taskDefinitionKey == 'qualityInspection'"
  628. >
  629. <template slot-scope="{ row }">
  630. <el-button type="text" @click="packMeta(row)"> 提交 </el-button>
  631. </template>
  632. </el-table-column>
  633. </el-table>
  634. </div>
  635. </div>
  636. <!-- <div class="center mt20" style="text-align: center">
  637. <el-button type="primary" @click="handleSave" :loading="saveLoading"
  638. >保存</el-button
  639. >
  640. <el-button @click="$router.go(-1)">返回</el-button>
  641. </div> -->
  642. <!-- <WareHouseDailog
  643. ref="wareHouseDailogRef"
  644. @houseData="houseData"
  645. ></WareHouseDailog> -->
  646. </el-card>
  647. </div>
  648. </template>
  649. <script>
  650. // import { getInfo } from '@/api/stockManagement';
  651. import StatusStep from '@/components/StatusStep/common.vue';
  652. // import { fileSystemDownload } from '@/utils';
  653. import outin from '@/api/warehouseManagement/outin';
  654. import fileUpload from '@/components/upload/fileUpload';
  655. import {
  656. getTreeByPid,
  657. getOutInBySourceBizNo,
  658. updateOutInRecord,
  659. updateMaterialById
  660. } from '@/api/classifyManage';
  661. import {
  662. materialType,
  663. warehousingType,
  664. useDict,
  665. useDictLabel,
  666. inputStatus,
  667. emergencyState,
  668. sceneState
  669. } from '@/utils/dict/index';
  670. import { auditStatus } from '@/utils/dict/common';
  671. // import { batchBarPrint } from '@/api/ledgerAssets/booksList';
  672. import { tableHeader } from './common';
  673. import { mapGetters, mapActions } from 'vuex';
  674. export default {
  675. components: { StatusStep, fileUpload },
  676. props: {
  677. businessId: {
  678. default: ''
  679. },
  680. type: {
  681. default: ''
  682. },
  683. taskDefinitionKey: {
  684. default: ''
  685. }
  686. },
  687. data() {
  688. return {
  689. qualityFile: '',
  690. saveLoading: false,
  691. metailList: [],
  692. dateTypes: 1,
  693. detailList: [],
  694. extInfo: {},
  695. codeList: [],
  696. auditStatus,
  697. infoData: {},
  698. warehousingMaterialList: [],
  699. tableData2: [],
  700. activeName: 'a',
  701. num: 1,
  702. openWindows: false, //打印弹窗
  703. barCodeConfig: [],
  704. stepsTitle: '已完成',
  705. stepsStatus: 'success',
  706. active: 0,
  707. // 条码类型枚举
  708. codeTypeObj: {
  709. 生产设备: 'EQUIPMENT',
  710. 舟皿: '',
  711. 周转车: 'TURNOVER_CAR',
  712. 模具: 'MODE',
  713. 库位: 'STORE_LOCAL',
  714. 混合料: 'MIX_MATER',
  715. 混炼料: 'MIXING_MATER',
  716. 破碎料: 'CRUSH_MATER',
  717. 货架: 'GOODS_SHELF',
  718. 返回料: 'RETURN_MATER',
  719. 返工料: 'REWORK_MATER',
  720. 备品备件: 'SPARE_PART',
  721. 车削料: 'LATHE_MATER',
  722. 风管料: 'WIND_PIPE_MATER',
  723. 地面料: 'GROUND_MATER'
  724. }
  725. };
  726. },
  727. watch: {
  728. 'infoData.verifyStatus': {
  729. immediate: true,
  730. handler(val) {
  731. if (val == 0) {
  732. this.active = 1;
  733. this.stepsTitle = '未审核';
  734. this.stepsStatus = 'wait';
  735. } else if (val == 1) {
  736. this.active = 2;
  737. this.stepsTitle = '审核中';
  738. this.stepsStatus = 'process';
  739. } else if (val == 2) {
  740. this.active = 2;
  741. this.stepsTitle = '审核通过';
  742. this.stepsStatus = 'success';
  743. } else if (val == 3) {
  744. this.active = 2;
  745. this.stepsTitle = '驳回';
  746. this.stepsStatus = 'error';
  747. }
  748. }
  749. }
  750. },
  751. computed: {
  752. ...mapGetters(['getDictValue']),
  753. curDateType() {
  754. if (this.materialCodeReqList) {
  755. return this.materialCodeReqList[0].manufactureTime
  756. ? 'manufactureTime'
  757. : 'procurementTime';
  758. }
  759. },
  760. tableHeader() {
  761. return tableHeader(this.infoData.assetType);
  762. },
  763. emergencyState() {
  764. return useDict(emergencyState)(this.infoData.emergencyState);
  765. }
  766. // 条码信息
  767. // materialCodeReqList() {
  768. // return this.warehousingMaterialList.warehouseLedgerDetails;
  769. // }
  770. },
  771. created() {
  772. this.requestDict('类型用途');
  773. this._getInfo();
  774. },
  775. methods: {
  776. //包装结果
  777. packItem(val, row) {
  778. if (val.dictCode == 0) {
  779. row.status = '1';
  780. } else {
  781. row.status = '';
  782. }
  783. },
  784. //质检物料提交
  785. async packMeta(data) {
  786. if (!data.result) {
  787. return this.$message.error('请选择质检结果!');
  788. }
  789. data.status = 1;
  790. data.result = Number(data.result);
  791. await updateMaterialById(data);
  792. this._getInfo();
  793. },
  794. //质检提交
  795. async packCout(data) {
  796. if (!data.result) {
  797. return this.$message.error('请选择质检结果!');
  798. }
  799. data.status = 1;
  800. await updateOutInRecord(data);
  801. this._getInfo();
  802. },
  803. //获取质检状态
  804. getStatus() {
  805. return this.detailList.filter((item) => item.status == 1);
  806. },
  807. //获取回执附件
  808. getQualityFile() {
  809. return { qualityFile: this.qualityFile, id: this.infoData.id };
  810. },
  811. //包装保存
  812. async packSave(row, index) {
  813. console.log('===', row);
  814. console.log('row.minPackingCount', row.minPackingCount);
  815. console.log(' this.detailList.length', this.detailList.length);
  816. let packNo = 0;
  817. this.warehousingMaterialList.forEach((item) => {
  818. if (
  819. item.categoryCode == row.categoryCode &&
  820. item.batchNo == row.batchNo
  821. ) {
  822. if (this.warehousingMaterialList.length != 1) {
  823. packNo = this.warehousingMaterialList.length;
  824. } else {
  825. packNo = item.packingCount;
  826. }
  827. }
  828. });
  829. console.log('packNopackNopackNo', packNo);
  830. if (packNo != this.detailList.length) {
  831. //存当前没改之前包装数量
  832. let count = 0;
  833. for (const item of this.warehousingMaterialList) {
  834. console.log('item', item);
  835. if (item.categoryId == row.categoryId) {
  836. count = item.outInNum;
  837. }
  838. }
  839. console.log(111);
  840. //新增包装更新物料
  841. const arr = [];
  842. row.outInDetailRecordVOList.forEach((it) => {
  843. it.outInDetailRecordMaterialDetailVOList.forEach((item) => {
  844. arr.push({ ...item });
  845. });
  846. });
  847. if (row.minPackingCount < Number(count)) {
  848. console.log(1);
  849. console.log('arr====arr', arr);
  850. console.log('rrrr', this.metailList.length);
  851. this.metailList = this.metaUpdate(arr, row);
  852. } else {
  853. console.log(2);
  854. this.metailList = this.metaAdd(arr, row);
  855. }
  856. this.$set(row, 'isPack', true);
  857. await updateOutInRecord(row);
  858. this.$message.success('修改成功');
  859. return;
  860. }
  861. this.$set(row, 'isPack', true);
  862. //更新包装明细数据,同步物料明细
  863. for (const i in this.metailList) {
  864. if (this.metailList[i].onlyCode == row.code) {
  865. this.metailList[i].clientCode = row.clientCode; //客户代号
  866. this.metailList[i].materielCode = row.materielCode; //物料代号
  867. this.metailList[i].result = row.result; //质检结果
  868. this.metailList[i].status = row.status; //质检状态
  869. this.metailList[i].weight = row.weight / row.minPackingCount; //重量
  870. }
  871. }
  872. //更新包装明细重量,更新物品重量
  873. const list = this.detailList;
  874. let sum = 0;
  875. for (let i = 0; i < list.length; i++) {
  876. sum += Number(list[i].weight);
  877. }
  878. await updateOutInRecord(row);
  879. this.$message.success('修改成功');
  880. this.warehousingMaterialList.forEach((item) => {
  881. if (
  882. item.categoryCode == row.categoryCode &&
  883. item.categoryCode == row.categoryCode
  884. ) {
  885. item.weight = sum;
  886. }
  887. });
  888. console.log(this.warehousingMaterialList);
  889. },
  890. //更新物料
  891. metaUpdate(arr, row) {
  892. const obj = {
  893. assetCode: row.categoryCode,
  894. assetName: row.name,
  895. batchNo: row.batchNo,
  896. clientCode: row.clientCode,
  897. createTime: row.createTime,
  898. engrave: '',
  899. id: '',
  900. materielCode: row.materielCode,
  901. measuringUnit: row.measuringUnit,
  902. minPackingCount: 1,
  903. no: '',
  904. onlyCode: row.code,
  905. outInDetailRecordId: '',
  906. pathName: row.position,
  907. result: row.result,
  908. status: row.status,
  909. weight: row.weight / row.minPackingCount,
  910. weightUnit: row.weightUtil,
  911. counts: row.minPackingCount
  912. };
  913. // 生成 no 字段的值
  914. let newArr = [];
  915. for (let i = 1; i <= obj.counts; i++) {
  916. newArr.push({
  917. ...obj,
  918. no: obj.onlyCode + i.toString().padStart(4, '0')
  919. });
  920. }
  921. console.log('新增', newArr);
  922. console.log(arr);
  923. let data = this.metailList.concat(newArr);
  924. const uniqueData = data.reduce((acc, curr) => {
  925. acc[curr.no] = curr;
  926. return acc;
  927. }, {});
  928. const result = Object.values(uniqueData);
  929. return result;
  930. },
  931. //包装编辑
  932. packEdit(row, index) {
  933. console.log('row', row);
  934. console.log('this.detailList', this.detailList);
  935. this.$set(row, 'isPack', false);
  936. this.$set(
  937. row,
  938. 'result',
  939. row.result != null ? row.result.toString() : ''
  940. );
  941. this.$set(
  942. row,
  943. 'status',
  944. row.status != null ? row.status.toString() : ''
  945. );
  946. },
  947. houseData(argum, idx) {
  948. this.$set(this.warehousingMaterialList[idx], 'houseList', argum);
  949. argum.forEach((item) => {
  950. item.position = `${item.warehouseName}-${item.areaName}-${item.shelfCode}-${item.cargoSpaceCode}`;
  951. item.pathIds = `${item.warehouseId},${item.areaId},${item.shelfId},${item.cargoSpaceId}`;
  952. });
  953. console.log(argum);
  954. this.$set(
  955. this.warehousingMaterialList[idx],
  956. 'position',
  957. argum[0].position
  958. );
  959. console.log(
  960. 'this.warehousingMaterialList',
  961. this.warehousingMaterialList
  962. );
  963. },
  964. // 仓库编辑
  965. handleWareHouse(row, idx) {
  966. const a = row.pathIds.split(',');
  967. const b = row.position.split('-');
  968. row.houseList = [
  969. {
  970. warehouseId: a[0],
  971. warehouseNam: b[0] + '-' + b[1],
  972. areaId: a[1],
  973. areaName: b[2],
  974. shelfId: a[2],
  975. shelfCode: b[3],
  976. cargoSpaceId: a[3],
  977. cargoSpaceCode: b[4],
  978. num: row.packingCount
  979. }
  980. ];
  981. this.$refs.wareHouseDailogRef.open(
  982. { ...row, outInNum: row.packingCount, warehouseId: a[0] },
  983. idx
  984. );
  985. },
  986. async handleSave() {
  987. this.saveLoading = true;
  988. if (this.detailList.length != 0) {
  989. let a = this.infoData;
  990. let array1 = this.warehousingMaterialList;
  991. let array2 = this.detailList.map((item) => {
  992. return { ...item, materialDetails: this.metailList };
  993. });
  994. // 遍历数组1
  995. array1.forEach((item1) => {
  996. item1.arr = [];
  997. item1.outInDetailRecordUpdatePOList = [];
  998. // 遍历数组2
  999. array2.forEach((item2) => {
  1000. if (
  1001. item1.id == item2.outInDetailId &&
  1002. item1.batchNo == item2.batchNo &&
  1003. item1.categoryCode == item2.categoryCode
  1004. ) {
  1005. // 判断id、batchNo、categoryId是否相等
  1006. // 将数组2对象添加到数组1对象的outInDetailRecordVOList中
  1007. item1.arr.push(item2);
  1008. } else {
  1009. console.log(item2);
  1010. item1.outInDetailRecordUpdatePOList.push({ ...item2 });
  1011. }
  1012. });
  1013. });
  1014. array1.forEach((ele) => {
  1015. if (ele.outInDetailRecordUpdatePOList.length == ele.arr.length) {
  1016. delete ele.arr;
  1017. } else {
  1018. ele.outInDetailRecordUpdatePOList = ele.arr;
  1019. delete ele.arr;
  1020. }
  1021. });
  1022. array1.forEach((e) => {
  1023. if (e.hasOwnProperty('houseList')) {
  1024. e.houseList.forEach((item) => {
  1025. e.position = `${item.warehouseName}-${item.areaName}-${item.shelfCode}-${item.cargoSpaceCode}`;
  1026. e.pathIds = `${item.warehouseId},${item.areaId},${item.shelfId},${item.cargoSpaceId}`;
  1027. });
  1028. }
  1029. });
  1030. delete array1.houseList;
  1031. a.outInDetailUpdatePOList = array1;
  1032. a.extInfo = this.extInfo;
  1033. const obj = this.formatUpdate(a);
  1034. console.log('sss===》', obj);
  1035. try {
  1036. const data = await outin.update(obj);
  1037. if (data.code == 0) {
  1038. this.$message.success('修改成功!');
  1039. // this.$router.push('/warehouseManagement/stockManagement');
  1040. }
  1041. } catch (error) {
  1042. this.saveLoading = false;
  1043. }
  1044. } else {
  1045. this.$message.warning('包装明细为空!');
  1046. }
  1047. this.saveLoading = false;
  1048. },
  1049. formatUpdate(a) {
  1050. delete a.outInDetailVOList;
  1051. console.log(a);
  1052. // 删除 outInDetailVOList 数组对象里面的 outInDetailRecordVOList 数组对象里面的 outInDetailRecordMaterialDetailVOList
  1053. a.outInDetailUpdatePOList = a.outInDetailUpdatePOList.map((item) => {
  1054. const newItem = { ...item };
  1055. delete newItem.outInDetailRecordVOList;
  1056. return newItem;
  1057. });
  1058. const newData = {
  1059. ...a,
  1060. outInDetailUpdatePOList: a.outInDetailUpdatePOList.map((detail) => {
  1061. const { outInDetailRecordMaterialDetailVOList, ...rest } = detail;
  1062. return {
  1063. ...rest,
  1064. outInDetailRecordUpdatePOList:
  1065. rest.outInDetailRecordUpdatePOList.map((record) => {
  1066. const {
  1067. outInDetailRecordMaterialDetailVOList,
  1068. ...recordRest
  1069. } = record;
  1070. return { ...recordRest };
  1071. })
  1072. };
  1073. })
  1074. };
  1075. // 对原始数据进行深拷贝,以避免修改原始数据
  1076. const arr = JSON.parse(JSON.stringify(newData));
  1077. // 遍历 outInDetailUpdatePOList 数组
  1078. arr.outInDetailUpdatePOList.forEach((detail) => {
  1079. // 遍历 outInDetailRecordUpdatePOList 数组
  1080. detail.outInDetailRecordUpdatePOList.forEach((record) => {
  1081. // 筛选出与 code 相等的 materialDetails 项
  1082. const matchedDetails = record.materialDetails.filter(
  1083. (item) => item.onlyCode === record.code
  1084. );
  1085. // 将匹配项放入 materialDetails 数组中
  1086. record.materialDetails = matchedDetails;
  1087. });
  1088. });
  1089. return arr;
  1090. },
  1091. packNum(row, value) {
  1092. console.log(row);
  1093. const total = {
  1094. packingCount: Number(row.minPackingCount),
  1095. outInNum: Number(row.packingCount)
  1096. };
  1097. if (row.measuringUnit == row.weightUnit) {
  1098. row.weight = total.packingCount * 1 * total.outInNum.toFixed(2);
  1099. } else {
  1100. const totals = total.packingCount * total.outInNum;
  1101. row.weight = totals * row.netWeight.toFixed(2);
  1102. }
  1103. return (row.outInNum = value.replace(/^(0+)|[^\d]+/g, ''));
  1104. },
  1105. listEdit(row) {
  1106. this.$set(row, 'isSave', false);
  1107. //包装
  1108. const list = this.detailList;
  1109. for (let i = 0; i < list.length; i++) {
  1110. if (list[i].categoryCode === row.categoryCode) {
  1111. // 删除满足条件的对象
  1112. this.detailList.splice(i, 1);
  1113. // 因为删除了一个对象,需要将索引减1
  1114. i--;
  1115. }
  1116. }
  1117. //物料
  1118. const lists = this.metailList;
  1119. for (let i = 0; i < lists.length; i++) {
  1120. if (lists[i].assetCode === row.categoryCode) {
  1121. // 删除满足条件的对象
  1122. this.metailList.splice(i, 1);
  1123. // 因为删除了一个对象,需要将索引减1
  1124. i--;
  1125. }
  1126. }
  1127. },
  1128. listSave(row, index) {
  1129. console.log(row);
  1130. const fileds = [
  1131. // `warehousingMaterialList.${index}.batchNo`,
  1132. `warehousingMaterialList.${index}.position`
  1133. ];
  1134. console.log('==1', this.infoData.bizType);
  1135. if (this.infoData.bizType != 5) {
  1136. fileds.push(
  1137. ...[
  1138. // `warehousingMaterialList.${index}.packingCount`,
  1139. // `warehousingMaterialList.${index}.minPackingCount`
  1140. ]
  1141. );
  1142. } else if (
  1143. this.warehousingMaterialList.some(
  1144. (i) => !i.outInDetailRecordVOList?.length
  1145. )
  1146. ) {
  1147. this.$message.error('请选择资产编号!');
  1148. return;
  1149. }
  1150. Promise.all(
  1151. fileds.map(
  1152. (item) =>
  1153. new Promise(async (resolve, rej) => {
  1154. this.$refs.warehousingMaterialListRef.validateField(
  1155. item,
  1156. (err) => {
  1157. if (err) {
  1158. rej(err);
  1159. } else {
  1160. resolve();
  1161. }
  1162. }
  1163. );
  1164. })
  1165. )
  1166. )
  1167. .then((res) => {
  1168. this.$set(row, 'isSave', true);
  1169. if (this.infoData.bizType != 5) {
  1170. this.createMaterialCode(row);
  1171. } else {
  1172. // 退还
  1173. // this.createMaterialCodeReturn(row);
  1174. }
  1175. })
  1176. .catch((err) => {
  1177. console.log(err);
  1178. this.$message.error('请填入必填项!');
  1179. });
  1180. },
  1181. async createMaterialCode(row) {
  1182. console.log('==--', row);
  1183. const {
  1184. packingCount,
  1185. minPackingCount,
  1186. weight,
  1187. outInDetailRecordVOList
  1188. } = row;
  1189. // console.log(row);
  1190. // if (row.houseList) {
  1191. // row.houseList.forEach((item) => {
  1192. // position = `${item.warehouseName}-${item.areaName}-${item.shelfCode}-${item.cargoSpaceCode}`;
  1193. // pathIds = `${item.warehouseId},${item.areaId},${item.shelfId},${item.cargoSpaceId}`;
  1194. // });
  1195. // }
  1196. const codes = outInDetailRecordVOList[0].code;
  1197. const index = outInDetailRecordVOList[0].code.indexOf('636');
  1198. const result = codes.slice(-3);
  1199. const dataArray = [];
  1200. for (let i = 0; i < packingCount; i++) {
  1201. const newData = { ...row };
  1202. if (outInDetailRecordVOList.length != packingCount) {
  1203. newData.minPackingCount = row.minPackingCount;
  1204. newData.packingCount = 1;
  1205. newData.weight = weight / packingCount;
  1206. newData.weightUtil = row.weightUnit;
  1207. newData.outInDetailId = row.id;
  1208. } else {
  1209. newData.minPackingCount = row.minPackingCount;
  1210. newData.weight = weight / packingCount;
  1211. newData.packingCount = row.packingCount / packingCount;
  1212. newData.weightUtil = row.weightUnit;
  1213. newData.outInDetailId = row.id;
  1214. }
  1215. dataArray.push(newData);
  1216. }
  1217. for (let j = 0; j < dataArray.length; j++) {
  1218. const num = Number(result);
  1219. const nums = num + j;
  1220. const str = nums.toString().padStart(result.length, '0');
  1221. dataArray[j].code =
  1222. dataArray[j].categoryCode + dataArray[j].batchNo + str;
  1223. dataArray[j].isPack = true;
  1224. }
  1225. const list = JSON.parse(localStorage.getItem('exitList'));
  1226. dataArray.forEach((ele, index) => {
  1227. if (index < list.length) {
  1228. if (ele.code === list[index].code) {
  1229. ele.id = list[index].id;
  1230. } else {
  1231. ele.isPack = false;
  1232. ele.id = ''; // 当 code 不匹配时,将 id 设为空字符串
  1233. }
  1234. } else {
  1235. ele.isPack = false;
  1236. ele.id = ''; // 如果 index 超出了 list 的范围,将 id 设为空字符串
  1237. }
  1238. });
  1239. this.detailList = this.pacKUpdate(dataArray);
  1240. this.metailList = this.metailUpdate(dataArray);
  1241. // this.metailList = this.metaAdd(dataArray);
  1242. console.log('====>>>>>1', dataArray);
  1243. },
  1244. //包装修改
  1245. pacKUpdate(arr) {
  1246. for (const it of arr) {
  1247. for (const ti of it.outInDetailRecordVOList) {
  1248. if (ti.id == it.id) {
  1249. it.materielCode = ti.materielCode;
  1250. it.clientCode = ti.clientCode;
  1251. it.result = ti.result;
  1252. it.status = ti.status;
  1253. }
  1254. }
  1255. }
  1256. return arr;
  1257. },
  1258. //物料新增
  1259. metaAdd(arr) {
  1260. const list = arr;
  1261. let resultArray = [];
  1262. list.forEach((item) => {
  1263. for (let i = 1; i <= Number(item.minPackingCount); i++) {
  1264. resultArray.push({
  1265. onlyCode: item.code,
  1266. no: item.code + i.toString().padStart(4, '0'),
  1267. assetCode: item.categoryCode,
  1268. assetName: item.name,
  1269. batchNo: item.batchNo,
  1270. minPackingCount: 1,
  1271. measuringUnit: item.measuringUnit,
  1272. materielCode: item.materielCode,
  1273. clientCode: item.clientCode,
  1274. weight: item.weight / Number(item.minPackingCount),
  1275. weightUnit: item.weightUnit,
  1276. engrave: item.engrave,
  1277. result: item.result,
  1278. status: item.status
  1279. });
  1280. }
  1281. });
  1282. return resultArray;
  1283. // console.log('物料', resultArray);
  1284. },
  1285. //物料修改
  1286. metailUpdate(arr) {
  1287. console.log('---', arr);
  1288. const extractedArray = [];
  1289. arr.forEach((item) => {
  1290. item.outInDetailRecordVOList.forEach((record) => {
  1291. extractedArray.push(
  1292. ...record.outInDetailRecordMaterialDetailVOList
  1293. );
  1294. });
  1295. });
  1296. // 用于存储已经遇到的ID
  1297. let idMap = {};
  1298. // 用于存储结果的数组
  1299. let uniqueArray = [];
  1300. // 遍历原始数据
  1301. for (let i = 0; i < extractedArray.length; i++) {
  1302. let currentItem = extractedArray[i];
  1303. // 检查当前ID是否已经在map中存在
  1304. if (!idMap[currentItem.id]) {
  1305. // 如果ID不存在,将当前ID添加到map中,并将当前数据添加到结果数组中
  1306. idMap[currentItem.id] = true;
  1307. uniqueArray.push(currentItem);
  1308. }
  1309. }
  1310. return uniqueArray;
  1311. },
  1312. //计算金额
  1313. calcSumTotal(PackingCount, outInNum, univalence) {
  1314. //最小包装单元,包装数量,单价
  1315. const total = {
  1316. PackingCount: Number(PackingCount),
  1317. outInNum: Number(outInNum),
  1318. univalence: Number(univalence == undefined ? 0 : univalence)
  1319. };
  1320. return total.PackingCount * total.outInNum * total.univalence;
  1321. },
  1322. ...mapActions('dict', ['requestDict']),
  1323. getAuditStatus: useDictLabel(auditStatus),
  1324. getMaterialType: useDictLabel(materialType),
  1325. getInputStatus: useDictLabel(inputStatus),
  1326. getSceneState: useDictLabel(sceneState),
  1327. handleRowUnit(row) {
  1328. return row.measuringUnit;
  1329. // if (this.extInfo.assetType == 1) {
  1330. // console.log(row);
  1331. // return row.weightUnit;
  1332. // } else if (this.extInfo.assetType == 4) {
  1333. // return row.measuringUnit;
  1334. // } else {
  1335. // return row.measuringUnit;
  1336. // }
  1337. },
  1338. handleAssetType(r) {
  1339. const code = this.codeList.find((item) => item.dictCode == r);
  1340. return code?.dictValue;
  1341. },
  1342. rowClass({ row, column, rowIndex, columnIndex }) {
  1343. if (rowIndex === 1) {
  1344. return {
  1345. display: 'none',
  1346. background: '#EEEEEE',
  1347. border: 'none'
  1348. };
  1349. }
  1350. return { background: '#EEEEEE', border: 'none' };
  1351. },
  1352. async _getInfo() {
  1353. const res =
  1354. this.type == 'sourceBizNo'
  1355. ? await getOutInBySourceBizNo(this.businessId)
  1356. : await outin.getById(this.businessId);
  1357. console.log('===', res);
  1358. console.log('===', res);
  1359. if (res) {
  1360. this.infoData = res;
  1361. this.extInfo = res.extInfo;
  1362. this.warehousingMaterialList = res.outInDetailVOList.map((item) => {
  1363. return { ...item, isSave: true };
  1364. });
  1365. const arr = [];
  1366. for (const key in this.warehousingMaterialList) {
  1367. for (const k in this.warehousingMaterialList[key]
  1368. .outInDetailRecordVOList) {
  1369. arr.push({
  1370. ...this.warehousingMaterialList[key].outInDetailRecordVOList[k],
  1371. weightUnit: this.warehousingMaterialList[key].weightUnit
  1372. });
  1373. }
  1374. }
  1375. this.exitList = arr;
  1376. localStorage.setItem('exitList', JSON.stringify(arr));
  1377. this.dateTypes = arr[0].dateType;
  1378. this.detailList = arr.map((item) => {
  1379. return { ...item, isPack: true };
  1380. });
  1381. let iArr = [];
  1382. arr.forEach((item) => {
  1383. item.outInDetailRecordMaterialDetailVOList.forEach((ele) => {
  1384. iArr.push({ ...ele });
  1385. });
  1386. });
  1387. this.metailList = iArr.map((item) => {
  1388. return {
  1389. ...item,
  1390. result:
  1391. item.result == 0
  1392. ? '0'
  1393. : item.result != null
  1394. ? item.result.toString()
  1395. : ''
  1396. };
  1397. });
  1398. }
  1399. const { data } = await getTreeByPid(0);
  1400. this.codeList = data.map((item) => {
  1401. return { dictCode: item.id, dictValue: item.name };
  1402. });
  1403. },
  1404. calcSum(a, b, c, row) {
  1405. if (
  1406. (Number.isNaN(+a) && a !== '') ||
  1407. (Number.isNaN(+b) && b !== '') ||
  1408. (Number.isNaN(+c) && c !== '')
  1409. ) {
  1410. return '';
  1411. }
  1412. return a * b * c + { yuan: '元', wanyuan: '万元' }[row.univalenceUnit];
  1413. },
  1414. contentImageDownload(item) {
  1415. fileSystemDownload(item);
  1416. },
  1417. selectActive(num) {
  1418. this.num = num;
  1419. }
  1420. }
  1421. };
  1422. </script>
  1423. <style lang="scss" scoped>
  1424. ::v-deep .page-title {
  1425. border-bottom: none;
  1426. }
  1427. ::v-deep .page-title-div {
  1428. width: 100%;
  1429. }
  1430. .stepsStatus {
  1431. width: 40%;
  1432. margin: 0 auto;
  1433. }
  1434. .el-form-item {
  1435. margin-bottom: 10px;
  1436. }
  1437. .p20 {
  1438. padding: 20px;
  1439. }
  1440. .flex {
  1441. display: flex;
  1442. }
  1443. .title {
  1444. justify-content: space-between;
  1445. border-bottom: 1px solid #ccc;
  1446. padding-bottom: 5px;
  1447. span {
  1448. font-size: 16px;
  1449. }
  1450. .col {
  1451. padding-left: 40px;
  1452. font-size: 14px;
  1453. color: #aaaaaa;
  1454. }
  1455. }
  1456. .degree {
  1457. margin-right: 10px;
  1458. padding: 0px 15px;
  1459. color: #fff;
  1460. font-size: 13px;
  1461. line-height: 23px;
  1462. border-radius: 23px;
  1463. display: flex;
  1464. align-items: center;
  1465. justify-content: space-between;
  1466. span {
  1467. width: 5px;
  1468. height: 5px;
  1469. border-radius: 100%;
  1470. margin-right: 6px;
  1471. background-color: #fff;
  1472. }
  1473. }
  1474. .red {
  1475. background-color: rgb(163, 0, 20);
  1476. }
  1477. .blue {
  1478. background-color: #1989fa;
  1479. }
  1480. .createdInfo {
  1481. justify-content: space-around;
  1482. margin-top: 10px;
  1483. font-size: 14px;
  1484. .col {
  1485. color: #6e6e6e;
  1486. padding-right: 10px;
  1487. }
  1488. }
  1489. .mt40 {
  1490. margin-top: 40px;
  1491. }
  1492. .custSteps {
  1493. margin-top: 20px;
  1494. margin-left: 70px;
  1495. .box {
  1496. width: 158px;
  1497. border: 1px solid #ccc;
  1498. padding: 10px;
  1499. flex-direction: row;
  1500. flex-wrap: wrap;
  1501. // justify-content: space-between;
  1502. font-size: 12px;
  1503. color: #9e9e9e;
  1504. .x {
  1505. width: 20px;
  1506. height: 15px;
  1507. margin-right: 5px;
  1508. }
  1509. .q {
  1510. background-color: #d0e4d5;
  1511. }
  1512. .b {
  1513. background-color: #1989fa;
  1514. }
  1515. .g {
  1516. background-color: #157a2c;
  1517. }
  1518. .r {
  1519. background-color: #a30014;
  1520. }
  1521. .a {
  1522. align-items: center;
  1523. margin-bottom: 10px;
  1524. }
  1525. .mr10 {
  1526. margin-right: 10px;
  1527. }
  1528. .mb0 {
  1529. margin-bottom: 0;
  1530. }
  1531. }
  1532. .stepsInfo {
  1533. // flex: 1;
  1534. width: 483px;
  1535. }
  1536. }
  1537. .mt20 {
  1538. margin-top: 20px;
  1539. }
  1540. .content-detail {
  1541. overflow: hidden;
  1542. }
  1543. .executor {
  1544. font-size: 14px;
  1545. .col {
  1546. color: #6e6e6e;
  1547. padding-right: 10px;
  1548. }
  1549. }
  1550. .result {
  1551. justify-content: space-around;
  1552. }
  1553. .mr20 {
  1554. margin-right: 20px;
  1555. }
  1556. .details {
  1557. font-size: 14px;
  1558. margin-bottom: 10px;
  1559. }
  1560. .customSteps {
  1561. margin-top: 40px;
  1562. font-size: 14px;
  1563. margin-left: 80px;
  1564. .time {
  1565. font-size: 12px;
  1566. color: #6e6e6e;
  1567. margin-right: 20px;
  1568. position: relative;
  1569. &::after {
  1570. content: '';
  1571. width: 1px;
  1572. height: 100%;
  1573. background-color: #157a2c;
  1574. position: absolute;
  1575. right: -26px;
  1576. }
  1577. }
  1578. .flex:last-child {
  1579. .time {
  1580. &::after {
  1581. display: none;
  1582. }
  1583. }
  1584. }
  1585. .round {
  1586. margin-right: 20px;
  1587. width: 10px;
  1588. height: 10px;
  1589. border-radius: 100%;
  1590. background-color: #157a2c;
  1591. position: relative;
  1592. span {
  1593. position: absolute;
  1594. top: 50%;
  1595. left: 50%;
  1596. width: 4px;
  1597. height: 4px;
  1598. background-color: #fff;
  1599. border-radius: 100%;
  1600. transform: translate(-2px, -2px);
  1601. }
  1602. }
  1603. .text {
  1604. .info {
  1605. margin-top: 10px;
  1606. width: 955px;
  1607. background-color: #f0f3f3;
  1608. overflow: hidden;
  1609. padding: 10px;
  1610. margin-bottom: 10px;
  1611. }
  1612. }
  1613. }
  1614. .switch_left li {
  1615. border-right: 1px solid rgba(222, 222, 222, 1);
  1616. border-left: 1px solid rgba(222, 222, 222, 1);
  1617. }
  1618. </style>