add copy.vue 116 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365
  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. :value="formData.extInfo.assetType"
  69. :options="codeList"
  70. :props="{
  71. value: 'id',
  72. label: 'name',
  73. children: 'children'
  74. }"
  75. @getValue="codeListValue"
  76. :isAll="false"
  77. />
  78. </el-form-item>
  79. </el-col>
  80. <el-col :span="8">
  81. <el-form-item label="入库类型" prop="bizType">
  82. <el-select
  83. @change="onClear"
  84. filterable
  85. placeholder="请选择"
  86. v-model="formData.bizType"
  87. clearable
  88. :disabled="
  89. !!(warehousingMaterialList && warehousingMaterialList.length)
  90. "
  91. >
  92. <el-option
  93. v-for="item in sceneState"
  94. :key="item.code"
  95. :value="item.code + ''"
  96. :label="item.label"
  97. ></el-option>
  98. </el-select> </el-form-item
  99. ></el-col>
  100. <el-col v-if="formData.bizType == 12" :span="8">
  101. <el-form-item label="关联出库单" prop="documentSource">
  102. <el-input
  103. placeholder="请输入"
  104. v-model="stockOutOrders"
  105. @click.native="handleStockOutOrder()"
  106. >
  107. </el-input>
  108. </el-form-item>
  109. </el-col>
  110. <el-col :span="8">
  111. <el-form-item
  112. v-if="formData.bizType == 12"
  113. label="委外申请单"
  114. prop="documentSource"
  115. >
  116. <el-input
  117. placeholder="请输入"
  118. v-model="formData.extInfo.documentSource"
  119. @click.native="handleOutsourcedOrders()"
  120. >
  121. <el-button
  122. slot="append"
  123. icon="el-icon-circle-close"
  124. @click.stop="onClear"
  125. ></el-button>
  126. </el-input>
  127. </el-form-item>
  128. <el-form-item
  129. v-if="formData.bizType == 2"
  130. label="采购收货单"
  131. prop="documentSource"
  132. >
  133. <el-input
  134. placeholder="请输入"
  135. v-model="formData.extInfo.documentSource"
  136. @click.native="handlePicker()"
  137. >
  138. <el-button
  139. slot="append"
  140. icon="el-icon-circle-close"
  141. @click.stop="onClear"
  142. ></el-button>
  143. </el-input>
  144. </el-form-item>
  145. <el-form-item
  146. v-if="formData.bizType == 1"
  147. label="生产工单"
  148. prop="documentSource"
  149. >
  150. <el-input
  151. placeholder="请输入"
  152. clearable
  153. v-model="formData.extInfo.documentSource"
  154. /></el-form-item>
  155. <el-form-item
  156. v-if="formData.bizType == 10"
  157. label="委外订单"
  158. prop="documentSource"
  159. >
  160. <el-input
  161. placeholder="请输入"
  162. clearable
  163. v-model="formData.extInfo.documentSource"
  164. /></el-form-item>
  165. <el-form-item
  166. v-if="
  167. formData.bizType != 1 &&
  168. formData.bizType != 2 &&
  169. formData.bizType != 3 &&
  170. formData.bizType != 10 &&
  171. formData.bizType != 12 &&
  172. formData.bizType != 13 &&
  173. formData.bizType != 14
  174. "
  175. label="销售订单"
  176. prop="documentSource"
  177. >
  178. <el-input
  179. placeholder="请输入"
  180. clearable
  181. v-model="formData.extInfo.documentSource"
  182. /></el-form-item>
  183. <el-form-item
  184. v-if="formData.bizType == 3"
  185. label="出库单"
  186. prop="documentSource"
  187. >
  188. <el-input
  189. placeholder="请输入"
  190. clearable
  191. v-model="formData.extInfo.documentSource"
  192. /></el-form-item>
  193. <el-form-item
  194. v-if="formData.bizType == 13"
  195. label="受托收货单"
  196. prop="documentSource"
  197. >
  198. <el-input
  199. placeholder="请输入"
  200. clearable
  201. @click.native="handleDeliveryNote()"
  202. v-model="formData.extInfo.documentSource"
  203. /></el-form-item>
  204. <el-form-item
  205. v-if="formData.bizType == 14"
  206. label="项目编码"
  207. prop="documentSource"
  208. >
  209. <el-input
  210. placeholder="请输入"
  211. clearable
  212. @click.native="handleProjectCode()"
  213. v-model="formData.extInfo.documentSource"
  214. /></el-form-item>
  215. </el-col>
  216. <el-col :span="8">
  217. <el-form-item label="权属部门" prop="deptName">
  218. <el-input
  219. placeholder="权属部门"
  220. disabled
  221. v-model="formData.extInfo.deptName"
  222. clearable
  223. />
  224. </el-form-item>
  225. </el-col>
  226. <el-col :span="8">
  227. <el-form-item label="入库登记人">
  228. <el-input
  229. placeholder="登记人"
  230. disabled
  231. v-model="formData.extInfo.createUserName"
  232. clearable /></el-form-item
  233. ></el-col>
  234. <!-- <el-col :span="8">
  235. <el-form-item label="入库时间" prop="outInTime">
  236. <el-date-picker
  237. v-model="formData.outInTime"
  238. clearable
  239. type="datetime"
  240. value-format="yyyy-MM-dd HH:mm:ss"
  241. placeholder="选择日期"
  242. >
  243. </el-date-picker></el-form-item
  244. ></el-col> -->
  245. <el-col :span="8" v-if="formData.bizType == 2">
  246. <el-form-item label="供应商" prop="supplierName">
  247. <!-- <DictSelection
  248. dictName="经销商列表"
  249. clearable
  250. v-model="formData.extInfo.supplierId"
  251. @itemChange="ChangeSupplier"
  252. /> -->
  253. <el-input
  254. placeholder="请输入"
  255. clearable
  256. v-model="formData.extInfo.supplierName"
  257. />
  258. </el-form-item>
  259. </el-col>
  260. <!-- <el-col :span="8" v-if="formData.bizType == 2">
  261. <el-form-item label="物料代号" prop="supplierCode">
  262. <el-input
  263. placeholder="请输入"
  264. v-model="formData.supplierCode"
  265. clearable /></el-form-item
  266. ></el-col> -->
  267. <!-- <el-col :span="8" v-if="formData.bizType == 2">
  268. <el-form-item label="客户" prop="clientName">
  269. <el-input
  270. placeholder="请输入"
  271. clearable
  272. v-model="formData.clientName"
  273. />
  274. </el-form-item>
  275. </el-col> -->
  276. <!-- <el-col :span="8" v-if="formData.bizType == 2">
  277. <el-form-item label="客户代号" prop="clientCode">
  278. <el-input
  279. placeholder="请输入"
  280. v-model="formData.clientCode"
  281. clearable /></el-form-item
  282. ></el-col> -->
  283. <!-- <el-col :span="8">
  284. <el-form-item label="送货人" prop="fromUser">
  285. <el-input
  286. placeholder="请输入"
  287. v-model="formData.fromUser"
  288. clearable /></el-form-item
  289. ></el-col> -->
  290. <el-col :span="8">
  291. <el-form-item label="送货人" prop="fromUser">
  292. <el-input
  293. placeholder="请输入"
  294. v-model="formData.fromUser"
  295. clearable
  296. />
  297. <!-- <el-select
  298. v-model="formData.fromUser"
  299. filterable
  300. placeholder="请选择送货人"
  301. >
  302. <el-option
  303. v-for="item in contactList"
  304. :key="item.id"
  305. :label="item.linkName"
  306. :value="item.id"
  307. @click.native="
  308. () => (formData.extInfo.deliveryPhone = item.mobilePhone)
  309. "
  310. >
  311. </el-option>
  312. </el-select> -->
  313. </el-form-item></el-col
  314. >
  315. <el-col :span="8">
  316. <el-form-item label="送货人联系方式" prop="deliveryPhone">
  317. <el-input
  318. placeholder="请输入"
  319. v-model="formData.extInfo.deliveryPhone"
  320. clearable /></el-form-item
  321. ></el-col>
  322. <!-- <el-col :span="8">
  323. <el-form-item label="紧急状态" prop="urgent">
  324. <el-select
  325. filterable
  326. placeholder="请选择"
  327. v-model="formData.extInfo.urgent"
  328. clearable
  329. >
  330. <el-option
  331. v-for="item in emergencyState"
  332. :key="item.code"
  333. :value="item.code"
  334. :label="item.label"
  335. ></el-option>
  336. </el-select> </el-form-item
  337. ></el-col> -->
  338. <!-- <el-col :span="8">
  339. <el-form-item label="审核人部门" prop="verifyDeptName">
  340. <selectTree
  341. ref="tree"
  342. class="form-ipt"
  343. size="medium"
  344. style="width: 100%"
  345. clearable
  346. :options="treeList"
  347. :props="{
  348. value: 'code',
  349. label: 'name',
  350. children: 'children'
  351. }"
  352. @getValue="auditorDeptClick"
  353. />
  354. </el-form-item>
  355. </el-col>
  356. <el-col :span="8">
  357. <el-form-item label="审核人" prop="verifyId">
  358. <el-select
  359. filterable
  360. class="form-ipt"
  361. style="width: 100%"
  362. v-model="formData.verifyId"
  363. placeholder="请选择"
  364. >
  365. <el-option
  366. v-for="item in staffList"
  367. :key="item.id"
  368. :label="item.name"
  369. :value="item.id"
  370. @click.native="changeVerfy(item)"
  371. >
  372. </el-option>
  373. </el-select>
  374. </el-form-item>
  375. </el-col> -->
  376. <!-- <el-col :span="24">
  377. <el-form-item label="附件" prop="contentImage">
  378. <selectUpload @getImgs="upload" :initData="uploadList" />
  379. </el-form-item>
  380. </el-col> -->
  381. <el-col :span="24">
  382. <el-form-item label="备注" prop="remark">
  383. <el-input
  384. v-model="formData.remark"
  385. clearable
  386. type="textarea"
  387. placeholder="请详细说明"
  388. :rows="4"
  389. ></el-input>
  390. </el-form-item>
  391. </el-col>
  392. </el-row>
  393. </el-form>
  394. <div class="material">
  395. <header-title title="产品信息">
  396. <el-button v-if="!isOutsourcing" type="primary" @click="addStock"
  397. >添加</el-button
  398. >
  399. </header-title>
  400. <div class="mt10 form-table">
  401. <el-form
  402. ref="warehousingMaterialListRef"
  403. :model="{ warehousingMaterialList: warehousingMaterialList }"
  404. :show-message="false"
  405. >
  406. <el-button
  407. v-if="warehousingMaterialList.length != 0"
  408. type="success"
  409. plain
  410. style="margin-bottom: 20px; float: right; margin-right: 20px"
  411. size="mini"
  412. @click="listSaveArrs"
  413. >批量保存</el-button
  414. >
  415. <el-table
  416. v-if="isWeight"
  417. :header-cell-style="rowClass"
  418. :max-height="300"
  419. ref="warehousingMaterialListTable"
  420. :key="formData.extInfo.assetType"
  421. :data="warehousingMaterialList"
  422. tooltip-effect="dark"
  423. style="width: 100%"
  424. stripe
  425. >
  426. <el-table-column
  427. label="序号"
  428. type="index"
  429. width="50"
  430. align="center"
  431. >
  432. </el-table-column>
  433. <el-table-column
  434. label="编码"
  435. prop="assetCode"
  436. align="center"
  437. width="130"
  438. :show-overflow-tooltip="true"
  439. ></el-table-column>
  440. <el-table-column
  441. label="名称"
  442. align="center"
  443. width="200"
  444. prop="assetName"
  445. :show-overflow-tooltip="true"
  446. ></el-table-column>
  447. <!-- <el-table-column
  448. label="客户编码"
  449. align="center"
  450. width="150"
  451. prop="customCode"
  452. v-if="formData.bizType == 1"
  453. >
  454. <template slot-scope="{ row, $index }">
  455. <template v-if="row.isSave">
  456. {{ row.customCode }}
  457. </template>
  458. <el-form-item
  459. v-else
  460. :prop="`warehousingMaterialList.${$index}.customCode`"
  461. required
  462. >
  463. <el-input v-model="row.customCode"> </el-input>
  464. </el-form-item>
  465. </template>
  466. </el-table-column>
  467. <el-table-column
  468. label="供应商编码"
  469. align="center"
  470. width="150"
  471. prop="customCode"
  472. v-if="formData.bizType == 2"
  473. >
  474. <template slot-scope="{ row, $index }">
  475. <template v-if="row.isSave">
  476. {{ row.supplierCode }}
  477. </template>
  478. <el-form-item
  479. v-else
  480. :prop="`warehousingMaterialList.${$index}.supplierCode`"
  481. required
  482. >
  483. <el-input v-model="row.supplierCode"> </el-input>
  484. </el-form-item>
  485. </template>
  486. </el-table-column> -->
  487. <el-table-column
  488. v-for="(item, index) in tableHeader"
  489. :key="index"
  490. align="center"
  491. :label="item.label"
  492. :width="item.width"
  493. :prop="item.prop"
  494. :show-overflow-tooltip="true"
  495. >
  496. <template slot-scope="{ row }">
  497. <template v-if="item.formatter">{{
  498. item.formatter(row)
  499. }}</template>
  500. <template v-else>{{ row[item.prop] }}</template>
  501. </template>
  502. </el-table-column>
  503. <el-table-column label="批号" width="100" prop="manualBatchNo">
  504. <template slot-scope="{ row, $index }">
  505. <template v-if="row.isSave">
  506. {{ row.manualBatchNo }}
  507. </template>
  508. <el-form-item v-else>
  509. <el-input
  510. :ref="'manualBatchNo' + $index"
  511. @keyup.native="
  512. moveFocus($event, $index, 'manualBatchNo', '产品', row)
  513. "
  514. v-model="row.manualBatchNo"
  515. >
  516. </el-input>
  517. </el-form-item>
  518. </template>
  519. </el-table-column>
  520. <el-table-column
  521. v-if="clientEnvironmentId != 2"
  522. label="批次号"
  523. prop="batchNo"
  524. width="70"
  525. align="center"
  526. >
  527. <template slot-scope="{ row, $index }">
  528. <template v-if="row.isSave">
  529. {{ row.batchNo }}
  530. </template>
  531. <el-form-item
  532. v-else
  533. :prop="`warehousingMaterialList.${$index}.batchNo`"
  534. required
  535. >
  536. <!-- <el-input v-model="row.batchNo"></el-input> -->
  537. {{ row.batchNo }}
  538. </el-form-item>
  539. </template>
  540. </el-table-column>
  541. <el-table-column
  542. label="最小包装单元"
  543. align="center"
  544. prop="minPackingCount"
  545. width="100"
  546. >
  547. <el-table-column label="" prop="minPackingCount" width="100">
  548. <template slot-scope="{ row, $index }">
  549. <template v-if="row.isSave">
  550. {{ row.minPackingCount }}
  551. </template>
  552. <el-form-item
  553. v-else
  554. :prop="`warehousingMaterialList.${$index}.minPackingCount`"
  555. required
  556. >
  557. <el-input
  558. :ref="'minPackingCount' + $index"
  559. @keyup.native="
  560. moveFocus(
  561. $event,
  562. $index,
  563. 'minPackingCount',
  564. '产品',
  565. row
  566. )
  567. "
  568. type="number"
  569. v-model="row.minPackingCount"
  570. @input="minPackingCountChange(row, $event)"
  571. >
  572. </el-input>
  573. </el-form-item>
  574. </template>
  575. </el-table-column>
  576. <el-table-column label="" prop="minPackingCount">
  577. <template slot-scope="{ row, $index }">
  578. {{ handleRowUnit(row) }} /{{ row.minPackUnit }}
  579. </template>
  580. </el-table-column>
  581. </el-table-column>
  582. <el-table-column
  583. label="包装数量"
  584. prop="outInNum"
  585. width="150"
  586. align="center"
  587. >
  588. <template slot-scope="{ row, $index }">
  589. <template v-if="row.isSave || formData.bizType == 5">
  590. {{ row.outInNum }} {{ row.minPackUnit }}
  591. </template>
  592. <el-form-item
  593. v-else
  594. :prop="`warehousingMaterialList.${$index}.outInNum`"
  595. required
  596. >
  597. <el-input
  598. :ref="'outInNum' + $index"
  599. @keyup.native="
  600. moveFocus($event, $index, 'outInNum', '产品', row)
  601. "
  602. v-model="row.outInNum"
  603. @input="packNum(row, $event)"
  604. >
  605. <template slot="append">
  606. {{ row.minPackUnit ? row.minPackUnit : '/' }}
  607. </template>
  608. </el-input>
  609. </el-form-item>
  610. </template>
  611. </el-table-column>
  612. <el-table-column label="计量数量" prop="counts">
  613. <template slot-scope="{ row, $index }">
  614. {{ $math.format(row.minPackingCount * row.outInNum, 14) }}
  615. </template>
  616. </el-table-column>
  617. <el-table-column
  618. label="计量单位"
  619. prop="batchNo"
  620. width="100"
  621. align="center"
  622. >
  623. <!-- v-if="formData.extInfo.assetType == 1" -->
  624. <template slot-scope="{ row, $index }">
  625. <template>
  626. {{ row.measuringUnit }}
  627. </template>
  628. </template>
  629. </el-table-column>
  630. <!-- <el-table-column
  631. label="计量单位"
  632. prop="batchNo"
  633. width="100"
  634. align="center"
  635. v-if="formData.extInfo.assetType == 4"
  636. >
  637. <template slot-scope="{ row, $index }">
  638. <template>
  639. {{ row.measuringUnit }}
  640. </template>
  641. </template>
  642. </el-table-column> -->
  643. <!-- <el-table-column
  644. label="数量"
  645. prop="batchNo"
  646. width="150"
  647. align="center"
  648. v-if="formData.extInfo.assetType == 1"
  649. >
  650. <template slot-scope="{ row, $index }">
  651. <template> {{ row.outInNum }} </template>
  652. </template>
  653. </el-table-column>
  654. <el-table-column
  655. label="数量"
  656. prop="batchNo"
  657. width="150"
  658. align="center"
  659. v-if="formData.extInfo.assetType == 4"
  660. >
  661. <template slot-scope="{ row, $index }">
  662. <template>
  663. {{ row.minPackingCount * row.outInNum }}
  664. </template>
  665. </template>
  666. </el-table-column> -->
  667. <el-table-column
  668. label="重量"
  669. align="center"
  670. prop="contentImage"
  671. :show-overflow-tooltip="true"
  672. >
  673. <!-- v-if="formData.extInfo.assetType == 1" -->
  674. <template slot-scope="{ row, $index }">
  675. {{ row.weight }}
  676. <template slot="append">
  677. {{ handleRowUnit(row) }}
  678. <!-- {{
  679. { yuan: '元', wanyuan: '万元' }[row.univalenceUnit]
  680. }} -->
  681. </template>
  682. </template>
  683. </el-table-column>
  684. <!-- <el-table-column
  685. label="重量"
  686. align="center"
  687. prop="contentImage"
  688. :show-overflow-tooltip="true"
  689. v-if="formData.extInfo.assetType == 4"
  690. >
  691. <template slot-scope="{ row, $index }">
  692. {{
  693. deviceWeight(
  694. row.roughWeight,
  695. row.minPackingCount * row.outInNum
  696. )
  697. }}
  698. <template slot="append"> -->
  699. <!-- {{ handleRowUnit(row) }} -->
  700. <!-- {{
  701. { yuan: '元', wanyuan: '万元' }[row.univalenceUnit]
  702. }} -->
  703. <!-- </template>
  704. </template>
  705. </el-table-column> -->
  706. <el-table-column
  707. label="重量单位"
  708. align="center"
  709. prop="contentImage"
  710. :show-overflow-tooltip="true"
  711. >
  712. <template slot-scope="{ row, $index }">
  713. {{ row.weightUnit }}
  714. <template slot="append"> </template>
  715. </template>
  716. </el-table-column>
  717. <el-table-column
  718. label="单价"
  719. prop="univalence"
  720. width="150"
  721. align="center"
  722. >
  723. <template slot-scope="{ row, $index }">
  724. <!-- <template v-if="row.isSave || formData.bizType == 5">
  725. <template v-if="row.univalence || row.univalence === 0">
  726. {{ row.univalence
  727. }}{{
  728. { yuan: '元', wanyuan: '万元' }[row.univalenceUnit]
  729. }}
  730. </template>
  731. </template> -->
  732. <!-- v-else -->
  733. <el-form-item
  734. :prop="`warehousingMaterialList.${$index}.univalence`"
  735. >
  736. <el-input
  737. :ref="'univalence' + $index"
  738. @keyup.native="
  739. moveFocus($event, $index, 'univalence', '产品', row)
  740. "
  741. v-model="row.univalence"
  742. placeholder="非必填"
  743. @input="
  744. (value) =>
  745. (row.univalence = value.replace(/[^0-9.]+/g, ''))
  746. "
  747. >
  748. <template slot="append">
  749. 元/{{ handleRowUnit(row) }}
  750. <!-- {{
  751. { yuan: '元', wanyuan: '万元' }[row.univalenceUnit]
  752. }} -->
  753. </template>
  754. </el-input>
  755. </el-form-item>
  756. </template>
  757. </el-table-column>
  758. <el-table-column
  759. label="金额"
  760. align="center"
  761. prop="contentImage"
  762. :show-overflow-tooltip="true"
  763. >
  764. <template slot-scope="{ row, $index }">
  765. {{
  766. calcSumTotal(
  767. row.outInNum,
  768. row.minPackingCount,
  769. row.univalence,
  770. row
  771. )
  772. }}
  773. </template>
  774. </el-table-column>
  775. <el-table-column
  776. v-if="clientEnvironmentId == 4"
  777. label="采购原因"
  778. align="center"
  779. width="200"
  780. prop="purpose"
  781. :show-overflow-tooltip="true"
  782. >
  783. <template slot-scope="{ row, $index }">
  784. <el-input
  785. :ref="'purpose' + $index"
  786. @keyup.native="
  787. moveFocus($event, $index, 'purpose', '产品', row)
  788. "
  789. v-model="row.purpose"
  790. >
  791. </el-input>
  792. </template>
  793. </el-table-column>
  794. <el-table-column
  795. label="货位"
  796. prop="warehouseName"
  797. :show-overflow-tooltip="true"
  798. width="250"
  799. required
  800. >
  801. <template slot-scope="{ row, $index }">
  802. <el-form-item
  803. :prop="`warehousingMaterialList.${$index}.houseList`"
  804. :required="true"
  805. >
  806. <div @click="handleWareHouse(row, $index)">
  807. <div
  808. style="color: #ff4949"
  809. v-if="row.houseList.length == 0"
  810. >
  811. ---(必填)
  812. </div>
  813. <div v-else>
  814. <div
  815. class="fontOmitted"
  816. v-for="(item, index) in row.houseList"
  817. :key="index"
  818. >
  819. {{ item.warehouseName }}- {{ item.areaName }}-
  820. {{ item.shelfCode }}- {{ item.cargoSpaceCode
  821. }}<span style="color: #ff4949" v-if="item.num">
  822. - {{ item.num }}(数)</span
  823. >
  824. <br />
  825. </div>
  826. </div>
  827. </div>
  828. </el-form-item>
  829. </template>
  830. </el-table-column>
  831. <el-table-column
  832. label="质检单"
  833. v-if="formData.extInfo.assetType === 3"
  834. prop="contentImage"
  835. :show-overflow-tooltip="true"
  836. >
  837. <template slot-scope="{ row, $index }">
  838. <upload @on-success="(data) => (row.contentImage = [data])"
  839. ><template slot="placeholder">上传</template></upload
  840. >
  841. </template>
  842. </el-table-column>
  843. <el-table-column
  844. label="操作"
  845. width="200"
  846. fixed="right"
  847. align="center"
  848. >
  849. <template slot="header" slot-scope="scope"> 操作 </template>
  850. <template slot-scope="{ row, $index }">
  851. <el-button
  852. type="text"
  853. v-show="!row.isSave"
  854. @click="listSave(row, $index)"
  855. >保存</el-button
  856. >
  857. <el-button
  858. type="text"
  859. v-show="row.isSave"
  860. @click="listEdit(row, $index)"
  861. >编辑</el-button
  862. >
  863. <el-button
  864. type="text"
  865. v-if="formData.bizType == 5"
  866. v-show="!row.isSave"
  867. @click="chooseAssets(row, $index)"
  868. >选择资产编号</el-button
  869. >
  870. <el-button type="text" @click="listDel(row, $index)"
  871. >删除</el-button
  872. >
  873. </template>
  874. </el-table-column>
  875. </el-table>
  876. </el-form>
  877. </div>
  878. <div class="mt20">
  879. <header-title :title="`包装明细`">
  880. <div class="switch_right">
  881. <span v-if="materialCodeReqList.length != 0 && !isDisableSplit">
  882. 分拆<el-switch
  883. v-model="isSplit"
  884. active-color="#13ce66"
  885. inactive-color="#ff4949"
  886. @change="handleIsDetail"
  887. style="margin-left: 10px"
  888. >
  889. </el-switch>
  890. </span>
  891. <el-button
  892. style="margin-left: 20px"
  893. type="text"
  894. @click="dateSetting"
  895. v-if="!isSplit && formData.bizType != 5"
  896. >批量设置{{
  897. curDateType === 'manufactureTime' ? '生产日期' : '采购日期'
  898. }}</el-button
  899. >
  900. </div>
  901. </header-title>
  902. <el-button
  903. v-if="materialCodeReqList.length != 0"
  904. type="success"
  905. plain
  906. style="margin-bottom: 20px; float: right; margin-right: 20px"
  907. size="mini"
  908. @click="wrapListSave"
  909. >批量保存</el-button
  910. >
  911. <el-table
  912. v-if="isWrapTable"
  913. ref="materialCodeReqListTable"
  914. :data="materialCodeReqList"
  915. tooltip-effect="dark"
  916. :key="formData.bizType"
  917. :header-cell-style="rowClass"
  918. style="width: 100%"
  919. stripe
  920. :max-height="300"
  921. @selection-change="handleSelectionChange"
  922. >
  923. <el-table-column
  924. v-if="formData.bizType != 5"
  925. type="selection"
  926. align="center"
  927. width="50"
  928. fixed="left"
  929. >
  930. </el-table-column>
  931. <el-table-column label="序号" type="index" width="50">
  932. </el-table-column>
  933. <el-table-column
  934. label="编码"
  935. prop="assetCode"
  936. width="130"
  937. :show-overflow-tooltip="true"
  938. ></el-table-column>
  939. <el-table-column
  940. label="名称"
  941. prop="assetName"
  942. width="150"
  943. :show-overflow-tooltip="true"
  944. ></el-table-column>
  945. <el-table-column
  946. label="批号"
  947. prop="manualBatchNo"
  948. width="100"
  949. ></el-table-column>
  950. <el-table-column
  951. v-if="clientEnvironmentId != 2"
  952. label="批次号"
  953. prop="batchNo"
  954. width="70"
  955. ></el-table-column>
  956. <el-table-column
  957. :label="`包装编码`"
  958. prop="onlyCode"
  959. width="200"
  960. :show-overflow-tooltip="true"
  961. ></el-table-column>
  962. <el-table-column
  963. label="包装数量"
  964. prop="packingCount"
  965. width="80"
  966. ></el-table-column>
  967. <el-table-column label="单位" prop="packingUnit"></el-table-column>
  968. <el-table-column
  969. label="计量数量"
  970. prop="minPackingCount"
  971. ></el-table-column>
  972. <el-table-column
  973. label="计量单位"
  974. prop="measuringUnit"
  975. ></el-table-column>
  976. <el-table-column label="物料代号" prop="materielCode" width="130">
  977. <template slot-scope="{ row, $index }">
  978. <el-input
  979. v-if="!row.isPack"
  980. :ref="'materielCode' + $index"
  981. @keyup.native="
  982. moveFocus($event, $index, 'materielCode', '包装', row)
  983. "
  984. v-model="row.materielCode"
  985. ></el-input>
  986. <span v-else>{{ row.materielCode }}</span>
  987. </template>
  988. </el-table-column>
  989. <el-table-column label="客户代号" prop="clientCode">
  990. <template slot-scope="{ row, $index }">
  991. <el-input
  992. v-if="!row.isPack"
  993. :ref="'clientCode' + $index"
  994. @keyup.native="
  995. moveFocus($event, $index, 'clientCode', '包装', row)
  996. "
  997. v-model="row.clientCode"
  998. ></el-input>
  999. <span v-else> {{ row.clientCode }}</span>
  1000. </template>
  1001. </el-table-column>
  1002. <el-table-column label="刻码" prop="engrave" width="140">
  1003. <template slot-scope="{ row, $index }">
  1004. <el-input
  1005. v-if="!row.isPack"
  1006. :ref="'engrave' + $index"
  1007. @keyup.native="
  1008. moveFocus($event, $index, 'engrave', '包装', row)
  1009. "
  1010. v-model="row.engrave"
  1011. ></el-input>
  1012. <span v-else>{{ row.engrave }}</span>
  1013. </template>
  1014. </el-table-column>
  1015. <el-table-column label="重量" prop="weight" width="100">
  1016. <template slot-scope="{ row, $index }">
  1017. <el-input
  1018. type="number"
  1019. v-if="!row.isPack && row.measuringUnit != row.weightUtil"
  1020. :ref="'weight' + $index"
  1021. @keyup.native="
  1022. moveFocus($event, $index, 'weight', '包装', row)
  1023. "
  1024. v-model="row.weight"
  1025. @input="weightInput($event, row)"
  1026. ></el-input>
  1027. <span v-else>{{ row.weight }}</span>
  1028. </template>
  1029. </el-table-column>
  1030. <el-table-column label="重量单位" prop="weightUtil">
  1031. <template slot-scope="{ row }">
  1032. {{ row.weightUtil }}
  1033. </template>
  1034. </el-table-column>
  1035. <el-table-column label="质检结果" prop="result" width="120">
  1036. <template slot-scope="{ row }">
  1037. <DictSelection
  1038. v-if="!row.isPack"
  1039. @updateVal="changeWrapStatus($event, row)"
  1040. dictName="质检结果"
  1041. clearable
  1042. v-model="row.result"
  1043. />
  1044. <span v-else>{{ qualityResults[row.result] }}</span>
  1045. </template>
  1046. </el-table-column>
  1047. <el-table-column label="质检状态" prop="status" width="120">
  1048. <template slot-scope="{ row }">
  1049. <!-- <DictSelection
  1050. dictName="质检状态"
  1051. clearable
  1052. v-model="row.status"
  1053. ></DictSelection> -->
  1054. <span>{{ qualityStatus[row.status] }}</span>
  1055. </template>
  1056. </el-table-column>
  1057. <el-table-column
  1058. v-if="formData.bizType != 5"
  1059. label="生产日期"
  1060. prop=""
  1061. width="220"
  1062. >
  1063. <template slot="header" slot-scope="scope">
  1064. <el-select :disabled="isSplit" filterable v-model="curDateType">
  1065. <el-option
  1066. value="manufactureTime"
  1067. label="生产日期"
  1068. ></el-option>
  1069. <el-option
  1070. value="procurementTime"
  1071. label="采购日期"
  1072. ></el-option>
  1073. </el-select>
  1074. </template>
  1075. <template slot-scope="{ row }">
  1076. <template v-if="formData.bizType == 5">
  1077. {{ row[curDateType] }}
  1078. </template>
  1079. <el-date-picker
  1080. v-else
  1081. :disabled="row.isPack"
  1082. size="small"
  1083. v-model="row[curDateType]"
  1084. type="datetime"
  1085. value-format="yyyy-MM-dd HH:mm:ss"
  1086. placeholder="选择日期"
  1087. >
  1088. </el-date-picker>
  1089. </template>
  1090. </el-table-column>
  1091. <template v-else>
  1092. <el-table-column
  1093. label="生产日期"
  1094. prop="manufactureTime"
  1095. width="200"
  1096. ></el-table-column>
  1097. <el-table-column
  1098. label="采购日期"
  1099. prop="procurementTime"
  1100. width="200"
  1101. ></el-table-column>
  1102. </template>
  1103. <el-table-column
  1104. v-if="!isSplit"
  1105. label="操作"
  1106. width="120"
  1107. fixed="right"
  1108. >
  1109. <template slot-scope="{ row, $index }">
  1110. <el-button type="text" @click="packCout(row)">
  1111. {{ !row.isPack ? '保存' : '编辑' }}
  1112. </el-button>
  1113. <el-button
  1114. v-if="isOutsourcing"
  1115. type="text"
  1116. @click="wrapDelete(row, $index)"
  1117. >
  1118. 删除
  1119. </el-button>
  1120. </template>
  1121. </el-table-column>
  1122. </el-table>
  1123. <!-- </el-tab-pane>
  1124. </el-tabs> -->
  1125. </div>
  1126. <div class="mt20" v-if="isSplit">
  1127. <header-title :title="`物料明细`"> </header-title>
  1128. <el-button
  1129. v-if="resultArray.length != 0"
  1130. type="success"
  1131. plain
  1132. style="margin-bottom: 20px; float: right; margin-right: 20px"
  1133. size="mini"
  1134. @click="materialListSave"
  1135. >批量保存</el-button
  1136. >
  1137. <el-table
  1138. v-if="isMaterialTable"
  1139. ref="resultArrayTable"
  1140. :data="resultArray"
  1141. tooltip-effect="dark"
  1142. :key="formData.bizType"
  1143. :header-cell-style="rowClass"
  1144. style="width: 100%"
  1145. stripe
  1146. :max-height="300"
  1147. @selection-change="handleSelectionChange"
  1148. >
  1149. <el-table-column label="序号" type="index" width="50">
  1150. </el-table-column>
  1151. <el-table-column
  1152. label="编码"
  1153. width="150"
  1154. prop="assetCode"
  1155. :show-overflow-tooltip="true"
  1156. ></el-table-column>
  1157. <el-table-column
  1158. label="名称"
  1159. prop="assetName"
  1160. width="200"
  1161. :show-overflow-tooltip="true"
  1162. ></el-table-column>
  1163. <el-table-column
  1164. label="批号"
  1165. prop="manualBatchNo"
  1166. width="100"
  1167. ></el-table-column>
  1168. <el-table-column
  1169. v-if="clientEnvironmentId != 2"
  1170. label="批次号"
  1171. prop="batchNo"
  1172. width="80"
  1173. ></el-table-column>
  1174. <el-table-column
  1175. label="物料编码"
  1176. prop="no"
  1177. width="200"
  1178. :show-overflow-tooltip="true"
  1179. ></el-table-column>
  1180. <el-table-column
  1181. label="计量数量"
  1182. prop="minPackingCount"
  1183. width="90"
  1184. ></el-table-column>
  1185. <el-table-column
  1186. width="80"
  1187. label="计量单位"
  1188. prop="measuringUnit"
  1189. ></el-table-column>
  1190. <el-table-column label="物料代号" prop="materielCode" width="130">
  1191. <template slot-scope="{ row, $index }">
  1192. <el-input
  1193. v-if="!row.isPack"
  1194. :ref="'materielCode' + $index"
  1195. @keyup.native="
  1196. moveFocus($event, $index, 'materielCode', '物料', row)
  1197. "
  1198. v-model="row.materielCode"
  1199. ></el-input>
  1200. <span v-else>{{ row.materielCode }}</span>
  1201. </template>
  1202. </el-table-column>
  1203. <el-table-column label="客户代号" prop="clientCode">
  1204. <template slot-scope="{ row, $index }">
  1205. <el-input
  1206. v-if="!row.isPack"
  1207. :ref="'clientCode' + $index"
  1208. @keyup.native="
  1209. moveFocus($event, $index, 'clientCode', '物料', row)
  1210. "
  1211. v-model="row.clientCode"
  1212. ></el-input>
  1213. <span v-else>{{ row.clientCode }}</span>
  1214. </template>
  1215. </el-table-column>
  1216. <el-table-column label="刻码" prop="engrave" width="140">
  1217. <template slot-scope="{ row, $index }">
  1218. <el-input
  1219. v-if="!row.isPack"
  1220. :ref="'engrave' + $index"
  1221. @keyup.native="
  1222. moveFocus($event, $index, 'engrave', '物料', row)
  1223. "
  1224. v-model="row.engrave"
  1225. ></el-input>
  1226. <span v-else>{{ row.engrave }}</span>
  1227. </template>
  1228. </el-table-column>
  1229. <el-table-column label="重量" prop="weight" width="100">
  1230. <template slot-scope="{ row, $index }">
  1231. <el-input
  1232. type="number"
  1233. v-if="!row.isPack && row.measuringUnit != row.weightUnit"
  1234. :ref="'weight' + $index"
  1235. @keyup.native="
  1236. moveFocus($event, $index, 'weight', '物料', row)
  1237. "
  1238. v-model="row.weight"
  1239. ></el-input>
  1240. <span v-else>{{ row.weight }}</span>
  1241. </template>
  1242. </el-table-column>
  1243. <el-table-column
  1244. label="重量单位"
  1245. prop="weightUnit"
  1246. width="100"
  1247. ></el-table-column>
  1248. <el-table-column label="质检结果" prop="result" width="120">
  1249. <template slot-scope="{ row }">
  1250. <DictSelection
  1251. v-if="!row.isPack"
  1252. @updateVal="changeWrapStatus($event, row)"
  1253. dictName="质检结果"
  1254. clearable
  1255. v-model="row.result"
  1256. />
  1257. <span v-else>{{ qualityResults[row.result] }}</span>
  1258. </template>
  1259. </el-table-column>
  1260. <el-table-column label="质检状态" prop="status" width="120">
  1261. <template slot-scope="{ row }">
  1262. <span>{{ qualityStatus[row.status] }}</span>
  1263. </template>
  1264. </el-table-column>
  1265. <el-table-column label="操作" width="120" fixed="right">
  1266. <template slot-scope="{ row, $index }">
  1267. <el-button type="text" @click="materialBtn(row)">
  1268. {{ !row.isPack ? '保存' : '编辑' }}
  1269. </el-button>
  1270. <el-button
  1271. v-if="isOutsourcing"
  1272. type="text"
  1273. @click="materialDelete(row, $index)"
  1274. >
  1275. 删除
  1276. </el-button>
  1277. </template>
  1278. </el-table-column>
  1279. </el-table>
  1280. </div>
  1281. </div>
  1282. <div class="center mt20">
  1283. <el-button type="primary" @click="handleSave" :loading="saveLoading"
  1284. >保存</el-button
  1285. >
  1286. <el-button @click="$router.go(-1)">返回</el-button>
  1287. </div>
  1288. </el-card>
  1289. <selectType
  1290. :visibleDialog.sync="visibleDialog"
  1291. :title="title"
  1292. :tableHeader="tableHeader"
  1293. :bizScene="formData.bizType"
  1294. :type="[selectEquiType]"
  1295. :loadTree.sync="loadTree"
  1296. @selectTableData="addProduct"
  1297. />
  1298. <WareHouseDailog
  1299. ref="wareHouseDailogRef"
  1300. @houseData="houseData"
  1301. ></WareHouseDailog>
  1302. <ReturnSelect
  1303. ref="returnSelectRef"
  1304. :tableHeader="tableHeader"
  1305. :curDateType="curDateType"
  1306. ></ReturnSelect>
  1307. <el-dialog :visible.sync="dateVisible" title="选择日期" width="400px">
  1308. <el-date-picker
  1309. size="small"
  1310. v-model="batchTime"
  1311. type="datetime"
  1312. style="width: 320px"
  1313. value-format="yyyy-MM-dd HH:mm:ss"
  1314. placeholder="选择日期"
  1315. >
  1316. </el-date-picker>
  1317. <div style="text-align: right; margin-top: 20px">
  1318. <el-button @click="dateVisible = false">取消</el-button>
  1319. <el-button type="primary" @click="dateConfirm" :disabled="!batchTime"
  1320. >确认</el-button
  1321. >
  1322. </div>
  1323. </el-dialog>
  1324. <!-- 出库单 -->
  1325. <stockOutOrder ref="stockOutOrderRef" @success="stockOutOrderSuccess" />
  1326. <!-- 销售订单 -->
  1327. <picker ref="pickerRef" @success="pickerSuccess" />
  1328. <!-- 委外订单 -->
  1329. <outsourcedOrders
  1330. ref="outsourcedOrdersRef"
  1331. @success="outsourcedOrdersSuccess"
  1332. />
  1333. <!-- 受托收货单 -->
  1334. <deliveryNote
  1335. ref="deliveryNoteRef"
  1336. @success="deliveryNoteSuccess"
  1337. ></deliveryNote>
  1338. <!-- 项目立项 -->
  1339. <projectCode
  1340. ref="projectCodeRef"
  1341. @success="projectCodeSuccess"
  1342. ></projectCode>
  1343. </div>
  1344. </template>
  1345. <script>
  1346. import { add, bignumber } from 'mathjs';
  1347. import picker from './components/picker.vue';
  1348. import deliveryNote from './components/deliveryNote.vue';
  1349. import projectCode from './components/projectCode.vue';
  1350. import stockOutOrder from './components/stockOutOrder.vue';
  1351. import outsourcedOrders from './components/outsourcedOrders.vue';
  1352. import outin from '@/api/warehouseManagement/outin';
  1353. import {
  1354. getTreeByPid,
  1355. getTreeByGroup,
  1356. getProductList
  1357. } from '@/api/classifyManage';
  1358. import warehouseDefinition from '@/api/warehouseManagement/warehouseDefinition';
  1359. import selectUpload from '@/components/selectUpload';
  1360. import upload from '@/components/uploadImg';
  1361. import {
  1362. warehousingType,
  1363. sceneState,
  1364. emergencyState,
  1365. materialType
  1366. } from '@/utils/dict/index';
  1367. // import { getInfo, warehousingAdd, getAssetNum } from '@/api/stockManagement';
  1368. import selectTree from '@/components/selectTree';
  1369. import selectType from '../components/selectType.vue';
  1370. import WareHouseDailog from '../components/WareHouseDailog.vue';
  1371. import ReturnSelect from './components/ReturnSelect.vue';
  1372. // import supplier from '@/api/main/supplier';
  1373. // import org from '@/api/main/org';
  1374. // import user from '@/api/main/user';
  1375. import { tableHeader } from '../common';
  1376. import { getCode } from '@/api/codeManagement/index.js';
  1377. import { number } from 'echarts/core';
  1378. import { purchaseorderGetById, contactlink, oneId } from '@/api/mes';
  1379. export default {
  1380. components: {
  1381. selectUpload,
  1382. selectTree,
  1383. selectType,
  1384. WareHouseDailog,
  1385. upload,
  1386. ReturnSelect,
  1387. picker,
  1388. outsourcedOrders,
  1389. stockOutOrder,
  1390. projectCode,
  1391. deliveryNote
  1392. },
  1393. data() {
  1394. return {
  1395. isWrapTable: true, // 包装表格显隐
  1396. isMaterialTable: true, // 物料表格显隐
  1397. isOutsourcing: false, // 是否委外
  1398. stockOutOrders: '',
  1399. isSplit: false, // 是否拆分到物料明细
  1400. qualityStatus: {
  1401. 0: '未检',
  1402. 1: '已检',
  1403. 2: '部分检'
  1404. }, // 质检状态 0未检 1已检
  1405. qualityResults: {
  1406. 0: '合格',
  1407. 1: '不合格',
  1408. 3: '让步接收'
  1409. }, // 质检结果 0合格 1不合格 3让步接收
  1410. isWeight: true,
  1411. resultArray: [],
  1412. contactList: [],
  1413. pickerRow: {},
  1414. outsourcedOrdersRow: {},
  1415. fromUserList: [],
  1416. codeList: [],
  1417. materialType,
  1418. warehousingType,
  1419. sceneState,
  1420. emergencyState,
  1421. saveLoading: false,
  1422. visibleDialog: false,
  1423. curDateType: 'manufactureTime',
  1424. materialCodeReqListSelected: [],
  1425. // warehouseList: [], //仓库数组
  1426. // warehouse: {},
  1427. title: '',
  1428. tableData2: [],
  1429. uploadList: [],
  1430. supplierList: [],
  1431. warehousingMaterialList: [],
  1432. activeName: 'a',
  1433. loadTree: true,
  1434. selectEquiType: '',
  1435. batchTime: '',
  1436. dateVisible: false,
  1437. treeList: [],
  1438. staffList: [],
  1439. deliveryNoteRow: {},
  1440. projectCodeRow: {},
  1441. formData: {
  1442. extInfo: {
  1443. assetType: '', //物品类型
  1444. deptCode: '', //部门code
  1445. deptName: '', //部门名称
  1446. verifyDeptCode: '', //审核部门编码
  1447. verifyDeptName: '', //审核部门名称
  1448. deliveryName: '', //送货人名称
  1449. deliveryPhone: '', //送货人电话
  1450. documentSource: '', //销售订单
  1451. urgent: '', //紧急状态
  1452. supplierId: '', //供应商ID
  1453. supplierName: '', //供应商名称
  1454. createUserName: '', //创建人名字
  1455. contentImage: [] //图片数组
  1456. },
  1457. fromUser: '', //送货人
  1458. bizType: '', //物品类型
  1459. verifyId: '', //审核人Id
  1460. verifyName: '', //审核人名称
  1461. createUserId: '',
  1462. remark: ''
  1463. },
  1464. rules: {
  1465. 'extInfo.assetType': {
  1466. required: true,
  1467. message: '请选择物品类型',
  1468. trigger: 'change'
  1469. },
  1470. bizType: {
  1471. required: true,
  1472. message: '请选择入库场景',
  1473. trigger: 'change'
  1474. }
  1475. }
  1476. };
  1477. },
  1478. computed: {
  1479. // 是否允许分拆
  1480. isDisableSplit() {
  1481. return this.warehousingMaterialList.some(
  1482. (item) => item.weightUnit == item.measuringUnit
  1483. );
  1484. },
  1485. // 条码信息
  1486. materialCodeReqList() {
  1487. return this.warehousingMaterialList
  1488. .map((i) => i.warehouseLedgerDetails || [])
  1489. .flat();
  1490. },
  1491. tableHeader() {
  1492. return tableHeader(this.selectEquiType);
  1493. },
  1494. clientEnvironmentId() {
  1495. return this.$store.state.user.info.clientEnvironmentId;
  1496. }
  1497. },
  1498. created() {
  1499. if (this.$route.query.id) {
  1500. // this._getInfo()
  1501. } else {
  1502. let obj = localStorage.getItem('orgInfo')
  1503. ? JSON.parse(localStorage.getItem('orgInfo'))
  1504. : {};
  1505. this.formData.createUserName = obj.name;
  1506. this.formData.extInfo.deptName = obj.dept?.name;
  1507. this.formData.deptCode = obj.dept?.code;
  1508. }
  1509. this.initData();
  1510. },
  1511. methods: {
  1512. // 键盘移动
  1513. moveFocus(event, index, key, type, row) {
  1514. let keyfield = [];
  1515. let listLength = 0;
  1516. switch (type) {
  1517. case '产品':
  1518. listLength = this.warehousingMaterialList.length;
  1519. if (this.clientEnvironmentId == 4) {
  1520. keyfield = [
  1521. 'manualBatchNo',
  1522. 'minPackingCount',
  1523. 'outInNum',
  1524. 'univalence',
  1525. 'purpose'
  1526. ];
  1527. } else {
  1528. keyfield = [
  1529. 'manualBatchNo',
  1530. 'minPackingCount',
  1531. 'outInNum',
  1532. 'univalence'
  1533. ];
  1534. }
  1535. break;
  1536. case '包装':
  1537. listLength = this.materialCodeReqList.length;
  1538. if (row.measuringUnit != row.weightUtil) {
  1539. keyfield = ['materielCode', 'clientCode', 'engrave', 'weight'];
  1540. } else {
  1541. keyfield = ['materielCode', 'clientCode', 'engrave'];
  1542. }
  1543. break;
  1544. case '物料':
  1545. listLength = this.resultArray.length;
  1546. if (row.measuringUnit != row.weightUnit) {
  1547. keyfield = ['materielCode', 'clientCode', 'engrave', 'weight'];
  1548. } else {
  1549. keyfield = ['materielCode', 'clientCode', 'engrave'];
  1550. }
  1551. break;
  1552. }
  1553. if (event.keyCode === 13) {
  1554. // 回车
  1555. if (
  1556. index === listLength - 1 &&
  1557. key === keyfield[keyfield.length - 1]
  1558. ) {
  1559. // 最后一行最后一个
  1560. return;
  1561. }
  1562. this.$refs[key + index].blur();
  1563. if (key === keyfield[keyfield.length - 1]) {
  1564. // 当前行最后一个,跳转下一行第一个
  1565. if (this.$refs[keyfield[0] + (index + 1)].value == 0) {
  1566. this.$refs[keyfield[0] + (index + 1)].value = '';
  1567. }
  1568. this.$refs[keyfield[0] + (index + 1)].focus();
  1569. } else {
  1570. // 跳转下一个
  1571. const nextkeyindex = keyfield.findIndex((k) => k === key) + 1;
  1572. this.$nextTick(() => {
  1573. if (this.$refs[keyfield[nextkeyindex] + index].value == 0) {
  1574. this.$refs[keyfield[nextkeyindex] + index].value = '';
  1575. }
  1576. this.$refs[keyfield[nextkeyindex] + index].focus();
  1577. });
  1578. }
  1579. }
  1580. // 向上 =38
  1581. if (event.keyCode === 38) {
  1582. console.log('向上');
  1583. if (index === 0) {
  1584. // 第一行
  1585. console.log('第一行无法向上');
  1586. return;
  1587. }
  1588. this.$refs[key + index].blur();
  1589. this.$nextTick(() => {
  1590. if (this.$refs[key + (index - 1)].value == 0) {
  1591. this.$refs[key + (index - 1)].value = '';
  1592. }
  1593. this.$refs[key + (index - 1)].focus();
  1594. });
  1595. }
  1596. // 下 = 40
  1597. if (event.keyCode === 40) {
  1598. console.log('向下');
  1599. if (index === listLength - 1) {
  1600. // 最后一行
  1601. console.log('最后一行无法向下');
  1602. return;
  1603. }
  1604. this.$refs[key + index].blur();
  1605. this.$nextTick(() => {
  1606. if (this.$refs[key + (index + 1)].value == 0) {
  1607. this.$refs[key + (index + 1)].value = '';
  1608. }
  1609. this.$refs[key + (index + 1)].focus();
  1610. });
  1611. }
  1612. // 左 = 37
  1613. if (event.keyCode === 37) {
  1614. console.log('向左');
  1615. if (index === 0 && key === keyfield[0]) {
  1616. // 第一行第一个
  1617. console.log('第一行第一个无法向左');
  1618. return;
  1619. }
  1620. this.$refs[key + index].blur();
  1621. if (key === keyfield[0]) {
  1622. if (
  1623. this.$refs[keyfield[keyfield.length - 1] + (index - 1)].value == 0
  1624. ) {
  1625. this.$refs[keyfield[keyfield.length - 1] + (index - 1)].value =
  1626. '';
  1627. }
  1628. // 当前行第一个,跳转上一行最后一个
  1629. this.$refs[keyfield[keyfield.length - 1] + (index - 1)].focus();
  1630. } else {
  1631. // 跳转上一个
  1632. const prevkeyindex = keyfield.findIndex((k) => k === key) - 1;
  1633. this.$nextTick(() => {
  1634. if (this.$refs[keyfield[prevkeyindex] + index].value == 0) {
  1635. this.$refs[keyfield[prevkeyindex] + index].value = '';
  1636. }
  1637. this.$refs[keyfield[prevkeyindex] + index].focus();
  1638. });
  1639. }
  1640. }
  1641. // 右 = 39
  1642. if (event.keyCode === 39) {
  1643. console.log('向右');
  1644. if (
  1645. index === listLength - 1 &&
  1646. key === keyfield[keyfield.length - 1]
  1647. ) {
  1648. // 最后一行最后一个
  1649. console.log('最后一行最后一个无法向左');
  1650. return;
  1651. }
  1652. this.$refs[key + index].blur();
  1653. if (key === keyfield[keyfield.length - 1]) {
  1654. // 当前行最后一个,跳转下一行第一个
  1655. if (this.$refs[keyfield[0] + (index + 1)].value == 0) {
  1656. this.$refs[keyfield[0] + (index + 1)].value = '';
  1657. }
  1658. this.$refs[keyfield[0] + (index + 1)].focus();
  1659. } else {
  1660. // 跳转下一个
  1661. const nextkeyindex = keyfield.findIndex((k) => k === key) + 1;
  1662. this.$nextTick(() => {
  1663. if (this.$refs[keyfield[nextkeyindex] + index].value == 0) {
  1664. this.$refs[keyfield[nextkeyindex] + index].value = '';
  1665. }
  1666. this.$refs[keyfield[nextkeyindex] + index].focus();
  1667. });
  1668. }
  1669. }
  1670. },
  1671. // 包装维度最小包装单元改变——>总重量
  1672. minPackingCountChange(row, value) {
  1673. if (value >= 0) {
  1674. row.minPackingCount = value.replace(/^[0]+/, '');
  1675. } else {
  1676. row.minPackingCount = 0;
  1677. }
  1678. // row.minPackingCount = value.replace(/^(0+)|[^\d]+/g, '');
  1679. if (row.outInNum >= 0 && value >= 0) {
  1680. this.packNum(row, row.outInNum);
  1681. }
  1682. },
  1683. // 选择质检结果改变质检状态
  1684. changeWrapStatus(resultValue, row) {
  1685. switch (resultValue) {
  1686. case '':
  1687. // 清空质检状态
  1688. row.status = '0';
  1689. break;
  1690. default:
  1691. // 默认已检质检状态
  1692. row.status = '1';
  1693. break;
  1694. }
  1695. },
  1696. // 包装批量保存
  1697. wrapListSave() {
  1698. // 批量修改包装明细
  1699. this.isWeight = false;
  1700. this.bulkEditingWrap();
  1701. this.$nextTick(() => {
  1702. this.isWeight = true;
  1703. });
  1704. },
  1705. // 物料批量保存
  1706. materialListSave() {
  1707. this.resultArray.forEach((item) => {
  1708. if (!item.isPack) {
  1709. this.materialBtn(item);
  1710. }
  1711. });
  1712. },
  1713. weightInput(value, row) {
  1714. const newValue = value.replace(/[^\d.]/g, ''); // 保留数字和小数点
  1715. const decimalCount = (newValue.match(/\./g) || []).length; // 计算小数点的个数
  1716. if (decimalCount > 1) {
  1717. // 如果小数点个数大于1,移除多余的小数点
  1718. const lastIndex = newValue.lastIndexOf('.');
  1719. row.weight =
  1720. newValue.slice(0, lastIndex) + newValue.slice(lastIndex + 1);
  1721. } else if (decimalCount === 1) {
  1722. // 如果小数点个数等于1,允许小数点的输入
  1723. row.weight = newValue;
  1724. } else {
  1725. row.weight = newValue === '' ? 0 : parseFloat(newValue); // 如果输入为空,则设为0
  1726. }
  1727. },
  1728. handleIsDetail(event) {
  1729. this.isSplit = event;
  1730. const list = this.materialCodeReqList;
  1731. if (event) {
  1732. let resultArray = [];
  1733. list.forEach((item) => {
  1734. // 包装维度改成已保存状态
  1735. item.isPack = true;
  1736. // 拆分物料维度并生成列表
  1737. for (let i = 1; i <= Number(item.minPackingCount); i++) {
  1738. console.log(item.weight);
  1739. console.log(item.minPackingCount);
  1740. resultArray.push({
  1741. onlyCode: item.onlyCode,
  1742. no: item.onlyCode + i.toString().padStart(4, '0'),
  1743. assetCode: item.assetCode,
  1744. assetName: item.assetName,
  1745. manualBatchNo: item.manualBatchNo,
  1746. batchNo: item.batchNo,
  1747. minPackingCount: 1,
  1748. measuringUnit: item.measuringUnit,
  1749. materielCode: item.materielCode,
  1750. clientCode: item.clientCode,
  1751. weight: this.$math.format(
  1752. item.weight / Number(item.minPackingCount),
  1753. 14
  1754. ),
  1755. initWeight: this.$math.format(
  1756. item.weight / Number(item.minPackingCount),
  1757. 14
  1758. ),
  1759. weightUnit: item.weightUnit,
  1760. engrave: item.engrave,
  1761. result: item.result,
  1762. status: item.status,
  1763. isPack: false
  1764. });
  1765. }
  1766. });
  1767. this.resultArray = resultArray;
  1768. // 批量修改包装明细
  1769. this.isWeight = false;
  1770. this.bulkEditingWrap();
  1771. this.$nextTick(() => {
  1772. this.isWeight = true;
  1773. });
  1774. } else {
  1775. // 包装维度改成编辑状态
  1776. list.forEach((item) => {
  1777. item.isPack = false;
  1778. });
  1779. // 清空物料维度列表
  1780. this.resultArray = [];
  1781. }
  1782. },
  1783. //包装明细保存
  1784. packCout(row) {
  1785. //true保存==》反之
  1786. if (!row.isPack) {
  1787. row.isPack = true;
  1788. const code = row.assetCode;
  1789. const batchNo = row.batchNo;
  1790. //做防护,防止weight字符串类型
  1791. this.materialCodeReqList.forEach((ele) => {
  1792. ele.weight = Number(ele.weight);
  1793. });
  1794. // const count = this.materialCodeReqList.reduce(
  1795. // (acc, curr) => acc + curr.weight,
  1796. // 0
  1797. // );
  1798. // 修改产品信息重量(包装维度累计)
  1799. this.isWeight = false;
  1800. this.warehousingMaterialList.forEach((item) => {
  1801. if (item.assetCode == code && item.batchNo == batchNo) {
  1802. let arr = [];
  1803. for (const key in this.materialCodeReqList) {
  1804. if (
  1805. this.materialCodeReqList[key].assetCode == item.assetCode &&
  1806. this.materialCodeReqList[key].batchNo == item.batchNo
  1807. ) {
  1808. arr.push({ ...this.materialCodeReqList[key] });
  1809. }
  1810. }
  1811. const count = arr.reduce((acc, curr) => {
  1812. if (curr.isPack) {
  1813. this.$set(curr, 'initWeight', +curr.weight);
  1814. return Number(this.$math.format(+acc + +curr.weight, 14));
  1815. } else {
  1816. return Number(this.$math.format(+acc + +curr.initWeight, 14));
  1817. }
  1818. }, 0);
  1819. this.$set(item, 'weight', count);
  1820. }
  1821. });
  1822. this.$nextTick(() => {
  1823. this.isWeight = true;
  1824. });
  1825. } else {
  1826. row.isPack = false;
  1827. }
  1828. this.$nextTick(() => {
  1829. this.isWrapTable = false;
  1830. this.$nextTick(() => {
  1831. this.isWrapTable = true;
  1832. });
  1833. });
  1834. },
  1835. // 批量修改包装明细
  1836. bulkEditingWrap() {
  1837. // 批量修改包装明细列表状态(已保存)
  1838. this.materialCodeReqList.forEach((item) => {
  1839. item.isPack = true;
  1840. });
  1841. // 改变产品明细重量
  1842. this.warehousingMaterialList.forEach((outItem) => {
  1843. let arr = [];
  1844. this.materialCodeReqList.forEach((inneritem) => {
  1845. if (
  1846. inneritem.assetCode == outItem.assetCode &&
  1847. inneritem.batchNo == outItem.batchNo
  1848. ) {
  1849. arr.push(inneritem);
  1850. }
  1851. });
  1852. const count = arr.reduce((acc, curr) => {
  1853. if (curr.isPack) {
  1854. this.$set(curr, 'initWeight', +curr.weight);
  1855. return Number(this.$math.format(+acc + +curr.weight, 14));
  1856. } else {
  1857. return Number(this.$math.format(+acc + +curr.initWeight, 14));
  1858. }
  1859. }, 0);
  1860. this.$set(outItem, 'weight', count);
  1861. });
  1862. },
  1863. // 批量修改物料明细
  1864. bulkEditingMaterial() {
  1865. // 批量修改物料明细列表状态(已保存)
  1866. this.resultArray.forEach((item) => {
  1867. item.isPack = true;
  1868. });
  1869. // 改变包装明细重量
  1870. this.materialCodeReqList.forEach((outItem) => {
  1871. let arr = [];
  1872. this.resultArray.forEach((inneritem) => {
  1873. if (
  1874. inneritem.assetCode == outItem.assetCode &&
  1875. inneritem.batchNo == outItem.batchNo
  1876. ) {
  1877. arr.push(inneritem);
  1878. }
  1879. });
  1880. const count = arr.reduce((acc, curr) => {
  1881. if (curr.isPack) {
  1882. this.$set(curr, 'initWeight', +curr.weight);
  1883. return Number(this.$math.format(+acc + +curr.weight, 14));
  1884. } else {
  1885. return Number(this.$math.format(+acc + +curr.initWeight, 14));
  1886. }
  1887. }, 0);
  1888. this.$set(outItem, 'weight', count);
  1889. });
  1890. },
  1891. // 物料明细保存
  1892. materialBtn(row) {
  1893. console.log(row);
  1894. console.log(this.resultArray);
  1895. console.log(this.materialCodeReqList);
  1896. // true保存 false编辑
  1897. if (!row.isPack) {
  1898. row.isPack = true;
  1899. // 物料维度修改质检改变包装维度质检(结果和状态)
  1900. this.materialCodeReqList.forEach((outItem) => {
  1901. let arr = [];
  1902. this.resultArray.forEach((inneritem) => {
  1903. if (inneritem.onlyCode == outItem.onlyCode) {
  1904. arr.push(inneritem);
  1905. }
  1906. });
  1907. console.log(arr);
  1908. // 首先判断是未填/合格不合格
  1909. let boolen = arr.every((item) => {
  1910. return item.result === '' || item.result === undefined;
  1911. });
  1912. // 判断只要物料全部质检结果(未填)——>包装质检结果(未填) 状态(未检)
  1913. if (boolen) {
  1914. this.$set(outItem, 'result', '');
  1915. this.$set(outItem, 'status', '0');
  1916. } else {
  1917. // 判断只要物料有一个质检结果(不合格)——>包装质检结果(不合格) 状态(已检)
  1918. let boolen = arr.some((item) => {
  1919. return item.result === '1';
  1920. });
  1921. if (boolen) {
  1922. this.$set(outItem, 'result', '1');
  1923. this.$set(outItem, 'status', '1');
  1924. } else {
  1925. // 判断只要物料有一个质检结果(让步接收)——>包装质检结果(让步接收) 状态(已检)
  1926. let boolen = arr.some((item) => {
  1927. return item.result === '3';
  1928. });
  1929. if (boolen) {
  1930. // 让步接收 已检
  1931. this.$set(outItem, 'result', '3');
  1932. this.$set(outItem, 'status', '1');
  1933. } else {
  1934. // 判断只要物料有全部质检结果(合格)——>包装质检结果(合格) 状态(已检)
  1935. let boolen = arr.every((item) => {
  1936. return item.result === '0';
  1937. });
  1938. if (boolen) {
  1939. // 合格 已检
  1940. this.$set(outItem, 'result', '0');
  1941. this.$set(outItem, 'status', '1');
  1942. } else {
  1943. // 合格 部分检
  1944. this.$set(outItem, 'result', '0');
  1945. this.$set(outItem, 'status', '2');
  1946. }
  1947. }
  1948. }
  1949. }
  1950. // this.$set(outItem, 'result', boolen ? '1' : '0');
  1951. });
  1952. // 物料维度修改重量改变包装维度重量
  1953. let onlyCode = row.onlyCode;
  1954. this.materialCodeReqList.forEach((item) => {
  1955. if (item.onlyCode === onlyCode) {
  1956. let arr = [];
  1957. for (const key in this.resultArray) {
  1958. if (this.resultArray[key].onlyCode == item.onlyCode) {
  1959. arr.push(this.resultArray[key]);
  1960. }
  1961. }
  1962. const count = arr.reduce((acc, curr) => {
  1963. if (curr.isPack) {
  1964. this.$set(curr, 'initWeight', +curr.weight);
  1965. return Number(this.$math.format(+acc + +curr.weight, 14));
  1966. } else {
  1967. return Number(this.$math.format(+acc + +curr.initWeight, 14));
  1968. }
  1969. }, 0);
  1970. this.$set(item, 'weight', count);
  1971. }
  1972. });
  1973. // 包装维度修改重量改变产品信息
  1974. this.isWeight = false;
  1975. // 批量修改包装明细
  1976. this.bulkEditingWrap();
  1977. this.$nextTick(() => {
  1978. this.isWeight = true;
  1979. });
  1980. } else {
  1981. row.isPack = false;
  1982. }
  1983. this.$nextTick(() => {
  1984. this.isWrapTable = false;
  1985. this.isMaterialTable = false;
  1986. this.$nextTick(() => {
  1987. this.isWrapTable = true;
  1988. this.isMaterialTable = true;
  1989. });
  1990. });
  1991. },
  1992. packNum(row, value) {
  1993. const total = {
  1994. packingCount: Number(
  1995. row.minPackingCount > 0 ? row.minPackingCount : 0
  1996. ),
  1997. outInNum: Number(row.outInNum > 0 ? row.outInNum : 0)
  1998. };
  1999. if (row.measuringUnit == row.weightUnit) {
  2000. row.weight = Number(
  2001. this.$math.format(
  2002. total.packingCount * 1 * total.outInNum.toFixed(2),
  2003. 14
  2004. )
  2005. );
  2006. } else {
  2007. const totals = Number(
  2008. this.$math.format(total.packingCount * total.outInNum, 14)
  2009. );
  2010. row.weight = Number(
  2011. this.$math.format(
  2012. totals * (row.netWeight > 0 ? row.netWeight.toFixed(2) : 0),
  2013. 14
  2014. )
  2015. );
  2016. }
  2017. return (row.outInNum = value.replace(/^(0+)|[^\d]+/g, ''));
  2018. },
  2019. async searchContact(id) {
  2020. const data = await contactlink({ contactId: id });
  2021. this.contactList = data.data;
  2022. },
  2023. outsourcedOrdersSuccess(row) {
  2024. this.outsourcedOrdersRow = row;
  2025. this.formData.extInfo.documentSource = row.code;
  2026. this.$forceUpdate();
  2027. },
  2028. deliveryNoteSuccess(row) {
  2029. this.deliveryNoteRow = row;
  2030. this.formData.extInfo.documentSource = row.code;
  2031. this.$forceUpdate();
  2032. },
  2033. projectCodeSuccess(row) {
  2034. this.projectCodeRow = row;
  2035. this.formData.extInfo.documentSource = row.code;
  2036. this.$forceUpdate();
  2037. },
  2038. // 包装删除
  2039. wrapDelete(row, index) {
  2040. // 删除包装
  2041. this.materialCodeReqList.splice(index, 1);
  2042. let outIndex = 0;
  2043. let arr = this.warehousingMaterialList.filter((item, index) => {
  2044. if (item.assetCode == row.assetCode && item.batchNo == row.batchNo) {
  2045. outIndex = index;
  2046. return true;
  2047. }
  2048. });
  2049. // 修改产品
  2050. if (arr[0].minPackingCount * arr[0].outInNum === row.minPackingCount) {
  2051. this.warehousingMaterialList.splice(outIndex, 1);
  2052. } else {
  2053. this.$set(
  2054. this.warehousingMaterialList[outIndex],
  2055. 'outInNum',
  2056. this.warehousingMaterialList[outIndex].outInNum - 1
  2057. );
  2058. }
  2059. // 删除物料
  2060. if (this.resultArray.length > 0) {
  2061. let indexs = [];
  2062. let arr = this.resultArray.filter((item, index) => {
  2063. if (
  2064. item.assetCode == row.assetCode &&
  2065. item.batchNo == row.batchNo
  2066. ) {
  2067. indexs.push(index);
  2068. return true;
  2069. }
  2070. });
  2071. console.log(indexs);
  2072. console.log(arr);
  2073. this.resultArray = this.resultArray.filter((item, index) => {
  2074. return !indexs.includes(index);
  2075. });
  2076. }
  2077. },
  2078. // 物料删除
  2079. materialDelete(row, index) {
  2080. console.log('row---------------');
  2081. console.log(index);
  2082. console.log(row);
  2083. let isBoolen = false;
  2084. // 删除物料
  2085. this.resultArray.splice(index, 1);
  2086. // 过滤物料对应包装
  2087. let wrapOutIndex = 0;
  2088. let wrapArr = this.materialCodeReqList.filter((item, index) => {
  2089. if (
  2090. item.assetCode == row.assetCode &&
  2091. item.batchNo == row.batchNo &&
  2092. item.onlyCode == row.onlyCode
  2093. ) {
  2094. wrapOutIndex = index;
  2095. return true;
  2096. }
  2097. });
  2098. console.log('wrapArr------------------');
  2099. console.log(wrapArr);
  2100. // 包装和物料数量一致(相同删除列/不同-1)
  2101. if (wrapArr[0].minPackingCount === row.minPackingCount) {
  2102. isBoolen = true;
  2103. // 修改产品
  2104. let materialOutIndex = 0;
  2105. let materialArr = this.warehousingMaterialList.filter(
  2106. (item, index) => {
  2107. console.log(wrapOutIndex);
  2108. console.log(this.materialCodeReqList);
  2109. console.log(item.assetCode);
  2110. console.log(this.materialCodeReqList[wrapOutIndex]);
  2111. console.log(this.materialCodeReqList[wrapOutIndex].assetCode);
  2112. console.log('----------------');
  2113. if (
  2114. item.assetCode ==
  2115. this.materialCodeReqList[wrapOutIndex].assetCode &&
  2116. item.batchNo == this.materialCodeReqList[wrapOutIndex].batchNo
  2117. ) {
  2118. materialOutIndex = index;
  2119. return true;
  2120. }
  2121. }
  2122. );
  2123. // 产品和包装数量一致(相同删除列/不同-1)———— 产品
  2124. if (
  2125. materialArr[0].minPackingCount * materialArr[0].outInNum ===
  2126. this.materialCodeReqList[wrapOutIndex].minPackingCount
  2127. ) {
  2128. this.warehousingMaterialList.splice(materialOutIndex, 1);
  2129. } else {
  2130. this.$set(
  2131. this.warehousingMaterialList[materialOutIndex],
  2132. 'outInNum',
  2133. this.warehousingMaterialList[materialOutIndex].outInNum - 1
  2134. );
  2135. }
  2136. this.materialCodeReqList.splice(wrapOutIndex, 1);
  2137. } else {
  2138. // 包装数量-1
  2139. this.$set(
  2140. this.materialCodeReqList[wrapOutIndex],
  2141. 'minPackingCount',
  2142. this.materialCodeReqList[wrapOutIndex].minPackingCount - 1
  2143. );
  2144. }
  2145. if (!isBoolen) {
  2146. // 修改产品
  2147. let materialOutIndex = 0;
  2148. // 找到包装对应产品
  2149. let materialArr = this.warehousingMaterialList.filter(
  2150. (item, index) => {
  2151. console.log(wrapOutIndex);
  2152. console.log(this.materialCodeReqList);
  2153. console.log(item.assetCode);
  2154. console.log(this.materialCodeReqList[wrapOutIndex]);
  2155. console.log(this.materialCodeReqList[wrapOutIndex].assetCode);
  2156. console.log('----------------');
  2157. if (
  2158. item.assetCode ==
  2159. this.materialCodeReqList[wrapOutIndex].assetCode &&
  2160. item.batchNo == this.materialCodeReqList[wrapOutIndex].batchNo
  2161. ) {
  2162. materialOutIndex = index;
  2163. return true;
  2164. }
  2165. }
  2166. );
  2167. // 产品和包装数量一致(相同删除列/不同-1)———— 产品
  2168. if (
  2169. materialArr[0].minPackingCount * materialArr[0].outInNum ===
  2170. this.materialCodeReqList[wrapOutIndex].minPackingCount
  2171. ) {
  2172. this.warehousingMaterialList.splice(materialOutIndex, 1);
  2173. } else {
  2174. this.$set(
  2175. this.warehousingMaterialList[materialOutIndex],
  2176. 'outInNum',
  2177. this.warehousingMaterialList[materialOutIndex].outInNum - 1
  2178. );
  2179. }
  2180. }
  2181. },
  2182. async stockOutOrderSuccess(row) {
  2183. console.log('--------------------------');
  2184. console.log(row);
  2185. this.stockOutOrders = row.bizNo;
  2186. this.formData.bizType = '2';
  2187. this.formData.extInfo = row.extInfo;
  2188. this.selectEquiType = row.categoryLevelTopId;
  2189. this.formData.sourceBizNo = row.receiveNo;
  2190. this.formData.fromId = row.id;
  2191. this.formData.clientName = row.partaName;
  2192. this.formData.clientCode = row.partaId;
  2193. // const data = await oneId(row.id);
  2194. // if (this.warehousingMaterialList.length == 0) {
  2195. // let list = data.productList.map((item) => {
  2196. // return {
  2197. // ...item,
  2198. // assetName: item.productName,
  2199. // assetCode: item.productCode,
  2200. // categoryId: item.productCategoryId,
  2201. // minPackUnit: item.packingUnit
  2202. // };
  2203. // });
  2204. // await this.onSelectTableData(await this.serachMainCode(list));
  2205. // }
  2206. // // 委外发货入库(出库再入库)
  2207. // if (row.outsourceSendCode) {
  2208. this.isOutsourcing = true;
  2209. this.formData.bizType = '12';
  2210. this.title = '委外入库(非采购)';
  2211. console.log('-------this.formData----');
  2212. console.log(this.formData);
  2213. outin.getById(row.id).then(async (res) => {
  2214. console.log('-------res--------res-------');
  2215. console.log(res);
  2216. if (res.outInDetailVOList && res.outInDetailVOList.length > 0) {
  2217. const batchNo = await getCode('lot_number_code');
  2218. this.warehousingMaterialList = [];
  2219. this.resultArray = [];
  2220. let arr = res.outInDetailVOList.map(async (goodsiItem) => {
  2221. return new Promise(async (outResolve) => {
  2222. goodsiItem.isSave = true;
  2223. goodsiItem.houseList = [];
  2224. goodsiItem.batchNo = batchNo;
  2225. goodsiItem.assetName = goodsiItem.name;
  2226. goodsiItem.assetCode = goodsiItem.categoryCode;
  2227. goodsiItem.outInNum =
  2228. goodsiItem.packingCount < 1 ? 1 : goodsiItem.packingCount;
  2229. goodsiItem.minPackingCount = goodsiItem.minPackingCount;
  2230. goodsiItem.minPackUnit = goodsiItem.packingUnit;
  2231. this.warehousingMaterialList.push(goodsiItem);
  2232. let res = await outin.getAssetNum({
  2233. assetCode: goodsiItem.assetCode,
  2234. batchNum: goodsiItem.batchNo,
  2235. num: goodsiItem.outInNum < 1 ? 1 : goodsiItem.outInNum
  2236. });
  2237. let arr = goodsiItem.outInDetailRecordVOList.map(
  2238. (wrapItem, index) => {
  2239. return new Promise(async (resolve) => {
  2240. wrapItem.onlyCode = res.shift().onlyCode;
  2241. wrapItem.packingCount =
  2242. wrapItem.packingCount < 1 ? 1 : wrapItem.packingCount;
  2243. wrapItem.isPack = true;
  2244. wrapItem.minPackingCount = wrapItem.totalCount;
  2245. wrapItem.assetName = goodsiItem.name;
  2246. wrapItem.assetCode = goodsiItem.categoryCode;
  2247. wrapItem.batchNo = batchNo;
  2248. wrapItem.result =
  2249. wrapItem.result === null ? '' : String(wrapItem.result);
  2250. // wrapItem.count =
  2251. // wrapItem.outInDetailRecordMaterialDetailVOList.length; // 增加包装计量数量
  2252. // 增加内部重量(解决重量未保存同时参与计算问题)
  2253. wrapItem.initWeight = wrapItem.weight;
  2254. if (
  2255. wrapItem.outInDetailRecordMaterialDetailVOList?.length >
  2256. 0
  2257. ) {
  2258. wrapItem.outInDetailRecordMaterialDetailVOList.forEach(
  2259. (materialItem, index) => {
  2260. materialItem.id = '';
  2261. materialItem.onlyCode = wrapItem.onlyCode;
  2262. materialItem.no =
  2263. materialItem.onlyCode +
  2264. index.toString().padStart(4, '0');
  2265. materialItem.result =
  2266. materialItem.result === null
  2267. ? ''
  2268. : String(materialItem.result);
  2269. materialItem.batchNo = batchNo;
  2270. materialItem.minPackingCount = 1;
  2271. materialItem.isPack = true;
  2272. // 增加内部重量(解决重量未保存同时参与计算问题)
  2273. materialItem.initWeight = materialItem.weight;
  2274. this.resultArray.push(materialItem);
  2275. }
  2276. );
  2277. }
  2278. resolve(wrapItem);
  2279. });
  2280. }
  2281. );
  2282. Promise.all(arr).then((data) => {
  2283. console.log(goodsiItem);
  2284. goodsiItem.warehouseLedgerDetails = data;
  2285. outResolve(goodsiItem);
  2286. });
  2287. });
  2288. });
  2289. Promise.all(arr).then((data) => {
  2290. console.log(this.warehousingMaterialList);
  2291. console.log(this.resultArray);
  2292. this.warehousingMaterialList = data;
  2293. if (this.resultArray.length > 0) {
  2294. this.isSplit = true;
  2295. }
  2296. });
  2297. }
  2298. });
  2299. // } else {
  2300. // this.formData.bizType = '2';
  2301. // this.title = '采购入库';
  2302. // }
  2303. },
  2304. async pickerSuccess(row) {
  2305. this.pickerRow = row;
  2306. this.formData.extInfo.documentSource = row.orderNo;
  2307. this.formData.clientName = row.partaName;
  2308. this.formData.clientCode = row.partaId;
  2309. this.formData.extInfo.supplierName = row.partbName;
  2310. this.formData.extInfo.supplierId = row.partbId;
  2311. await this.searchContact(row.partbId);
  2312. const data = await oneId(row.id);
  2313. if (this.warehousingMaterialList.length == 0) {
  2314. console.log('data===', data);
  2315. let list = data.data.productList.map((item) => {
  2316. return {
  2317. ...item,
  2318. assetName: item.productName,
  2319. assetCode: item.productCode,
  2320. categoryId: item.productCategoryId,
  2321. minPackUnit: item.packingUnit
  2322. };
  2323. });
  2324. this.onSelectTableData(await this.serachMainCode(list));
  2325. }
  2326. },
  2327. async serachMainCode(arr) {
  2328. let newArr = [];
  2329. // 使用 Promise.all 来等待所有异步操作完成
  2330. await Promise.all(
  2331. arr.map(async (item) => {
  2332. const data = await getProductList({
  2333. pageNum: 1,
  2334. size: 10,
  2335. categoryLevelId: item.categoryLevelPathIdParent,
  2336. code: item.assetCode
  2337. });
  2338. newArr.push(data.list); // 将结果存储到 newArr 中
  2339. })
  2340. );
  2341. let re = [];
  2342. for (const item of newArr) {
  2343. for (const it of item) {
  2344. re.push(it);
  2345. }
  2346. }
  2347. return re.map((item) => {
  2348. return {
  2349. ...item,
  2350. minPackUnit: item.packingUnit,
  2351. assetCode: item.code,
  2352. assetName: item.name
  2353. };
  2354. });
  2355. },
  2356. onClear() {
  2357. this.formData.extInfo.documentSource = '';
  2358. this.pickerRow = {};
  2359. this.outsourcedOrdersRow = {};
  2360. this.formData.clientName = '';
  2361. this.formData.clientCode = '';
  2362. this.formData.extInfo.supplierName = '';
  2363. this.formData.extInfo.supplierId = '';
  2364. this.$forceUpdate();
  2365. },
  2366. handleStockOutOrder() {
  2367. this.$refs.stockOutOrderRef.open();
  2368. },
  2369. handleOutsourcedOrders() {
  2370. this.$refs.outsourcedOrdersRef.open();
  2371. },
  2372. handlePicker() {
  2373. this.$refs.pickerRef.open();
  2374. },
  2375. handleDeliveryNote() {
  2376. this.$refs.deliveryNoteRef.open();
  2377. },
  2378. handleProjectCode() {
  2379. this.$refs.projectCodeRef.open();
  2380. },
  2381. codeListValue(val) {
  2382. this.formData.extInfo.assetType = val.id;
  2383. this.$forceUpdate();
  2384. this.title = val?.name;
  2385. this.selectEquiType = val?.id;
  2386. },
  2387. //计算生产设备重量
  2388. deviceWeight(row, num) {
  2389. if (row) {
  2390. return Number(row * num);
  2391. } else {
  2392. return row;
  2393. }
  2394. },
  2395. //计算金额
  2396. calcSumTotal(PackingCount, outInNum, univalence) {
  2397. //最小包装单元,包装数量,单价
  2398. const total = {
  2399. PackingCount: Number(PackingCount > 0 ? PackingCount : 0),
  2400. outInNum: Number(outInNum > 0 ? outInNum : 0),
  2401. univalence: Number(univalence > 0 ? univalence : 0)
  2402. };
  2403. return Number(
  2404. this.$math.format(
  2405. total.PackingCount * total.outInNum * total.univalence,
  2406. 14
  2407. )
  2408. );
  2409. },
  2410. handleRowUnit(row) {
  2411. return row.measuringUnit;
  2412. // if (this.formData.extInfo.assetType == 1) {
  2413. // return row.weightUnit;
  2414. // } else if (this.formData.extInfo.assetType == 4) {
  2415. // return row.measuringUnit;
  2416. // } else {
  2417. // return row.measuringUnit;
  2418. // }
  2419. },
  2420. changeVerfy(it) {
  2421. this.formData.verifyName = it.name;
  2422. },
  2423. //选择供应啥的操作
  2424. ChangeSupplier(data) {
  2425. this.formData.extInfo.supplierName = data.dictValue;
  2426. },
  2427. ChangeSuppliers(data) {
  2428. this.formData.clientName = data.dictValue;
  2429. },
  2430. rowClass({ row, column, rowIndex, columnIndex }) {
  2431. if (rowIndex === 1) {
  2432. return {
  2433. display: 'none',
  2434. background: '#EEEEEE',
  2435. border: 'none'
  2436. };
  2437. }
  2438. return { background: '#EEEEEE', border: 'none' };
  2439. },
  2440. calcSum(a, b, c, row) {
  2441. if (
  2442. (Number.isNaN(+a) && a !== '') ||
  2443. (Number.isNaN(+b) && b !== '') ||
  2444. (Number.isNaN(+c) && c !== '')
  2445. ) {
  2446. return '';
  2447. }
  2448. return a * b * c + { yuan: '元', wanyuan: '万元' }[row.univalenceUnit];
  2449. // return a * b * c;
  2450. },
  2451. // 部门 点击事件
  2452. async auditorDeptClick(data) {
  2453. this.formData.extInfo.verifyDeptCode = data?.id;
  2454. this.formData.extInfo.verifyDeptName = data?.name;
  2455. this.formData.verifyId = '';
  2456. this.formData.verifyName = '';
  2457. this.$refs.formName.validateField('verifyDeptName');
  2458. if (data) {
  2459. this.getStaffList(data);
  2460. }
  2461. },
  2462. async getStaffList(data) {
  2463. let res = await warehouseDefinition.getUserPage({
  2464. groupId: data.id,
  2465. size: 9999,
  2466. page: 1
  2467. });
  2468. this.staffList = res.list;
  2469. },
  2470. // 详情接口
  2471. // async _getInfo () {
  2472. // const res = await getInfo({ id: this.$route.query.id })
  2473. // if (res?.success) {
  2474. // this.warehousingMaterialList = res.data.warehouseLedgerInfos.map(i => {
  2475. // i.isSave = true
  2476. // return i
  2477. // })
  2478. // this.formData = res.data.outInWarehouse
  2479. // this.uploadList = this.formData.contentImage
  2480. // }
  2481. // },
  2482. chooseAssets(row, index) {
  2483. this.$refs.returnSelectRef.open(row, (res) => {
  2484. row.outInNum = res.length;
  2485. this.$set(
  2486. row,
  2487. 'selfWarehouseLedgerDetails',
  2488. res.map((i) => {
  2489. delete i.updateTime;
  2490. delete i.createTime;
  2491. return i;
  2492. })
  2493. );
  2494. });
  2495. },
  2496. // 仓库编辑
  2497. handleWareHouse(row, idx) {
  2498. this.$refs.wareHouseDailogRef.open(row, idx);
  2499. },
  2500. // 入库操作
  2501. listEdit(row) {
  2502. this.$set(row, 'isSave', false);
  2503. row.selfWarehouseLedgerDetails = row.warehouseLedgerDetails;
  2504. row.warehouseLedgerDetails = [];
  2505. // 重置重量
  2506. this.packNum(row, row.outInNum);
  2507. // 清空物料明细防止数据错乱
  2508. if (this.isSplit && this.resultArray?.length > 0) {
  2509. this.handleIsDetail(false);
  2510. }
  2511. },
  2512. listSave(row, index) {
  2513. console.log('---------');
  2514. if (this.isSplit && this.resultArray?.length > 0) {
  2515. this.handleIsDetail(false);
  2516. }
  2517. let fileds = [];
  2518. if (this.clientEnvironmentId != 2) {
  2519. fileds = [
  2520. // `warehousingMaterialList.${index}.cargoSpaceCode`,
  2521. `warehousingMaterialList.${index}.batchNo`,
  2522. `warehousingMaterialList.${index}.houseList`
  2523. ];
  2524. } else {
  2525. fileds = [`warehousingMaterialList.${index}.houseList`];
  2526. }
  2527. if (this.formData.bizType == 1) {
  2528. // fileds.push(...[`warehousingMaterialList.${index}.customCode`]);
  2529. } else if (this.formData.bizType == 2) {
  2530. // fileds.push(...[`warehousingMaterialList.${index}.supplierCode`]);
  2531. }
  2532. if (this.formData.bizType != 5) {
  2533. fileds.push(
  2534. ...[
  2535. `warehousingMaterialList.${index}.outInNum`,
  2536. `warehousingMaterialList.${index}.minPackingCount`
  2537. ]
  2538. );
  2539. } else if (
  2540. this.warehousingMaterialList.some(
  2541. (i) => !i.selfWarehouseLedgerDetails?.length
  2542. )
  2543. ) {
  2544. this.$message.error('请选择资产编号!');
  2545. return;
  2546. }
  2547. console.log('---------------------');
  2548. Promise.all(
  2549. fileds.map(
  2550. (item) =>
  2551. new Promise(async (resolve, rej) => {
  2552. this.$refs.warehousingMaterialListRef.validateField(
  2553. item,
  2554. (err) => {
  2555. if (err) {
  2556. rej(err);
  2557. } else {
  2558. resolve();
  2559. }
  2560. }
  2561. );
  2562. })
  2563. )
  2564. )
  2565. .then((res) => {
  2566. this.$set(row, 'isSave', true);
  2567. if (this.formData.bizType != 5) {
  2568. this.createMaterialCode(row);
  2569. } else {
  2570. // 退还
  2571. this.createMaterialCodeReturn(row);
  2572. }
  2573. })
  2574. .catch((err) => {
  2575. this.$message.error('请填入必填项!');
  2576. });
  2577. },
  2578. listSaveArrs() {
  2579. // 已经拆分(还原到未拆封编辑状态)
  2580. if (this.isSplit && this.resultArray.length > 0) {
  2581. this.handleIsDetail(false);
  2582. }
  2583. const rows = this.warehousingMaterialList;
  2584. const indexes = Array.from(
  2585. { length: this.warehousingMaterialList.length },
  2586. (_, index) => index
  2587. );
  2588. let showMessage = true;
  2589. rows.forEach((row, i) => {
  2590. const index = indexes[i];
  2591. let fileds = [];
  2592. if (this.clientEnvironmentId != 2) {
  2593. fileds = [
  2594. // `warehousingMaterialList.${index}.cargoSpaceCode`,
  2595. `warehousingMaterialList.${index}.batchNo`,
  2596. `warehousingMaterialList.${index}.houseList`
  2597. ];
  2598. } else {
  2599. fileds = [`warehousingMaterialList.${index}.houseList`];
  2600. }
  2601. if (this.formData.bizType == 1) {
  2602. // fileds.push(...[`warehousingMaterialList.${index}.customCode`]);
  2603. } else if (this.formData.bizType == 2) {
  2604. // fileds.push(...[`warehousingMaterialList.${index}.supplierCode`]);
  2605. }
  2606. if (this.formData.bizType != 5) {
  2607. fileds.push(
  2608. ...[
  2609. `warehousingMaterialList.${index}.outInNum`,
  2610. `warehousingMaterialList.${index}.minPackingCount`
  2611. ]
  2612. );
  2613. } else if (
  2614. this.warehousingMaterialList.some(
  2615. (i) => !i.selfWarehouseLedgerDetails?.length
  2616. )
  2617. ) {
  2618. this.$message.error('请选择资产编号!');
  2619. return;
  2620. }
  2621. Promise.all(
  2622. fileds.map(
  2623. (item) =>
  2624. new Promise(async (resolve, rej) => {
  2625. this.$refs.warehousingMaterialListRef.validateField(
  2626. item,
  2627. (err) => {
  2628. if (err) {
  2629. rej(err);
  2630. } else {
  2631. resolve();
  2632. }
  2633. }
  2634. );
  2635. })
  2636. )
  2637. )
  2638. .then((res) => {
  2639. this.$set(row, 'isSave', true);
  2640. if (this.formData.bizType != 5) {
  2641. this.createMaterialCode(row);
  2642. } else {
  2643. // 退还
  2644. this.createMaterialCodeReturn(row);
  2645. }
  2646. })
  2647. .catch((err) => {
  2648. if (showMessage) {
  2649. showMessage = false;
  2650. this.$message.error('请填入必填项!');
  2651. }
  2652. });
  2653. });
  2654. },
  2655. // listSaveArrs() {
  2656. // console.log(this.warehousingMaterialList);
  2657. // },
  2658. // 批量设置生产日期
  2659. handleSelectionChange(val) {
  2660. this.materialCodeReqListSelected = val;
  2661. },
  2662. dateSetting() {
  2663. if (!this.materialCodeReqListSelected.length) {
  2664. return this.$message.error(`请选择${this.title}明细!`);
  2665. }
  2666. this.dateVisible = true;
  2667. },
  2668. dateConfirm() {
  2669. this.materialCodeReqListSelected.forEach((item) => {
  2670. this.$set(item, this.curDateType, this.batchTime);
  2671. });
  2672. this.dateVisible = false;
  2673. },
  2674. //入库明细删除
  2675. listDel(row, index) {
  2676. this.warehousingMaterialList.splice(index, 1);
  2677. if (this.isSplit && this.resultArray?.length > 0) {
  2678. this.handleIsDetail(false);
  2679. }
  2680. },
  2681. // 入库明细生成条码信息
  2682. async createMaterialCode(row) {
  2683. // 添加相同物品、批次号重新更新明细 原料编码
  2684. const list = this.warehousingMaterialList.filter(
  2685. (i) =>
  2686. i.assetCode === row.assetCode &&
  2687. i.batchNo === row.batchNo &&
  2688. i.isSave
  2689. );
  2690. const num = list.reduce((num, pre) => {
  2691. num += row.isUnpack
  2692. ? Number(this.$math.format(pre.outInNum * pre.minPackingCount, 14))
  2693. : pre.outInNum - 0;
  2694. return num;
  2695. }, 0);
  2696. const nums = list.reduce((num, pre) => {
  2697. num += Number(
  2698. this.$math.format(pre.outInNum * pre.minPackingCount, 14)
  2699. );
  2700. return num;
  2701. }, 0);
  2702. const res = await outin.getAssetNum({
  2703. assetCode: row.assetCode,
  2704. batchNum: row.batchNo,
  2705. num: num
  2706. });
  2707. // row.measuringUnit == 'PCS' ? nums :
  2708. list.forEach((item) => {
  2709. if (item.warehouseLedgerDetails?.length) {
  2710. item.warehouseLedgerDetails.forEach((i) => {
  2711. i.onlyCode = res.shift().onlyCode;
  2712. });
  2713. } else {
  2714. this.$set(
  2715. item,
  2716. 'warehouseLedgerDetails',
  2717. Array.from(
  2718. new Array(
  2719. item.isUnpack
  2720. ? Number(
  2721. this.$math.format(
  2722. item.outInNum * item.minPackingCount,
  2723. 14
  2724. )
  2725. )
  2726. : // : item.measuringUnit == 'PCS'
  2727. // ? +item.outInNum * parseInt(item.minPackingCount)
  2728. +item.outInNum
  2729. ),
  2730. (val, idx) => {
  2731. return {
  2732. ...item,
  2733. onlyCode: res.shift().onlyCode,
  2734. bizStatus: 1,
  2735. contentImage: []
  2736. };
  2737. }
  2738. )
  2739. );
  2740. }
  2741. });
  2742. // 添加相同物品,重复批次号 重新更新明细 包装编码
  2743. const batchList = this.warehousingMaterialList.filter(
  2744. (i) => i.batchNo === row.batchNo && i.isSave
  2745. );
  2746. if (batchList.length) {
  2747. const num = batchList.reduce((num, pre) => {
  2748. num += +pre.outInNum;
  2749. return num;
  2750. }, 0);
  2751. const res1 = await outin.getAssetNum({
  2752. batchNum: row.batchNo,
  2753. num
  2754. });
  2755. if (res1) {
  2756. batchList.forEach((item) => {
  2757. let num = res1.shift()?.num;
  2758. let minPackingCount = item.minPackingCount;
  2759. if (item.warehouseLedgerDetails?.length) {
  2760. item.warehouseLedgerDetails.forEach((i, index) => {
  2761. this.$set(i, 'num', num);
  2762. console.log('i---', i);
  2763. console.log('row---', row);
  2764. if (row.code == i.code) {
  2765. if (item.measuringUnit == item.weightUnit) {
  2766. this.$set(i, 'weight', item.minPackingCount);
  2767. this.$set(i, 'initWeight', item.minPackingCount);
  2768. } else {
  2769. this.$set(
  2770. i,
  2771. 'weight',
  2772. Number(
  2773. this.$math.format(
  2774. 1 * item.minPackingCount * item.netWeight,
  2775. 14
  2776. )
  2777. )
  2778. );
  2779. this.$set(
  2780. i,
  2781. 'initWeight',
  2782. Number(
  2783. this.$math.format(
  2784. 1 * item.minPackingCount * item.netWeight,
  2785. 14
  2786. )
  2787. )
  2788. );
  2789. }
  2790. }
  2791. this.$set(i, 'weightUtil', item.weightUnit);
  2792. this.$set(i, 'packingCount', 1);
  2793. this.$set(i, 'packingUnit ', item.packingUnit);
  2794. this.$set(i, 'minPackingCount ', item.minPackingCount);
  2795. this.$set(i, 'measuringUnit', item.measuringUnit);
  2796. this.$set(i, 'isPack', false);
  2797. this.$set(i, 'result', '0');
  2798. this.$set(i, 'status', '1');
  2799. // if (this.formData.extInfo.assetType == 1) {
  2800. // this.$set(i, 'status', '0');
  2801. // } else {
  2802. // this.$set(i, 'result', '0');
  2803. // this.$set(i, 'status', '1');
  2804. // }
  2805. if (!item.isUnpack) {
  2806. if (index < item.warehouseLedgerDetails.length - 1) {
  2807. num = res1.shift()?.num;
  2808. }
  2809. } else {
  2810. // 拆包的包装编码一致
  2811. minPackingCount--;
  2812. if (
  2813. minPackingCount === 0 &&
  2814. index < item.warehouseLedgerDetails.length - 1
  2815. ) {
  2816. minPackingCount = item.minPackingCount;
  2817. num = res1.shift()?.num;
  2818. }
  2819. }
  2820. });
  2821. }
  2822. });
  2823. }
  2824. }
  2825. },
  2826. // 入库明细生成条码信息 退还
  2827. async createMaterialCodeReturn(row) {
  2828. // 添加相同物品重新更新明细 原料编码
  2829. const list = this.warehousingMaterialList.filter(
  2830. (i) => i.batchNo === row.batchNo && i.isSave
  2831. );
  2832. // 退还
  2833. const res = await getAssetNum({
  2834. batchNo: row.batchNo,
  2835. num: list.reduce((num, pre) => {
  2836. num += pre.selfWarehouseLedgerDetails.length;
  2837. return num;
  2838. }, 0)
  2839. });
  2840. if (res?.success) {
  2841. list.forEach((item) => {
  2842. let num = res.data.shift().num;
  2843. let minPackingCount = item.minPackingCount;
  2844. if (item.warehouseLedgerDetails?.length) {
  2845. item.warehouseLedgerDetails.forEach((i, index) => {
  2846. Object.assign(i, {
  2847. num,
  2848. manualBatchNo: item.manualBatchNo,
  2849. batchNo: item.batchNo,
  2850. cargoSpaceCode: item.cargoSpaceCode, //货位编码
  2851. cargoSpaceId: item.cargoSpaceId, //货位id
  2852. shelfId: item.shelfId, //货架id
  2853. shelfCode: item.shelfCode, //货架名称
  2854. areaId: item.areaId, //库区id
  2855. areaName: item.areaName, //库区名称
  2856. warehouseId: item.warehouseId, //仓库id
  2857. warehouseName: item.warehouseName //仓库名称
  2858. });
  2859. if (!item.isUnpack) {
  2860. // 拆包的包装编码一致
  2861. if (index < item.warehouseLedgerDetails.length - 1) {
  2862. num = res.data.shift()?.num;
  2863. }
  2864. } else {
  2865. minPackingCount--;
  2866. if (
  2867. minPackingCount === 0 &&
  2868. index < item.warehouseLedgerDetails.length - 1
  2869. ) {
  2870. minPackingCount = item.minPackingCount;
  2871. num = res1.data.shift()?.num;
  2872. }
  2873. }
  2874. });
  2875. } else {
  2876. this.$set(
  2877. item,
  2878. 'warehouseLedgerDetails',
  2879. item.selfWarehouseLedgerDetails.map((val, idx) => {
  2880. let obj = {
  2881. ...val,
  2882. bizStatus: 1,
  2883. minPackingCount: item.minPackingCount,
  2884. batchNo: item.batchNo,
  2885. cargoSpaceCode: item.cargoSpaceCode, //货位编码
  2886. cargoSpaceId: item.cargoSpaceId, //货位id
  2887. shelfId: item.shelfId, //货架id
  2888. shelfCode: item.shelfCode, //货架名称
  2889. areaId: item.areaId, //库区id
  2890. areaName: item.areaName, //库区名称
  2891. warehouseId: item.warehouseId, //仓库id
  2892. warehouseName: item.warehouseName, //仓库名称
  2893. materialId: item.materialId,
  2894. num
  2895. };
  2896. if (!item.isUnpack) {
  2897. // 拆包的包装编码一致
  2898. if (idx < item.warehouseLedgerDetails.length - 1) {
  2899. num = res.data.shift()?.num;
  2900. }
  2901. } else {
  2902. minPackingCount--;
  2903. if (
  2904. minPackingCount === 0 &&
  2905. idx < item.warehouseLedgerDetails.length - 1
  2906. ) {
  2907. minPackingCount = item.minPackingCount;
  2908. num = res1.data.shift()?.num;
  2909. }
  2910. }
  2911. return obj;
  2912. })
  2913. );
  2914. }
  2915. });
  2916. }
  2917. },
  2918. handleSave() {
  2919. if (this.isOutsourcing) {
  2920. if (!this.formData.extInfo.documentSource) {
  2921. this.$message.error('请选择委外申请单!');
  2922. return false;
  2923. }
  2924. let boolen = this.warehousingMaterialList.every(
  2925. (item) => item.houseList.length > 0
  2926. );
  2927. if (!boolen) {
  2928. this.$message.error('请选择产品仓库!');
  2929. return false;
  2930. }
  2931. }
  2932. this.$refs.formName.validate(async (valid) => {
  2933. if (valid) {
  2934. if (!this.warehousingMaterialList?.length) {
  2935. return this.$message.error('请添加入库明细!');
  2936. } else if (
  2937. this.warehousingMaterialList.some((item) => !item.isSave)
  2938. ) {
  2939. return this.$message.error('请保存入库明细!');
  2940. }
  2941. // 默认全部保存
  2942. if (this.resultArray?.length > 0) {
  2943. // 物料批量保存
  2944. this.materialListSave();
  2945. } else {
  2946. // 包装批量保存
  2947. this.wrapListSave();
  2948. }
  2949. this.formatWarehouseMaterialList();
  2950. let arr = this.warehousingMaterialList.map((item) => {
  2951. return {
  2952. netWeight: item.netWeight > 0 ? item.netWeight : 0,
  2953. num: item.num > 0 ? item.num : 0,
  2954. manualBatchNo: item.manualBatchNo,
  2955. batchNo: item.batchNo,
  2956. categoryId:
  2957. this.formData.bizType == 2 || this.formData.bizType == 12
  2958. ? item.categoryId
  2959. ? item.categoryId
  2960. : item.id
  2961. : item.id,
  2962. count:
  2963. item.outInNum > 0 && item.minPackingCount > 0
  2964. ? this.$math.format(
  2965. parseInt(item.outInNum) *
  2966. parseInt(item.minPackingCount),
  2967. 14
  2968. )
  2969. : 0,
  2970. minPackingCount:
  2971. item.minPackingCount > 0 ? item.minPackingCount : 0,
  2972. packingCount: item.outInNum > 0 ? item.outInNum : 0,
  2973. price: item.univalence > 0 ? item.univalence : 0,
  2974. outInDetailRecordAddPOList: item.warehouseLedgerDetails,
  2975. position: `${item.warehouseName}-${item.areaName}-${item.shelfCode}-${item.cargoSpaceCode}`,
  2976. remark: '',
  2977. pathIds: `${item.warehouseId},${item.areaId},${item.shelfId},${item.cargoSpaceId}`,
  2978. pathName: `${item.warehouseName},${item.areaName},${item.shelfCode},${item.cargoSpaceCode}`,
  2979. totalMoney:
  2980. item.outInNum > 0 &&
  2981. item.minPackingCount > 0 &&
  2982. item.univalence > 0
  2983. ? this.$math.format(
  2984. item.outInNum * item.minPackingCount * item.univalence,
  2985. 14
  2986. )
  2987. : 0,
  2988. weightUnit: item.weightUnit,
  2989. customCode: item.customCode,
  2990. supplierCode: item.supplierCode,
  2991. weight: item.weight > 0 ? item.weight : 0
  2992. };
  2993. });
  2994. arr.forEach((item) => {
  2995. if (item.outInDetailRecordAddPOList.length > 0) {
  2996. let list = item.outInDetailRecordAddPOList.map((it) => {
  2997. return this.formatOutInDetailRecordAddPO(it, item);
  2998. });
  2999. item.outInDetailRecordAddPOList = list;
  3000. }
  3001. });
  3002. let obj = { ...this.formData, type: 1 };
  3003. obj.sourceBizNo = this.formData.extInfo.documentSource;
  3004. obj.outInDetailAddPOList = arr;
  3005. console.log('=====>', obj);
  3006. this.saveLoading = true;
  3007. try {
  3008. if (obj.bizType == '12') {
  3009. obj.storageSource = 1;
  3010. }
  3011. const res = await outin.save(obj);
  3012. if (res.code == 0) {
  3013. // 委外入库(非采购)
  3014. if (obj.bizType == '12') {
  3015. await outin.outApproveQuality({ outInId: res.data[0] });
  3016. } else {
  3017. await outin.outApproves({ outInId: res.data[0] });
  3018. }
  3019. this.$message.success('保存成功!');
  3020. this.saveLoading = false;
  3021. this.$router.push('/warehouseManagement/stockManagement');
  3022. }
  3023. } catch (error) {
  3024. this.$message.error('保存失败!');
  3025. }
  3026. }
  3027. });
  3028. },
  3029. formatWarehouseMaterialList() {
  3030. for (let key in this.warehousingMaterialList) {
  3031. for (let k in this.warehousingMaterialList[key].houseList) {
  3032. let house = this.warehousingMaterialList[key].houseList[k];
  3033. this.warehousingMaterialList[key].warehouseName =
  3034. house.warehouseName;
  3035. this.warehousingMaterialList[key].areaName = house.areaName;
  3036. this.warehousingMaterialList[key].shelfCode = house.shelfCode;
  3037. this.warehousingMaterialList[key].cargoSpaceCode =
  3038. house.cargoSpaceCode;
  3039. this.warehousingMaterialList[key].warehouseId = house.warehouseId;
  3040. this.warehousingMaterialList[key].areaId = house.areaId;
  3041. this.warehousingMaterialList[key].shelfId = house.shelfId;
  3042. this.warehousingMaterialList[key].cargoSpaceId = house.cargoSpaceId;
  3043. this.warehousingMaterialList[key].num = house.num;
  3044. }
  3045. }
  3046. },
  3047. formatOutInDetailRecordAddPO(it, item) {
  3048. return {
  3049. code: it.onlyCode,
  3050. dateType: this.curDateType === 'manufactureTime' ? 2 : 1,
  3051. dateValue: it[this.curDateType],
  3052. minUnit: it.minPackingCount,
  3053. minPackingCount: it.minPackingCount,
  3054. minPositionId: it.cargoSpaceId,
  3055. name: it.assetName,
  3056. pathIds: item.pathIds,
  3057. unit: it.unit,
  3058. packageNo: it.num,
  3059. clientCode: it.clientCode,
  3060. materielCode: it.materielCode,
  3061. weight: it.weight,
  3062. weightUtil: it.weightUtil,
  3063. engrave: it.engrave,
  3064. materialDetails: this.materialDetails(it.onlyCode),
  3065. packingCount: it.packingCount,
  3066. status: it.status,
  3067. result: it.result
  3068. };
  3069. },
  3070. materialDetails(onlyCode) {
  3071. return this.resultArray.filter((item) => item.onlyCode === onlyCode);
  3072. },
  3073. async getOrderCode() {
  3074. const data = await getCode('in_warehouse');
  3075. return data;
  3076. },
  3077. // 添加物品明细
  3078. addProduct(val) {
  3079. // 已经拆分(还原到未拆封编辑状态)
  3080. if (this.isSplit && this.resultArray.length > 0) {
  3081. this.handleIsDetail(false);
  3082. }
  3083. this.onSelectTableData(val);
  3084. },
  3085. //添加明细
  3086. async onSelectTableData(val) {
  3087. console.log('val-----------', val);
  3088. const res = await getCode('lot_number_code');
  3089. this.warehousingMaterialList.push(
  3090. ...val.map((next) => {
  3091. next.batchNo = res;
  3092. let cur = {};
  3093. next.realInventoryAmount = next.realInventoryAmount || 0;
  3094. cur = {
  3095. ...next,
  3096. cargoSpaceCode: '', //货位编码
  3097. cargoSpaceId: '', //货位id
  3098. shelfId: '', //货架id
  3099. shelfCode: '', //货架名称
  3100. areaId: '', //库区id
  3101. areaName: '', //库区名称
  3102. warehouseId: '', //仓库id
  3103. warehouseName: '', //仓库名称
  3104. assetType: this.formData.extInfo.assetType,
  3105. expirationDate: '',
  3106. outInNum: '',
  3107. minPackingCount: '',
  3108. bizStatus: 1,
  3109. contentImage: [],
  3110. warehouseLedgerDetails: [],
  3111. houseList: []
  3112. };
  3113. return cur;
  3114. })
  3115. );
  3116. },
  3117. async initData() {
  3118. const { data } = await getTreeByGroup({ type: 2 });
  3119. this.codeList = data;
  3120. // .map((item) => {
  3121. // return { dictCode: item.id, dictValue: item.name };
  3122. // });
  3123. const res = await warehouseDefinition.tree();
  3124. this.treeList = this.$util.toTreeData({
  3125. data: res,
  3126. idField: 'id',
  3127. parentIdField: 'parentId'
  3128. });
  3129. // const res111 = await warehouseDefinition.list();
  3130. // this.warehouseList = res111.list;
  3131. let res22 = await warehouseDefinition.getUserPage({
  3132. size: -1,
  3133. page: 1
  3134. });
  3135. this.fromUserList = res22.list;
  3136. const info = JSON.parse(localStorage.getItem('info'));
  3137. let obj = res.find(
  3138. (item) => item.id === info.deptId[info.deptId.length - 1]
  3139. );
  3140. if (!obj) return;
  3141. this.formData.extInfo.deptCode = obj.id;
  3142. this.formData.extInfo.deptName = obj.name;
  3143. this.formData.extInfo.createUserName = info.name;
  3144. this.formData.createUserId = info.id;
  3145. // this.treeList = res;
  3146. // this.formData.extInfo.deptCode =
  3147. // this.getTreeList().then((res) => {
  3148. // if (res?.success) {
  3149. // this.treeList = res.data;
  3150. // }
  3151. // });
  3152. // this.getSupplier().then((res) => {
  3153. // if (res?.success) {
  3154. // this.supplierList = res.data.items;
  3155. // }
  3156. // });
  3157. // this.getStaffList();
  3158. },
  3159. addStock() {
  3160. // this.$refs.wareHouseDailogRef.open({});
  3161. // return;
  3162. if (!this.title) return this.$message.error('请选择入库产品类型');
  3163. if (!this.formData.bizType)
  3164. return this.$message.error('请选择入库场景');
  3165. if (
  3166. this.formData.bizType == 12 &&
  3167. !this.formData.extInfo.documentSource
  3168. ) {
  3169. return this.$message.error('请选择委外申请单');
  3170. }
  3171. this.visibleDialog = true;
  3172. },
  3173. handleChange(data) {
  3174. this.title = data?.dictValue;
  3175. this.selectEquiType = data?.dictCode;
  3176. },
  3177. handleChanges(code) {
  3178. const data = this.codeList.find((item) => item.dictCode == code);
  3179. this.title = data?.dictValue;
  3180. this.selectEquiType = data?.dictCode;
  3181. },
  3182. getSupplier() {
  3183. return new Promise((resolve, reject) => {
  3184. supplier.list({ page: 1, size: 999 }).then((res) => {
  3185. if (res.success) {
  3186. resolve(res);
  3187. }
  3188. });
  3189. });
  3190. },
  3191. getTreeList() {
  3192. return new Promise((resolve, reject) => {
  3193. org.tree().then((res) => {
  3194. if (res.success) {
  3195. resolve(res);
  3196. }
  3197. });
  3198. });
  3199. },
  3200. upload(data) {
  3201. this.formData.contentImage = data;
  3202. this.$refs.formName.validateField('contentImage');
  3203. },
  3204. houseData(argum, idx) {
  3205. this.$set(this.warehousingMaterialList[idx], 'houseList', argum);
  3206. }
  3207. },
  3208. watch: {
  3209. // 解决右侧悬浮操作栏不对称问题
  3210. warehousingMaterialList: {
  3211. handler() {
  3212. this.$nextTick(() => {
  3213. this.$refs.warehousingMaterialListTable?.doLayout();
  3214. });
  3215. },
  3216. deep: true
  3217. },
  3218. // 解决右侧悬浮操作栏不对称问题
  3219. materialCodeReqList: {
  3220. handler() {
  3221. this.$nextTick(() => {
  3222. this.$refs.materialCodeReqListTable?.doLayout();
  3223. });
  3224. },
  3225. deep: true
  3226. },
  3227. // 解决右侧悬浮操作栏不对称问题
  3228. resultArray: {
  3229. handler() {
  3230. this.$nextTick(() => {
  3231. this.$refs.resultArrayTable?.doLayout();
  3232. });
  3233. },
  3234. deep: true
  3235. }
  3236. }
  3237. };
  3238. </script>
  3239. <style lang="scss" scoped>
  3240. ::v-deep .el-row {
  3241. display: flex;
  3242. flex-wrap: wrap;
  3243. }
  3244. ::v-deep.form-table {
  3245. .el-form-item {
  3246. margin-bottom: 0;
  3247. }
  3248. .el-input__inner {
  3249. padding: 0 10px;
  3250. }
  3251. ::-webkit-scrollbar {
  3252. width: 8px;
  3253. height: 8px;
  3254. background-color: transparent;
  3255. }
  3256. }
  3257. .p20 {
  3258. padding: 20px;
  3259. }
  3260. .el-select,
  3261. .el-date-editor {
  3262. width: 100%;
  3263. }
  3264. .el-form-item {
  3265. margin-bottom: 22px;
  3266. }
  3267. .material {
  3268. margin-top: 20px;
  3269. .flex {
  3270. display: flex;
  3271. justify-content: space-between;
  3272. font-size: 14px;
  3273. align-items: center;
  3274. .red {
  3275. color: #ff4949;
  3276. }
  3277. }
  3278. }
  3279. .mt10 {
  3280. margin-top: 10px;
  3281. }
  3282. .mt20 {
  3283. margin-top: 20px;
  3284. }
  3285. .center {
  3286. text-align: center;
  3287. }
  3288. .switch_left li {
  3289. border-right: 1px solid rgba(222, 222, 222, 1);
  3290. border-left: 1px solid rgba(222, 222, 222, 1);
  3291. }
  3292. .fontOmitted {
  3293. text-overflow: ellipsis;
  3294. overflow: hidden;
  3295. word-break: break-all;
  3296. white-space: nowrap;
  3297. }
  3298. .table-fixed {
  3299. .el-table__fixed-right {
  3300. height: 100% !important;
  3301. }
  3302. .el-table__fixed-left {
  3303. height: 100% !important;
  3304. }
  3305. .el-table__fixed {
  3306. height: 100% !important;
  3307. }
  3308. }
  3309. </style>