add.vue 72 KB

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