addStock.vue 83 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732
  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. if (packingBoolen) {
  1323. filterArr = row.packingSpecificationOption.filter(item =>
  1324. item.conversionUnit == row.unit && item.packageUnit != item.conversionUnit
  1325. )
  1326. if (filterArr.length) {
  1327. num = Math.ceil(row.quantity / filterArr[0].packageCell)
  1328. }
  1329. } else {
  1330. if (row.isUnpack || measureBoolen) {
  1331. let splitIndex = row.packingSpecificationOption.findIndex(item =>
  1332. item.conversionUnit == row.unit && item.packageUnit != item.conversionUnit)
  1333. for (; splitIndex > 1; splitIndex--) {
  1334. num = num * row.packingSpecificationOption[splitIndex].packageCell
  1335. }
  1336. } else {
  1337. num = row.quantity
  1338. }
  1339. }
  1340. // 不拆包:按 packingCodeList 生成单个包装
  1341. if (!row.isUnpack) {
  1342. let unit = row.packingSpecificationOption[1]?.conversionUnit || row.unit
  1343. let totalCalc = Number(row.quantity)
  1344. let calcStart = row.packingSpecificationOption.findIndex(ite =>
  1345. row.measureUnit == ite.packageUnit && ite.packageUnit != ite.conversionUnit
  1346. )
  1347. let calcEnd = row.packingSpecificationOption.findIndex(ite =>
  1348. row.unit == ite.conversionUnit
  1349. )
  1350. for (; calcStart < calcEnd; calcEnd--) {
  1351. totalCalc = Math.round(row.packingSpecificationOption[calcEnd].packageCell * totalCalc * 1e4) / 1e4
  1352. }
  1353. let packingQuantity = row.measureQuantity / totalCalc
  1354. let measureQuantity = row.measureQuantity / packingCodeList.length
  1355. let measureUnit = row.measureUnit
  1356. for (let i = 0; i < packingCodeList.length; i++) {
  1357. let item = this.buildPackingItem(row, i, packingCodeList, packingQuantity, unit, measureQuantity, measureUnit, productionDate, purchaseDate, expireDate, packingBoolen, measureBoolen, filterArr)
  1358. row.outInDetailRecordRequestList.push(item)
  1359. }
  1360. } else {
  1361. // 拆包:按 num 生成
  1362. for (let i = 0; i < packingCodeList.length; i++) {
  1363. let measureQuantity = 1
  1364. if (packingBoolen) {
  1365. measureQuantity = Number(row.quantity) > filterArr[0].packageCell * (i + 1)
  1366. ? filterArr[0].packageCell
  1367. : Number(row.quantity) - filterArr[0].packageCell * i
  1368. } else {
  1369. //计量单位等于重量单位并且有总重 计量数量=总重/包装数
  1370. if (row.weightUnit == row.measureUnit && row.weight) {
  1371. measureQuantity =
  1372. Math.trunc((row.weight / packingCodeList.length) * 10000) /
  1373. 10000;
  1374. } else {
  1375. measureQuantity = row.packingSpecificationOption[1].packageCell;
  1376. }
  1377. }
  1378. // let packingUnit = packingBoolen ? filterArr[0].conversionUnit
  1379. // : measureBoolen ? row.packingSpecificationOption[1]?.conversionUnit || row.measureUnit
  1380. // : row.measureUnit
  1381. if (row.isUnpack) {
  1382. row.packingUnit =
  1383. row.packingSpecificationOption[1].conversionUnit;
  1384. }
  1385. let measureUnit = row.isUnpack
  1386. ? measureBoolen
  1387. ? row.packingSpecificationOption[1]
  1388. ? row.packingSpecificationOption[1].packageUnit
  1389. : row.packingSpecificationOption[0].packageUnit
  1390. : row.measureUnit
  1391. : row.measureUnit // 计量单位
  1392. let item = this.buildPackingItem(row, i, packingCodeList, 1, row.packingUnit, measureQuantity, measureUnit, productionDate, purchaseDate, expireDate, packingBoolen, measureBoolen, filterArr)
  1393. row.outInDetailRecordRequestList.push(item)
  1394. }
  1395. }
  1396. },
  1397. // 构建单个包装项
  1398. buildPackingItem(row, i, packingCodeList, packingQuantity, packingUnit, measureQuantity, measureUnit,
  1399. productionDate, purchaseDate, expireDate, packingBoolen, measureBoolen, filterArr) {
  1400. let item = {
  1401. index: row.index + '-' + i,
  1402. warehouseId: row.warehouseId,
  1403. warehouseName: row.warehouseName,
  1404. categoryName: row.categoryName,
  1405. categoryCode: row.categoryCode,
  1406. categoryModel: row.categoryModel,
  1407. specification: row.specification,
  1408. brandNum: row.brandNum,
  1409. parentIndex: row.index,
  1410. batchNo: row.batchNo,
  1411. packageNo: packingCodeList[i]?.onlyCode,
  1412. packingQuantity: packingQuantity,
  1413. packingUnit: packingUnit,
  1414. measureQuantity: measureQuantity,
  1415. measureUnit: measureUnit,
  1416. weight: row.weight / row.packingQuantity,
  1417. packingSpecificationOption: row.packingSpecificationOption,
  1418. weightUnit: row.weightUnit,
  1419. netWeight: row.netWeight,
  1420. barcodes: '',
  1421. clientCode: row.clientCode || '',
  1422. materielDesignation: row.materielDesignation || '',
  1423. engrave: row.engrave || '',
  1424. supplierName: row.supplierName || '',
  1425. supplierCode: row.supplierCode || '',
  1426. modelKey: row.modelKey || '',
  1427. colorKey: row.colorKey || '',
  1428. reelSpecification: row.reelSpecification || '',
  1429. isUnpack: row.isUnpack,
  1430. productionDate: productionDate,
  1431. purchaseDate: purchaseDate,
  1432. expireDate: expireDate,
  1433. result: 1,
  1434. status: 2
  1435. }
  1436. // 重量计算
  1437. let outBoolen = !!this.getDict(item.measureUnit).dictValue
  1438. if (outBoolen) {
  1439. item.weight = item.measureQuantity ? Number(item.measureQuantity) : 0
  1440. } else {
  1441. let inBoolen = !!this.getDict(item.packingSpecificationOption[0]?.packageUnit).dictValue
  1442. let si = item.packingSpecificationOption.findIndex(ite =>
  1443. item.measureUnit == ite.packingUnit && ite.packingUnit != ite.conversionUnit)
  1444. let ei = item.packingSpecificationOption.findIndex(ite =>
  1445. item.packingUnit == ite.conversionUnit)
  1446. let total = item.packingQuantity ? Number(item.packingQuantity) : 0
  1447. for (; si < ei; ei--) {
  1448. total = Math.round(item.packingSpecificationOption[ei].packageCell * total * 1e4) / 1e4
  1449. }
  1450. if (inBoolen) {
  1451. item.weight = total || 0
  1452. } else {
  1453. item.weight = total * item.netWeight || 0
  1454. }
  1455. }
  1456. return item
  1457. },
  1458. async requireDictCode() {
  1459. // 不拆物料层规格列表
  1460. const res = await getByCode('material_layer')
  1461. this.dictCodeList = res.map(item => {
  1462. const arr = Object.entries(item)
  1463. return {
  1464. dictCode: arr[0][0],
  1465. dictValue: arr[0][1]
  1466. }
  1467. })
  1468. },
  1469. getDict(dictCode) {
  1470. // 不拆物料层规格列表
  1471. if (this.dictCodeList.length > 0) {
  1472. return this.dictCodeList.find(item => item.dictCode == dictCode) || {}
  1473. } else {
  1474. return {}
  1475. }
  1476. },
  1477. // 小数处理,最大3位
  1478. format3(str) {
  1479. let value = str;
  1480. value = value.toString().replace(/[^0-9.]/g, '');
  1481. const parts = value.split('.');
  1482. if (parts.length > 2) {
  1483. value = parts[0] + '.' + parts.slice(1).join('');
  1484. }
  1485. if (parts.length === 2) {
  1486. value = parts[0] + '.' + parts[1].slice(0, 3);
  1487. }
  1488. console.log(value);
  1489. return value;
  1490. },
  1491. async computeNum(row, index, isClear) {
  1492. console.log(row)
  1493. console.log(row.quantity)
  1494. console.log(row.unit)
  1495. if (row.quantity) {
  1496. let value = row.quantity.toString().replace(/[^0-9.]/g, '')
  1497. const parts = value.split('.')
  1498. if (parts.length > 2) value = parts[0] + '.' + parts.slice(1).join('')
  1499. if (parts.length === 2) value = parts[0] + '.' + parts[1].slice(0, 3)
  1500. row.quantity = value
  1501. }
  1502. // 根据 unitId 匹配 unit
  1503. if (row.unitId && row.packingSpecificationOption) {
  1504. let data = row.packingSpecificationOption.find(item => item.id == row.unitId)
  1505. if (data) row.unit = data.conversionUnit
  1506. }
  1507. // 清空仓库(数量输入)
  1508. if (isClear) {
  1509. if (row.quantity < 1) {
  1510. this.$set(this.productList[index], 'quantity', 1)
  1511. }
  1512. }
  1513. // 同步 packingQuantity 供 listSave/generateWrappers 使用
  1514. // row.packingQuantity = row.quantity
  1515. // row.packingUnit = row.unit
  1516. if (row.quantity && row.unit) {
  1517. const res = await warehouseDefinitionList({
  1518. inventoryType: row?.categoryLevelPathIdParent,
  1519. factoryId: this.factoryId
  1520. })
  1521. if(res.length == 1) {
  1522. this.$set(this.productList[index], 'warehouseId', res[0].id);
  1523. this.$set(this.productList[index], 'warehouseName', res[0]?.name);
  1524. let table1 = [];
  1525. table1.push({
  1526. measureQuantity: row.measureQuantity,
  1527. packingQuantity: row.quantity,
  1528. warehouseName: res[0]?.name,
  1529. warehouseId: res[0].id
  1530. });
  1531. } else {
  1532. this.$set(this.productList[index], 'warehouseId', '');
  1533. this.$set(this.productList[index], 'warehouseName', '');
  1534. }
  1535. // 保存过滤后的仓库列表到产品行,供 showWarehousePicker 使用
  1536. this.$set(this.productList[index], 'filteredWarehouseList', res || [])
  1537. let data = row.packingSpecificationOption.find(item => item.id == row.unitId)
  1538. let endIndex = row.packingSpecificationOption.findIndex(ite => data && data.id == ite.id)
  1539. let total = Number(row.quantity)
  1540. for (; 0 < endIndex; endIndex--) {
  1541. total = row.packingSpecificationOption[endIndex].packageCell * total
  1542. }
  1543. row.measureQuantity = total
  1544. //计量单位不是数量时,配置了单重的重量计算
  1545. // row.measureType != 1 &&
  1546. let weight = 0;
  1547. if (row.measureUnit == row.weightUnit) {
  1548. weight = row.measureQuantity;
  1549. //包装单位与重量单位相等时,单重重量为0
  1550. if (row.unit == row.weightUnit) {
  1551. row.singleWeight = 0;
  1552. } else {
  1553. row.singleWeight =
  1554. Math.trunc((row.measureQuantity / row.quantity) * 10000) /
  1555. 10000;
  1556. }
  1557. } else if (row.singleWeight) {
  1558. weight = row.measureQuantity * Number(row.singleWeight);
  1559. }
  1560. this.$set(this.productList[index], 'weight', weight);
  1561. this.$set(
  1562. this.productList[index],
  1563. 'packingQuantity',
  1564. this.setPNum(row)
  1565. );
  1566. // 判断包装单位和计量单位是否为不拆物料层规格
  1567. // console.log(this.getDict(row.unit))
  1568. // let packingBoolen = !!this.getDict(row.unit).dictValue
  1569. // let measureBoolen = !!this.getDict(row.measureUnit).dictValue
  1570. // if (packingBoolen || measureBoolen) {
  1571. // row.weight = total
  1572. // } else {
  1573. // row.weight = total * row.netWeight
  1574. // }
  1575. }
  1576. },
  1577. setPNum(row) {
  1578. let pNum = 0;
  1579. if (row.unitId) {
  1580. let splitIndex = row.packingSpecificationOption.findIndex(
  1581. (item) => item.id == row.unitId
  1582. );
  1583. if (splitIndex == 0) {
  1584. pNum = Math.ceil(
  1585. row.measureQuantity /
  1586. row.packingSpecificationOption[1]?.packageCell
  1587. );
  1588. }
  1589. if (splitIndex == 1) {
  1590. pNum = row.quantity;
  1591. }
  1592. for (; splitIndex > 1; splitIndex--) {
  1593. pNum = Math.ceil(
  1594. row.quantity *
  1595. row.packingSpecificationOption[splitIndex].packageCell
  1596. );
  1597. }
  1598. } else {
  1599. pNum = Math.ceil(
  1600. row.measureQuantity / row.packingSpecificationOption[1]?.packageCell
  1601. );
  1602. }
  1603. return pNum;
  1604. },
  1605. //获取仓库(按产品类型和工厂过滤)
  1606. async getFilteredWarehouseList(row) {
  1607. const res = await warehouseDefinitionList({
  1608. inventoryType: row?.categoryLevelPathIdParent,
  1609. factoryId: this.factoryId
  1610. })
  1611. this.warehouseListOption = [res || []]
  1612. },
  1613. showWarehousePicker(index) {
  1614. this.currentProductIndex = index
  1615. const row = this.productList[index]
  1616. // 按产品类型过滤仓库列表
  1617. this.getFilteredWarehouseList(row).then(() => {
  1618. this.warehouseShow = true
  1619. })
  1620. },
  1621. showPackingUnitPicker(data, index) {
  1622. this.currentProductIndex = index
  1623. this.currentPackingSpecificationOption = [data.packingSpecificationOption]
  1624. this.packingUnitsShow = true
  1625. },
  1626. showSupplierPicker(data, index) {
  1627. this.currentProductIndex = index
  1628. this.currentSupplierListOption = [data.supplierListOptions]
  1629. this.suppliersShow = true
  1630. },
  1631. selectPackingUnitInfo(e) {
  1632. const selected = e.value[0]
  1633. const row = this.productList[this.currentProductIndex]
  1634. row.unitId = selected?.id || ''
  1635. row.unit = selected?.conversionUnit || ''
  1636. row.packingUnit = selected?.conversionUnit || '' // 兼容旧逻辑
  1637. this.computeNum(row, this.currentProductIndex)
  1638. this.packingUnitsShow = false
  1639. },
  1640. selectSuppliersInfo(e) {
  1641. this.productList[this.currentProductIndex].supplierName = e.value[0]?.name
  1642. this.productList[this.currentProductIndex].supplierId = e.value[0]?.id
  1643. this.suppliersShow = false
  1644. },
  1645. selectWarehouseInfo(e) {
  1646. this.productList[this.currentProductIndex].warehouseName = e.value[0]?.name
  1647. this.productList[this.currentProductIndex].warehouseId = e.value[0]?.id
  1648. this.productList[this.currentProductIndex].warehouseNames = [e.value[0]?.name]
  1649. this.productList[this.currentProductIndex].warehouseIds = [e.value[0]?.id]
  1650. this.warehouseShow = false
  1651. },
  1652. selectTimeTypeInfo(e) {
  1653. this.currentDateType = e.value[0]?.prop
  1654. this.timeTypeShow = false
  1655. },
  1656. sceneStateFilter(bizType) {
  1657. if (bizType) {
  1658. return this.sceneState.filter(item => item.value == bizType)[0].text
  1659. }
  1660. },
  1661. formatter(dataTime) {
  1662. return dayjs(dataTime).format('YYYY-MM-DD HH:mm:ss')
  1663. },
  1664. timeConfirm() {
  1665. this.timeShow = false
  1666. this.$nextTick(() => {
  1667. console.log(this.storageTime)
  1668. console.log(this.formatter(this.storageTime))
  1669. this.formData.storageTime = this.formatter(this.storageTime)
  1670. console.log(this.formData)
  1671. })
  1672. },
  1673. timeCancel() {
  1674. this.timeShow = false
  1675. },
  1676. openPicker() {
  1677. this.$refs.treePicker._show()
  1678. },
  1679. // 获取物品列表
  1680. async getListItems() {
  1681. this.goodsLists = await getTreeByGroup({
  1682. type: 2
  1683. })
  1684. },
  1685. confirm(data, name, allList) {
  1686. console.log('name-------', name)
  1687. this.assetTypeName = name
  1688. this.formData.extInfo.assetType = allList.map(item => item.id)
  1689. },
  1690. handleScan() {
  1691. if (this.formData.bizType !== '' && this.formData.bizType != 5) {
  1692. uni.showModal({
  1693. title: '提示',
  1694. content: '仅退还入库支持扫码,是否清除已选明细并切换至退还入库?',
  1695. success: async res => {
  1696. if (res.confirm) {
  1697. this.productList = []
  1698. this.formData.bizType = 5
  1699. this.getData()
  1700. }
  1701. }
  1702. })
  1703. return
  1704. }
  1705. this.getData()
  1706. },
  1707. // goScan () {
  1708. // uni.navigateTo({
  1709. // url: '/pages/ScanCode/ScanCode'
  1710. // })
  1711. // },
  1712. // 根据条码请求设备数据 @_@
  1713. getData() {
  1714. let par = {
  1715. barType: this.qrContent.split('@_@')[1] || 0,
  1716. qrContent: this.qrContent
  1717. }
  1718. // uni.showLoading({
  1719. // title: '加载中',
  1720. // mask: true
  1721. // })
  1722. // postJ(this.apiUrl + '/scan/getAssetInfo', par)
  1723. // .then(res => {
  1724. // let data = res.data
  1725. // console.log(data, 'qrContent')
  1726. // if (data.assetType === undefined) {
  1727. // uni.showToast({
  1728. // title: '请扫码物品码',
  1729. // icon: 'none'
  1730. // })
  1731. // return
  1732. // } else if (data.source == 2) {
  1733. // uni.showModal({
  1734. // title: '提示',
  1735. // content: '当前物品已在库',
  1736. // success: async res => {}
  1737. // })
  1738. // return
  1739. // } else if (this.warehousingName && this.formData.assetType != data.assetType) {
  1740. // uni.showToast({
  1741. // title: `当前物品不属于${this.warehousingName}分类`,
  1742. // icon: 'none'
  1743. // })
  1744. // return
  1745. // }
  1746. // this.setScanMaterial(data)
  1747. // })
  1748. // .finally(() => {
  1749. // uni.hideLoading()
  1750. // })
  1751. },
  1752. async setScanMaterial(data) {
  1753. this.formData.assetType = data.assetType
  1754. this.formData.bizType = 5
  1755. const curMap = {
  1756. assetId: 'id',
  1757. assetCode: 'informationCode', //编码
  1758. assetName: 'informationName', //名称
  1759. materialId: 'id',
  1760. materialName: 'informationName',
  1761. batchNo: '', //批次号
  1762. unit: 'measuringUnit', //单位
  1763. minPackUnit: 'packingUnit' //最小包装单位
  1764. }
  1765. let obj = {}
  1766. for (const key in curMap) {
  1767. obj[key] = (curMap[key] && data.information[curMap[key]]) || ''
  1768. }
  1769. let detailObj = uni.$u.deepClone(obj)
  1770. detailObj.onlyCode = data.assetCode
  1771. obj = {
  1772. ...data.information,
  1773. ...obj,
  1774. ...{
  1775. cargoSpaceCode: '', //货位编码
  1776. cargoSpaceId: '', //货位id
  1777. shelfId: '', //货架id
  1778. shelfCode: '', //货架名称
  1779. areaId: '', //库区id
  1780. areaName: '', //库区名称
  1781. warehouseId: '', //仓库id
  1782. warehouseName: '', //仓库名称
  1783. measurementUnit: '',
  1784. bizStatus: 1,
  1785. contentImage: []
  1786. }
  1787. }
  1788. let warehouseLedgerDetails = [detailObj]
  1789. this.productList.push(obj)
  1790. this.$set(this.productList[this.productList.length - 1], 'warehouseLedgerDetails',
  1791. warehouseLedgerDetails)
  1792. this.$set(this.productList[this.productList.length - 1], 'selfWarehouseLedgerDetails', uni.$u
  1793. .deepClone(warehouseLedgerDetails))
  1794. this.handleBatchSetting(obj, this.productList.length - 1, true)
  1795. },
  1796. calcSum(a, b, c, row) {
  1797. if ((Number.isNaN(+a) && a !== '') || (Number.isNaN(+b) && b !== '') || (Number.isNaN(+c) && c !== '')) {
  1798. return ''
  1799. }
  1800. return a * b * c + {
  1801. yuan: '元',
  1802. wanyuan: '万元'
  1803. } [row.univalenceUnit]
  1804. },
  1805. handleBatchSetting(item, index, isScan = false) {
  1806. this.settingIndex = index
  1807. uni.setStorageSync('inputData', item)
  1808. uni.setStorageSync('productList', this.productList || [])
  1809. uni.navigateTo({
  1810. url: '/pages/warehouse/enterHouse/batchNumEdit?bizType=' + this.formData.bizType +
  1811. '&assetType=' + this.formData.assetType + '&index=' + index + '&isScan=' + isScan
  1812. })
  1813. },
  1814. chooseFile(file) {
  1815. console.log(file)
  1816. this.$refs.lFile.upload({
  1817. //替换为你的上传接口地址
  1818. url: this.apiUrl + '/data/doc/add',
  1819. // 服务端接收附件的key
  1820. name: 'file',
  1821. //根据你接口需求自定义 (优先不传content-type,安卓端无法收到参数再传)
  1822. header: {
  1823. Authorization: 'bearer eyJhbGciO',
  1824. uid: '27682',
  1825. client: 'app'
  1826. }
  1827. // 限制选择附件的大小上限,默认10M
  1828. // maxSize: 20,
  1829. // 若需要在body单独添加附件名或附件大小如下方式传入组件:
  1830. // addName: '后端要的附件名称字段key,此处请勿写name的同值如(file),会覆盖name',
  1831. // addSize: '后端要的附件大小字段key'
  1832. // body参数直接写key,value,如:
  1833. // date: '2020-1-1',
  1834. // key2: 'value2',
  1835. })
  1836. },
  1837. changeType(e) {
  1838. this.formData.bizType = e
  1839. },
  1840. // 抬头下拉信息保存
  1841. handlePicker(e, list, idKey, nameKey) {
  1842. console.log('e?.detail--------------', e)
  1843. if (idKey) {
  1844. this.formData[idKey] = list[e?.detail.value]?.value
  1845. }
  1846. if (nameKey) {
  1847. this.formData[nameKey] = list[e?.detail.value]?.text
  1848. }
  1849. this.$nextTick(() => {
  1850. if (idKey === 'assetType' || idKey === 'bizType') {
  1851. this.$refs.formRef.validateField(idKey)
  1852. }
  1853. console.log('this.formData.bizType---', this.formData.bizType)
  1854. })
  1855. },
  1856. // 抬头下拉信息保存
  1857. handleDictPicker(e, list, idKey, nameKey) {
  1858. if (idKey) {
  1859. this.formData[idKey] = list[e?.detail.value]?.dictCode
  1860. }
  1861. if (nameKey) {
  1862. this.formData[nameKey] = list[e?.detail.value]?.dictValue
  1863. }
  1864. this.$nextTick(() => {
  1865. if (idKey === 'assetType' || idKey === 'bizType') {
  1866. this.$refs.formRef.validateField(idKey)
  1867. }
  1868. })
  1869. },
  1870. // 明细下拉信息保存
  1871. handleListPicker(e, list, item, idKey, nameKey) {
  1872. if (idKey) {
  1873. item[idKey] = list[e.detail.value].id
  1874. }
  1875. if (nameKey) {
  1876. item[nameKey] = list[e.detail.value].name
  1877. }
  1878. },
  1879. //获取仓库信息
  1880. handleWarehouseChoose(item) {
  1881. this.$refs.warehouseChooseRef.openDefault(item, res => {
  1882. Object.assign(item, res)
  1883. })
  1884. },
  1885. //状态
  1886. getstatus(e) {
  1887. this.formData.houseType = this.statusList[e.detail.value].name
  1888. },
  1889. //上传附件
  1890. getUpFlie(res) {
  1891. console.log(res)
  1892. let arr = []
  1893. res.forEach(item => {
  1894. let obj = {
  1895. accessUrl: item.accessUrl,
  1896. docId: item.docId,
  1897. name: item.name,
  1898. size: item.size,
  1899. url: item.url,
  1900. type: 1
  1901. }
  1902. // obj.type.id = item.type.id;
  1903. // obj.type.value = item.type.name;
  1904. arr.push(obj)
  1905. })
  1906. this.formData.attaments = arr
  1907. },
  1908. //选择入库类别跳转
  1909. selectType() {
  1910. if (!this.formData.extInfo.assetType) {
  1911. uni.showToast({
  1912. title: '请选择物品类型',
  1913. icon: 'none'
  1914. })
  1915. return
  1916. }
  1917. if (!this.formData.bizType) {
  1918. uni.showToast({
  1919. title: '请选择入库场景',
  1920. icon: 'none'
  1921. })
  1922. return
  1923. }
  1924. uni.navigateTo({
  1925. url: '/pages/warehouse/enterHouse/selectEnterType?assetType=' + this.formData.extInfo.assetType
  1926. })
  1927. },
  1928. //删除
  1929. getDelete(index) {
  1930. uni.showModal({
  1931. title: '提示',
  1932. content: '是否删除当前物品',
  1933. success: res => {
  1934. if (res.confirm) {
  1935. this.productList.splice(index, 1)
  1936. }
  1937. }
  1938. })
  1939. },
  1940. deletePacking(index, idx) {
  1941. uni.showModal({
  1942. title: '提示',
  1943. content: '是否删除当前包装',
  1944. success: res => {
  1945. if (res.confirm) {
  1946. this.productList[index].outInDetailRecordRequestList.splice(idx, 1)
  1947. this.productList[index].packingQuantity = this.productList[index].packingQuantity -
  1948. 1
  1949. }
  1950. }
  1951. })
  1952. },
  1953. // 入库操作
  1954. // listEdit(row) {
  1955. // this.$set(row, 'isSave', false)
  1956. // },
  1957. // listSave(row, index) {
  1958. // const fileds = [`productList.${index}.cargoSpaceCode`, `productList.${index}.batchNum`]
  1959. // if (this.formData.bizType != 5) {
  1960. // fileds.push(...[`productList.${index}.outInNum`, `productList.${index}.measurementUnit`])
  1961. // } else if (this.productList.some(i => !i.selfWarehouseLedgerDetails?.length)) {
  1962. // uni.showToast({
  1963. // title: '请选择资产编号!',
  1964. // icon: 'none'
  1965. // })
  1966. // return
  1967. // }
  1968. // Promise.all(
  1969. // fileds.map(
  1970. // item =>
  1971. // new Promise(async (resolve, rej) => {
  1972. // this.$refs.lisrFormRef.validateField(item, err => {
  1973. // if (err?.length) {
  1974. // rej(err)
  1975. // } else {
  1976. // resolve()
  1977. // }
  1978. // })
  1979. // })
  1980. // )
  1981. // )
  1982. // .then(res => {
  1983. // this.$set(row, 'isSave', true)
  1984. // if (this.formData.bizType != 5) {
  1985. // this.createMaterialCode(row)
  1986. // } else {
  1987. // // 退还
  1988. // this.createMaterialCodeReturn(row)
  1989. // }
  1990. // })
  1991. // .catch(err => {
  1992. // uni.showToast({
  1993. // icon: 'error',
  1994. // title: '请填入必填项!'
  1995. // })
  1996. // })
  1997. // },
  1998. //入库明细删除
  1999. listDel(row, index) {
  2000. this.productList.splice(index, 1)
  2001. this.deletePackingAndMaterial(row);
  2002. },
  2003. // 入库明细生成条码信息
  2004. async createMaterialCode(row) {
  2005. return
  2006. // 添加相同物品重新更新明细 原料编码
  2007. const list = this.productList.filter(i => i.assetCode === row.assetCode && i.batchNum === row
  2008. .batchNum && i.isSave)
  2009. const num = list.reduce((num, pre) => {
  2010. num += row.isUnpack ? pre.outInNum * pre.measurementUnit : pre.outInNum
  2011. return num
  2012. }, 0)
  2013. const res = await postJ(this.apiUrl + '/outInWarehouse/getAssetNum', {
  2014. batchNum: row.batchNum,
  2015. assetCode: row.assetCode,
  2016. num
  2017. })
  2018. if (res?.success) {
  2019. list.forEach(item => {
  2020. if (item.warehouseLedgerDetails?.length) {
  2021. item.warehouseLedgerDetails.forEach(i => {
  2022. i.onlyCode = res.data.shift().onlyCode
  2023. })
  2024. } else {
  2025. this.$set(
  2026. item,
  2027. 'warehouseLedgerDetails',
  2028. Array.from(new Array(item.isUnpack ? item.outInNum * item.measurementUnit :
  2029. +item.outInNum), (val, idx) => {
  2030. return {
  2031. ...item,
  2032. onlyCode: res.data.shift().onlyCode,
  2033. bizStatus: 1,
  2034. contentImage: []
  2035. }
  2036. })
  2037. )
  2038. }
  2039. })
  2040. }
  2041. // 添加相同物品,重复批次号 重新更新明细 包装编码
  2042. const batchList = this.productList.filter(i => i.batchNum === row.batchNum && i.isSave)
  2043. if (batchList.length) {
  2044. const num = batchList.reduce((num, pre) => {
  2045. num += +pre.outInNum
  2046. return num
  2047. }, 0)
  2048. const res1 = await postJ(this.apiUrl + '/outInWarehouse/getAssetNum', {
  2049. batchNum: row.batchNum,
  2050. num
  2051. })
  2052. if (res1?.success) {
  2053. batchList.forEach(item => {
  2054. let num = res1.data.shift()?.num
  2055. let measurementUnit = item.measurementUnit
  2056. if (item.warehouseLedgerDetails?.length) {
  2057. item.warehouseLedgerDetails.forEach((i, index) => {
  2058. this.$set(i, 'num', num)
  2059. if (!item.isUnpack) {
  2060. if (index < item.warehouseLedgerDetails.length - 1) {
  2061. num = res1.data.shift()?.num
  2062. }
  2063. } else {
  2064. // 拆包的包装编码一致
  2065. measurementUnit--
  2066. if (measurementUnit === 0 && index < item
  2067. .warehouseLedgerDetails.length - 1) {
  2068. measurementUnit = item.measurementUnit
  2069. num = res1.data.shift()?.num
  2070. }
  2071. }
  2072. })
  2073. }
  2074. })
  2075. }
  2076. }
  2077. },
  2078. // 入库明细生成条码信息 退还
  2079. async createMaterialCodeReturn(row) {
  2080. return
  2081. // 添加相同物品重新更新明细 原料编码
  2082. const list = this.productList.filter(i => i.batchNum === row.batchNum && i.isSave)
  2083. // 退还
  2084. const res = await postJ(this.apiUrl + '/outInWarehouse/getAssetNum', {
  2085. batchNum: row.batchNum,
  2086. num: list.reduce((num, pre) => {
  2087. num += pre.selfWarehouseLedgerDetails.length
  2088. return num
  2089. }, 0)
  2090. })
  2091. if (res?.success) {
  2092. list.forEach(item => {
  2093. const num = res.data.shift().num
  2094. if (item.warehouseLedgerDetails?.length) {
  2095. item.warehouseLedgerDetails.forEach(i => {
  2096. i.num = num
  2097. if (!item.isUnpack) {
  2098. // 拆包的包装编码一致
  2099. num = res.data.shift()?.num
  2100. }
  2101. })
  2102. } else {
  2103. this.$set(
  2104. item,
  2105. 'warehouseLedgerDetails',
  2106. item.selfWarehouseLedgerDetails.map((val, idx) => {
  2107. let obj = {
  2108. ...val,
  2109. bizStatus: 1,
  2110. batchNum: item.batchNum,
  2111. cargoSpaceCode: item.cargoSpaceCode, //货位编码
  2112. cargoSpaceId: item.cargoSpaceId, //货位id
  2113. shelfId: item.shelfId, //货架id
  2114. shelfCode: item.shelfCode, //货架名称
  2115. areaId: item.areaId, //库区id
  2116. areaName: item.areaName, //库区名称
  2117. warehouseId: item.warehouseId, //仓库id
  2118. warehouseName: item.warehouseName, //仓库名称
  2119. num
  2120. }
  2121. if (!item.isUnpack) {
  2122. // 拆包的包装编码一致
  2123. num = res.data.shift()?.num
  2124. }
  2125. return obj
  2126. })
  2127. )
  2128. }
  2129. })
  2130. }
  2131. },
  2132. //确定提交
  2133. getsure() {
  2134. return
  2135. this.$refs.formRef.validate().then(res => {
  2136. if (!this.productList?.length) {
  2137. uni.showToast({
  2138. icon: 'error',
  2139. title: '请添加明细!'
  2140. })
  2141. return
  2142. } else if (this.productList.some(item => !item.warehouseLedgerDetails?.length)) {
  2143. uni.showToast({
  2144. icon: 'error',
  2145. title: '请完善明细信息!'
  2146. })
  2147. return
  2148. }
  2149. const params = {
  2150. outInWarehouse: {
  2151. ...this.formData,
  2152. bizStatus: 1
  2153. },
  2154. warehouseLedgerInfos: this.productList
  2155. }
  2156. postJ(this.apiUrl + '/outInWarehouse/add', params).then(res => {
  2157. if (res?.success) {
  2158. uni.showToast({
  2159. icon: 'success',
  2160. title: '保存成功'
  2161. })
  2162. setTimeout(() => {
  2163. uni.navigateBack({
  2164. delta: 1
  2165. })
  2166. }, 1500)
  2167. }
  2168. })
  2169. })
  2170. },
  2171. // 部门确认
  2172. deptConfirm(data, name) {
  2173. this.formData.deptName = name
  2174. this.formData.deptCode = data[0]
  2175. },
  2176. // 部门确认
  2177. verifyDeptConfirm(data, name) {
  2178. this.formData.verifyDeptCode = data[0]
  2179. this.formData.verifyDeptName = name
  2180. this.formData.verifyId = ''
  2181. this.formData.verifyName = ''
  2182. this.getUser(data[0])
  2183. },
  2184. // 获取部门
  2185. getDept() {
  2186. return
  2187. get(this.apiUrl + '/main/org/dept/effectiveTree').then(res => {
  2188. if (res?.success) {
  2189. this.deptList = res.data
  2190. }
  2191. })
  2192. },
  2193. // 获取供应商
  2194. getSupplier() {
  2195. // post(this.apiUrl + `/main/supplier/list?page=1&size=999`, {
  2196. // page: 1,
  2197. // size: 999
  2198. // }).then(res => {
  2199. // if (res?.success) {
  2200. // this.supplierList = res.data.items
  2201. // }
  2202. // })
  2203. },
  2204. // 获取人员
  2205. getUser(deptCode) {
  2206. // post(this.apiUrl + '/main/user/list', {
  2207. // deptCode,
  2208. // page: 1,
  2209. // size: 9999
  2210. // }).then(res => {
  2211. // if (res?.success) {
  2212. // this.userList = res.data.items.map(item => {
  2213. // item.name = item.trueName
  2214. // item.id = item.userId
  2215. // return item
  2216. // })
  2217. // }
  2218. // })
  2219. },
  2220. }
  2221. }
  2222. </script>
  2223. <style lang="scss" scoped>
  2224. .mainBox {
  2225. padding-bottom: 120rpx;
  2226. }
  2227. /deep/.required-form .u-form-item__body__left__content__label::before {
  2228. content: '*';
  2229. color: red;
  2230. }
  2231. .required-form-text {
  2232. /deep/ .u-form-item__body__right {
  2233. overflow: hidden;
  2234. // background-color: red;
  2235. .u-form-item__body__right__content {
  2236. width: 100%;
  2237. display: inline-block !important;
  2238. }
  2239. }
  2240. }
  2241. // ::v-deep .listCont .u-input {
  2242. // height: 60rpx !important;
  2243. // }
  2244. ::v-deep .dd .u-form-item__body__right {
  2245. border: 1px solid #e5e5e5 !important;
  2246. border-radius: 4px;
  2247. line-height: 60rpx;
  2248. }
  2249. .ellipsis {
  2250. max-width: 100%;
  2251. overflow: hidden;
  2252. white-space: nowrap;
  2253. text-overflow: ellipsis;
  2254. }
  2255. .picList {
  2256. display: flex;
  2257. align-items: center;
  2258. justify-items: flex-start;
  2259. flex-wrap: wrap;
  2260. }
  2261. /deep/.baseForm {
  2262. .u-form-item__body {
  2263. padding: 4px !important;
  2264. }
  2265. .assetType_box {
  2266. padding: 12rpx 18rpx;
  2267. width: 100%;
  2268. overflow: hidden;
  2269. white-space: nowrap;
  2270. text-overflow: ellipsis;
  2271. font-size: 30rpx;
  2272. }
  2273. }
  2274. /deep/ .picList .u-image {
  2275. margin-right: 10rpx;
  2276. margin-bottom: 10rpx;
  2277. }
  2278. /deep/.cLine .u-line:nth-child(1) {
  2279. border-bottom: none !important;
  2280. }
  2281. .detail-box {
  2282. position: relative;
  2283. align-items: center;
  2284. /deep/uni-button {
  2285. margin: 0 !important;
  2286. width: 180rpx;
  2287. }
  2288. .selectEnterType {
  2289. margin-left: 10rpx !important;
  2290. }
  2291. }
  2292. .footBox {
  2293. position: fixed;
  2294. left: 0px;
  2295. bottom: 0px;
  2296. height: 100rpx;
  2297. width: 100%;
  2298. display: flex;
  2299. align-items: center;
  2300. justify-content: space-between;
  2301. view {
  2302. width: 100%;
  2303. height: 100%;
  2304. text-align: center;
  2305. color: #fff;
  2306. display: flex;
  2307. align-items: center;
  2308. justify-content: center;
  2309. }
  2310. .reg {
  2311. background: $u-success-dark;
  2312. }
  2313. .add {
  2314. background: $uni-color-primary;
  2315. }
  2316. .uni-icons {
  2317. margin-right: 8rpx !important;
  2318. }
  2319. }
  2320. .listBox {
  2321. padding: 20rpx 10rpx;
  2322. border-bottom: 1px #f2f2f2 solid;
  2323. position: relative;
  2324. &.code {
  2325. .label {
  2326. width: 120rpx !important;
  2327. }
  2328. }
  2329. .listTit {
  2330. width: 100%;
  2331. align-items: center;
  2332. /deep/uni-button {
  2333. margin-right: 20rpx;
  2334. width: 100rpx;
  2335. &.assets {
  2336. width: 180rpx;
  2337. }
  2338. }
  2339. .name {
  2340. width: 50%;
  2341. margin-left: 10px;
  2342. overflow: hidden;
  2343. white-space: nowrap;
  2344. -o-text-overflow: ellipsis;
  2345. text-overflow: ellipsis;
  2346. font-size: 28rpx;
  2347. font-weight: bold;
  2348. }
  2349. .btn {
  2350. display: flex;
  2351. justify-content: flex-end;
  2352. }
  2353. .weight {
  2354. width: 30%;
  2355. font-size: 24rpx;
  2356. margin-left: auto;
  2357. margin-right: 60rpx;
  2358. position: relative;
  2359. display: flex;
  2360. input {
  2361. margin-right: 10rpx;
  2362. border: 1px solid black;
  2363. width: 40%;
  2364. height: 20rpx;
  2365. }
  2366. }
  2367. .weight::after {
  2368. position: absolute;
  2369. right: -30rpx;
  2370. top: 50%;
  2371. content: '';
  2372. background: #eee;
  2373. width: 1px;
  2374. height: 28rpx;
  2375. margin-top: -14rpx;
  2376. }
  2377. }
  2378. .z_list {
  2379. height: 100% !important;
  2380. max-height: 500rpx;
  2381. .material {
  2382. margin-top: 10rpx;
  2383. .left {
  2384. width: 40rpx;
  2385. }
  2386. .zdy_check {
  2387. width: 30rpx;
  2388. height: 30rpx;
  2389. border: 2rpx solid #c8c9cc;
  2390. border-radius: 4rpx;
  2391. }
  2392. .check_active {
  2393. background: $theme-color;
  2394. border: 2rpx solid $theme-color;
  2395. /deep/ .u-icon__icon {
  2396. color: #fff !important;
  2397. }
  2398. }
  2399. .content_table {
  2400. width: 670rpx;
  2401. border: 2rpx solid $border-color;
  2402. .item {
  2403. display: flex;
  2404. border-bottom: 2rpx solid $border-color;
  2405. .lable {
  2406. width: 200rpx;
  2407. text-align: center;
  2408. background-color: #f7f9fa;
  2409. font-size: 26rpx;
  2410. border-right: 2rpx solid $border-color;
  2411. flex-shrink: 0;
  2412. }
  2413. .ww80 {
  2414. width: 80rpx;
  2415. }
  2416. .content {
  2417. width: 500rpx;
  2418. min-height: 64rpx;
  2419. font-size: 28rpx;
  2420. line-height: 28rpx;
  2421. font-style: normal;
  2422. font-weight: 400;
  2423. padding: 18rpx 8rpx;
  2424. box-sizing: border-box;
  2425. word-wrap: break-word;
  2426. flex-grow: 1 !important;
  2427. }
  2428. .input_box {
  2429. padding: 0 !important;
  2430. }
  2431. .content_num {
  2432. display: flex;
  2433. align-items: center;
  2434. padding: 0 4rpx;
  2435. /deep/ .uni-input-input {
  2436. width: 200rpx;
  2437. border: 2rpx solid #f0f8f2;
  2438. background: #f0f8f2;
  2439. color: $theme-color;
  2440. }
  2441. .unit {
  2442. padding: 0 4rpx;
  2443. font-size: 24rpx;
  2444. color: #404446;
  2445. }
  2446. }
  2447. .ww400 {
  2448. /deep/ .uni-input-input {
  2449. width: 400rpx;
  2450. }
  2451. }
  2452. .pd4 {
  2453. padding: 4rpx 8rpx;
  2454. }
  2455. &:last-child {
  2456. border-bottom: none;
  2457. }
  2458. }
  2459. .ww55 {
  2460. width: 55%;
  2461. }
  2462. .ww45 {
  2463. width: 45%;
  2464. }
  2465. .ww50 {
  2466. width: 50%;
  2467. }
  2468. .ww30 {
  2469. width: 30%;
  2470. }
  2471. .ww70 {
  2472. width: 70%;
  2473. }
  2474. .ww80 {
  2475. width: 80%;
  2476. }
  2477. .ww20 {
  2478. width: 20%;
  2479. }
  2480. .check {
  2481. width: 30rpx;
  2482. height: 30rpx;
  2483. }
  2484. .tag_box {
  2485. padding: 2rpx 10rpx;
  2486. margin-right: 12rpx;
  2487. background: #e6a23c;
  2488. font-size: 22rpx;
  2489. color: #fff;
  2490. border-radius: 4rpx;
  2491. }
  2492. }
  2493. }
  2494. }
  2495. .more {
  2496. position: absolute;
  2497. bottom: 26rpx;
  2498. right: 30rpx;
  2499. font-size: 28rpx;
  2500. color: #666;
  2501. }
  2502. }
  2503. .listCont {
  2504. display: flex;
  2505. align-items: center;
  2506. flex-wrap: wrap;
  2507. margin-top: 20rpx;
  2508. margin-left: 10rpx;
  2509. &.save {
  2510. .u-input {
  2511. border: none;
  2512. }
  2513. }
  2514. .u-input {
  2515. border: 1px solid rgb(229, 229, 229);
  2516. height: 60rpx !important;
  2517. padding: 0 0 0 9px !important;
  2518. }
  2519. .item {
  2520. width: 100%;
  2521. font-size: 28rpx;
  2522. margin-bottom: 10rpx;
  2523. margin-right: 3%;
  2524. /deep/.u-form-item__body {
  2525. padding: 0 !important;
  2526. }
  2527. /deep/.u-input__content__field-wrapper__field,
  2528. /deep/.u-form-item {
  2529. font-size: 28rpx !important;
  2530. }
  2531. text.label {
  2532. width: 120rpx;
  2533. display: inline-block;
  2534. text-align: right;
  2535. margin-right: 20rpx;
  2536. margin-bottom: 20rpx;
  2537. }
  2538. /deep/.uni-date__x-input {
  2539. height: 40rpx;
  2540. font-size: 28rpx;
  2541. }
  2542. /deep/.uni-date {
  2543. width: 48%;
  2544. display: inline-block;
  2545. .uni-icons {
  2546. display: none !important;
  2547. }
  2548. .uni-date-x {
  2549. padding: 0 !important;
  2550. }
  2551. }
  2552. }
  2553. .item text {
  2554. color: #666;
  2555. }
  2556. }
  2557. .selectTime {
  2558. display: flex;
  2559. justify-content: flex-end;
  2560. align-items: center;
  2561. margin-bottom: 10rpx;
  2562. .title {
  2563. flex: 1;
  2564. font-size: 30rpx;
  2565. }
  2566. .timeBox {
  2567. display: flex;
  2568. width: 500rpx;
  2569. .firstBtn {
  2570. margin-right: 10rpx;
  2571. }
  2572. }
  2573. }
  2574. .listBox:last-child {
  2575. border: none !important;
  2576. }
  2577. .textBox {
  2578. border: 1px #f2f2f2 solid;
  2579. height: 160px;
  2580. display: block;
  2581. width: auto !important;
  2582. }
  2583. .saveBtn {
  2584. width: 50%;
  2585. margin: 40rpx auto;
  2586. }
  2587. .top-css {
  2588. border-bottom: 1px solid rgb(207, 204, 204);
  2589. }
  2590. .flex_between {
  2591. display: flex;
  2592. justify-content: space-between;
  2593. }
  2594. </style>