addStock.vue 83 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738
  1. <template>
  2. <view class="mainBox">
  3. <uni-nav-bar fixed="true" statusBar="true" left-icon="back" title="新增入库单" @clickLeft="back">
  4. <!-- @clickRight="handleScan"
  5. right-icon="scan"
  6. > -->
  7. <!--右菜单-->
  8. <template slot="float">
  9. <!-- <view class="nav-icon-caozuo rightNav" @click="getsure">
  10. <u-button type="success" size="small" class="u-reset-button" text="确定"></u-button>
  11. </view> -->
  12. </template>
  13. </uni-nav-bar>
  14. <u-form labelPosition="left" :model="formData" :rules="rules" ref="formRef" labelWidth="240" labelAlign="right"
  15. class="baseForm">
  16. <u-form-item label="物品类型" class="required-form" borderBottom prop="assetTypeName">
  17. <view :style="{ color: assetTypeName ? 'black' : '#c0c4cc' }" class="assetType_box" @click="openPicker">
  18. {{ assetTypeName ? assetTypeName : '请选择产品类型' }}
  19. </view>
  20. </u-form-item>
  21. <u-form-item label="来源单据" prop="documentSource" borderBottom>
  22. <u-input type="text" placeholder="请输入" v-model="formData.sourceBizNo" @click.native="goToRequisition" />
  23. </u-form-item>
  24. <u-form-item label="入库类型" class="required-form" prop="bizType" borderBottom>
  25. <uni-data-select v-model="formData.bizType" :localdata="sceneState"
  26. @change="changeType"></uni-data-select>
  27. <!-- <picker :disabled="!!(productList && productList.length)"
  28. @change="handlePicker(e, sceneState, 'bizType')" :value="pickerIndex" :range="sceneState"
  29. range-key="text">
  30. <u-input :value="sceneStateFilter(formData.bizType)"
  31. :disableColor="!!(productList && productList.length) ? '#F5F7FA' : '#fff'" placeholder="请选择"
  32. disabled type="select" />
  33. </picker> -->
  34. <!-- <u-icon slot="right" name="arrow-right"></u-icon> -->
  35. </u-form-item>
  36. <u-form-item label="入库时间" prop="storageTime" borderBottom>
  37. <view class="assetType_box" @click="timeShow = true">{{ storageTime ? formatter(storageTime) : '请选择' }}
  38. </view>
  39. </u-form-item>
  40. <u-form-item label="入库登记人" prop="createUserName" borderBottom>
  41. <u-input disableColor="#ffffff" :value="formData.extInfo.createUserName" placeholder="请选择" disabled
  42. type="text" />
  43. </u-form-item>
  44. <!-- <u-form-item label="客户名称" prop="clientName" borderBottom>
  45. <u-input type="text" placeholder="请输入" v-model="formData.clientName" />
  46. </u-form-item> -->
  47. <u-form-item label="供应商" prop="supplierName" borderBottom v-if="formData.bizType == 2">
  48. <u-input type="text" placeholder="请输入" v-model="formData.extInfo.supplierName" />
  49. </u-form-item>
  50. <u-form-item label="送货人" prop="deliveryName" borderBottom>
  51. <u-input type="text" placeholder="请输入" v-model="formData.fromUser" />
  52. </u-form-item>
  53. <u-form-item label="送货人联系方式" prop="deliveryPhone" borderBottom>
  54. <u-input type="text" placeholder="请输入" v-model="formData.extInfo.deliveryPhone" />
  55. </u-form-item>
  56. <u-form-item label="备注" prop="remark" borderBottom>
  57. <u-input disableColor="#ffffff" v-model="formData.remark" placeholder="请输入内容" type="text" />
  58. </u-form-item>
  59. </u-form>
  60. <uni-collapse ref="collapse" v-model="collapseOpen">
  61. <uni-collapse-item :typeOpen="1" title="" name="collapse1" :open="true" :key="detailOpen"
  62. :show-animation="true">
  63. <template v-slot:title>
  64. <view class="detail-box flex_between">
  65. <view data-v-41027c34="" class="uni-collapse-item__title-wrap">
  66. <view data-v-41027c34=""
  67. class="uni-collapse-item__title-box uni-collapse-item__title-box-base">
  68. <text data-v-41027c34="" class="tag tag-base"><text></text></text>
  69. <text data-v-41027c34="" class="uni-collapse-item__title-text"><text>入库明细</text></text>
  70. </view>
  71. </view>
  72. <u-button type="primary" size="small" text="扫码添加"
  73. @click.native.stop="goToScanCodeList"></u-button>
  74. <u-button type="success" size="small" class="selectEnterType" text="手动添加"
  75. @click.native.stop="selectType"></u-button>
  76. </view>
  77. </template>
  78. <view>
  79. <u-button type="warning" size="small" text="批量保存"
  80. @click.native.stop="batchSave" v-if="productList.length"></u-button>
  81. </view>
  82. <u-form labelPosition="left" :model="{ productList: productList }" ref="lisrFormRef" labelWidth="160"
  83. :rules="listRules" errorType="none" labelAlign="right" :labelStyle="{
  84. fontSize: '28rpx'
  85. }">
  86. <view class="listContent">
  87. <view class="listBox" v-for="(item, index) in productList" :key="index">
  88. <view class="listTit flex_between">
  89. <view class="name">{{ item.categoryName }}</view>
  90. <view class="btn">
  91. <u-button v-if="item.isSave" type="primary" size="small" :hairline="true" text="编辑"
  92. @click="listEdit(item, index)"></u-button>
  93. <u-button v-else type="primary" size="small" :hairline="true" text="保存"
  94. @click="listSave(item, index)"></u-button>
  95. <u-button type="error" size="small" :hairline="true" text="删除"
  96. @click="getDelete(index)"></u-button>
  97. </view>
  98. </view>
  99. <view class="listCont" :class="{ save: item.isSave }">
  100. <view class="item w100">
  101. <u-form-item :label="`物品编码`">
  102. {{ item.categoryCode }}
  103. </u-form-item>
  104. </view>
  105. <view class="item w100">
  106. <u-form-item :label="`型号`">
  107. {{ item.categoryModel || '-' }}
  108. </u-form-item>
  109. </view>
  110. <view class="item w100">
  111. <u-form-item :label="`规格`">
  112. {{ item.specification || '-' }}
  113. </u-form-item>
  114. </view>
  115. <view class="item w100">
  116. <u-form-item :label="`牌号`">
  117. {{ item.brandNum || '-' }}
  118. </u-form-item>
  119. </view>
  120. <view class="item w100">
  121. <u-form-item label="包装规格" prop="packingSpecificationLabel">
  122. <u-tag style="margin-right: 5rpx" v-for="ite in item.packingSpecificationLabel"
  123. :text="ite"></u-tag>
  124. </u-form-item>
  125. </view>
  126. <view class="item">
  127. <u-form-item label="批次号" :prop="`productList.${index}.batchNo`"
  128. class="required-form">
  129. <u-input :disabled="item.isSave" placeholder="请输入" style="height: 30px;"
  130. v-model="item.batchNo" />
  131. </u-form-item>
  132. </view>
  133. <view class="flex_between w100">
  134. <view class="item">
  135. <u-form-item label="数量" :prop="`productList.${index}.quantity`"
  136. class="aa required-form">
  137. <u--input :disabled="item.isSave" placeholder="请输入" border="surround"
  138. v-model="item.quantity"
  139. @change="computeNum(item, index, true)"></u--input>
  140. </u-form-item>
  141. </view>
  142. <view class="item">
  143. <u-form-item label="单位" :prop="`productList.${index}.unit`"
  144. class="dd required-form">
  145. <view
  146. :style="{ color: item.unit ? 'black' : '#c0c4cc',marginLeft:'9px' }"
  147. class="assetType_box" :disabled="item.isSave"
  148. @click="showPackingUnitPicker(item, index)">
  149. {{ item.unit ? item.unit : '请选择' }}
  150. </view>
  151. </u-form-item>
  152. </view>
  153. </view>
  154. <view class="item">
  155. <u-form-item label="仓库" :prop="`productList.${index}.warehouseId`"
  156. class="dd required-form">
  157. <view
  158. :style="{ color: item.warehouseName ? 'black' : '#c0c4cc',marginLeft:'9px' }"
  159. class="assetType_box" :disabled="item.isSave"
  160. @click="showWarehousePicker( index)">
  161. {{ item.warehouseName ? item.warehouseName : '请选择' }}
  162. </view>
  163. </u-form-item>
  164. </view>
  165. <view class="item w100">
  166. <u-form-item label="供应商" :prop="`productList.${index}.supplierName`" class="dd">
  167. <view
  168. :style="{ color: item.supplierName ? 'black' : '#c0c4cc',marginLeft:'9px' }"
  169. class="assetType_box" :disabled="item.isSave"
  170. @click="showSupplierPicker(item, index)">
  171. {{ item.supplierName ? item.supplierName : '请选择' }}
  172. </view>
  173. </u-form-item>
  174. </view>
  175. <view class="item">
  176. <u-form-item label="颜色" :prop="`productList.${index}.colorKey`"
  177. class="dd">
  178. <!-- <u--input :disabled="item.isSave" placeholder="请输入" border="surround"
  179. v-model="item.batchNo"></u--input> -->
  180. <u-input placeholder="请输入" style="height: 30px;"
  181. v-model="item.colorKey" />
  182. </u-form-item>
  183. </view>
  184. <view class="item">
  185. <u-form-item label="盘具" :prop="`productList.${index}.reelSpecification`"
  186. class="dd">
  187. <u-input placeholder="请输入" style="height: 30px;"
  188. v-model="item.reelSpecification" />
  189. </u-form-item>
  190. </view>
  191. <view class="item">
  192. <u-form-item label="采购原因" :prop="`productList.${index}.purpose`"
  193. class="dd">
  194. <u-input :disabled="item.isSave" placeholder="请输入" style="height: 30px;"
  195. v-model="item.purpose" />
  196. </u-form-item>
  197. </view>
  198. <view class="item">
  199. <u-form-item label="生产日期" :prop="`productList.${index}.detailProductionDate`"
  200. class="dd">
  201. <view :style="{ color: item.detailProductionDate ? 'black' : '#c0c4cc' }"
  202. class="assetType_box" @click="datePickerOpen(index, 'detailProductionDate')">
  203. {{ item.detailProductionDate || '请选择' }}
  204. </view>
  205. </u-form-item>
  206. </view>
  207. <view class="item">
  208. <u-form-item label="采购日期" :prop="`productList.${index}.detailPurchaseDate`"
  209. class="dd">
  210. <view :style="{ color: item.detailPurchaseDate ? 'black' : '#c0c4cc' }"
  211. class="assetType_box" @click="datePickerOpen(index, 'detailPurchaseDate')">
  212. {{ item.detailPurchaseDate || '请选择' }}
  213. </view>
  214. </u-form-item>
  215. </view>
  216. <view class="item">
  217. <u-form-item label="失效日期" :prop="`productList.${index}.detailExpireDate`"
  218. class="dd">
  219. <view :style="{ color: item.detailExpireDate ? 'black' : '#c0c4cc' }"
  220. class="assetType_box" @click="datePickerOpen(index, 'detailExpireDate')">
  221. {{ item.detailExpireDate || '请选择' }}
  222. </view>
  223. </u-form-item>
  224. </view>
  225. <view class="flex_between w100">
  226. <view class="item">
  227. <u-form-item label="包装数量"
  228. prop="measureQuantity">{{ item.packingQuantity }}</u-form-item>
  229. </view>
  230. <view class="item">
  231. <u-form-item label="包装单位"
  232. prop="measureUnit">{{ item.packingUnit }}</u-form-item>
  233. </view>
  234. </view>
  235. <view class="flex_between w100">
  236. <view class="item">
  237. <u-form-item label="计量数量"
  238. prop="measureQuantity">{{ item.measureQuantity }}</u-form-item>
  239. </view>
  240. <view class="item">
  241. <u-form-item label="计量单位"
  242. prop="measureUnit">{{ item.measureUnit }}</u-form-item>
  243. </view>
  244. </view>
  245. <view class="flex_between w100">
  246. <view class="item">
  247. <u-form-item label="单重" :prop="`productList.${index}.singleWeight`"
  248. class="required-form">
  249. <u-input :disabled="item.isSave" placeholder="请输入" style="height: 30px;"
  250. v-model="item.singleWeight" />
  251. </u-form-item>
  252. </view>
  253. <view class="item">
  254. <u-form-item label="总重" :prop="`productList.${index}.weight`">
  255. <u-input :disabled="item.isSave" placeholder="请输入" style="height: 30px;"
  256. v-model="item.weight" />
  257. </u-form-item>
  258. </view>
  259. </view>
  260. <view class="item">
  261. <u-form-item label="重量单位" prop="weightUnit">{{ item.weightUnit }}</u-form-item>
  262. </view>
  263. <view class="item">
  264. <u-form-item label="是否拆包"
  265. prop="isUnpack">{{ item.isUnpack ? '是' : '否' }}</u-form-item>
  266. </view>
  267. </view>
  268. <view class="selectTime" v-if="item.outInDetailRecordRequestList.length > 0">
  269. <view class="title">包装列表</view>
  270. <view class="timeBox">
  271. <u-button class="firstBtn" size="small" type="primary" text="选择时间类型"
  272. @click="timeTypeShow = true"></u-button>
  273. <u-button type="warning" size="small"
  274. :text="`批量设置${currentDateType?curDateTypeLabel[currentDateType]:''}`"
  275. @click="typeTimeClick(index)"></u-button>
  276. </view>
  277. </view>
  278. <u-list @scrolltolower="scrolltolower" class="z_list" style="height: 100% !important">
  279. <view class="material rx-ss" v-for="(ite, idx) in item.outInDetailRecordRequestList"
  280. :key="idx">
  281. <!-- <view class="left rx-ss" @click="deletePacking(index, idx)">
  282. <uni-icons custom-prefix="iconfont" type="icon-shanchu" size="20" color="#fa3534"></uni-icons>
  283. </view> -->
  284. <view class="content_table">
  285. <view class="item">
  286. <view class="lable rx-cc">序号</view>
  287. <view class="content">{{ idx + 1 }}</view>
  288. </view>
  289. <view class="item">
  290. <view class="lable rx-cc">批次号</view>
  291. <view class="content">{{ ite.batchNo }}</view>
  292. </view>
  293. <view class="item">
  294. <view class="lable rx-cc">包装编码</view>
  295. <view class="content">{{ ite.packageNo }}</view>
  296. </view>
  297. <view class="item">
  298. <view class="lable rx-cc">名称/编码</view>
  299. <view class="content">{{ ite.categoryName }} / {{ ite.categoryCode }}</view>
  300. </view>
  301. <view class="item">
  302. <view class="lable rx-cc">型号/规格</view>
  303. <view class="content">{{ ite.categoryModel || '-' }} / {{ ite.specification || '-' }}</view>
  304. </view>
  305. <view class="item">
  306. <view class="lable rx-cc">牌号</view>
  307. <view class="content">{{ ite.brandNum || '-' }}</view>
  308. </view>
  309. <view class="item">
  310. <view class="lable rx-cc">包装数量({{ ite.packingUnit }})</view>
  311. <view class="content">{{ ite.packingQuantity }}</view>
  312. </view>
  313. <view class="item">
  314. <view class="lable rx-cc">计量数量({{ ite.measureUnit }})</view>
  315. <view class="content">{{ ite.measureQuantity }}</view>
  316. </view>
  317. <view class="item">
  318. <view class="lable rx-cc">仓库</view>
  319. <view class="content">{{ ite.warehouseName || '-' }}</view>
  320. </view>
  321. <view class="item">
  322. <view class="lable rx-cc">供应商</view>
  323. <view class="content">{{ ite.supplierName || '-' }}</view>
  324. </view>
  325. <view class="item">
  326. <view class="lable rx-cc">供应商代号</view>
  327. <view class="content">{{ ite.supplierCode || '-' }}</view>
  328. </view>
  329. <view class="item">
  330. <view class="lable rx-cc">机型</view>
  331. <view class="content">{{ ite.modelKey || '-' }}</view>
  332. </view>
  333. <view class="item">
  334. <view class="lable rx-cc">颜色</view>
  335. <view class="content">{{ ite.colorKey || '-' }}</view>
  336. </view>
  337. <view class="item">
  338. <view class="lable rx-cc">物料代号</view>
  339. <view class="content input_box"><u--input clearable placeholder="请输入"
  340. border="surround" v-model="ite.materielDesignation"></u--input>
  341. </view>
  342. </view>
  343. <view class="item">
  344. <view class="lable rx-cc">客户代号</view>
  345. <view class="content input_box"><u--input clearable placeholder="请输入"
  346. border="surround" v-model="ite.clientCode"></u--input></view>
  347. </view>
  348. <view class="item">
  349. <view class="lable rx-cc">刻码</view>
  350. <view class="content input_box"><u--input clearable placeholder="请输入"
  351. border="surround" v-model="ite.engrave"></u--input></view>
  352. </view>
  353. <view class="item">
  354. <view class="lable rx-cc">重量({{ ite.weightUnit }})</view>
  355. <view class="content input_box">
  356. <u--input clearable placeholder="请输入" border="surround"
  357. v-model="ite.weight"
  358. @change="weightInput($event, ite, index)"></u--input>
  359. </view>
  360. </view>
  361. <view class="item">
  362. <view class="lable rx-cc">重量单位</view>
  363. <view class="content">{{ ite.weightUnit || '-' }}</view>
  364. </view>
  365. <view class="item">
  366. <view class="lable rx-cc">质检结果</view>
  367. <view class="content" @click="statusClick(index, idx)">
  368. {{ qualityResults[ite.result] || qualityResults[ite.status] }}
  369. </view>
  370. </view>
  371. <view class="item">
  372. <view class="lable rx-cc">生产日期</view>
  373. <view class="content">{{ ite.productionDate || '-' }}</view>
  374. </view>
  375. <view class="item">
  376. <view class="lable rx-cc">采购日期</view>
  377. <view class="content">{{ ite.purchaseDate || '-' }}</view>
  378. </view>
  379. <view class="item">
  380. <view class="lable rx-cc">失效日期</view>
  381. <view class="content">{{ ite.expireDate || '-' }}</view>
  382. </view>
  383. </view>
  384. </view>
  385. </u-list>
  386. </view>
  387. </view>
  388. </u-form>
  389. </uni-collapse-item>
  390. </uni-collapse>
  391. <view class="footBox">
  392. <view class="reg" @click="submit">
  393. <uni-icons custom-prefix="iconfont" size="20" color="#fff"></uni-icons>
  394. 提交
  395. </view>
  396. </view>
  397. <!-- 选择物品类型 -->
  398. <ba-tree-picker ref="treePicker" :multiple="true" @select-change="confirm" title="选择物品类型"
  399. :localdata="goodsLists" valueKey="id" textKey="name" childrenKey="child" />
  400. <!-- 选择入库时间 -->
  401. <u-datetime-picker @confirm="timeConfirm" @cancel="timeCancel" :show="timeShow" v-model="storageTime"
  402. mode="datetime"></u-datetime-picker>
  403. <!-- 选择包装单位 -->
  404. <u-picker :show="packingUnitsShow" visibleItemCount="10" :columns="currentPackingSpecificationOption"
  405. keyName="conversionUnit" @confirm="selectPackingUnitInfo" @cancel="packingUnitsShow = false"
  406. title="选择包装单位"></u-picker>
  407. <!-- 选择供应商单位 -->
  408. <u-picker :show="suppliersShow" visibleItemCount="10" :columns="currentSupplierListOption" keyName="name"
  409. @confirm="selectSuppliersInfo" @cancel="suppliersShow = false" title="选择供应商"></u-picker>
  410. <!-- 选择仓库 -->
  411. <u-picker :show="warehouseShow" visibleItemCount="10" :columns="warehouseListOption" keyName="name"
  412. @confirm="selectWarehouseInfo" @cancel="warehouseShow = false" title="选择仓库"></u-picker>
  413. <!-- 选择时间类型 -->
  414. <u-picker :show="timeTypeShow" visibleItemCount="10" :columns="timeTypeOption" keyName="name"
  415. @confirm="selectTimeTypeInfo" @cancel="timeTypeShow = false" title="选择时间类型"></u-picker>
  416. <!-- 选择生产/采购日期 -->
  417. <u-datetime-picker @confirm="typeTimeConfirm" @cancel="typeTimeShow = false" :show="typeTimeShow"
  418. v-model="currentTypeTime" mode="datetime"></u-datetime-picker>
  419. <!-- 选择质检状态 -->
  420. <u-picker :show="statusShow" visibleItemCount="10" :columns="qualityResultsOption" keyName="label"
  421. @confirm="selectStautsInfo" @cancel="statusShow = false" title="选择质检状态"></u-picker>
  422. <!-- 产品日期选择 -->
  423. <u-datetime-picker @confirm="itemDateConfirm" @cancel="itemDateShow = false" :show="itemDateShow"
  424. v-model="currentItemDate" mode="date"></u-datetime-picker>
  425. </view>
  426. </template>
  427. <script>
  428. // import ScanCode from '@/components/ScanCode.vue'
  429. import {
  430. getTreeByGroup,
  431. contactQueryByCategoryIdsAPI,
  432. getCode,
  433. getCategoryPackageDisposition,
  434. getWarehouseList,
  435. getAssetNum,
  436. storage,
  437. qualityInspectionTwo,
  438. submitTwo,
  439. warehouseDefinitionList,
  440. isVerifyRepeatIsStock
  441. } from '@/api/warehouseManagement'
  442. import {
  443. getGroupList
  444. } from '@/api/wt'
  445. import {
  446. getByCode
  447. } from '@/api/pda/common'
  448. import dayjs from 'dayjs'
  449. import {
  450. sceneState
  451. } from '../common'
  452. import {
  453. post,
  454. postJ,
  455. get,
  456. getJ
  457. } from '@/utils/api.js'
  458. import WarehouseChoose from '@/components/WarehouseChoose'
  459. import {
  460. warehousingType,
  461. inputStatus,
  462. emergencyState,
  463. warehousingMaterialListTable,
  464. getDictName,
  465. materialType
  466. } from '../enum.js'
  467. import baTreePicker from '@/components/ba-tree-picker/ba-tree-picker.vue'
  468. // import addDetails from '@/components/addDetails'
  469. import UploadFileNew from '@/components/UploadFileNew'
  470. // import { getRuleNo } from '@/utils/utils.js'
  471. import {
  472. tableHeader
  473. } from '../common'
  474. // import dictMixins from '@/mixins/dictMixins.js'
  475. export default {
  476. components: {
  477. WarehouseChoose,
  478. baTreePicker,
  479. UploadFileNew
  480. },
  481. // mixins: [dictMixins],
  482. data() {
  483. return {
  484. goodsLists: [], // 物品类型
  485. assetTypeName: '', // 物品类型名称
  486. timeShow: false,
  487. packingSpecificationOption: [], // 包装规格
  488. currentPackingSpecificationOption: [], // 当前包装规格
  489. currentSupplierListOption: [], // 当前供货商
  490. warehouseListOption: [], // 仓库列表
  491. currentTypeTime: Number(new Date()), // 当前时间类型的时间
  492. storageTime: '', // 入库时间
  493. currentProductIndex: null, // 当前产品索引
  494. currentPackingIndex: null, // 当前包装索引
  495. packingUnitsShow: false,
  496. typeTimeShow: false,
  497. suppliersShow: false,
  498. warehouseShow: false,
  499. timeTypeShow: false,
  500. statusShow: false,
  501. itemDateShow: false, // 产品日期选择弹窗
  502. itemDateTarget: '', // 产品日期目标字段
  503. currentEditIndex: null, // 当前编辑的产品索引
  504. currentItemDate: Number(new Date()), // 产品日期选择值
  505. dictCodeList: [], // 字典列表
  506. curDateType: 'purchaseDate',
  507. currentDateType: 'purchaseDate',
  508. qualityResultsOption: [
  509. [{
  510. label: '合格',
  511. value: 1
  512. },
  513. {
  514. label: '不合格',
  515. value: 2
  516. }
  517. ]
  518. ], // 质检状态 0未检 1已检
  519. qualityResults: {
  520. 1: '合格',
  521. 2: '不合格'
  522. }, // 质检结果 1合格 2不合格
  523. curDateTypeLabel: {
  524. purchaseDate: '采购日期',
  525. productionDate: '生产日期',
  526. expireDate: '失效日期'
  527. },
  528. timeTypeOption: [
  529. [{
  530. name: '采购日期',
  531. prop: 'purchaseDate'
  532. },
  533. {
  534. name: '生产日期',
  535. prop: 'productionDate'
  536. },
  537. {
  538. name: '失效日期',
  539. prop: 'expireDate'
  540. }
  541. ]
  542. ], // 时间类型
  543. collapseOpen: 'collapse1',
  544. emergencyState,
  545. warehousingType,
  546. materialType,
  547. sceneState,
  548. inputStatus,
  549. getDictName,
  550. detailOpen: false,
  551. codeOpen: false,
  552. deptList: [], //部门
  553. supplierList: [], //供应商
  554. formData: {
  555. type: 1, // 入库
  556. bizType: '', // 入库场景
  557. storageTime: '', // 入库时间
  558. extInfo: {}, // 扩展信息
  559. sourceBizNo: '', // 来源单据编号
  560. clientName: '', // 客户名称
  561. fromUser: '', // 送货人
  562. remark: '' // 备注
  563. },
  564. statusList: [{
  565. id: 1,
  566. name: '紧急'
  567. },
  568. {
  569. id: 2,
  570. name: '中等'
  571. },
  572. {
  573. id: 1,
  574. name: '普通'
  575. }
  576. ], //紧急状态
  577. pickerIndex: 0,
  578. productList: [],
  579. userList: [],
  580. rules: {
  581. assetType: {
  582. type: 'number',
  583. required: true,
  584. message: '请选择入库产品类型',
  585. trigger: ['blur', 'change']
  586. },
  587. bizType: {
  588. type: 'number',
  589. required: true,
  590. message: '请选择入库场景',
  591. trigger: ['blur', 'change']
  592. }
  593. // contentImage: {
  594. // type: 'array',
  595. // required: true,
  596. // message: '请上传附件',
  597. // trigger: ['blur', 'change']
  598. // }
  599. },
  600. settingIndex: 0
  601. }
  602. },
  603. onShow() {
  604. // const _this = this
  605. // uni.$off('scancode') // 每次进来先 移除全局自定义事件监听器
  606. // uni.$on('scancode', function (data) {
  607. // uni.navigateBack({
  608. // delta: 1
  609. // })
  610. // _this.qrContent = data.code.trim()
  611. // _this.handleScan()
  612. // })
  613. this.collapseOpen = 'collapse1'
  614. },
  615. beforeDestroy() {
  616. uni.$off('setSelectList')
  617. uni.$off('requisitionSelect')
  618. },
  619. async onLoad(options) {
  620. await this.getListItems() // 物品类型
  621. // await this.getwarehouseList() // 仓库列表
  622. await this.requireDictCode() // 字典列表
  623. // this.requestDict('物品类型')
  624. // this.getDept()
  625. // this.getSupplier()
  626. // const userInfo = uni.getStorageSync('userInfo')
  627. // console.log('userInfo~~~', userInfo)
  628. // this.formData.extInfo.createUserName = userInfo.name
  629. // this.formData.createUserId = userInfo.userId
  630. this.initUserInfo()
  631. this.storageTime = Number(new Date())
  632. this.formData.storageTime = this.formatter(this.storageTime)
  633. // this.formData.registerId = userInfo.id
  634. uni.$on('setSelectList', async data => {
  635. if (data?.length) {
  636. this.formData.sourceBizNo = ''
  637. // 获取批次号
  638. const batchNo = await getCode('lot_number_code')
  639. // 获取供应商
  640. const supplierList = await contactQueryByCategoryIdsAPI({
  641. categoryIds: data.map(item => item.id)
  642. })
  643. // 获取包装规格
  644. let packingSpecification = await getCategoryPackageDisposition({
  645. categoryIds: data.map(item => item.id)
  646. })
  647. this.packingSpecificationOption = data.map(item => {
  648. return packingSpecification.filter(ite => item.id == ite.categoryId).sort((
  649. a, b) => a.sort - b.sort)
  650. })
  651. let productList = data.map((item, index) => {
  652. // 显示规格
  653. let packingSpecificationLabel = this.packingSpecificationOption[index]
  654. .map(item => {
  655. if (item.sort > 0) {
  656. return `${item.packageCell}${item.packageUnit}/${item.conversionUnit}`
  657. }
  658. })
  659. .filter(item => !!item)
  660. // 默认单位取第一层
  661. const defaultPackingUnitId = this.packingSpecificationOption[index]?.[0]?.id || ''
  662. const defaultPackingUnit = this.packingSpecificationOption[index]?.[0]?.conversionUnit || ''
  663. return {
  664. index: this.productList.length - 1 > -1 ? this.productList[this
  665. .productList.length - 1].index + index + 1 : this.productList
  666. .length + index,
  667. isSave: false,
  668. categoryId: item.id, // 物品id
  669. categoryName: item.name, // 物品名称
  670. categoryCode: item.code, // 物品编码
  671. categoryLevelPathIdParent: item.categoryLevelPathIdParent || '', // 物品类型父级ID(仓库过滤用)
  672. categoryModel: item.modelType || '', // 物品型号
  673. specification: item.specification || '', // 规格
  674. brandNum: item.brandNum || '', // 牌号
  675. batchNo: batchNo, // 批次号
  676. supplierListOptions: supplierList[item.id] || [], // 供应商列表
  677. supplierId: '', // 供应商id
  678. supplierName: '', // 供应商名称
  679. supplierCode: '', // 供应商代号
  680. approvalNumber: item.approvalNumber || '', // 批准文号
  681. packingSpecification: item.packingSpecification, // 包装规格
  682. packingSpecificationOption: this.packingSpecificationOption[
  683. index], // 包装规格选项
  684. packingSpecificationLabel: packingSpecificationLabel, // 包装规格显示
  685. minPackingQuantity: '', // 最小包装单元数量
  686. quantity: '', // 数量
  687. unitId: defaultPackingUnitId, // 默认单位ID
  688. unit: defaultPackingUnit, // 默认单位
  689. packingQuantity: '', // 包装数量(兼容)
  690. packingUnit: item.packingUnit || '', // 包装单位
  691. measureQuantity: 0, // 计量数量
  692. measureUnit: item.measuringUnit || '', // 计量单位
  693. netWeight: item.netWeight > 0 ? item.netWeight : 0, // 净重
  694. weight: 0, // 重量
  695. weightUnit: item.weightUnit || '', // 重量单位
  696. totalMoney: '', // 总价
  697. price: item.price || '', // 单价
  698. purpose: '', // 采购原因
  699. isUnpack: item.isUnpack, // 是否允许拆包
  700. reelSpecification: '', // 盘具
  701. modelKey: item.modelKey ? item.modelKey?.split(',')?.[0] || '' : '', // 机型
  702. colorKey: item.colorKey ? item.colorKey?.split(',')?.[0] || '' : '', // 颜色
  703. materielDesignation: '', // 物料代号
  704. clientCode: '', // 客户代号
  705. engrave: '', // 刻码
  706. detailProductionDate: '', // 生产日期
  707. detailPurchaseDate: '', // 采购日期
  708. detailExpireDate: '', // 失效日期
  709. singleWeight: 0, // 单重
  710. warehouseId: '', // 仓库ID
  711. warehouseName: '', // 仓库名称
  712. warehouseIds: [], // 仓库ID列表
  713. warehouseNames: [], // 仓库名称列表
  714. filteredWarehouseList: [], // 按产品类型过滤的仓库列表
  715. outInDetailRecordRequestList: [],
  716. extField: item.extField,
  717. }
  718. })
  719. this.productList = this.productList.concat(productList)
  720. console.log(this.productList, '------------------this.productList----111-----')
  721. setTimeout(() => {
  722. this.detailOpen = !this.detailOpen
  723. this.$refs.collapse && this.$refs.collapse.resize()
  724. }, 0)
  725. }
  726. })
  727. uni.$on('requisitionSelect', async (data, query) => {
  728. console.log(data)
  729. this.formData.sourceBizNo = query.sourceBizNo
  730. this.formData.bizType = parseInt(query.bizType)
  731. this.formData.extInfo.assetType = query.assetType.split(',')
  732. let filterArray = this.formData.extInfo.assetType.map(item => {
  733. return this.goodsLists.find(ite => ite.id == item).name
  734. })
  735. this.assetTypeName = Array.from(new Set(filterArray)).join('/')
  736. const batchNo = await getCode('lot_number_code')
  737. // 获取包装规格
  738. let packingSpecification = await getCategoryPackageDisposition({
  739. categoryIds: data.map(item => item.categoryId)
  740. })
  741. this.packingSpecificationOption = data.map(item => {
  742. return packingSpecification.filter(ite => item.categoryId == ite.categoryId)
  743. .sort((a, b) => a.sort - b.sort)
  744. })
  745. this.productList = data.map((productItem, productIndex) => {
  746. // 显示规格
  747. let packingSpecificationLabel = this.packingSpecificationOption[productIndex]
  748. .map(item => {
  749. if (item.sort > 0) {
  750. return `${item.packageCell}${item.packageUnit}/${item.conversionUnit}`
  751. }
  752. })
  753. .filter(item => !!item)
  754. return {
  755. ...productItem,
  756. index: this.productList.length + productIndex,
  757. isSave: productItem.outInDetailRecordRequestList?.length > 0 ? true :
  758. false,
  759. // 默认字段(兼容来源数据可能缺失)
  760. categoryModel: productItem.categoryModel || productItem.modelType || '',
  761. netWeight: productItem.netWeight > 0 ? productItem.netWeight : 0,
  762. weight: productItem.weight ? Number(productItem.weight) : 0,
  763. reelSpecification: productItem.reelSpecification || '',
  764. modelKey: productItem.modelKey || '',
  765. colorKey: productItem.colorKey || '',
  766. materielDesignation: productItem.materielDesignation || '',
  767. clientCode: productItem.clientCode || '',
  768. engrave: productItem.engrave || '',
  769. supplierCode: productItem.supplierCode || '',
  770. // 数量和单位映射
  771. quantity: productItem.quantity || productItem.packingQuantity || '',
  772. unit: productItem.unit || productItem.measuringUnit || '',
  773. unitId: productItem.unitId || '',
  774. measureUnit: productItem.measureUnit || productItem.measuringUnit || '',
  775. batchNo: productItem.batchNo || batchNo, // 批次号
  776. warehouseIds: [productItem.warehouseId], // 仓库Id
  777. warehouseNames: [productItem.warehouseName], // 仓库名称
  778. packingSpecificationOption: this.packingSpecificationOption[
  779. productIndex], // 包装规格选项
  780. packingSpecificationLabel: packingSpecificationLabel, // 包装规格显示
  781. outInDetailRecordRequestList: productItem.outInDetailRecordRequestList
  782. ?.length > 0 ?
  783. productItem.outInDetailRecordRequestList.map((packingItem,
  784. packingIndex) => {
  785. return {
  786. ...packingItem,
  787. index: this.productList.length + productIndex + '-' +
  788. packingIndex, // 包装索引
  789. batchNo: batchNo, // 批次号
  790. parentIndex: this.productList.length +
  791. productIndex, // 物品索引
  792. categoryName: productItem.categoryName,
  793. categoryCode: productItem.categoryCode,
  794. reelSpecification: productItem.reelSpecification || '',
  795. materialDetailList: packingItem.materialDetailList.map((
  796. materialItem, materialIndex) => {
  797. return {
  798. ...materialItem,
  799. index: this.productList.length +
  800. productIndex + '-' + packingIndex +
  801. '——' + materialIndex, // 包装索引
  802. parentIndex: this.productList.length +
  803. productIndex + '-' +
  804. packingIndex, // 物品索引
  805. batchNo: batchNo, // 批次号
  806. categoryName: productItem.categoryName,
  807. categoryCode: productItem.categoryCode
  808. }
  809. })
  810. }
  811. }) : []
  812. }
  813. })
  814. setTimeout(() => {
  815. this.detailOpen = !this.detailOpen
  816. this.$refs.collapse && this.$refs.collapse.resize()
  817. }, 0)
  818. })
  819. // 明细信息填写
  820. uni.$on('batchNumBack', productList => {
  821. if (productList?.length) {
  822. this.productList = productList
  823. }
  824. })
  825. },
  826. mounted() {
  827. // this.getAddDetails();
  828. },
  829. computed: {
  830. tableHeader() {
  831. return tableHeader(this.formData.assetType)
  832. },
  833. materialCodeReqList() {
  834. return this.productList.map(i => i.warehouseLedgerDetails || []).flat()
  835. },
  836. isMaterial() {
  837. return this.formData.assetType == 3
  838. },
  839. warehousingName() {
  840. return []
  841. this.productList = []
  842. return this.getDictValue('物品类型', this.formData.assetType)
  843. },
  844. listRules() {
  845. return this.productList.reduce((cur, pre, index) => {
  846. return {
  847. ...cur,
  848. [`productList.${index}.batchNo`]: {
  849. type: 'string',
  850. required: true,
  851. trigger: ['blur', 'change']
  852. },
  853. [`productList.${index}.quantity`]: {
  854. type: 'number',
  855. required: true,
  856. trigger: ['blur', 'change']
  857. },
  858. [`productList.${index}.unit`]: {
  859. type: 'string',
  860. required: true,
  861. trigger: ['blur', 'change']
  862. },
  863. [`productList.${index}.warehouseId`]: {
  864. type: 'string',
  865. required: true,
  866. trigger: ['blur', 'change']
  867. }
  868. }
  869. }, {})
  870. },
  871. factoryId() {
  872. return uni.getStorageSync('userInfo').factoryId;
  873. },
  874. },
  875. methods: {
  876. // 初始化当前用户信息
  877. async initUserInfo() {
  878. const res = await getGroupList();
  879. let info = uni.getStorageSync('userInfo');
  880. console.log(info, 'infoinfoinfo');
  881. let obj = res.find(
  882. (item) => item.id === info.deptIds[info.deptIds.length - 1]
  883. );
  884. // if (!obj) return;
  885. if (obj) {
  886. console.log(
  887. obj,
  888. 'objobjobjobjobjobjobjobjobjobjobjobjobjobjobjobjobj'
  889. );
  890. this.formData.extInfo.deptCode = obj?.id;
  891. this.formData.extInfo.deptName = obj?.name;
  892. } else {
  893. this.formData.extInfo.deptName = info.deptName
  894. ? info.deptName
  895. : info.groupName
  896. ? info.groupName
  897. : '';
  898. }
  899. this.formData.extInfo.createUserName = info.name;
  900. this.formData.createUserId = info.userId;
  901. },
  902. goToScanCodeList() {
  903. uni.navigateTo({
  904. url: '/pages/warehouse/enterHouse/components/scanCodeList'
  905. })
  906. },
  907. goToRequisition() {
  908. uni.navigateTo({
  909. url: '/pages/warehouse/components/requisitionList?type=' + 1
  910. })
  911. },
  912. async isVerifyRepeatIsStock() {
  913. const isVerifyData = await isVerifyRepeatIsStock({
  914. categoryCodes: this.productList.map((item) => item.categoryCode),
  915. batchNos: this.productList.map((item) => item.batchNo)
  916. });
  917. return new Promise((resolve) => {
  918. if (isVerifyData?.length) {
  919. uni.showModal({
  920. title: '提示',
  921. content: `当前批次:${isVerifyData[0].batchNo},物品${isVerifyData
  922. .map((item) => item.categoryName)
  923. .join(',')}已有入库记录,是否继续入库!`,
  924. success: (res) => {
  925. resolve(res.confirm);
  926. }
  927. });
  928. } else {
  929. resolve(true);
  930. }
  931. });
  932. },
  933. // 入库
  934. async submit() {
  935. if (this.productList.length <= 0) {
  936. uni.showToast({
  937. icon: 'none',
  938. title: '请添加产品!'
  939. })
  940. return
  941. }
  942. let boolen = this.productList.every(item => item.isSave)
  943. if (!boolen) {
  944. uni.showToast({
  945. icon: 'none',
  946. title: '请先保存所有产品信息!'
  947. })
  948. return
  949. }
  950. uni.showLoading({
  951. title: '保存中...'
  952. })
  953. this.formData.outInDetailList = this.productList
  954. let obj = uni.$u.deepClone(this.formData)
  955. // 处理物品类型assetType
  956. obj.extInfo.assetType = obj.extInfo.assetType?.join(',')
  957. // 处理仓库id
  958. let warehouseId = []
  959. let warehouseName = []
  960. let warehouseIds = this.productList.map(item => item.warehouseIds).flat()
  961. let warehouseNames = this.productList.map(item => item.warehouseNames).flat()
  962. warehouseIds.forEach((item, index) => {
  963. if (!warehouseId.includes(item)) {
  964. warehouseId.push(item)
  965. warehouseName.push(warehouseNames[index])
  966. }
  967. })
  968. obj.warehouseIds = warehouseId
  969. obj.warehouseNames = warehouseName
  970. // 是否需要审核(0审核 1跳过审核)
  971. if (obj.bizType == '12') {
  972. obj.isSkip = 1
  973. } else {
  974. obj.isSkip = 0
  975. }
  976. if (!(await this.isVerifyRepeatIsStock())) {
  977. uni.hideLoading()
  978. return;
  979. }
  980. // obj.isSkip = 1;
  981. console.log(obj, '提交')
  982. storage(obj)
  983. .then(async res => {
  984. console.log('入库成功', res)
  985. if (res.code == 0) {
  986. try {
  987. // 委外入库(非采购)
  988. if (obj.bizType == '12') {
  989. await qualityInspectionTwo({
  990. outInId: res.data[0]
  991. })
  992. } else {
  993. await submitTwo({
  994. outInId: res.data[0]
  995. })
  996. }
  997. uni.hideLoading()
  998. uni.showToast({
  999. icon: 'none',
  1000. title: '入库成功',
  1001. duration: 1500
  1002. })
  1003. uni.navigateBack({
  1004. delta: 1
  1005. })
  1006. } catch (error) {
  1007. uni.hideLoading()
  1008. console.log('提交流程失败', error)
  1009. }
  1010. }
  1011. })
  1012. .catch(err => {
  1013. console.log('入库失败', err)
  1014. uni.hideLoading()
  1015. uni.showToast({
  1016. icon: 'none',
  1017. title: '入库失败',
  1018. duration: 2000
  1019. })
  1020. })
  1021. },
  1022. // 重量限制
  1023. weightInput(value, row, productIndex) {
  1024. const newValue = value.replace(/[^\d.]/g, '') // 保留数字和小数点
  1025. const decimalCount = (newValue.match(/\./g) || []).length // 计算小数点的个数
  1026. if (row.weight < 0) {
  1027. row.weight = 0
  1028. } else if (row.weight > 9999) {
  1029. row.weight = 9999
  1030. } else {
  1031. if (decimalCount > 1) {
  1032. // 如果小数点个数大于1,移除多余的小数点
  1033. const lastIndex = newValue.lastIndexOf('.')
  1034. row.weight = newValue.slice(0, lastIndex) + newValue.slice(lastIndex + 1)
  1035. } else if (decimalCount === 1) {
  1036. // 如果小数点个数等于1,允许小数点的输入
  1037. row.weight = newValue
  1038. } else {
  1039. row.weight = newValue === '' ? 0 : parseFloat(newValue) // 如果输入为空,则设为0
  1040. }
  1041. }
  1042. this.packingWeightCahnge(productIndex)
  1043. },
  1044. // 包装重量修改
  1045. packingWeightCahnge(productIndex) {
  1046. // 修改物品重量
  1047. let totalWeight = this.productList[productIndex].outInDetailRecordRequestList.reduce((accumulator,
  1048. currentValue) => {
  1049. return Number(accumulator) + Number(currentValue.weight)
  1050. }, 0)
  1051. this.$set(this.productList[productIndex], 'weight', totalWeight)
  1052. },
  1053. scrolltolower() {
  1054. console.log('滑动了~~~')
  1055. },
  1056. typeTimeClick(index, idx) {
  1057. console.log('index-----', index)
  1058. console.log('idx----', idx)
  1059. this.currentProductIndex = index
  1060. this.currentPackingIndex = idx > -1 ? idx : -1
  1061. this.typeTimeShow = true
  1062. },
  1063. statusClick(index, idx) {
  1064. this.currentProductIndex = index
  1065. this.currentPackingIndex = idx > -1 ? idx : -1
  1066. this.statusShow = true
  1067. },
  1068. selectStautsInfo(e) {
  1069. this.productList[this.currentProductIndex].outInDetailRecordRequestList[this.currentPackingIndex].status =
  1070. e.value[0]?.value
  1071. this.statusShow = false
  1072. },
  1073. // 产品列表日期选择
  1074. datePickerOpen(index, field) {
  1075. this.currentEditIndex = index
  1076. this.itemDateTarget = field
  1077. const val = this.productList[index][field]
  1078. this.currentItemDate = val ? this.formatter(val) : Number(new Date())
  1079. this.itemDateShow = true
  1080. },
  1081. itemDateConfirm() {
  1082. this.itemDateShow = false
  1083. if (this.currentEditIndex != null && this.itemDateTarget) {
  1084. const formatted = dayjs(this.currentItemDate).format('YYYY-MM-DD')
  1085. this.$set(this.productList[this.currentEditIndex], this.itemDateTarget, formatted)
  1086. }
  1087. },
  1088. // 批量保存
  1089. // 批量保存(参照 target)
  1090. async batchSave() {
  1091. try {
  1092. // 验证所有未保存的表单
  1093. await this.validateForm();
  1094. // 遍历所有产品进行保存
  1095. for (let i = 0; i < this.productList.length; i++) {
  1096. const row = this.productList[i];
  1097. if (!row.isSave) {
  1098. await this.listSave(row, i);
  1099. }
  1100. }
  1101. } catch (error) {
  1102. uni.showToast({ icon: 'none', title: '批量保存失败,请检查必填项' })
  1103. }
  1104. },
  1105. typeTimeConfirm() {
  1106. this.typeTimeShow = false
  1107. this.$nextTick(() => {
  1108. console.log(this.currentPackingIndex)
  1109. if (this.currentPackingIndex > -1) {
  1110. // 单独
  1111. this.productList[this.currentProductIndex].outInDetailRecordRequestList[this
  1112. .currentPackingIndex][this.currentDateType] = this.formatter(this.currentTypeTime)
  1113. } else {
  1114. // 批量
  1115. this.productList[this.currentProductIndex].outInDetailRecordRequestList = this.productList[
  1116. this.currentProductIndex].outInDetailRecordRequestList.map(item => {
  1117. console.log(this.currentTypeTime)
  1118. console.log(this.formatter(this.currentTypeTime))
  1119. return {
  1120. ...item,
  1121. [this.currentDateType]: this.formatter(this.currentTypeTime)
  1122. }
  1123. })
  1124. }
  1125. })
  1126. },
  1127. // 物品保存验证表单(单独)
  1128. validateFormIndividually(index) {
  1129. return new Promise((resolve, reject) => {
  1130. console.log('index----------------', index)
  1131. let fileds = [`productList.${index}.batchNo`, `productList.${index}.quantity`,
  1132. `productList.${index}.unit`, `productList.${index}.warehouseId`
  1133. ]
  1134. console.log('fileds----------------', this.productList[index])
  1135. Promise.all(
  1136. fileds.map(
  1137. item =>
  1138. new Promise((res, rej) => {
  1139. this.$refs.lisrFormRef.validateField(item, err => {
  1140. console.log('err--', err)
  1141. if (err?.length) {
  1142. rej(err)
  1143. } else {
  1144. res(true)
  1145. }
  1146. })
  1147. })
  1148. )
  1149. )
  1150. .then(() => {
  1151. resolve()
  1152. })
  1153. .catch(err => {
  1154. uni.showToast({
  1155. icon: 'none',
  1156. title: '请填入必填项!'
  1157. })
  1158. reject(err)
  1159. })
  1160. })
  1161. },
  1162. // 物品保存验证表单(批量)- 参照 target
  1163. validateForm() {
  1164. return new Promise(async (resolve, reject) => {
  1165. let list = this.productList.map(async (row, index) => {
  1166. if (row.isSave) {
  1167. return Promise.resolve(true);
  1168. }
  1169. return await this.validateFormIndividually(index).then(
  1170. () => true,
  1171. () => { throw new Error('验证失败'); }
  1172. );
  1173. });
  1174. Promise.all(list)
  1175. .then(() => {
  1176. resolve();
  1177. })
  1178. .catch((err) => {
  1179. uni.showToast({ icon: 'none', title: '请填入必填项!' });
  1180. reject(err);
  1181. });
  1182. });
  1183. },
  1184. // 产品编辑
  1185. listEdit(row, index) {
  1186. this.currentProductIndex = index
  1187. this.productList[index].isSave = false
  1188. this.deletePackingAndMaterial(row);
  1189. },
  1190. // 根据产品信息删除包装和物料
  1191. deletePackingAndMaterial(row) {
  1192. console.log('row--------', row);
  1193. console.log('packingList------', row.outInDetailRecordRequestList);
  1194. // 删除包装(去掉不相同的包装)
  1195. row.outInDetailRecordRequestList = row.outInDetailRecordRequestList.filter(
  1196. (item) => item.parentIndex !== row.index
  1197. );
  1198. // this.showPackingList = this.showPackingList.filter(
  1199. // (item) => item.parentIndex !== row.index
  1200. // );
  1201. // this.pickingPageNum = Math.ceil(
  1202. // this.showPackingList.length / this.pageSize
  1203. // );
  1204. // console.log('包装当前页数');
  1205. // console.log(this.pickingPageNum);
  1206. },
  1207. // 产品保存(返回 Promise,参照 target)
  1208. listSave(row, index) {
  1209. console.log('index------', index)
  1210. return new Promise(async (resolve, reject) => {
  1211. try {
  1212. await this.validateFormIndividually(index)
  1213. console.log('通过了!!!')
  1214. // 检查包装规格是否存在
  1215. if (row.packingSpecificationLabel?.length < 1) {
  1216. uni.showToast({ icon: 'none', title: '请到主数据维护包装组信息!' })
  1217. return reject(new Error('包装规格缺失'))
  1218. }
  1219. // 不拆包
  1220. if (!row.isUnpack) {
  1221. if (row.packingUnit != row.measureUnit) {
  1222. let pNum = row.quantity;
  1223. let splitIndex = row.packingSpecificationOption.findIndex(
  1224. (item) =>
  1225. item.conversionUnit == row.unit &&
  1226. item.packageUnit != item.conversionUnit
  1227. );
  1228. for (; splitIndex > 1; splitIndex--) {
  1229. pNum = Math.round(pNum *
  1230. row.packingSpecificationOption[splitIndex].packageCell *
  1231. 1e4) / 1e4;
  1232. }
  1233. console.log(pNum, 'pNum12');
  1234. const { data } = await getAssetNum([
  1235. {
  1236. assetCode: row.categoryCode + row.index,
  1237. batchNum: row.batchNo,
  1238. num: Math.ceil(pNum)
  1239. }
  1240. ]);
  1241. // this.generateWrappers(row, index, data)
  1242. } else {
  1243. let pNum = 0;
  1244. const { data } = await getAssetNum([
  1245. {
  1246. assetCode: row.categoryCode + row.index,
  1247. batchNum: row.batchNo,
  1248. num: Math.ceil(pNum)
  1249. }
  1250. ]);
  1251. }
  1252. } else {
  1253. let pNum = this.setPNum(row);
  1254. // row.packingQuantity;
  1255. // console.log(row.packingQuantity,'row.packingQuantity')
  1256. // return
  1257. //拆包
  1258. const { data } = await getAssetNum([
  1259. {
  1260. assetCode: row.categoryCode + row.index,
  1261. batchNum: row.batchNo,
  1262. num: Math.ceil(pNum)
  1263. }
  1264. ]);
  1265. console.log(data, 'data');
  1266. this.generateWrappers(row, index, data);
  1267. this.$set(
  1268. this.productList[index],
  1269. 'packingQuantity',
  1270. data.length
  1271. );
  1272. }
  1273. this.$set(this.productList[index], 'isSave', true);
  1274. this.$set(this.productList[index], 'warehouseId', row.warehouseId);
  1275. this.$set(this.productList[index], 'warehouseName', row.warehouseName);
  1276. this.$set(this.productList[index], 'warehouseIds', [row.warehouseId]);
  1277. this.$set(this.productList[index], 'warehouseNames', [row.warehouseName]);
  1278. resolve();
  1279. } catch (error) {
  1280. reject(error);
  1281. }
  1282. })
  1283. },
  1284. // 获取当前时间函数
  1285. getNowDate() {
  1286. let date = new Date(),
  1287. obj = {
  1288. year: date.getFullYear(), //获取完整的年份(4位)
  1289. month: date.getMonth() + 1, //获取当前月份(0-11,0代表1月)
  1290. strDate: date.getDate(), // 获取当前日(1-31)
  1291. hour: date.getHours(), //获取当前小时(0 ~ 23)
  1292. minute: date.getMinutes(), //获取当前分钟(0 ~ 59)
  1293. second: date.getSeconds() //获取当前秒数(0 ~ 59)
  1294. }
  1295. Object.keys(obj).forEach(key => {
  1296. if (obj[key] < 10) obj[key] = `0${obj[key]}`
  1297. })
  1298. return obj
  1299. },
  1300. // 生成包装(参照 target)
  1301. generateWrappers(row, productIndex, packingCodeList) {
  1302. // 不拆包 + 计量类型不是数量 + 计量单位=包装单位,直接赋值,不生成包装层
  1303. if (!row.isUnpack && row.measureUnit == row.unit) {
  1304. this.productList[productIndex].measureQuantity = row.measureQuantity;
  1305. this.productList[productIndex].weight = row.weight;
  1306. return;
  1307. }
  1308. let obj = this.getNowDate()
  1309. let productionDate = row.detailProductionDate || ''
  1310. let purchaseDate = row.detailPurchaseDate || ''
  1311. let expireDate = row.detailExpireDate || ''
  1312. if (this.formData.bizType == '1') {
  1313. productionDate = `${obj.year}-${obj.month}-${obj.strDate} ${obj.hour}:${obj.minute}:${obj.second}`
  1314. } else if (this.formData.bizType == '2') {
  1315. purchaseDate = `${obj.year}-${obj.month}-${obj.strDate} ${obj.hour}:${obj.minute}:${obj.second}`
  1316. }
  1317. // 判断单位和计量单位是否为不拆物料层规格
  1318. let packingBoolen = !!this.getDict(row.unit).dictValue
  1319. let measureBoolen = !!this.getDict(row.measureUnit).dictValue
  1320. let num = row.packingQuantity
  1321. let filterArr = []
  1322. console.log('row.packingSpecificationOption~~~', row.packingSpecificationOption);
  1323. if (packingBoolen) {
  1324. filterArr = row.packingSpecificationOption.filter(item =>
  1325. item.packageUnit == row.unit && item.packageUnit != item.conversionUnit
  1326. )
  1327. console.log('filterArr~~~!!!', filterArr, row.unit);
  1328. if (filterArr.length) {
  1329. num = Math.ceil(row.quantity / filterArr[0].packageCell)
  1330. }
  1331. } else {
  1332. if (row.isUnpack || measureBoolen) {
  1333. let splitIndex = row.packingSpecificationOption.findIndex(item =>
  1334. item.conversionUnit == row.unit && item.packageUnit != item.conversionUnit)
  1335. for (; splitIndex > 1; splitIndex--) {
  1336. num = num * row.packingSpecificationOption[splitIndex].packageCell
  1337. }
  1338. } else {
  1339. num = row.quantity
  1340. }
  1341. }
  1342. console.log('filterArr~~~', filterArr);
  1343. // 不拆包:按 packingCodeList 生成单个包装
  1344. if (!row.isUnpack) {
  1345. let unit = row.packingSpecificationOption[1]?.conversionUnit || row.unit
  1346. let totalCalc = Number(row.quantity)
  1347. let calcStart = row.packingSpecificationOption.findIndex(ite =>
  1348. row.measureUnit == ite.packageUnit && ite.packageUnit != ite.conversionUnit
  1349. )
  1350. let calcEnd = row.packingSpecificationOption.findIndex(ite =>
  1351. row.unit == ite.conversionUnit
  1352. )
  1353. for (; calcStart < calcEnd; calcEnd--) {
  1354. totalCalc = Math.round(row.packingSpecificationOption[calcEnd].packageCell * totalCalc * 1e4) / 1e4
  1355. }
  1356. let packingQuantity = row.measureQuantity / totalCalc
  1357. let measureQuantity = row.measureQuantity / packingCodeList.length
  1358. let measureUnit = row.measureUnit
  1359. for (let i = 0; i < packingCodeList.length; i++) {
  1360. let item = this.buildPackingItem(row, i, packingCodeList, packingQuantity, unit, measureQuantity, measureUnit, productionDate, purchaseDate, expireDate, packingBoolen, measureBoolen, filterArr)
  1361. row.outInDetailRecordRequestList.push(item)
  1362. }
  1363. } else {
  1364. // 拆包:按 num 生成
  1365. for (let i = 0; i < packingCodeList.length; i++) {
  1366. let measureQuantity = 1
  1367. if (packingBoolen) {
  1368. measureQuantity = Number(row.quantity) > filterArr[0].packageCell * (i + 1)
  1369. ? filterArr[0].packageCell
  1370. : Number(row.quantity) - filterArr[0].packageCell * i
  1371. } else {
  1372. //计量单位等于重量单位并且有总重 计量数量=总重/包装数
  1373. if (row.weightUnit == row.measureUnit && row.weight) {
  1374. measureQuantity =
  1375. Math.trunc((row.weight / packingCodeList.length) * 10000) /
  1376. 10000;
  1377. } else {
  1378. measureQuantity = row.packingSpecificationOption[1].packageCell;
  1379. }
  1380. }
  1381. // let packingUnit = packingBoolen ? filterArr[0].conversionUnit
  1382. // : measureBoolen ? row.packingSpecificationOption[1]?.conversionUnit || row.measureUnit
  1383. // : row.measureUnit
  1384. if (row.isUnpack) {
  1385. row.packingUnit =
  1386. row.packingSpecificationOption[1].conversionUnit;
  1387. }
  1388. let measureUnit = row.isUnpack
  1389. ? measureBoolen
  1390. ? row.packingSpecificationOption[1]
  1391. ? row.packingSpecificationOption[1].packageUnit
  1392. : row.packingSpecificationOption[0].packageUnit
  1393. : row.measureUnit
  1394. : row.measureUnit // 计量单位
  1395. let item = this.buildPackingItem(row, i, packingCodeList, 1, row.packingUnit, measureQuantity, measureUnit, productionDate, purchaseDate, expireDate, packingBoolen, measureBoolen, filterArr)
  1396. row.outInDetailRecordRequestList.push(item)
  1397. }
  1398. }
  1399. },
  1400. // 构建单个包装项
  1401. buildPackingItem(row, i, packingCodeList, packingQuantity, packingUnit, measureQuantity, measureUnit,
  1402. productionDate, purchaseDate, expireDate, packingBoolen, measureBoolen, filterArr) {
  1403. let item = {
  1404. index: row.index + '-' + i,
  1405. warehouseId: row.warehouseId,
  1406. warehouseName: row.warehouseName,
  1407. categoryName: row.categoryName,
  1408. categoryCode: row.categoryCode,
  1409. categoryModel: row.categoryModel,
  1410. specification: row.specification,
  1411. brandNum: row.brandNum,
  1412. parentIndex: row.index,
  1413. batchNo: row.batchNo,
  1414. packageNo: packingCodeList[i]?.onlyCode,
  1415. packingQuantity: packingQuantity,
  1416. packingUnit: packingUnit,
  1417. measureQuantity: measureQuantity,
  1418. measureUnit: measureUnit,
  1419. weight: row.weight / row.packingQuantity,
  1420. packingSpecificationOption: row.packingSpecificationOption,
  1421. weightUnit: row.weightUnit,
  1422. netWeight: row.netWeight,
  1423. barcodes: '',
  1424. clientCode: row.clientCode || '',
  1425. materielDesignation: row.materielDesignation || '',
  1426. engrave: row.engrave || '',
  1427. supplierName: row.supplierName || '',
  1428. supplierCode: row.supplierCode || '',
  1429. modelKey: row.modelKey || '',
  1430. colorKey: row.colorKey || '',
  1431. reelSpecification: row.reelSpecification || '',
  1432. isUnpack: row.isUnpack,
  1433. productionDate: productionDate,
  1434. purchaseDate: purchaseDate,
  1435. expireDate: expireDate,
  1436. result: 1,
  1437. status: 2
  1438. }
  1439. // 重量计算
  1440. let outBoolen = !!this.getDict(item.measureUnit).dictValue
  1441. if (outBoolen) {
  1442. item.weight = item.measureQuantity ? Number(item.measureQuantity) : 0
  1443. } else {
  1444. let inBoolen = !!this.getDict(item.packingSpecificationOption[0]?.packageUnit).dictValue
  1445. let si = item.packingSpecificationOption.findIndex(ite =>
  1446. item.measureUnit == ite.packingUnit && ite.packingUnit != ite.conversionUnit)
  1447. let ei = item.packingSpecificationOption.findIndex(ite =>
  1448. item.packingUnit == ite.conversionUnit)
  1449. let total = item.packingQuantity ? Number(item.packingQuantity) : 0
  1450. for (; si < ei; ei--) {
  1451. total = Math.round(item.packingSpecificationOption[ei].packageCell * total * 1e4) / 1e4
  1452. }
  1453. if (inBoolen) {
  1454. item.weight = total || 0
  1455. } else {
  1456. item.weight = total * item.netWeight || 0
  1457. }
  1458. }
  1459. return item
  1460. },
  1461. async requireDictCode() {
  1462. // 不拆物料层规格列表
  1463. const res = await getByCode('material_layer')
  1464. this.dictCodeList = res.map(item => {
  1465. const arr = Object.entries(item)
  1466. return {
  1467. dictCode: arr[0][0],
  1468. dictValue: arr[0][1]
  1469. }
  1470. })
  1471. },
  1472. getDict(dictCode) {
  1473. // 不拆物料层规格列表
  1474. if (this.dictCodeList.length > 0) {
  1475. return this.dictCodeList.find(item => item.dictCode == dictCode) || {}
  1476. } else {
  1477. return {}
  1478. }
  1479. },
  1480. // 小数处理,最大3位
  1481. format3(str) {
  1482. let value = str;
  1483. value = value.toString().replace(/[^0-9.]/g, '');
  1484. const parts = value.split('.');
  1485. if (parts.length > 2) {
  1486. value = parts[0] + '.' + parts.slice(1).join('');
  1487. }
  1488. if (parts.length === 2) {
  1489. value = parts[0] + '.' + parts[1].slice(0, 3);
  1490. }
  1491. console.log(value);
  1492. return value;
  1493. },
  1494. async computeNum(row, index, isClear) {
  1495. console.log(row)
  1496. console.log(row.quantity)
  1497. console.log(row.unit)
  1498. if (row.quantity) {
  1499. let value = row.quantity.toString().replace(/[^0-9.]/g, '')
  1500. const parts = value.split('.')
  1501. if (parts.length > 2) value = parts[0] + '.' + parts.slice(1).join('')
  1502. if (parts.length === 2) value = parts[0] + '.' + parts[1].slice(0, 3)
  1503. row.quantity = value
  1504. }
  1505. // 根据 unitId 匹配 unit
  1506. if (row.unitId && row.packingSpecificationOption) {
  1507. let data = row.packingSpecificationOption.find(item => item.id == row.unitId)
  1508. if (data) row.unit = data.conversionUnit
  1509. }
  1510. // 清空仓库(数量输入)
  1511. if (isClear) {
  1512. if (row.quantity < 1) {
  1513. this.$set(this.productList[index], 'quantity', 1)
  1514. }
  1515. }
  1516. // 同步 packingQuantity 供 listSave/generateWrappers 使用
  1517. // row.packingQuantity = row.quantity
  1518. // row.packingUnit = row.unit
  1519. if (row.quantity && row.unit) {
  1520. const res = await warehouseDefinitionList({
  1521. inventoryType: row?.categoryLevelPathIdParent,
  1522. factoryId: this.factoryId
  1523. })
  1524. if(res.length == 1) {
  1525. this.$set(this.productList[index], 'warehouseId', res[0].id);
  1526. this.$set(this.productList[index], 'warehouseName', res[0]?.name);
  1527. let table1 = [];
  1528. table1.push({
  1529. measureQuantity: row.measureQuantity,
  1530. packingQuantity: row.quantity,
  1531. warehouseName: res[0]?.name,
  1532. warehouseId: res[0].id
  1533. });
  1534. } else {
  1535. this.$set(this.productList[index], 'warehouseId', '');
  1536. this.$set(this.productList[index], 'warehouseName', '');
  1537. }
  1538. // 保存过滤后的仓库列表到产品行,供 showWarehousePicker 使用
  1539. this.$set(this.productList[index], 'filteredWarehouseList', res || [])
  1540. let data = row.packingSpecificationOption.find(item => item.id == row.unitId)
  1541. let endIndex = row.packingSpecificationOption.findIndex(ite => data && data.id == ite.id)
  1542. let total = Number(row.quantity)
  1543. for (; 0 < endIndex; endIndex--) {
  1544. total = row.packingSpecificationOption[endIndex].packageCell * total
  1545. }
  1546. row.measureQuantity = total
  1547. //计量单位不是数量时,配置了单重的重量计算
  1548. // row.measureType != 1 &&
  1549. let weight = 0;
  1550. if (row.measureUnit == row.weightUnit) {
  1551. weight = row.measureQuantity;
  1552. //包装单位与重量单位相等时,单重重量为0
  1553. if (row.unit == row.weightUnit) {
  1554. row.singleWeight = 0;
  1555. } else {
  1556. row.singleWeight =
  1557. Math.trunc((row.measureQuantity / row.quantity) * 10000) /
  1558. 10000;
  1559. }
  1560. } else if (row.singleWeight) {
  1561. weight = row.measureQuantity * Number(row.singleWeight);
  1562. }
  1563. this.$set(this.productList[index], 'weight', weight);
  1564. this.$set(
  1565. this.productList[index],
  1566. 'packingQuantity',
  1567. this.setPNum(row)
  1568. );
  1569. // 判断包装单位和计量单位是否为不拆物料层规格
  1570. // console.log(this.getDict(row.unit))
  1571. // let packingBoolen = !!this.getDict(row.unit).dictValue
  1572. // let measureBoolen = !!this.getDict(row.measureUnit).dictValue
  1573. // if (packingBoolen || measureBoolen) {
  1574. // row.weight = total
  1575. // } else {
  1576. // row.weight = total * row.netWeight
  1577. // }
  1578. }
  1579. },
  1580. setPNum(row) {
  1581. let pNum = 0;
  1582. if (row.unitId) {
  1583. let splitIndex = row.packingSpecificationOption.findIndex(
  1584. (item) => item.id == row.unitId
  1585. );
  1586. if (splitIndex == 0) {
  1587. pNum = Math.ceil(
  1588. row.measureQuantity /
  1589. row.packingSpecificationOption[1]?.packageCell
  1590. );
  1591. }
  1592. if (splitIndex == 1) {
  1593. pNum = row.quantity;
  1594. }
  1595. for (; splitIndex > 1; splitIndex--) {
  1596. pNum = Math.ceil(
  1597. row.quantity *
  1598. row.packingSpecificationOption[splitIndex].packageCell
  1599. );
  1600. }
  1601. } else {
  1602. pNum = Math.ceil(
  1603. row.measureQuantity / row.packingSpecificationOption[1]?.packageCell
  1604. );
  1605. }
  1606. return pNum;
  1607. },
  1608. //获取仓库(按产品类型和工厂过滤)
  1609. async getFilteredWarehouseList(row) {
  1610. const res = await warehouseDefinitionList({
  1611. inventoryType: row?.categoryLevelPathIdParent,
  1612. factoryId: this.factoryId
  1613. })
  1614. this.warehouseListOption = [res || []]
  1615. },
  1616. showWarehousePicker(index) {
  1617. this.currentProductIndex = index
  1618. const row = this.productList[index]
  1619. // 按产品类型过滤仓库列表
  1620. this.getFilteredWarehouseList(row).then(() => {
  1621. this.warehouseShow = true
  1622. })
  1623. },
  1624. showPackingUnitPicker(data, index) {
  1625. this.currentProductIndex = index
  1626. this.currentPackingSpecificationOption = [data.packingSpecificationOption]
  1627. this.packingUnitsShow = true
  1628. },
  1629. showSupplierPicker(data, index) {
  1630. this.currentProductIndex = index
  1631. this.currentSupplierListOption = [data.supplierListOptions]
  1632. this.suppliersShow = true
  1633. },
  1634. selectPackingUnitInfo(e) {
  1635. const selected = e.value[0]
  1636. const row = this.productList[this.currentProductIndex]
  1637. row.unitId = selected?.id || ''
  1638. row.unit = selected?.conversionUnit || ''
  1639. row.packingUnit = selected?.conversionUnit || '' // 兼容旧逻辑
  1640. this.computeNum(row, this.currentProductIndex)
  1641. this.packingUnitsShow = false
  1642. },
  1643. selectSuppliersInfo(e) {
  1644. this.productList[this.currentProductIndex].supplierName = e.value[0]?.name
  1645. this.productList[this.currentProductIndex].supplierId = e.value[0]?.id
  1646. this.suppliersShow = false
  1647. },
  1648. selectWarehouseInfo(e) {
  1649. this.productList[this.currentProductIndex].warehouseName = e.value[0]?.name
  1650. this.productList[this.currentProductIndex].warehouseId = e.value[0]?.id
  1651. this.productList[this.currentProductIndex].warehouseNames = [e.value[0]?.name]
  1652. this.productList[this.currentProductIndex].warehouseIds = [e.value[0]?.id]
  1653. this.warehouseShow = false
  1654. },
  1655. selectTimeTypeInfo(e) {
  1656. this.currentDateType = e.value[0]?.prop
  1657. this.timeTypeShow = false
  1658. },
  1659. sceneStateFilter(bizType) {
  1660. if (bizType) {
  1661. return this.sceneState.filter(item => item.value == bizType)[0].text
  1662. }
  1663. },
  1664. formatter(dataTime) {
  1665. return dayjs(dataTime).format('YYYY-MM-DD HH:mm:ss')
  1666. },
  1667. timeConfirm() {
  1668. this.timeShow = false
  1669. this.$nextTick(() => {
  1670. console.log(this.storageTime)
  1671. console.log(this.formatter(this.storageTime))
  1672. this.formData.storageTime = this.formatter(this.storageTime)
  1673. console.log(this.formData)
  1674. })
  1675. },
  1676. timeCancel() {
  1677. this.timeShow = false
  1678. },
  1679. openPicker() {
  1680. this.$refs.treePicker._show()
  1681. },
  1682. // 获取物品列表
  1683. async getListItems() {
  1684. this.goodsLists = await getTreeByGroup({
  1685. type: 2
  1686. })
  1687. },
  1688. confirm(data, name, allList) {
  1689. console.log('name-------', name)
  1690. this.assetTypeName = name
  1691. this.formData.extInfo.assetType = allList.map(item => item.id)
  1692. },
  1693. handleScan() {
  1694. if (this.formData.bizType !== '' && this.formData.bizType != 5) {
  1695. uni.showModal({
  1696. title: '提示',
  1697. content: '仅退还入库支持扫码,是否清除已选明细并切换至退还入库?',
  1698. success: async res => {
  1699. if (res.confirm) {
  1700. this.productList = []
  1701. this.formData.bizType = 5
  1702. this.getData()
  1703. }
  1704. }
  1705. })
  1706. return
  1707. }
  1708. this.getData()
  1709. },
  1710. // goScan () {
  1711. // uni.navigateTo({
  1712. // url: '/pages/ScanCode/ScanCode'
  1713. // })
  1714. // },
  1715. // 根据条码请求设备数据 @_@
  1716. getData() {
  1717. let par = {
  1718. barType: this.qrContent.split('@_@')[1] || 0,
  1719. qrContent: this.qrContent
  1720. }
  1721. // uni.showLoading({
  1722. // title: '加载中',
  1723. // mask: true
  1724. // })
  1725. // postJ(this.apiUrl + '/scan/getAssetInfo', par)
  1726. // .then(res => {
  1727. // let data = res.data
  1728. // console.log(data, 'qrContent')
  1729. // if (data.assetType === undefined) {
  1730. // uni.showToast({
  1731. // title: '请扫码物品码',
  1732. // icon: 'none'
  1733. // })
  1734. // return
  1735. // } else if (data.source == 2) {
  1736. // uni.showModal({
  1737. // title: '提示',
  1738. // content: '当前物品已在库',
  1739. // success: async res => {}
  1740. // })
  1741. // return
  1742. // } else if (this.warehousingName && this.formData.assetType != data.assetType) {
  1743. // uni.showToast({
  1744. // title: `当前物品不属于${this.warehousingName}分类`,
  1745. // icon: 'none'
  1746. // })
  1747. // return
  1748. // }
  1749. // this.setScanMaterial(data)
  1750. // })
  1751. // .finally(() => {
  1752. // uni.hideLoading()
  1753. // })
  1754. },
  1755. async setScanMaterial(data) {
  1756. this.formData.assetType = data.assetType
  1757. this.formData.bizType = 5
  1758. const curMap = {
  1759. assetId: 'id',
  1760. assetCode: 'informationCode', //编码
  1761. assetName: 'informationName', //名称
  1762. materialId: 'id',
  1763. materialName: 'informationName',
  1764. batchNo: '', //批次号
  1765. unit: 'measuringUnit', //单位
  1766. minPackUnit: 'packingUnit' //最小包装单位
  1767. }
  1768. let obj = {}
  1769. for (const key in curMap) {
  1770. obj[key] = (curMap[key] && data.information[curMap[key]]) || ''
  1771. }
  1772. let detailObj = uni.$u.deepClone(obj)
  1773. detailObj.onlyCode = data.assetCode
  1774. obj = {
  1775. ...data.information,
  1776. ...obj,
  1777. ...{
  1778. cargoSpaceCode: '', //货位编码
  1779. cargoSpaceId: '', //货位id
  1780. shelfId: '', //货架id
  1781. shelfCode: '', //货架名称
  1782. areaId: '', //库区id
  1783. areaName: '', //库区名称
  1784. warehouseId: '', //仓库id
  1785. warehouseName: '', //仓库名称
  1786. measurementUnit: '',
  1787. bizStatus: 1,
  1788. contentImage: []
  1789. }
  1790. }
  1791. let warehouseLedgerDetails = [detailObj]
  1792. this.productList.push(obj)
  1793. this.$set(this.productList[this.productList.length - 1], 'warehouseLedgerDetails',
  1794. warehouseLedgerDetails)
  1795. this.$set(this.productList[this.productList.length - 1], 'selfWarehouseLedgerDetails', uni.$u
  1796. .deepClone(warehouseLedgerDetails))
  1797. this.handleBatchSetting(obj, this.productList.length - 1, true)
  1798. },
  1799. calcSum(a, b, c, row) {
  1800. if ((Number.isNaN(+a) && a !== '') || (Number.isNaN(+b) && b !== '') || (Number.isNaN(+c) && c !== '')) {
  1801. return ''
  1802. }
  1803. return a * b * c + {
  1804. yuan: '元',
  1805. wanyuan: '万元'
  1806. } [row.univalenceUnit]
  1807. },
  1808. handleBatchSetting(item, index, isScan = false) {
  1809. this.settingIndex = index
  1810. uni.setStorageSync('inputData', item)
  1811. uni.setStorageSync('productList', this.productList || [])
  1812. uni.navigateTo({
  1813. url: '/pages/warehouse/enterHouse/batchNumEdit?bizType=' + this.formData.bizType +
  1814. '&assetType=' + this.formData.assetType + '&index=' + index + '&isScan=' + isScan
  1815. })
  1816. },
  1817. chooseFile(file) {
  1818. console.log(file)
  1819. this.$refs.lFile.upload({
  1820. //替换为你的上传接口地址
  1821. url: this.apiUrl + '/data/doc/add',
  1822. // 服务端接收附件的key
  1823. name: 'file',
  1824. //根据你接口需求自定义 (优先不传content-type,安卓端无法收到参数再传)
  1825. header: {
  1826. Authorization: 'bearer eyJhbGciO',
  1827. uid: '27682',
  1828. client: 'app'
  1829. }
  1830. // 限制选择附件的大小上限,默认10M
  1831. // maxSize: 20,
  1832. // 若需要在body单独添加附件名或附件大小如下方式传入组件:
  1833. // addName: '后端要的附件名称字段key,此处请勿写name的同值如(file),会覆盖name',
  1834. // addSize: '后端要的附件大小字段key'
  1835. // body参数直接写key,value,如:
  1836. // date: '2020-1-1',
  1837. // key2: 'value2',
  1838. })
  1839. },
  1840. changeType(e) {
  1841. this.formData.bizType = e
  1842. },
  1843. // 抬头下拉信息保存
  1844. handlePicker(e, list, idKey, nameKey) {
  1845. console.log('e?.detail--------------', e)
  1846. if (idKey) {
  1847. this.formData[idKey] = list[e?.detail.value]?.value
  1848. }
  1849. if (nameKey) {
  1850. this.formData[nameKey] = list[e?.detail.value]?.text
  1851. }
  1852. this.$nextTick(() => {
  1853. if (idKey === 'assetType' || idKey === 'bizType') {
  1854. this.$refs.formRef.validateField(idKey)
  1855. }
  1856. console.log('this.formData.bizType---', this.formData.bizType)
  1857. })
  1858. },
  1859. // 抬头下拉信息保存
  1860. handleDictPicker(e, list, idKey, nameKey) {
  1861. if (idKey) {
  1862. this.formData[idKey] = list[e?.detail.value]?.dictCode
  1863. }
  1864. if (nameKey) {
  1865. this.formData[nameKey] = list[e?.detail.value]?.dictValue
  1866. }
  1867. this.$nextTick(() => {
  1868. if (idKey === 'assetType' || idKey === 'bizType') {
  1869. this.$refs.formRef.validateField(idKey)
  1870. }
  1871. })
  1872. },
  1873. // 明细下拉信息保存
  1874. handleListPicker(e, list, item, idKey, nameKey) {
  1875. if (idKey) {
  1876. item[idKey] = list[e.detail.value].id
  1877. }
  1878. if (nameKey) {
  1879. item[nameKey] = list[e.detail.value].name
  1880. }
  1881. },
  1882. //获取仓库信息
  1883. handleWarehouseChoose(item) {
  1884. this.$refs.warehouseChooseRef.openDefault(item, res => {
  1885. Object.assign(item, res)
  1886. })
  1887. },
  1888. //状态
  1889. getstatus(e) {
  1890. this.formData.houseType = this.statusList[e.detail.value].name
  1891. },
  1892. //上传附件
  1893. getUpFlie(res) {
  1894. console.log(res)
  1895. let arr = []
  1896. res.forEach(item => {
  1897. let obj = {
  1898. accessUrl: item.accessUrl,
  1899. docId: item.docId,
  1900. name: item.name,
  1901. size: item.size,
  1902. url: item.url,
  1903. type: 1
  1904. }
  1905. // obj.type.id = item.type.id;
  1906. // obj.type.value = item.type.name;
  1907. arr.push(obj)
  1908. })
  1909. this.formData.attaments = arr
  1910. },
  1911. //选择入库类别跳转
  1912. selectType() {
  1913. if (!this.formData.extInfo.assetType) {
  1914. uni.showToast({
  1915. title: '请选择物品类型',
  1916. icon: 'none'
  1917. })
  1918. return
  1919. }
  1920. if (!this.formData.bizType) {
  1921. uni.showToast({
  1922. title: '请选择入库场景',
  1923. icon: 'none'
  1924. })
  1925. return
  1926. }
  1927. uni.navigateTo({
  1928. url: '/pages/warehouse/enterHouse/selectEnterType?assetType=' + this.formData.extInfo.assetType
  1929. })
  1930. },
  1931. //删除
  1932. getDelete(index) {
  1933. uni.showModal({
  1934. title: '提示',
  1935. content: '是否删除当前物品',
  1936. success: res => {
  1937. if (res.confirm) {
  1938. this.productList.splice(index, 1)
  1939. }
  1940. }
  1941. })
  1942. },
  1943. deletePacking(index, idx) {
  1944. uni.showModal({
  1945. title: '提示',
  1946. content: '是否删除当前包装',
  1947. success: res => {
  1948. if (res.confirm) {
  1949. this.productList[index].outInDetailRecordRequestList.splice(idx, 1)
  1950. this.productList[index].packingQuantity = this.productList[index].packingQuantity -
  1951. 1
  1952. }
  1953. }
  1954. })
  1955. },
  1956. // 入库操作
  1957. // listEdit(row) {
  1958. // this.$set(row, 'isSave', false)
  1959. // },
  1960. // listSave(row, index) {
  1961. // const fileds = [`productList.${index}.cargoSpaceCode`, `productList.${index}.batchNum`]
  1962. // if (this.formData.bizType != 5) {
  1963. // fileds.push(...[`productList.${index}.outInNum`, `productList.${index}.measurementUnit`])
  1964. // } else if (this.productList.some(i => !i.selfWarehouseLedgerDetails?.length)) {
  1965. // uni.showToast({
  1966. // title: '请选择资产编号!',
  1967. // icon: 'none'
  1968. // })
  1969. // return
  1970. // }
  1971. // Promise.all(
  1972. // fileds.map(
  1973. // item =>
  1974. // new Promise(async (resolve, rej) => {
  1975. // this.$refs.lisrFormRef.validateField(item, err => {
  1976. // if (err?.length) {
  1977. // rej(err)
  1978. // } else {
  1979. // resolve()
  1980. // }
  1981. // })
  1982. // })
  1983. // )
  1984. // )
  1985. // .then(res => {
  1986. // this.$set(row, 'isSave', true)
  1987. // if (this.formData.bizType != 5) {
  1988. // this.createMaterialCode(row)
  1989. // } else {
  1990. // // 退还
  1991. // this.createMaterialCodeReturn(row)
  1992. // }
  1993. // })
  1994. // .catch(err => {
  1995. // uni.showToast({
  1996. // icon: 'error',
  1997. // title: '请填入必填项!'
  1998. // })
  1999. // })
  2000. // },
  2001. //入库明细删除
  2002. listDel(row, index) {
  2003. this.productList.splice(index, 1)
  2004. this.deletePackingAndMaterial(row);
  2005. },
  2006. // 入库明细生成条码信息
  2007. async createMaterialCode(row) {
  2008. return
  2009. // 添加相同物品重新更新明细 原料编码
  2010. const list = this.productList.filter(i => i.assetCode === row.assetCode && i.batchNum === row
  2011. .batchNum && i.isSave)
  2012. const num = list.reduce((num, pre) => {
  2013. num += row.isUnpack ? pre.outInNum * pre.measurementUnit : pre.outInNum
  2014. return num
  2015. }, 0)
  2016. const res = await postJ(this.apiUrl + '/outInWarehouse/getAssetNum', {
  2017. batchNum: row.batchNum,
  2018. assetCode: row.assetCode,
  2019. num
  2020. })
  2021. if (res?.success) {
  2022. list.forEach(item => {
  2023. if (item.warehouseLedgerDetails?.length) {
  2024. item.warehouseLedgerDetails.forEach(i => {
  2025. i.onlyCode = res.data.shift().onlyCode
  2026. })
  2027. } else {
  2028. this.$set(
  2029. item,
  2030. 'warehouseLedgerDetails',
  2031. Array.from(new Array(item.isUnpack ? item.outInNum * item.measurementUnit :
  2032. +item.outInNum), (val, idx) => {
  2033. return {
  2034. ...item,
  2035. onlyCode: res.data.shift().onlyCode,
  2036. bizStatus: 1,
  2037. contentImage: []
  2038. }
  2039. })
  2040. )
  2041. }
  2042. })
  2043. }
  2044. // 添加相同物品,重复批次号 重新更新明细 包装编码
  2045. const batchList = this.productList.filter(i => i.batchNum === row.batchNum && i.isSave)
  2046. if (batchList.length) {
  2047. const num = batchList.reduce((num, pre) => {
  2048. num += +pre.outInNum
  2049. return num
  2050. }, 0)
  2051. const res1 = await postJ(this.apiUrl + '/outInWarehouse/getAssetNum', {
  2052. batchNum: row.batchNum,
  2053. num
  2054. })
  2055. if (res1?.success) {
  2056. batchList.forEach(item => {
  2057. let num = res1.data.shift()?.num
  2058. let measurementUnit = item.measurementUnit
  2059. if (item.warehouseLedgerDetails?.length) {
  2060. item.warehouseLedgerDetails.forEach((i, index) => {
  2061. this.$set(i, 'num', num)
  2062. if (!item.isUnpack) {
  2063. if (index < item.warehouseLedgerDetails.length - 1) {
  2064. num = res1.data.shift()?.num
  2065. }
  2066. } else {
  2067. // 拆包的包装编码一致
  2068. measurementUnit--
  2069. if (measurementUnit === 0 && index < item
  2070. .warehouseLedgerDetails.length - 1) {
  2071. measurementUnit = item.measurementUnit
  2072. num = res1.data.shift()?.num
  2073. }
  2074. }
  2075. })
  2076. }
  2077. })
  2078. }
  2079. }
  2080. },
  2081. // 入库明细生成条码信息 退还
  2082. async createMaterialCodeReturn(row) {
  2083. return
  2084. // 添加相同物品重新更新明细 原料编码
  2085. const list = this.productList.filter(i => i.batchNum === row.batchNum && i.isSave)
  2086. // 退还
  2087. const res = await postJ(this.apiUrl + '/outInWarehouse/getAssetNum', {
  2088. batchNum: row.batchNum,
  2089. num: list.reduce((num, pre) => {
  2090. num += pre.selfWarehouseLedgerDetails.length
  2091. return num
  2092. }, 0)
  2093. })
  2094. if (res?.success) {
  2095. list.forEach(item => {
  2096. const num = res.data.shift().num
  2097. if (item.warehouseLedgerDetails?.length) {
  2098. item.warehouseLedgerDetails.forEach(i => {
  2099. i.num = num
  2100. if (!item.isUnpack) {
  2101. // 拆包的包装编码一致
  2102. num = res.data.shift()?.num
  2103. }
  2104. })
  2105. } else {
  2106. this.$set(
  2107. item,
  2108. 'warehouseLedgerDetails',
  2109. item.selfWarehouseLedgerDetails.map((val, idx) => {
  2110. let obj = {
  2111. ...val,
  2112. bizStatus: 1,
  2113. batchNum: item.batchNum,
  2114. cargoSpaceCode: item.cargoSpaceCode, //货位编码
  2115. cargoSpaceId: item.cargoSpaceId, //货位id
  2116. shelfId: item.shelfId, //货架id
  2117. shelfCode: item.shelfCode, //货架名称
  2118. areaId: item.areaId, //库区id
  2119. areaName: item.areaName, //库区名称
  2120. warehouseId: item.warehouseId, //仓库id
  2121. warehouseName: item.warehouseName, //仓库名称
  2122. num
  2123. }
  2124. if (!item.isUnpack) {
  2125. // 拆包的包装编码一致
  2126. num = res.data.shift()?.num
  2127. }
  2128. return obj
  2129. })
  2130. )
  2131. }
  2132. })
  2133. }
  2134. },
  2135. //确定提交
  2136. getsure() {
  2137. return
  2138. this.$refs.formRef.validate().then(res => {
  2139. if (!this.productList?.length) {
  2140. uni.showToast({
  2141. icon: 'error',
  2142. title: '请添加明细!'
  2143. })
  2144. return
  2145. } else if (this.productList.some(item => !item.warehouseLedgerDetails?.length)) {
  2146. uni.showToast({
  2147. icon: 'error',
  2148. title: '请完善明细信息!'
  2149. })
  2150. return
  2151. }
  2152. const params = {
  2153. outInWarehouse: {
  2154. ...this.formData,
  2155. bizStatus: 1
  2156. },
  2157. warehouseLedgerInfos: this.productList
  2158. }
  2159. postJ(this.apiUrl + '/outInWarehouse/add', params).then(res => {
  2160. if (res?.success) {
  2161. uni.showToast({
  2162. icon: 'success',
  2163. title: '保存成功'
  2164. })
  2165. setTimeout(() => {
  2166. uni.navigateBack({
  2167. delta: 1
  2168. })
  2169. }, 1500)
  2170. }
  2171. })
  2172. })
  2173. },
  2174. // 部门确认
  2175. deptConfirm(data, name) {
  2176. this.formData.deptName = name
  2177. this.formData.deptCode = data[0]
  2178. },
  2179. // 部门确认
  2180. verifyDeptConfirm(data, name) {
  2181. this.formData.verifyDeptCode = data[0]
  2182. this.formData.verifyDeptName = name
  2183. this.formData.verifyId = ''
  2184. this.formData.verifyName = ''
  2185. this.getUser(data[0])
  2186. },
  2187. // 获取部门
  2188. getDept() {
  2189. return
  2190. get(this.apiUrl + '/main/org/dept/effectiveTree').then(res => {
  2191. if (res?.success) {
  2192. this.deptList = res.data
  2193. }
  2194. })
  2195. },
  2196. // 获取供应商
  2197. getSupplier() {
  2198. // post(this.apiUrl + `/main/supplier/list?page=1&size=999`, {
  2199. // page: 1,
  2200. // size: 999
  2201. // }).then(res => {
  2202. // if (res?.success) {
  2203. // this.supplierList = res.data.items
  2204. // }
  2205. // })
  2206. },
  2207. // 获取人员
  2208. getUser(deptCode) {
  2209. // post(this.apiUrl + '/main/user/list', {
  2210. // deptCode,
  2211. // page: 1,
  2212. // size: 9999
  2213. // }).then(res => {
  2214. // if (res?.success) {
  2215. // this.userList = res.data.items.map(item => {
  2216. // item.name = item.trueName
  2217. // item.id = item.userId
  2218. // return item
  2219. // })
  2220. // }
  2221. // })
  2222. },
  2223. }
  2224. }
  2225. </script>
  2226. <style lang="scss" scoped>
  2227. .mainBox {
  2228. padding-bottom: 120rpx;
  2229. }
  2230. /deep/.required-form .u-form-item__body__left__content__label::before {
  2231. content: '*';
  2232. color: red;
  2233. }
  2234. .required-form-text {
  2235. /deep/ .u-form-item__body__right {
  2236. overflow: hidden;
  2237. // background-color: red;
  2238. .u-form-item__body__right__content {
  2239. width: 100%;
  2240. display: inline-block !important;
  2241. }
  2242. }
  2243. }
  2244. // ::v-deep .listCont .u-input {
  2245. // height: 60rpx !important;
  2246. // }
  2247. ::v-deep .dd .u-form-item__body__right {
  2248. border: 1px solid #e5e5e5 !important;
  2249. border-radius: 4px;
  2250. line-height: 60rpx;
  2251. }
  2252. .ellipsis {
  2253. max-width: 100%;
  2254. overflow: hidden;
  2255. white-space: nowrap;
  2256. text-overflow: ellipsis;
  2257. }
  2258. .picList {
  2259. display: flex;
  2260. align-items: center;
  2261. justify-items: flex-start;
  2262. flex-wrap: wrap;
  2263. }
  2264. /deep/.baseForm {
  2265. .u-form-item__body {
  2266. padding: 4px !important;
  2267. }
  2268. .assetType_box {
  2269. padding: 12rpx 18rpx;
  2270. width: 100%;
  2271. overflow: hidden;
  2272. white-space: nowrap;
  2273. text-overflow: ellipsis;
  2274. font-size: 30rpx;
  2275. }
  2276. }
  2277. /deep/ .picList .u-image {
  2278. margin-right: 10rpx;
  2279. margin-bottom: 10rpx;
  2280. }
  2281. /deep/.cLine .u-line:nth-child(1) {
  2282. border-bottom: none !important;
  2283. }
  2284. .detail-box {
  2285. position: relative;
  2286. align-items: center;
  2287. /deep/uni-button {
  2288. margin: 0 !important;
  2289. width: 180rpx;
  2290. }
  2291. .selectEnterType {
  2292. margin-left: 10rpx !important;
  2293. }
  2294. }
  2295. .footBox {
  2296. position: fixed;
  2297. left: 0px;
  2298. bottom: 0px;
  2299. height: 100rpx;
  2300. width: 100%;
  2301. display: flex;
  2302. align-items: center;
  2303. justify-content: space-between;
  2304. view {
  2305. width: 100%;
  2306. height: 100%;
  2307. text-align: center;
  2308. color: #fff;
  2309. display: flex;
  2310. align-items: center;
  2311. justify-content: center;
  2312. }
  2313. .reg {
  2314. background: $u-success-dark;
  2315. }
  2316. .add {
  2317. background: $uni-color-primary;
  2318. }
  2319. .uni-icons {
  2320. margin-right: 8rpx !important;
  2321. }
  2322. }
  2323. .listBox {
  2324. padding: 20rpx 10rpx;
  2325. border-bottom: 1px #f2f2f2 solid;
  2326. position: relative;
  2327. &.code {
  2328. .label {
  2329. width: 120rpx !important;
  2330. }
  2331. }
  2332. .listTit {
  2333. width: 100%;
  2334. align-items: center;
  2335. /deep/uni-button {
  2336. margin-right: 20rpx;
  2337. width: 100rpx;
  2338. &.assets {
  2339. width: 180rpx;
  2340. }
  2341. }
  2342. .name {
  2343. width: 50%;
  2344. margin-left: 10px;
  2345. overflow: hidden;
  2346. white-space: nowrap;
  2347. -o-text-overflow: ellipsis;
  2348. text-overflow: ellipsis;
  2349. font-size: 28rpx;
  2350. font-weight: bold;
  2351. }
  2352. .btn {
  2353. display: flex;
  2354. justify-content: flex-end;
  2355. }
  2356. .weight {
  2357. width: 30%;
  2358. font-size: 24rpx;
  2359. margin-left: auto;
  2360. margin-right: 60rpx;
  2361. position: relative;
  2362. display: flex;
  2363. input {
  2364. margin-right: 10rpx;
  2365. border: 1px solid black;
  2366. width: 40%;
  2367. height: 20rpx;
  2368. }
  2369. }
  2370. .weight::after {
  2371. position: absolute;
  2372. right: -30rpx;
  2373. top: 50%;
  2374. content: '';
  2375. background: #eee;
  2376. width: 1px;
  2377. height: 28rpx;
  2378. margin-top: -14rpx;
  2379. }
  2380. }
  2381. .z_list {
  2382. height: 100% !important;
  2383. max-height: 500rpx;
  2384. .material {
  2385. margin-top: 10rpx;
  2386. .left {
  2387. width: 40rpx;
  2388. }
  2389. .zdy_check {
  2390. width: 30rpx;
  2391. height: 30rpx;
  2392. border: 2rpx solid #c8c9cc;
  2393. border-radius: 4rpx;
  2394. }
  2395. .check_active {
  2396. background: $theme-color;
  2397. border: 2rpx solid $theme-color;
  2398. /deep/ .u-icon__icon {
  2399. color: #fff !important;
  2400. }
  2401. }
  2402. .content_table {
  2403. width: 670rpx;
  2404. border: 2rpx solid $border-color;
  2405. .item {
  2406. display: flex;
  2407. border-bottom: 2rpx solid $border-color;
  2408. .lable {
  2409. width: 200rpx;
  2410. text-align: center;
  2411. background-color: #f7f9fa;
  2412. font-size: 26rpx;
  2413. border-right: 2rpx solid $border-color;
  2414. flex-shrink: 0;
  2415. }
  2416. .ww80 {
  2417. width: 80rpx;
  2418. }
  2419. .content {
  2420. width: 500rpx;
  2421. min-height: 64rpx;
  2422. font-size: 28rpx;
  2423. line-height: 28rpx;
  2424. font-style: normal;
  2425. font-weight: 400;
  2426. padding: 18rpx 8rpx;
  2427. box-sizing: border-box;
  2428. word-wrap: break-word;
  2429. flex-grow: 1 !important;
  2430. }
  2431. .input_box {
  2432. padding: 0 !important;
  2433. }
  2434. .content_num {
  2435. display: flex;
  2436. align-items: center;
  2437. padding: 0 4rpx;
  2438. /deep/ .uni-input-input {
  2439. width: 200rpx;
  2440. border: 2rpx solid #f0f8f2;
  2441. background: #f0f8f2;
  2442. color: $theme-color;
  2443. }
  2444. .unit {
  2445. padding: 0 4rpx;
  2446. font-size: 24rpx;
  2447. color: #404446;
  2448. }
  2449. }
  2450. .ww400 {
  2451. /deep/ .uni-input-input {
  2452. width: 400rpx;
  2453. }
  2454. }
  2455. .pd4 {
  2456. padding: 4rpx 8rpx;
  2457. }
  2458. &:last-child {
  2459. border-bottom: none;
  2460. }
  2461. }
  2462. .ww55 {
  2463. width: 55%;
  2464. }
  2465. .ww45 {
  2466. width: 45%;
  2467. }
  2468. .ww50 {
  2469. width: 50%;
  2470. }
  2471. .ww30 {
  2472. width: 30%;
  2473. }
  2474. .ww70 {
  2475. width: 70%;
  2476. }
  2477. .ww80 {
  2478. width: 80%;
  2479. }
  2480. .ww20 {
  2481. width: 20%;
  2482. }
  2483. .check {
  2484. width: 30rpx;
  2485. height: 30rpx;
  2486. }
  2487. .tag_box {
  2488. padding: 2rpx 10rpx;
  2489. margin-right: 12rpx;
  2490. background: #e6a23c;
  2491. font-size: 22rpx;
  2492. color: #fff;
  2493. border-radius: 4rpx;
  2494. }
  2495. }
  2496. }
  2497. }
  2498. .more {
  2499. position: absolute;
  2500. bottom: 26rpx;
  2501. right: 30rpx;
  2502. font-size: 28rpx;
  2503. color: #666;
  2504. }
  2505. }
  2506. .listCont {
  2507. display: flex;
  2508. align-items: center;
  2509. flex-wrap: wrap;
  2510. margin-top: 20rpx;
  2511. margin-left: 10rpx;
  2512. &.save {
  2513. .u-input {
  2514. border: none;
  2515. }
  2516. }
  2517. .u-input {
  2518. border: 1px solid rgb(229, 229, 229);
  2519. height: 60rpx !important;
  2520. padding: 0 0 0 9px !important;
  2521. }
  2522. .item {
  2523. width: 100%;
  2524. font-size: 28rpx;
  2525. margin-bottom: 10rpx;
  2526. margin-right: 3%;
  2527. /deep/.u-form-item__body {
  2528. padding: 0 !important;
  2529. }
  2530. /deep/.u-input__content__field-wrapper__field,
  2531. /deep/.u-form-item {
  2532. font-size: 28rpx !important;
  2533. }
  2534. text.label {
  2535. width: 120rpx;
  2536. display: inline-block;
  2537. text-align: right;
  2538. margin-right: 20rpx;
  2539. margin-bottom: 20rpx;
  2540. }
  2541. /deep/.uni-date__x-input {
  2542. height: 40rpx;
  2543. font-size: 28rpx;
  2544. }
  2545. /deep/.uni-date {
  2546. width: 48%;
  2547. display: inline-block;
  2548. .uni-icons {
  2549. display: none !important;
  2550. }
  2551. .uni-date-x {
  2552. padding: 0 !important;
  2553. }
  2554. }
  2555. }
  2556. .item text {
  2557. color: #666;
  2558. }
  2559. }
  2560. .selectTime {
  2561. display: flex;
  2562. justify-content: flex-end;
  2563. align-items: center;
  2564. margin-bottom: 10rpx;
  2565. .title {
  2566. flex: 1;
  2567. font-size: 30rpx;
  2568. }
  2569. .timeBox {
  2570. display: flex;
  2571. width: 500rpx;
  2572. .firstBtn {
  2573. margin-right: 10rpx;
  2574. }
  2575. }
  2576. }
  2577. .listBox:last-child {
  2578. border: none !important;
  2579. }
  2580. .textBox {
  2581. border: 1px #f2f2f2 solid;
  2582. height: 160px;
  2583. display: block;
  2584. width: auto !important;
  2585. }
  2586. .saveBtn {
  2587. width: 50%;
  2588. margin: 40rpx auto;
  2589. }
  2590. .top-css {
  2591. border-bottom: 1px solid rgb(207, 204, 204);
  2592. }
  2593. .flex_between {
  2594. display: flex;
  2595. justify-content: space-between;
  2596. }
  2597. </style>