productionWarehousing.vue 73 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098
  1. <!-- 生产入库 -->
  2. <template>
  3. <div class="productionWarehousing">
  4. <el-card shadow="never">
  5. <header-title title="基本信息"></header-title>
  6. <el-form
  7. :model="formData"
  8. ref="formName"
  9. label-width="110px"
  10. :rules="rules"
  11. >
  12. <el-row :gutter="20">
  13. <el-col :span="8">
  14. <el-form-item label="物品类型" prop="extInfo.assetType">
  15. <selectTree
  16. ref="tree"
  17. class="form-ipt"
  18. :isBindPlan="true"
  19. disabled
  20. size="medium"
  21. style="width: 100%"
  22. :value="formData.extInfo.assetType"
  23. clearable
  24. :options="codeList"
  25. :props="{
  26. value: 'id',
  27. label: 'name',
  28. children: 'children'
  29. }"
  30. @getValue="codeListValue"
  31. :isAll="false"
  32. />
  33. </el-form-item>
  34. </el-col>
  35. <el-col :span="8">
  36. <el-form-item label="入库类型" prop="bizType">
  37. <el-select
  38. @change="onClear"
  39. filterable
  40. placeholder="请选择"
  41. v-model="formData.bizType"
  42. clearable
  43. :disabled="
  44. !!(warehousingMaterialList && warehousingMaterialList.length)
  45. "
  46. >
  47. <el-option
  48. v-for="item in sceneState"
  49. :key="item.code"
  50. :value="item.code + ''"
  51. :label="item.label"
  52. ></el-option>
  53. </el-select> </el-form-item
  54. ></el-col>
  55. <el-col :span="8">
  56. <el-form-item label="生产工单" prop="documentSource">
  57. <el-input
  58. v-model="formData.extInfo.documentSource"
  59. placeholder=""
  60. disabled
  61. ></el-input>
  62. <!-- <el-input
  63. placeholder="请输入"
  64. v-model="formData.extInfo.documentSource"
  65. @click.native="handlePicker()"
  66. :disabled="isTask"
  67. >
  68. </el-input> -->
  69. </el-form-item>
  70. </el-col>
  71. <el-col :span="8">
  72. <el-form-item label="权属部门" prop="deptName">
  73. <el-input
  74. placeholder="权属部门"
  75. disabled
  76. v-model="formData.extInfo.deptName"
  77. clearable
  78. />
  79. </el-form-item>
  80. </el-col>
  81. <el-col :span="8">
  82. <el-form-item label="入库登记人">
  83. <el-input
  84. placeholder="登记人"
  85. disabled
  86. v-model="formData.extInfo.createUserName"
  87. clearable /></el-form-item
  88. ></el-col>
  89. <el-col :span="8" v-if="formData.bizType == 2">
  90. <el-form-item label="供应商" prop="supplierName">
  91. <el-input
  92. placeholder="请输入"
  93. clearable
  94. v-model="formData.extInfo.supplierName"
  95. />
  96. </el-form-item>
  97. </el-col>
  98. <el-col :span="8">
  99. <el-form-item label="送货人" prop="fromUser">
  100. <el-input
  101. placeholder="请输入"
  102. v-model="formData.fromUser"
  103. clearable
  104. /> </el-form-item
  105. ></el-col>
  106. <el-col :span="8">
  107. <el-form-item label="送货人联系方式" prop="deliveryPhone">
  108. <el-input
  109. placeholder="请输入"
  110. v-model="formData.extInfo.deliveryPhone"
  111. clearable /></el-form-item
  112. ></el-col>
  113. <el-col :span="24">
  114. <el-form-item label="备注" prop="remark">
  115. <el-input
  116. v-model="formData.remark"
  117. clearable
  118. type="textarea"
  119. placeholder="请详细说明"
  120. :rows="4"
  121. ></el-input>
  122. </el-form-item>
  123. </el-col>
  124. </el-row>
  125. </el-form>
  126. <div class="material">
  127. <header-title title="产品信息">
  128. <el-button type="primary" @click="addStock" v-if="!isTask"
  129. >添加</el-button
  130. >
  131. </header-title>
  132. <div class="mt10 form-table">
  133. <el-form
  134. ref="warehousingMaterialListRef"
  135. :model="{ warehousingMaterialList: warehousingMaterialList }"
  136. :show-message="false"
  137. >
  138. <el-button
  139. v-if="warehousingMaterialList.length != 0"
  140. type="success"
  141. plain
  142. style="margin-bottom: 20px; float: right; margin-right: 20px"
  143. size="mini"
  144. @click="listSaveArrs"
  145. >批量保存</el-button
  146. >
  147. <el-table
  148. v-if="isWeight"
  149. :header-cell-style="rowClass"
  150. ref="warehousingMaterialListTable"
  151. :key="formData.extInfo.assetType"
  152. :data="warehousingMaterialList"
  153. tooltip-effect="dark"
  154. style="width: 100%"
  155. stripe
  156. >
  157. <el-table-column
  158. label="序号"
  159. type="index"
  160. width="50"
  161. align="center"
  162. >
  163. </el-table-column>
  164. <el-table-column
  165. label="编码"
  166. prop="assetCode"
  167. align="center"
  168. width="130"
  169. ></el-table-column>
  170. <el-table-column
  171. label="名称"
  172. align="center"
  173. width="200"
  174. prop="assetName"
  175. ></el-table-column>
  176. <!-- <el-table-column
  177. label="客户编码"
  178. align="center"
  179. width="150"
  180. prop="customCode"
  181. v-if="formData.bizType == 1"
  182. >
  183. <template slot-scope="{ row, $index }">
  184. <template v-if="row.isSave">
  185. {{ row.customCode }}
  186. </template>
  187. <el-form-item
  188. v-else
  189. :prop="`warehousingMaterialList.${$index}.customCode`"
  190. required
  191. >
  192. <el-input v-model="row.customCode"> </el-input>
  193. </el-form-item>
  194. </template>
  195. </el-table-column>
  196. <el-table-column
  197. label="供应商编码"
  198. align="center"
  199. width="150"
  200. prop="customCode"
  201. v-if="formData.bizType == 2"
  202. >
  203. <template slot-scope="{ row, $index }">
  204. <template v-if="row.isSave">
  205. {{ row.supplierCode }}
  206. </template>
  207. <el-form-item
  208. v-else
  209. :prop="`warehousingMaterialList.${$index}.supplierCode`"
  210. required
  211. >
  212. <el-input v-model="row.supplierCode"> </el-input>
  213. </el-form-item>
  214. </template>
  215. </el-table-column> -->
  216. <el-table-column
  217. v-for="(item, index) in tableHeader"
  218. :key="index"
  219. align="center"
  220. :label="item.label"
  221. width="150"
  222. :prop="item.prop"
  223. >
  224. <template slot-scope="{ row }">
  225. <template v-if="item.formatter">{{
  226. item.formatter(row)
  227. }}</template>
  228. <template v-else>{{ row[item.prop] }}</template>
  229. </template>
  230. </el-table-column>
  231. <el-table-column label="批号" width="100" prop="assetName">
  232. <template slot-scope="{ row, $index }">
  233. <template>
  234. {{ row.manualBatchNo }}
  235. </template>
  236. <!-- <el-form-item>
  237. <el-input v-model="row.manualBatchNo"> </el-input>
  238. </el-form-item> -->
  239. </template>
  240. </el-table-column>
  241. <el-table-column
  242. label="批次号"
  243. prop="batchNo"
  244. width="70"
  245. align="center"
  246. >
  247. <template slot-scope="{ row, $index }">
  248. <template v-if="row.isSave">
  249. {{ row.batchNo }}
  250. </template>
  251. <el-form-item
  252. v-else
  253. :prop="`warehousingMaterialList.${$index}.batchNo`"
  254. required
  255. >
  256. <!-- <el-input v-model="row.batchNo"></el-input> -->
  257. {{ row.batchNo }}
  258. </el-form-item>
  259. </template>
  260. </el-table-column>
  261. <el-table-column
  262. label="最小包装单元"
  263. align="center"
  264. prop="minPackingCount"
  265. width="100"
  266. >
  267. <el-table-column label="" prop="minPackingCount" width="100">
  268. <template slot-scope="{ row, $index }">
  269. <template>
  270. {{ row.minPackingCount }}
  271. </template>
  272. <!-- <template v-if="row.isSave">
  273. {{ row.minPackingCount }}
  274. </template>
  275. <el-form-item
  276. v-else
  277. :prop="`warehousingMaterialList.${$index}.minPackingCount`"
  278. required
  279. >
  280. <el-input
  281. type="number"
  282. v-model="row.minPackingCount"
  283. @input="minPackingCountChange(row, $event)"
  284. >
  285. </el-input>
  286. </el-form-item> -->
  287. </template>
  288. </el-table-column>
  289. <el-table-column label="" prop="minPackingCount">
  290. <template slot-scope="{ row, $index }">
  291. {{ handleRowUnit(row) }} /{{ row.minPackUnit }}
  292. </template>
  293. </el-table-column>
  294. </el-table-column>
  295. <el-table-column
  296. label="包装数量"
  297. prop="outInNum"
  298. width="150"
  299. align="center"
  300. >
  301. <template slot-scope="{ row, $index }">
  302. <template>
  303. {{ row.outInNum }} {{ row.minPackUnit }}
  304. </template>
  305. <!-- <template v-if="row.isSave || formData.bizType == 5">
  306. {{ row.outInNum }} {{ row.minPackUnit }}
  307. </template>
  308. <el-form-item
  309. v-else
  310. :prop="`warehousingMaterialList.${$index}.outInNum`"
  311. required
  312. >
  313. <el-input
  314. v-model="row.outInNum"
  315. @input="packNum(row, $event)"
  316. >
  317. <template slot="append">
  318. {{ row.minPackUnit ? row.minPackUnit : '/' }}
  319. </template>
  320. </el-input>
  321. </el-form-item> -->
  322. </template>
  323. </el-table-column>
  324. <el-table-column label="计量数量" prop="counts">
  325. <template slot-scope="{ row, $index }">
  326. {{ $math.format(row.minPackingCount * row.outInNum, 14) }}
  327. </template>
  328. </el-table-column>
  329. <el-table-column
  330. label="计量单位"
  331. prop="batchNo"
  332. width="100"
  333. align="center"
  334. >
  335. <!-- v-if="formData.extInfo.assetType == 1" -->
  336. <template slot-scope="{ row, $index }">
  337. <template>
  338. {{ row.measuringUnit }}
  339. </template>
  340. </template>
  341. </el-table-column>
  342. <el-table-column
  343. label="重量"
  344. align="center"
  345. prop="contentImage"
  346. :show-overflow-tooltip="true"
  347. >
  348. <template slot-scope="{ row, $index }">
  349. {{ row.weight }}
  350. <template slot="append">
  351. {{ handleRowUnit(row) }}
  352. </template>
  353. </template>
  354. </el-table-column>
  355. <el-table-column
  356. label="重量单位"
  357. align="center"
  358. prop="contentImage"
  359. :show-overflow-tooltip="true"
  360. >
  361. <template slot-scope="{ row, $index }">
  362. {{ row.weightUnit }}
  363. <template slot="append"> </template>
  364. </template>
  365. </el-table-column>
  366. <el-table-column
  367. label="单价"
  368. prop="univalence"
  369. width="150"
  370. align="center"
  371. >
  372. <template slot-scope="{ row, $index }">
  373. <div v-if="row.isSave"
  374. >{{ row.univalence }}元/{{ handleRowUnit(row) }}</div
  375. >
  376. <el-form-item
  377. v-else
  378. :prop="`warehousingMaterialList.${$index}.univalence`"
  379. >
  380. <el-input
  381. v-model="row.univalence"
  382. placeholder="非必填"
  383. @input="
  384. (value) =>
  385. (row.univalence = value.replace(/[^0-9.]+/g, ''))
  386. "
  387. >
  388. <template slot="append">
  389. 元/{{ handleRowUnit(row) }}
  390. </template>
  391. </el-input>
  392. </el-form-item>
  393. </template>
  394. </el-table-column>
  395. <el-table-column
  396. label="金额"
  397. align="center"
  398. prop="contentImage"
  399. :show-overflow-tooltip="true"
  400. >
  401. <template slot-scope="{ row, $index }">
  402. {{
  403. calcSumTotal(
  404. row.outInNum,
  405. row.minPackingCount,
  406. row.univalence,
  407. row
  408. )
  409. }}
  410. </template>
  411. </el-table-column>
  412. <el-table-column
  413. label="货位"
  414. prop="warehouseName"
  415. :show-overflow-tooltip="true"
  416. width="250"
  417. required
  418. >
  419. <template slot-scope="{ row, $index }">
  420. <el-form-item
  421. :prop="`warehousingMaterialList.${$index}.houseList`"
  422. :required="true"
  423. >
  424. <div @click="handleWareHouse(row, $index)">
  425. <div
  426. style="color: #ff4949"
  427. v-if="row.houseList.length == 0"
  428. >
  429. ---(必填)
  430. </div>
  431. <div v-else>
  432. <div
  433. class="fontOmitted"
  434. v-for="(item, index) in row.houseList"
  435. :key="index"
  436. >
  437. {{ item.warehouseName }}- {{ item.areaName }}-
  438. {{ item.shelfCode }}- {{ item.cargoSpaceCode
  439. }}<span style="color: #ff4949" v-if="item.num">
  440. - {{ item.num }}(数)</span
  441. >
  442. <br />
  443. </div>
  444. </div>
  445. </div>
  446. </el-form-item>
  447. </template>
  448. </el-table-column>
  449. <el-table-column
  450. label="质检单"
  451. v-if="formData.extInfo.assetType === 3"
  452. prop="contentImage"
  453. :show-overflow-tooltip="true"
  454. >
  455. <template slot-scope="{ row, $index }">
  456. <upload @on-success="(data) => (row.contentImage = [data])"
  457. ><template slot="placeholder">上传</template></upload
  458. >
  459. </template>
  460. </el-table-column>
  461. <el-table-column
  462. label="操作"
  463. width="200"
  464. fixed="right"
  465. align="center"
  466. >
  467. <template slot="header" slot-scope="scope"> 操作 </template>
  468. <template slot-scope="{ row, $index }">
  469. <el-button
  470. type="text"
  471. v-show="!row.isSave"
  472. @click="listSave(row, $index)"
  473. >保存</el-button
  474. >
  475. <el-button
  476. type="text"
  477. v-show="row.isSave"
  478. @click="listEdit(row, $index)"
  479. >编辑</el-button
  480. >
  481. <el-button
  482. type="text"
  483. @click="listDel(row, $index)"
  484. v-if="!isTask"
  485. >删除</el-button
  486. >
  487. </template>
  488. </el-table-column>
  489. </el-table>
  490. </el-form>
  491. </div>
  492. <div class="mt20">
  493. <header-title :title="`包装明细`">
  494. <div class="switch_right">
  495. <span v-if="materialCodeReqList.length != 0">
  496. 分拆<el-switch
  497. v-model="isSplit"
  498. active-color="#13ce66"
  499. inactive-color="#ff4949"
  500. @change="handleIsDetail"
  501. style="margin-left: 10px"
  502. >
  503. </el-switch>
  504. </span>
  505. <!-- <el-button
  506. style="margin-left: 20px"
  507. type="text"
  508. @click="dateSetting"
  509. v-if="formData.bizType != 5"
  510. >批量设置{{
  511. curDateType === 'manufactureTime' ? '生产日期' : '采购日期'
  512. }}</el-button
  513. > -->
  514. </div>
  515. </header-title>
  516. <!-- <el-button
  517. v-if="materialCodeReqList.length != 0"
  518. type="success"
  519. plain
  520. style="margin-bottom: 20px; float: right; margin-right: 20px"
  521. size="mini"
  522. @click="wrapListSave"
  523. >批量保存</el-button
  524. > -->
  525. <el-table
  526. ref="materialCodeReqListTable"
  527. :data="materialCodeReqList"
  528. tooltip-effect="dark"
  529. :key="formData.bizType"
  530. :header-cell-style="rowClass"
  531. style="width: 100%"
  532. stripe
  533. height="300px"
  534. @selection-change="handleSelectionChange"
  535. >
  536. <el-table-column
  537. label=""
  538. type="selection"
  539. align="center"
  540. width="50"
  541. v-if="formData.bizType != 5"
  542. >
  543. </el-table-column>
  544. <el-table-column label="序号" type="index" width="50">
  545. </el-table-column>
  546. <el-table-column
  547. label="编码"
  548. prop="assetCode"
  549. width="130"
  550. :show-overflow-tooltip="true"
  551. ></el-table-column>
  552. <el-table-column
  553. label="名称"
  554. prop="assetName"
  555. width="150"
  556. :show-overflow-tooltip="true"
  557. ></el-table-column>
  558. <el-table-column
  559. label="批号"
  560. prop="manualBatchNo"
  561. width="100"
  562. ></el-table-column>
  563. <el-table-column
  564. label="批次号"
  565. prop="batchNo"
  566. width="70"
  567. ></el-table-column>
  568. <el-table-column
  569. label="发货条码"
  570. prop="barcodes"
  571. width="80"
  572. :show-overflow-tooltip="true"
  573. ></el-table-column>
  574. <el-table-column
  575. :label="`包装编码`"
  576. prop="onlyCode"
  577. width="130"
  578. :show-overflow-tooltip="true"
  579. ></el-table-column>
  580. <el-table-column
  581. label="包装数量"
  582. prop="packingCount"
  583. width="80"
  584. ></el-table-column>
  585. <el-table-column
  586. label="包装单位"
  587. prop="packingUnit"
  588. ></el-table-column>
  589. <el-table-column
  590. label="计量数量"
  591. prop="minPackingCount"
  592. ></el-table-column>
  593. <el-table-column
  594. label="计量单位"
  595. prop="measuringUnit"
  596. ></el-table-column>
  597. <el-table-column label="物料代号" prop="materielCode" width="130">
  598. <template slot-scope="{ row }">
  599. <span>{{ row.materielCode }}</span>
  600. </template>
  601. </el-table-column>
  602. <el-table-column label="客户代号" prop="clientCode">
  603. <template slot-scope="{ row }">
  604. <span> {{ row.clientCode }}</span>
  605. </template>
  606. </el-table-column>
  607. <el-table-column label="刻码" prop="engrave">
  608. <template slot-scope="{ row }">
  609. <span>{{ row.engrave }}</span>
  610. </template>
  611. </el-table-column>
  612. <el-table-column label="重量" prop="weight" width="100">
  613. <template slot-scope="{ row }">
  614. <span>{{ row.weight }}</span>
  615. </template>
  616. </el-table-column>
  617. <el-table-column label="重量单位" prop="weightUtil">
  618. <template slot-scope="{ row }">
  619. {{ row.weightUtil }}
  620. </template>
  621. </el-table-column>
  622. <el-table-column label="质检结果" prop="result" width="120">
  623. <template slot-scope="{ row }">
  624. <span>{{ qualityResults[row.result] }}</span>
  625. </template>
  626. </el-table-column>
  627. <el-table-column label="质检状态" prop="status" width="120">
  628. <template slot-scope="{ row }">
  629. <span>{{ qualityStatus[row.status] }}</span>
  630. </template>
  631. </el-table-column>
  632. <el-table-column
  633. label="生产日期"
  634. width="150"
  635. prop="createTime"
  636. ></el-table-column>
  637. <!-- <el-table-column label="操作" width="80" fixed="right">
  638. <template slot-scope="{ row }">
  639. <el-button type="text" @click="packCout(row)">
  640. {{ !row.isPack ? '保存' : '编辑' }}
  641. </el-button>
  642. </template>
  643. </el-table-column> -->
  644. </el-table>
  645. <!-- </el-tab-pane>
  646. </el-tabs> -->
  647. </div>
  648. <div class="mt20" v-if="isSplit">
  649. <header-title :title="`物料明细`"> </header-title>
  650. <!-- <el-button
  651. v-if="resultArray.length != 0"
  652. type="success"
  653. plain
  654. style="margin-bottom: 20px; float: right; margin-right: 20px"
  655. size="mini"
  656. @click="materialListSave"
  657. >批量保存</el-button
  658. > -->
  659. <el-table
  660. ref="resultArrayTable"
  661. :data="resultArray"
  662. tooltip-effect="dark"
  663. :key="formData.bizType"
  664. :header-cell-style="rowClass"
  665. style="width: 100%"
  666. stripe
  667. height="300px"
  668. @selection-change="handleSelectionChange"
  669. >
  670. <el-table-column label="序号" type="index" width="50">
  671. </el-table-column>
  672. <el-table-column
  673. label="编码"
  674. prop="assetCode"
  675. :show-overflow-tooltip="true"
  676. ></el-table-column>
  677. <el-table-column
  678. label="名称"
  679. prop="assetName"
  680. width="200"
  681. :show-overflow-tooltip="true"
  682. ></el-table-column>
  683. <el-table-column
  684. label="批号"
  685. prop="manualBatchNo"
  686. width="100"
  687. ></el-table-column>
  688. <el-table-column
  689. label="批次号"
  690. prop="batchNo"
  691. width="80"
  692. ></el-table-column>
  693. <el-table-column
  694. label="物料编码"
  695. prop="no"
  696. width="200"
  697. :show-overflow-tooltip="true"
  698. ></el-table-column>
  699. <el-table-column
  700. label="发货条码"
  701. prop="barcodes"
  702. width="80"
  703. :show-overflow-tooltip="true"
  704. ></el-table-column>
  705. <el-table-column
  706. label="计量数量"
  707. prop="minPackingCount"
  708. width="90"
  709. ></el-table-column>
  710. <el-table-column
  711. width="80"
  712. label="计量单位"
  713. prop="measuringUnit"
  714. ></el-table-column>
  715. <el-table-column label="物料代号" prop="meterielCode" width="130">
  716. <template slot-scope="{ row }">
  717. <span>{{ row.materialCode }}</span>
  718. </template>
  719. </el-table-column>
  720. <el-table-column label="客户代号" prop="clientCode">
  721. <template slot-scope="{ row }">
  722. <span> {{ row.clientCode }}</span>
  723. </template>
  724. </el-table-column>
  725. <el-table-column label="刻码" prop="engrave">
  726. <template slot-scope="{ row }">
  727. <span> {{ row.engrave }}</span>
  728. </template>
  729. </el-table-column>
  730. <el-table-column width="100" label="重量" prop="weight">
  731. <template slot-scope="{ row }">
  732. <span>{{ row.weight }}</span>
  733. </template>
  734. </el-table-column>
  735. <el-table-column label="重量单位" prop="weightUnit" width="100">
  736. </el-table-column>
  737. <el-table-column label="质检结果" prop="result" width="120">
  738. <template slot-scope="{ row }">
  739. <span>{{ qualityResults[row.result] }}</span>
  740. </template>
  741. </el-table-column>
  742. <el-table-column label="质检状态" prop="status" width="120">
  743. <template slot-scope="{ row }">
  744. <span>{{ qualityStatus[row.status] }}</span>
  745. </template>
  746. </el-table-column>
  747. <!-- <el-table-column label="操作" width="80" fixed="right">
  748. <template slot-scope="{ row }">
  749. <el-button type="text" @click="materialBtn(row)">
  750. {{ !row.isPack ? '保存' : '编辑' }}
  751. </el-button>
  752. </template>
  753. </el-table-column> -->
  754. </el-table>
  755. </div>
  756. </div>
  757. </el-card>
  758. <selectType
  759. :visibleDialog.sync="visibleDialog"
  760. :title="title"
  761. :tableHeader="tableHeader"
  762. :bizScene="formData.bizType"
  763. :type="[selectEquiType]"
  764. :loadTree.sync="loadTree"
  765. @selectTableData="addProduct"
  766. />
  767. <WareHouseDailog
  768. ref="wareHouseDailogRef"
  769. @houseData="houseData"
  770. ></WareHouseDailog>
  771. <el-dialog :visible.sync="dateVisible" title="选择日期" width="400px">
  772. <el-date-picker
  773. size="small"
  774. v-model="batchTime"
  775. type="datetime"
  776. style="width: 320px"
  777. value-format="yyyy-MM-dd HH:mm:ss"
  778. placeholder="选择日期"
  779. >
  780. </el-date-picker>
  781. <div style="text-align: right; margin-top: 20px">
  782. <el-button @click="dateVisible = false">取消</el-button>
  783. <el-button type="primary" @click="dateConfirm" :disabled="!batchTime"
  784. >确认</el-button
  785. >
  786. </div>
  787. </el-dialog>
  788. <!-- 销售订单 -->
  789. <picker ref="pickerRef" @success="pickerSuccess" />
  790. </div>
  791. </template>
  792. <script>
  793. import { getProductList } from '@/api/bpm/components/saleManage/contact';
  794. import { getLoginUser } from '@/api/login';
  795. import picker from '@/views/bpm/stockManagement/components/picker.vue';
  796. import outin from '@/api/warehouseManagement/outin';
  797. import { getTreeByGroup, allCategoryLevel } from '@/api/classifyManage';
  798. import warehouseDefinition from '@/api/warehouseManagement/warehouseDefinition';
  799. import selectUpload from '@/components/selectUpload';
  800. import upload from '@/components/uploadImg';
  801. import { sceneState } from '@/utils/dict/index';
  802. import selectTree from '@/components/selectTree';
  803. import selectType from '@/views/bpm/stockManagement/components/selectType.vue';
  804. import WareHouseDailog from '@/views/bpm/stockManagement/components/WareHouseDailog.vue';
  805. import ReturnSelect from '@/views/bpm/stockManagement/components/ReturnSelect.vue';
  806. import { tableHeader } from '@/views/bpm/handleTask/components/inoutBound/common';
  807. import { getCode } from '@/api/codeManagement/index.js';
  808. import { getReceiveSaleOrderrecordDetail } from '@/api/bpm/components/purchasingManage/purchaseorderreceive';
  809. import { deepClone } from 'ele-admin/lib/utils/core';
  810. export default {
  811. components: {
  812. selectUpload,
  813. selectTree,
  814. selectType,
  815. WareHouseDailog,
  816. upload,
  817. ReturnSelect,
  818. picker
  819. },
  820. data() {
  821. return {
  822. isSplit: false, // 是否拆分到物料明细
  823. qualityStatus: {
  824. 0: '未检',
  825. 1: '已检',
  826. 2: '部分检'
  827. }, // 质检状态 0未检 1已检
  828. qualityResults: {
  829. 0: '合格',
  830. 1: '不合格',
  831. 3: '让步接收'
  832. }, // 质检结果 0合格 1不合格 3让步接收
  833. isTask: false,
  834. isWeight: true,
  835. resultArray: [],
  836. pickerRow: {},
  837. codeList: [],
  838. sceneState,
  839. visibleDialog: false,
  840. curDateType: 'manufactureTime',
  841. materialCodeReqListSelected: [],
  842. title: '',
  843. warehousingMaterialList: [],
  844. loadTree: true,
  845. selectEquiType: '',
  846. batchTime: '',
  847. dateVisible: false,
  848. formData: {
  849. extInfo: {
  850. assetType: '', //物品类型
  851. deptCode: '', //部门code
  852. deptName: '', //部门名称
  853. verifyDeptCode: '', //审核部门编码
  854. verifyDeptName: '', //审核部门名称
  855. deliveryName: '', //送货人名称
  856. deliveryPhone: '', //送货人电话
  857. documentSource: '', //销售订单
  858. urgent: '', //紧急状态
  859. supplierId: '', //供应商ID
  860. supplierName: '', //供应商名称
  861. createUserName: '', //创建人名字
  862. contentImage: [] //图片数组
  863. },
  864. fromUser: '', //送货人
  865. bizType: '', //物品类型
  866. verifyId: '', //审核人Id
  867. verifyName: '', //审核人名称
  868. createUserId: '',
  869. remark: ''
  870. },
  871. rules: {
  872. 'extInfo.assetType': {
  873. required: true,
  874. message: '请选择物品类型',
  875. trigger: 'change'
  876. },
  877. bizType: {
  878. required: true,
  879. message: '请选择入库场景',
  880. trigger: 'change'
  881. }
  882. }
  883. };
  884. },
  885. props: ['inboundType'],
  886. computed: {
  887. // 条码信息
  888. materialCodeReqList() {
  889. return this.warehousingMaterialList
  890. .map((i) => i.warehouseLedgerDetails || [])
  891. .flat();
  892. },
  893. tableHeader() {
  894. return tableHeader(this.selectEquiType);
  895. }
  896. },
  897. created() {
  898. this.initData();
  899. },
  900. methods: {
  901. // 包装维度最小包装单元改变——>总重量
  902. minPackingCountChange(row, value) {
  903. if (value >= 0) {
  904. row.minPackingCount = value;
  905. } else {
  906. row.minPackingCount = 0;
  907. }
  908. // row.minPackingCount = value.replace(/^(0+)|[^\d]+/g, '');
  909. if (row.outInNum >= 0 && value >= 0) {
  910. this.packNum(row, row.outInNum);
  911. }
  912. },
  913. // 选择质检结果改变质检状态
  914. changeWrapStatus(resultValue, row) {
  915. switch (resultValue) {
  916. case '':
  917. // 清空质检状态
  918. row.status = '0';
  919. break;
  920. default:
  921. // 默认已检质检状态
  922. row.status = '1';
  923. break;
  924. }
  925. },
  926. weightInput(value, row) {
  927. const newValue = value.replace(/[^\d.]/g, ''); // 保留数字和小数点
  928. const decimalCount = (newValue.match(/\./g) || []).length; // 计算小数点的个数
  929. if (decimalCount > 1) {
  930. // 如果小数点个数大于1,移除多余的小数点
  931. const lastIndex = newValue.lastIndexOf('.');
  932. row.weight =
  933. newValue.slice(0, lastIndex) + newValue.slice(lastIndex + 1);
  934. } else if (decimalCount === 1) {
  935. // 如果小数点个数等于1,允许小数点的输入
  936. row.weight = newValue;
  937. } else {
  938. row.weight = newValue === '' ? 0 : parseFloat(newValue); // 如果输入为空,则设为0
  939. }
  940. },
  941. // 拆分物料
  942. handleIsDetail(event) {
  943. this.isSplit = event;
  944. const list = this.materialCodeReqList;
  945. if (event) {
  946. let resultArray = [];
  947. list.forEach((item) => {
  948. // 包装维度改成已保存状态
  949. item.isPack = true;
  950. // 拆分物料维度并生成列表
  951. for (let i = 1; i <= Number(item.minPackingCount); i++) {
  952. resultArray.push({
  953. onlyCode: item.onlyCode,
  954. no: item.onlyCode + i.toString().padStart(4, '0'),
  955. assetCode: item.assetCode,
  956. assetName: item.assetName,
  957. barcodes: item.barcodes,
  958. manualBatchNo: item.manualBatchNo,
  959. batchNo: item.batchNo,
  960. minPackingCount: 1,
  961. measuringUnit: item.measuringUnit,
  962. materielCode: item.materielCode,
  963. clientCode: item.clientCode,
  964. weight: this.$math.format(
  965. item.weight / Number(item.minPackingCount),
  966. 14
  967. ),
  968. initWeight: this.$math.format(
  969. item.weight / Number(item.minPackingCount),
  970. 14
  971. ),
  972. weightUnit: item.weightUnit,
  973. engrave: item.engrave,
  974. result: item.result,
  975. status: item.status,
  976. isPack: false
  977. });
  978. }
  979. });
  980. this.resultArray = resultArray;
  981. // 批量修改包装明细
  982. this.isWeight = false;
  983. this.bulkEditingWrap();
  984. this.$nextTick(() => {
  985. this.isWeight = true;
  986. });
  987. } else {
  988. // 包装维度改成编辑状态
  989. list.forEach((item) => {
  990. item.isPack = false;
  991. });
  992. // 清空物料维度列表
  993. this.resultArray = [];
  994. }
  995. },
  996. //包装明细保存
  997. packCout(row) {
  998. //true保存==》反之
  999. if (!row.isPack) {
  1000. row.isPack = true;
  1001. const code = row.assetCode;
  1002. const batchNo = row.batchNo;
  1003. //做防护,防止weight字符串类型
  1004. this.materialCodeReqList.forEach((ele) => {
  1005. ele.weight = Number(ele.weight);
  1006. });
  1007. // 修改产品信息重量(包装维度累计)
  1008. this.isWeight = false;
  1009. this.warehousingMaterialList.forEach((item) => {
  1010. if (item.assetCode == code && item.batchNo == batchNo) {
  1011. let arr = [];
  1012. for (const key in this.materialCodeReqList) {
  1013. if (
  1014. this.materialCodeReqList[key].assetCode == item.assetCode &&
  1015. this.materialCodeReqList[key].batchNo == item.batchNo
  1016. ) {
  1017. arr.push({ ...this.materialCodeReqList[key] });
  1018. }
  1019. }
  1020. const count = arr.reduce((acc, curr) => {
  1021. if (curr.isPack) {
  1022. this.$set(curr, 'initWeight', +curr.weight);
  1023. return Number(this.$math.format(+acc + +curr.weight, 14));
  1024. } else {
  1025. return Number(this.$math.format(+acc + +curr.initWeight, 14));
  1026. }
  1027. }, 0);
  1028. this.$set(item, 'weight', count);
  1029. }
  1030. });
  1031. this.$nextTick(() => {
  1032. this.isWeight = true;
  1033. });
  1034. } else {
  1035. row.isPack = false;
  1036. }
  1037. },
  1038. // 批量修改包装明细
  1039. bulkEditingWrap() {
  1040. // 批量修改包装明细列表状态(已保存)
  1041. this.materialCodeReqList.forEach((item) => {
  1042. item.isPack = true;
  1043. });
  1044. // 改变产品明细重量
  1045. this.warehousingMaterialList.forEach((outItem) => {
  1046. let arr = [];
  1047. this.materialCodeReqList.forEach((inneritem) => {
  1048. if (
  1049. inneritem.assetCode == outItem.assetCode &&
  1050. inneritem.batchNo == outItem.batchNo
  1051. ) {
  1052. arr.push(inneritem);
  1053. }
  1054. });
  1055. const count = arr.reduce((acc, curr) => {
  1056. if (curr.isPack) {
  1057. this.$set(curr, 'initWeight', +curr.weight);
  1058. return Number(this.$math.format(+acc + +curr.weight, 14));
  1059. } else {
  1060. return Number(this.$math.format(+acc + +curr.initWeight, 14));
  1061. }
  1062. }, 0);
  1063. this.$set(outItem, 'weight', count);
  1064. });
  1065. },
  1066. // 批量修改物料明细
  1067. bulkEditingMaterial() {
  1068. // 批量修改物料明细列表状态(已保存)
  1069. this.resultArray.forEach((item) => {
  1070. item.isPack = true;
  1071. });
  1072. // 改变包装明细重量
  1073. this.materialCodeReqList.forEach((outItem) => {
  1074. let arr = [];
  1075. this.resultArray.forEach((inneritem) => {
  1076. if (
  1077. inneritem.assetCode == outItem.assetCode &&
  1078. inneritem.batchNo == outItem.batchNo
  1079. ) {
  1080. arr.push(inneritem);
  1081. }
  1082. });
  1083. const count = arr.reduce((acc, curr) => {
  1084. if (curr.isPack) {
  1085. this.$set(curr, 'initWeight', +curr.weight);
  1086. return Number(this.$math.format(+acc + +curr.weight, 14));
  1087. } else {
  1088. return Number(this.$math.format(+acc + +curr.initWeight, 14));
  1089. }
  1090. }, 0);
  1091. this.$set(outItem, 'weight', count);
  1092. });
  1093. },
  1094. // 物料明细保存
  1095. materialBtn(row) {
  1096. console.log(row);
  1097. console.log(this.resultArray);
  1098. console.log(this.materialCodeReqList);
  1099. // true保存 false编辑
  1100. if (!row.isPack) {
  1101. row.isPack = true;
  1102. // 物料维度修改质检改变包装维度质检(结果和状态)
  1103. this.materialCodeReqList.forEach((outItem) => {
  1104. let arr = [];
  1105. this.resultArray.forEach((inneritem) => {
  1106. if (inneritem.onlyCode == outItem.onlyCode) {
  1107. arr.push(inneritem);
  1108. }
  1109. });
  1110. console.log(arr);
  1111. // 首先判断是未填/合格不合格
  1112. let boolen = arr.every((item) => {
  1113. return (
  1114. item.result === '' ||
  1115. item.result === undefined ||
  1116. item.result === null
  1117. );
  1118. });
  1119. // 判断只要物料全部质检结果(未填)——>包装质检结果(未填) 状态(未检)
  1120. if (boolen) {
  1121. this.$set(outItem, 'result', '');
  1122. this.$set(outItem, 'status', '0');
  1123. } else {
  1124. // 判断只要物料有一个质检结果(不合格)——>包装质检结果(不合格) 状态(已检)
  1125. let boolen = arr.some((item) => {
  1126. return item.result === '1';
  1127. });
  1128. if (boolen) {
  1129. this.$set(outItem, 'result', '1');
  1130. this.$set(outItem, 'status', '1');
  1131. } else {
  1132. // 判断只要物料有一个质检结果(让步接收)——>包装质检结果(让步接收) 状态(已检)
  1133. let boolen = arr.some((item) => {
  1134. return item.result === '3';
  1135. });
  1136. if (boolen) {
  1137. // 让步接收 已检
  1138. this.$set(outItem, 'result', '3');
  1139. this.$set(outItem, 'status', '1');
  1140. } else {
  1141. // 判断只要物料有全部质检结果(合格)——>包装质检结果(合格) 状态(已检)
  1142. let boolen = arr.every((item) => {
  1143. return item.result === '0';
  1144. });
  1145. if (boolen) {
  1146. // 合格 已检
  1147. this.$set(outItem, 'result', '0');
  1148. this.$set(outItem, 'status', '1');
  1149. } else {
  1150. // 合格 部分检
  1151. this.$set(outItem, 'result', '0');
  1152. this.$set(outItem, 'status', '2');
  1153. }
  1154. }
  1155. }
  1156. }
  1157. // this.$set(outItem, 'result', boolen ? '1' : '0');
  1158. });
  1159. // 物料维度修改重量改变包装维度重量
  1160. let onlyCode = row.onlyCode;
  1161. this.materialCodeReqList.forEach((item) => {
  1162. if (item.onlyCode === onlyCode) {
  1163. let arr = [];
  1164. for (const key in this.resultArray) {
  1165. if (this.resultArray[key].onlyCode == item.onlyCode) {
  1166. arr.push(this.resultArray[key]);
  1167. }
  1168. }
  1169. const count = arr.reduce((acc, curr) => {
  1170. if (curr.isPack) {
  1171. this.$set(curr, 'initWeight', +curr.weight);
  1172. return Number(this.$math.format(+acc + +curr.weight, 14));
  1173. } else {
  1174. return Number(this.$math.format(+acc + +curr.initWeight, 14));
  1175. }
  1176. }, 0);
  1177. this.$set(item, 'weight', count);
  1178. }
  1179. });
  1180. // 包装维度修改重量改变产品信息
  1181. this.isWeight = false;
  1182. // 批量修改包装明细
  1183. this.bulkEditingWrap();
  1184. this.$nextTick(() => {
  1185. this.isWeight = true;
  1186. });
  1187. } else {
  1188. row.isPack = false;
  1189. }
  1190. },
  1191. // 重量计算
  1192. packNum(row, value) {
  1193. const total = {
  1194. packingCount: Number(
  1195. row.minPackingCount > 0 ? row.minPackingCount : 0
  1196. ),
  1197. outInNum: Number(row.outInNum > 0 ? row.outInNum : 0)
  1198. };
  1199. if (row.measuringUnit == row.weightUnit) {
  1200. row.weight = Number(
  1201. this.$math.format(
  1202. total.packingCount * 1 * total.outInNum.toFixed(2),
  1203. 14
  1204. )
  1205. );
  1206. } else {
  1207. const totals = Number(
  1208. this.$math.format(total.packingCount * total.outInNum, 14)
  1209. );
  1210. row.weight = Number(
  1211. this.$math.format(
  1212. totals * (row.netWeight > 0 ? row.netWeight.toFixed(2) : 0),
  1213. 14
  1214. )
  1215. );
  1216. }
  1217. return (row.outInNum = value.replace(/^(0+)|[^\d]+/g, ''));
  1218. },
  1219. // 根据单据信息初始化产品信息(外部调用)
  1220. async pickerSuccess(row) {
  1221. this.formData.bizType = '1'; // 生产入库
  1222. console.log('row---------------');
  1223. console.log(row);
  1224. this.formData.extInfo.assetType = row.categoryLevelId;
  1225. this.title = row.categoryLevelName;
  1226. this.selectEquiType = row.categoryLevelId;
  1227. this.isTask = true;
  1228. this.pickerRow = row;
  1229. // this.formData.extInfo.documentSource = row.orderNo;
  1230. this.formData.sourceBizNo = row.code;
  1231. // this.formData.fromId = row.id;
  1232. // this.formData.clientName = row.partaName;
  1233. // this.formData.clientCode = row.partaId;
  1234. // this.formData.extInfo.supplierName = row.supplierName;
  1235. // this.formData.extInfo.supplierId = row.supplierId;
  1236. if (this.warehousingMaterialList.length == 0) {
  1237. this.createDataByWrap(row);
  1238. // let list = data.productList.map((item) => {
  1239. // return {
  1240. // ...item,
  1241. // assetName: item.productName,
  1242. // assetCode: item.productCode,
  1243. // categoryId: item.productCategoryId,
  1244. // minPackUnit: item.packingUnit
  1245. // };
  1246. // });
  1247. // this.onSelectTableData(
  1248. // await this.serachMainCode({
  1249. // ...row,
  1250. // assetName: row.categoryName,
  1251. // assetCode: row.categoryCode,
  1252. // categoryId: row.categoryId,
  1253. // minPackUnit: row.packingUnit
  1254. // })
  1255. // );
  1256. }
  1257. },
  1258. async createDataByWrap(wrapData) {
  1259. console.log(wrapData);
  1260. let list = deepClone(wrapData);
  1261. const batchNo = await getCode('lot_number_code'); // 生成批次号
  1262. let sameItemWraplist = []; // 储存分类数据
  1263. let sameItemWrapInfolist = []; // 用来判断去重
  1264. // 先过滤同一种物品下面包装
  1265. list.detailList.forEach((item) => {
  1266. if (sameItemWraplist.length > 0) {
  1267. let filterArr = sameItemWrapInfolist.filter(
  1268. (it) =>
  1269. item.categoryCode == it.categoryCode &&
  1270. item.quantity == it.quantity
  1271. );
  1272. if (filterArr.length > 0) {
  1273. sameItemWraplist[filterArr[0].index].push(item);
  1274. } else {
  1275. sameItemWraplist.push([item]);
  1276. sameItemWrapInfolist.push({
  1277. categoryCode: item.categoryCode,
  1278. quantity: item.quantity,
  1279. index: sameItemWrapInfolist.length
  1280. });
  1281. }
  1282. } else {
  1283. sameItemWraplist.push([item]);
  1284. sameItemWrapInfolist.push({
  1285. categoryCode: item.categoryCode,
  1286. quantity: item.quantity,
  1287. index: 0
  1288. });
  1289. }
  1290. });
  1291. // 添加包装批号丶包装编码丶包装数量
  1292. const onlyCodeList = await outin.getAssetNum({
  1293. assetCode: list.detailList[0].categoryCode,
  1294. batchNum: batchNo,
  1295. num: list.detailList.length
  1296. });
  1297. Promise.all(
  1298. sameItemWraplist.map(async (goodsItem) => {
  1299. goodsItem = goodsItem.map((wrapItem) => {
  1300. return {
  1301. ...wrapItem,
  1302. assetCode: wrapData.categoryCode,
  1303. assetName: wrapData.categoryName,
  1304. manualBatchNo: wrapData.manualBatchNo,
  1305. batchNo,
  1306. barcodes: wrapItem.sendCode,
  1307. weight: wrapItem.packingWeight,
  1308. initWeight: wrapItem.packingWeight,
  1309. weightUtil: wrapItem.weightUnit,
  1310. engrave: wrapItem.extInfo.engrave,
  1311. materielCode: wrapItem.extInfo.materielCode,
  1312. clientCode: wrapItem.extInfo.clientCode,
  1313. num: wrapItem.quantity,
  1314. isPack: false,
  1315. packingCount: 1,
  1316. minPackingCount: wrapItem.quantity,
  1317. onlyCode: onlyCodeList.shift().onlyCode,
  1318. result: '0',
  1319. status: '1',
  1320. modelType: wrapData.modelType,
  1321. specification: wrapData.specification,
  1322. brandNum: wrapData.brandNum
  1323. };
  1324. });
  1325. console.log(goodsItem);
  1326. return goodsItem;
  1327. })
  1328. ).then((sameItemWraplist) => {
  1329. console.log(sameItemWraplist.flat());
  1330. console.log(sameItemWraplist);
  1331. console.log(sameItemWrapInfolist);
  1332. this.warehousingMaterialList = sameItemWraplist.map((goodsItem) => {
  1333. return {
  1334. assetCode: wrapData.categoryCode,
  1335. assetName: wrapData.categoryName,
  1336. manualBatchNo: wrapData.manualBatchNo,
  1337. modelType: wrapData.modelType,
  1338. specification: wrapData.specification,
  1339. brandNum: wrapData.brandNum,
  1340. batchNo,
  1341. categoryId: goodsItem[0].categoryId,
  1342. minPackingCount: goodsItem[0].num,
  1343. outInNum: goodsItem.length,
  1344. minPackUnit: goodsItem[0].packingUnit,
  1345. measuringUnit: goodsItem[0].measuringUnit,
  1346. weight: goodsItem.reduce((num, pre) => (num += pre.weight), 0),
  1347. weightUnit: goodsItem[0].weightUnit,
  1348. univalence: wrapData.univalence > 0 ? wrapData.univalence : '',
  1349. warehouseId: goodsItem[0].warehouseId,
  1350. houseList: [],
  1351. warehouseLedgerDetails: goodsItem
  1352. };
  1353. });
  1354. });
  1355. // this.materialCodeReqList = list.detailList.map((wrapItem) => {
  1356. // return {
  1357. // code: it.onlyCode,
  1358. // dateType: 2, // 2生产日期 1采购日期
  1359. // dateValue: wrapItem.createTime,
  1360. // minUnit: it.minPackingCount,
  1361. // minPositionId: it.cargoSpaceId,
  1362. // minPackingCount: it.minPackingCount,
  1363. // name: it.assetName,
  1364. // pathIds: item.pathIds,
  1365. // unit: it.unit,
  1366. // packageNo: it.num,
  1367. // clientCode: it.clientCode,
  1368. // materielCode: it.materielCode,
  1369. // weight: it.weight,
  1370. // weightUtil: it.weightUtil,
  1371. // engrave: it.engrave,
  1372. // materialDetails: this.materialDetails(it.onlyCode),
  1373. // packingCount: it.packingCount,
  1374. // status: it.status,
  1375. // result: it.result
  1376. // };
  1377. // });
  1378. },
  1379. async serachMainCode(arr) {
  1380. let newArr = [];
  1381. const data = await getProductList({
  1382. pageNum: 1,
  1383. size: 10,
  1384. categoryLevelId: arr.categoryLevelId,
  1385. codeEq: arr.assetCode
  1386. });
  1387. newArr.push(data.list); // 将结果存储到 newArr 中
  1388. let re = [];
  1389. for (const item of newArr) {
  1390. for (const it of item) {
  1391. re.push(it);
  1392. }
  1393. }
  1394. return re.map((item) => {
  1395. return {
  1396. ...item,
  1397. minPackUnit: item.packingUnit,
  1398. assetCode: item.code,
  1399. assetName: item.name
  1400. };
  1401. });
  1402. },
  1403. onClear() {
  1404. this.formData.extInfo.documentSource = '';
  1405. this.pickerRow = {};
  1406. this.formData.clientName = '';
  1407. this.formData.clientCode = '';
  1408. this.formData.extInfo.supplierName = '';
  1409. this.formData.extInfo.supplierId = '';
  1410. this.$forceUpdate();
  1411. },
  1412. handlePicker() {
  1413. this.$refs.pickerRef.open();
  1414. },
  1415. // 物品类型选择
  1416. codeListValue(val) {
  1417. this.formData.extInfo.assetType = val.id || val;
  1418. this.$forceUpdate();
  1419. this.title = val?.name;
  1420. this.selectEquiType = val?.id || val;
  1421. },
  1422. //计算金额
  1423. calcSumTotal(PackingCount, outInNum, univalence) {
  1424. //最小包装单元,包装数量,单价
  1425. const total = {
  1426. PackingCount: Number(PackingCount > 0 ? PackingCount : 0),
  1427. outInNum: Number(outInNum > 0 ? outInNum : 0),
  1428. univalence: Number(univalence == undefined ? 0 : univalence)
  1429. };
  1430. return Number(
  1431. this.$math.format(
  1432. total.PackingCount * total.outInNum * total.univalence,
  1433. 14
  1434. )
  1435. );
  1436. },
  1437. handleRowUnit(row) {
  1438. return row.measuringUnit;
  1439. },
  1440. rowClass({ row, column, rowIndex, columnIndex }) {
  1441. if (rowIndex === 1) {
  1442. return {
  1443. display: 'none',
  1444. background: '#EEEEEE',
  1445. border: 'none'
  1446. };
  1447. }
  1448. return { background: '#EEEEEE', border: 'none' };
  1449. },
  1450. // 仓库编辑
  1451. handleWareHouse(row, idx) {
  1452. this.$refs.wareHouseDailogRef.open(row, idx, true);
  1453. },
  1454. // 入库操作
  1455. listEdit(row) {
  1456. this.$set(row, 'isSave', false);
  1457. // row.selfWarehouseLedgerDetails = row.warehouseLedgerDetails;
  1458. // row.warehouseLedgerDetails = [];
  1459. // // 重置重量
  1460. // this.packNum(row, row.outInNum);
  1461. // // 清空物料明细防止数据错乱
  1462. // if (this.isSplit && this.resultArray?.length > 0) {
  1463. // this.handleIsDetail(false);
  1464. // }
  1465. },
  1466. // 产品单个保存
  1467. listSave(row, index) {
  1468. // 清空物料明细防止数据错乱
  1469. if (this.isSplit && this.resultArray?.length > 0) {
  1470. this.handleIsDetail(false);
  1471. }
  1472. const fileds = [
  1473. // `warehousingMaterialList.${index}.cargoSpaceCode`,
  1474. // `warehousingMaterialList.${index}.batchNo`,
  1475. `warehousingMaterialList.${index}.houseList`
  1476. ];
  1477. if (this.formData.bizType == 1) {
  1478. // fileds.push(...[`warehousingMaterialList.${index}.customCode`]);
  1479. } else if (this.formData.bizType == 2) {
  1480. // fileds.push(...[`warehousingMaterialList.${index}.supplierCode`]);
  1481. }
  1482. if (this.formData.bizType != 5) {
  1483. // fileds.push(
  1484. // ...[
  1485. // `warehousingMaterialList.${index}.outInNum`,
  1486. // `warehousingMaterialList.${index}.minPackingCount`
  1487. // ]
  1488. // );
  1489. } else if (
  1490. this.warehousingMaterialList.some(
  1491. (i) => !i.selfWarehouseLedgerDetails?.length
  1492. )
  1493. ) {
  1494. this.$message.error('请选择资产编号!');
  1495. return;
  1496. }
  1497. Promise.all(
  1498. fileds.map(
  1499. (item) =>
  1500. new Promise(async (resolve, rej) => {
  1501. this.$refs.warehousingMaterialListRef.validateField(
  1502. item,
  1503. (err) => {
  1504. if (err) {
  1505. rej(err);
  1506. } else {
  1507. resolve();
  1508. }
  1509. }
  1510. );
  1511. })
  1512. )
  1513. )
  1514. .then((res) => {
  1515. console.log('-------------');
  1516. this.$set(row, 'isSave', true);
  1517. // this.createMaterialCode(row);
  1518. })
  1519. .catch((err) => {
  1520. this.$message.error('请填入必填项!');
  1521. });
  1522. },
  1523. // 产品批量保存
  1524. listSaveArrs() {
  1525. // 已经拆分(还原到未拆封编辑状态)
  1526. if (this.isSplit && this.resultArray.length > 0) {
  1527. this.handleIsDetail(false);
  1528. }
  1529. const rows = this.warehousingMaterialList;
  1530. const indexes = Array.from(
  1531. { length: this.warehousingMaterialList.length },
  1532. (_, index) => index
  1533. );
  1534. let showMessage = true;
  1535. rows.forEach((row, i) => {
  1536. const index = indexes[i];
  1537. const fileds = [
  1538. // `warehousingMaterialList.${index}.cargoSpaceCode`,
  1539. // `warehousingMaterialList.${index}.batchNo`,
  1540. `warehousingMaterialList.${index}.houseList`
  1541. ];
  1542. if (this.formData.bizType == 1) {
  1543. // fileds.push(...[`warehousingMaterialList.${index}.customCode`]);
  1544. } else if (this.formData.bizType == 2) {
  1545. // fileds.push(...[`warehousingMaterialList.${index}.supplierCode`]);
  1546. }
  1547. if (this.formData.bizType != 5) {
  1548. // fileds.push(
  1549. // ...[
  1550. // `warehousingMaterialList.${index}.outInNum`,
  1551. // `warehousingMaterialList.${index}.minPackingCount`
  1552. // ]
  1553. // );
  1554. } else if (
  1555. this.warehousingMaterialList.some(
  1556. (i) => !i.selfWarehouseLedgerDetails?.length
  1557. )
  1558. ) {
  1559. this.$message.error('请选择资产编号!');
  1560. return;
  1561. }
  1562. Promise.all(
  1563. fileds.map(
  1564. (item) =>
  1565. new Promise(async (resolve, rej) => {
  1566. this.$refs.warehousingMaterialListRef.validateField(
  1567. item,
  1568. (err) => {
  1569. if (err) {
  1570. rej(err);
  1571. } else {
  1572. resolve();
  1573. }
  1574. }
  1575. );
  1576. })
  1577. )
  1578. )
  1579. .then((res) => {
  1580. this.$set(row, 'isSave', true);
  1581. // this.createMaterialCode(row);
  1582. })
  1583. .catch((err) => {
  1584. if (showMessage) {
  1585. showMessage = false;
  1586. this.$message.error('请填入必填项!');
  1587. }
  1588. });
  1589. });
  1590. },
  1591. // 批量设置生产日期
  1592. handleSelectionChange(val) {
  1593. this.materialCodeReqListSelected = val;
  1594. },
  1595. dateSetting() {
  1596. if (!this.materialCodeReqListSelected.length) {
  1597. return this.$message.error(`请选择${this.title}明细!`);
  1598. }
  1599. this.dateVisible = true;
  1600. },
  1601. dateConfirm() {
  1602. this.materialCodeReqListSelected.forEach((item) => {
  1603. this.$set(item, this.curDateType, this.batchTime);
  1604. });
  1605. this.dateVisible = false;
  1606. },
  1607. //入库明细删除
  1608. listDel(row, index) {
  1609. this.warehousingMaterialList.splice(index, 1);
  1610. if (this.isSplit && this.resultArray?.length > 0) {
  1611. this.handleIsDetail(false);
  1612. }
  1613. },
  1614. // 入库明细生成条码信息
  1615. async createMaterialCode(row) {
  1616. // 添加相同物品、批次号重新更新明细 原料编码
  1617. const list = this.warehousingMaterialList.filter(
  1618. (i) =>
  1619. i.assetCode === row.assetCode &&
  1620. i.batchNo === row.batchNo &&
  1621. i.isSave
  1622. );
  1623. const num = list.reduce((num, pre) => {
  1624. num += row.isUnpack
  1625. ? pre.outInNum * pre.minPackingCount
  1626. : pre.outInNum - 0;
  1627. return num;
  1628. }, 0);
  1629. const nums = list.reduce((num, pre) => {
  1630. num += pre.outInNum * pre.minPackingCount;
  1631. return num;
  1632. }, 0);
  1633. const res = await outin.getAssetNum({
  1634. assetCode: row.assetCode,
  1635. batchNum: row.batchNo,
  1636. num: num
  1637. });
  1638. // row.measuringUnit == 'PCS' ? nums :
  1639. list.forEach((item) => {
  1640. if (item.warehouseLedgerDetails?.length) {
  1641. item.warehouseLedgerDetails.forEach((i) => {
  1642. i.onlyCode = res.shift().onlyCode;
  1643. });
  1644. } else {
  1645. this.$set(
  1646. item,
  1647. 'warehouseLedgerDetails',
  1648. Array.from(
  1649. new Array(
  1650. item.isUnpack
  1651. ? item.outInNum * item.minPackingCount
  1652. : // : item.measuringUnit == 'PCS'
  1653. // ? +item.outInNum * parseInt(item.minPackingCount)
  1654. +item.outInNum
  1655. ),
  1656. (val, idx) => {
  1657. return {
  1658. ...item,
  1659. onlyCode: res.shift().onlyCode,
  1660. bizStatus: 1,
  1661. contentImage: []
  1662. };
  1663. }
  1664. )
  1665. );
  1666. }
  1667. });
  1668. // 添加相同物品,重复批次号 重新更新明细 包装编码
  1669. const batchList = this.warehousingMaterialList.filter(
  1670. (i) => i.batchNo === row.batchNo && i.isSave
  1671. );
  1672. if (batchList.length) {
  1673. const num = batchList.reduce((num, pre) => {
  1674. num += +pre.outInNum;
  1675. return num;
  1676. }, 0);
  1677. const res1 = await outin.getAssetNum({
  1678. batchNum: row.batchNo,
  1679. num
  1680. });
  1681. if (res1) {
  1682. batchList.forEach((item) => {
  1683. let num = res1.shift()?.num;
  1684. let minPackingCount = item.minPackingCount;
  1685. if (item.warehouseLedgerDetails?.length) {
  1686. item.warehouseLedgerDetails.forEach((i, index) => {
  1687. this.$set(i, 'num', num);
  1688. if (row.code == i.code) {
  1689. if (item.measuringUnit == item.weightUnit) {
  1690. this.$set(i, 'weight', item.minPackingCount);
  1691. this.$set(i, 'initWeight', item.minPackingCount);
  1692. } else {
  1693. this.$set(
  1694. i,
  1695. 'weight',
  1696. Number(
  1697. this.$math.format(
  1698. 1 * item.minPackingCount * item.netWeight,
  1699. 14
  1700. )
  1701. )
  1702. );
  1703. this.$set(
  1704. i,
  1705. 'initWeight',
  1706. Number(
  1707. this.$math.format(
  1708. 1 * item.minPackingCount * item.netWeight,
  1709. 14
  1710. )
  1711. )
  1712. );
  1713. }
  1714. }
  1715. this.$set(i, 'weightUtil', item.weightUnit);
  1716. this.$set(i, 'packingCount', 1);
  1717. this.$set(i, 'packingUnit ', item.packingUnit);
  1718. this.$set(i, 'minPackingCount ', item.minPackingCount);
  1719. this.$set(i, 'measuringUnit', item.measuringUnit);
  1720. this.$set(i, 'isPack', false);
  1721. console.log('inboundType------------', this.inboundType);
  1722. if (this.inboundType == '1') {
  1723. // 生产性采购(未检)
  1724. this.$set(i, 'result', '');
  1725. this.$set(i, 'status', '0');
  1726. } else {
  1727. // 非生产性采购(已检合格)
  1728. this.$set(i, 'result', '0');
  1729. this.$set(i, 'status', '1');
  1730. }
  1731. if (!item.isUnpack) {
  1732. if (index < item.warehouseLedgerDetails.length - 1) {
  1733. num = res1.shift()?.num;
  1734. }
  1735. } else {
  1736. // 拆包的包装编码一致
  1737. minPackingCount--;
  1738. if (
  1739. minPackingCount === 0 &&
  1740. index < item.warehouseLedgerDetails.length - 1
  1741. ) {
  1742. minPackingCount = item.minPackingCount;
  1743. num = res1.shift()?.num;
  1744. }
  1745. }
  1746. });
  1747. }
  1748. });
  1749. }
  1750. }
  1751. },
  1752. // 包装批量保存
  1753. wrapListSave() {
  1754. // 批量修改包装明细
  1755. this.isWeight = false;
  1756. this.bulkEditingWrap();
  1757. this.$nextTick(() => {
  1758. this.isWeight = true;
  1759. });
  1760. },
  1761. // 物料批量保存
  1762. materialListSave() {
  1763. this.resultArray.forEach((item) => {
  1764. if (!item.isPack) {
  1765. this.materialBtn(item);
  1766. }
  1767. });
  1768. },
  1769. // 外部调用获取入库数据
  1770. getReturnStorage() {
  1771. return new Promise((resolve) => {
  1772. this.$refs.formName.validate(async (valid) => {
  1773. if (valid) {
  1774. if (!this.warehousingMaterialList?.length) {
  1775. return this.$message.error('请添加入库明细!');
  1776. } else if (
  1777. this.warehousingMaterialList.some((item) => !item.isSave)
  1778. ) {
  1779. return this.$message.error('请保存入库明细!');
  1780. }
  1781. // 默认全部保存
  1782. if (this.resultArray?.length > 0) {
  1783. // 物料批量保存
  1784. this.materialListSave();
  1785. } else {
  1786. // 包装批量保存
  1787. this.wrapListSave();
  1788. }
  1789. this.formatWarehouseMaterialList();
  1790. let arr = this.warehousingMaterialList.map((item) => {
  1791. console.log(item, 'item');
  1792. return {
  1793. netWeight: item.netWeight > 0 ? item.netWeight : 0,
  1794. num: item.num > 0 ? item.num : 0,
  1795. manualBatchNo: item.manualBatchNo,
  1796. batchNo: item.batchNo,
  1797. categoryId: item.categoryId,
  1798. count:
  1799. item.outInNum > 0 && item.minPackingCount > 0
  1800. ? this.$math.format(
  1801. parseInt(item.outInNum) *
  1802. parseInt(item.minPackingCount),
  1803. 14
  1804. )
  1805. : 0,
  1806. minPackingCount:
  1807. item.minPackingCount > 0 ? item.minPackingCount : 0,
  1808. packingCount: item.outInNum > 0 ? item.outInNum : 0,
  1809. price: item.univalence > 0 ? item.univalence : 0,
  1810. outInDetailRecordAddPOList: item.warehouseLedgerDetails,
  1811. manualBatchNo: item.manualBatchNo,
  1812. position: `${item.warehouseName}-${item.areaName}-${item.shelfCode}-${item.cargoSpaceCode}`,
  1813. remark: '',
  1814. pathIds: `${item.warehouseId},${item.areaId},${item.shelfId},${item.cargoSpaceId}`,
  1815. pathName: `${item.warehouseName},${item.areaName},${item.shelfCode},${item.cargoSpaceCode}`,
  1816. totalMoney:
  1817. item.outInNum > 0 &&
  1818. item.minPackingCount > 0 &&
  1819. item.univalence > 0
  1820. ? this.$math.format(
  1821. item.outInNum *
  1822. item.minPackingCount *
  1823. item.univalence,
  1824. 14
  1825. )
  1826. : 0,
  1827. weightUnit: item.weightUnit,
  1828. customCode: item.customCode,
  1829. supplierCode: item.supplierCode,
  1830. weight: item.weight > 0 ? item.weight : 0,
  1831. houseList: [
  1832. `${item.warehouseName},${item.areaName},${item.shelfCode},${item.cargoSpaceCode}`
  1833. ]
  1834. };
  1835. });
  1836. arr.forEach((item) => {
  1837. if (item.outInDetailRecordAddPOList.length > 0) {
  1838. let list = item.outInDetailRecordAddPOList.map((it) => {
  1839. return this.formatOutInDetailRecordAddPO(it, item);
  1840. });
  1841. item.outInDetailRecordAddPOList = list;
  1842. }
  1843. });
  1844. let obj = { ...this.formData, type: 1 };
  1845. obj.outInDetailAddPOList = arr;
  1846. resolve(obj);
  1847. }
  1848. });
  1849. });
  1850. },
  1851. // 格式化产品信息入库数据
  1852. formatWarehouseMaterialList() {
  1853. for (let key in this.warehousingMaterialList) {
  1854. for (let k in this.warehousingMaterialList[key].houseList) {
  1855. let house = this.warehousingMaterialList[key].houseList[k];
  1856. this.warehousingMaterialList[key].warehouseName =
  1857. house.warehouseName;
  1858. this.warehousingMaterialList[key].areaName = house.areaName;
  1859. this.warehousingMaterialList[key].shelfCode = house.shelfCode;
  1860. this.warehousingMaterialList[key].cargoSpaceCode =
  1861. house.cargoSpaceCode;
  1862. this.warehousingMaterialList[key].warehouseId = house.warehouseId;
  1863. this.warehousingMaterialList[key].areaId = house.areaId;
  1864. this.warehousingMaterialList[key].shelfId = house.shelfId;
  1865. this.warehousingMaterialList[key].cargoSpaceId = house.cargoSpaceId;
  1866. this.warehousingMaterialList[key].num = house.num;
  1867. }
  1868. }
  1869. },
  1870. // 格式化包装明细入库数据
  1871. formatOutInDetailRecordAddPO(it, item) {
  1872. return {
  1873. code: it.onlyCode,
  1874. dateType: this.curDateType === 'manufactureTime' ? 2 : 1,
  1875. dateValue: it[this.curDateType],
  1876. minUnit: it.minPackingCount,
  1877. minPositionId: it.cargoSpaceId,
  1878. minPackingCount: it.minPackingCount,
  1879. name: it.assetName,
  1880. pathIds: item.pathIds,
  1881. unit: it.unit,
  1882. barcodes: it.barcodes,
  1883. manualBatchNo: it.manualBatchNo,
  1884. packageNo: it.num,
  1885. clientCode: it.clientCode,
  1886. materielCode: it.materielCode,
  1887. weight: it.weight,
  1888. weightUtil: it.weightUtil,
  1889. engrave: it.engrave,
  1890. materialDetails: this.materialDetails(it.onlyCode),
  1891. packingCount: it.packingCount,
  1892. status: it.status,
  1893. result: it.result
  1894. };
  1895. },
  1896. // 过滤物料明细入库数据
  1897. materialDetails(onlyCode) {
  1898. return this.resultArray.filter((item) => item.onlyCode === onlyCode);
  1899. },
  1900. // 添加物品明细
  1901. addProduct(val) {
  1902. // 已经拆分(还原到未拆封编辑状态)
  1903. if (this.isSplit && this.resultArray.length > 0) {
  1904. this.handleIsDetail(false);
  1905. }
  1906. this.onSelectTableData(val);
  1907. },
  1908. //添加产品明细
  1909. async onSelectTableData(val) {
  1910. const res = await getCode('lot_number_code');
  1911. this.warehousingMaterialList.push(
  1912. ...val.map((next) => {
  1913. next.batchNo = res;
  1914. let cur = {};
  1915. next.realInventoryAmount = next.realInventoryAmount || 0;
  1916. cur = {
  1917. ...next,
  1918. cargoSpaceCode: '', //货位编码
  1919. cargoSpaceId: '', //货位id
  1920. shelfId: '', //货架id
  1921. shelfCode: '', //货架名称
  1922. areaId: '', //库区id
  1923. areaName: '', //库区名称
  1924. warehouseId: '', //仓库id
  1925. warehouseName: '', //仓库名称
  1926. assetType: this.formData.extInfo.assetType,
  1927. expirationDate: '',
  1928. outInNum: '',
  1929. minPackingCount: '',
  1930. bizStatus: 1,
  1931. contentImage: [],
  1932. warehouseLedgerDetails: [],
  1933. houseList: []
  1934. };
  1935. return cur;
  1936. })
  1937. );
  1938. },
  1939. async initData() {
  1940. const { data } = await allCategoryLevel();
  1941. this.codeList = data;
  1942. console.log(this.codeList, 'codeList--------------');
  1943. const res = await warehouseDefinition.tree();
  1944. const info = await getLoginUser();
  1945. let obj = res.find(
  1946. (item) => item.id === info.deptId[info.deptId.length - 1]
  1947. );
  1948. if (!obj) return;
  1949. this.formData.extInfo.deptCode = obj.id;
  1950. this.formData.extInfo.deptName = obj.name;
  1951. this.formData.extInfo.createUserName = info.name;
  1952. this.formData.createUserId = info.id;
  1953. },
  1954. // 添加产品信息
  1955. addStock() {
  1956. if (!this.title) {
  1957. return this.$message.error('请选择入库产品类型');
  1958. }
  1959. if (!this.formData.bizType) {
  1960. return this.$message.error('请选择入库场景');
  1961. }
  1962. this.visibleDialog = true;
  1963. },
  1964. upload(data) {
  1965. this.formData.contentImage = data;
  1966. this.$refs.formName.validateField('contentImage');
  1967. },
  1968. houseData(argum, idx) {
  1969. this.$set(this.warehousingMaterialList[idx], 'houseList', argum);
  1970. }
  1971. },
  1972. watch: {
  1973. // 解决右侧悬浮操作栏不对称问题
  1974. warehousingMaterialList: {
  1975. handler() {
  1976. this.$nextTick(() => {
  1977. this.$refs.warehousingMaterialListTable?.doLayout();
  1978. });
  1979. },
  1980. deep: true
  1981. },
  1982. // 解决右侧悬浮操作栏不对称问题
  1983. materialCodeReqList: {
  1984. handler() {
  1985. this.$nextTick(() => {
  1986. this.$refs.materialCodeReqListTable?.doLayout();
  1987. });
  1988. },
  1989. deep: true
  1990. },
  1991. // 解决右侧悬浮操作栏不对称问题
  1992. resultArray: {
  1993. handler() {
  1994. this.$nextTick(() => {
  1995. this.$refs.resultArrayTable?.doLayout();
  1996. });
  1997. },
  1998. deep: true
  1999. }
  2000. }
  2001. };
  2002. </script>
  2003. <style lang="scss" scoped>
  2004. ::v-deep.form-table {
  2005. .el-form-item {
  2006. margin-bottom: 0;
  2007. }
  2008. .el-input__inner {
  2009. padding: 0 10px;
  2010. }
  2011. ::-webkit-scrollbar {
  2012. width: 8px;
  2013. height: 8px;
  2014. background-color: transparent;
  2015. }
  2016. }
  2017. .p20 {
  2018. padding: 20px;
  2019. }
  2020. .el-select,
  2021. .el-date-editor {
  2022. width: 100%;
  2023. }
  2024. .el-form-item {
  2025. margin-bottom: 22px;
  2026. }
  2027. .material {
  2028. margin-top: 20px;
  2029. .flex {
  2030. display: flex;
  2031. justify-content: space-between;
  2032. font-size: 14px;
  2033. align-items: center;
  2034. .red {
  2035. color: #ff4949;
  2036. }
  2037. }
  2038. }
  2039. .mt10 {
  2040. margin-top: 10px;
  2041. }
  2042. .mt20 {
  2043. margin-top: 20px;
  2044. }
  2045. .center {
  2046. text-align: center;
  2047. }
  2048. .switch_left li {
  2049. border-right: 1px solid rgba(222, 222, 222, 1);
  2050. border-left: 1px solid rgba(222, 222, 222, 1);
  2051. }
  2052. .fontOmitted {
  2053. text-overflow: ellipsis;
  2054. overflow: hidden;
  2055. word-break: break-all;
  2056. white-space: nowrap;
  2057. }
  2058. .table-fixed {
  2059. .el-table__fixed-right {
  2060. height: 100% !important;
  2061. }
  2062. .el-table__fixed-left {
  2063. height: 100% !important;
  2064. }
  2065. .el-table__fixed {
  2066. height: 100% !important;
  2067. }
  2068. }
  2069. </style>