addStock.vue 65 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087
  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="260" labelAlign="right" class="baseForm">
  15. <u-form-item label="物品类型" class="required-form" borderBottom prop="assetType">
  16. <view class="assetType_box" @click="openPicker">{{ assetTypeName ? assetTypeName : '请选择产品类型' }}</view>
  17. </u-form-item>
  18. <u-form-item label="入库场景" class="required-form" prop="bizType" borderBottom>
  19. <picker :disabled="!!(productList && productList.length)" @change="e => handlePicker(e, sceneState, 'bizType')" :value="pickerIndex" :range="sceneState" range-key="text">
  20. <u-input :value="sceneStateFilter(formData.bizType)" :disableColor="!!(productList && productList.length) ? '#F5F7FA' : '#fff'" placeholder="请选择" disabled type="select" />
  21. </picker>
  22. <u-icon slot="right" name="arrow-right"></u-icon>
  23. </u-form-item>
  24. <u-form-item label="来源单据" prop="documentSource" borderBottom>
  25. <u-input type="text" placeholder="请输入" v-model="formData.sourceBizNo" @click.native="goToRequisition" />
  26. </u-form-item>
  27. <u-form-item label="入库时间" prop="storageTime" borderBottom>
  28. <view class="assetType_box" @click="timeShow = true">{{ storageTime ? formatter(storageTime) : '请选择' }}</view>
  29. </u-form-item>
  30. <u-form-item label="入库登记人" prop="createUserName" borderBottom>
  31. <u-input disableColor="#ffffff" :value="formData.extInfo.createUserName" placeholder="请选择" disabled type="text" />
  32. </u-form-item>
  33. <u-form-item label="送货人" prop="deliveryName" borderBottom>
  34. <u-input type="text" placeholder="请输入" v-model="formData.fromUser" />
  35. </u-form-item>
  36. <u-form-item label="送货人联系方式" prop="deliveryPhone" borderBottom>
  37. <u-input type="text" placeholder="请输入" v-model="formData.extInfo.deliveryPhone" />
  38. </u-form-item>
  39. <u-form-item label="备注" prop="remark" borderBottom>
  40. <u-input disableColor="#ffffff" v-model="formData.remark" placeholder="请输入内容" type="text" />
  41. </u-form-item>
  42. </u-form>
  43. <uni-collapse ref="collapse" v-model="collapseOpen">
  44. <uni-collapse-item :typeOpen="1" title="" name="collapse1" :open="true" :key="detailOpen" :show-animation="true">
  45. <template v-slot:title>
  46. <view class="detail-box">
  47. <view data-v-41027c34="" class="uni-collapse-item__title-wrap">
  48. <view data-v-41027c34="" class="uni-collapse-item__title-box uni-collapse-item__title-box-base">
  49. <text data-v-41027c34="" class="tag tag-base"><text></text></text>
  50. <text data-v-41027c34="" class="uni-collapse-item__title-text"><text>入库明细</text></text>
  51. </view>
  52. </view>
  53. <!-- <u-button type="primary" size="small" text="扫码添加" @click.native.stop="selectType"></u-button> -->
  54. <u-button type="success" size="small" class="selectEnterType" text="手动添加" @click.native.stop="selectType"></u-button>
  55. </view>
  56. </template>
  57. <u-form
  58. labelPosition="left"
  59. :model="{ productList: productList }"
  60. ref="lisrFormRef"
  61. labelWidth="150"
  62. :rules="listRules"
  63. errorType="none"
  64. labelAlign="right"
  65. :labelStyle="{
  66. fontSize: '28rpx'
  67. }">
  68. <view class="listContent">
  69. <view class="listBox" v-for="(item, index) in productList" :key="index">
  70. <view class="listTit">
  71. <view class="name">{{ item.categoryName }}</view>
  72. <view class="btn">
  73. <u-button v-if="item.isSave" type="primary" size="small" :hairline="true" text="编辑" @click="listEdit(index)"></u-button>
  74. <u-button v-else type="primary" size="small" :hairline="true" text="保存" @click="listSave(item, index)"></u-button>
  75. <u-button type="error" size="small" :hairline="true" text="删除" @click="getDelete(index)"></u-button>
  76. </view>
  77. </view>
  78. <view class="listCont" :class="{ save: item.isSave }">
  79. <view class="item w100">
  80. <u-form-item :label="`物品编码`">
  81. {{ item.categoryCode }}
  82. </u-form-item>
  83. </view>
  84. <view class="item w100">
  85. <u-form-item label="包装规格" prop="packingSpecificationLabel">
  86. <u-tag style="margin-right: 5rpx" v-for="ite in item.packingSpecificationLabel" :text="ite"></u-tag>
  87. </u-form-item>
  88. </view>
  89. <view class="item">
  90. <u-form-item label="批次号" :prop="`productList.${index}.batchNo`" required>
  91. <u--input :disabled="item.isSave" placeholder="请输入" border="surround" v-model="item.batchNo"></u--input>
  92. </u-form-item>
  93. </view>
  94. <view class="item">
  95. <u-form-item label="数量" :prop="`productList.${index}.packingQuantity`" required>
  96. <u--input :disabled="item.isSave" placeholder="请输入" border="surround" v-model="item.packingQuantity" @change="computeNum(item, index, true)"></u--input>
  97. </u-form-item>
  98. </view>
  99. <view class="item">
  100. <u-form-item label="包装单位" :prop="`productList.${index}.packingUnit`" required>
  101. <u--input :disabled="item.isSave" placeholder="请选择" border="surround" v-model="item.packingUnit" @click.native="showPackingUnitPicker(item, index)"></u--input>
  102. </u-form-item>
  103. </view>
  104. <view class="item">
  105. <u-form-item label="仓库" :prop="`productList.${index}.warehouseId`" required>
  106. <u--input :disabled="item.isSave" placeholder="请选择" border="surround" v-model="item.warehouseName" @click.native="showWarehousePicker(index)"></u--input>
  107. </u-form-item>
  108. </view>
  109. <view class="item w100">
  110. <u-form-item label="供应商" :prop="`productList.${index}.supplierName`">
  111. <u--input :disabled="item.isSave" placeholder="请选择" border="surround" v-model="item.supplierName" @click.native="showSupplierPicker(item, index)"></u--input>
  112. </u-form-item>
  113. </view>
  114. <view class="item">
  115. <u-form-item label="计量数量" prop="measureQuantity">{{ item.measureQuantity }}</u-form-item>
  116. </view>
  117. <view class="item">
  118. <u-form-item label="计量单位" prop="measureUnit">{{ item.measureUnit }}</u-form-item>
  119. </view>
  120. <view class="item">
  121. <u-form-item label="重量" prop="weight">{{ item.weight }}</u-form-item>
  122. </view>
  123. <view class="item">
  124. <u-form-item label="重量单位" prop="weightUnit">{{ item.weightUnit }}</u-form-item>
  125. </view>
  126. <view class="item">
  127. <u-form-item label="是否拆包" prop="isUnpack">{{ item.isUnpack ? '是' : '否' }}</u-form-item>
  128. </view>
  129. </view>
  130. <view class="selectTime" v-if="item.outInDetailRecordRequestList.length > 0">
  131. <view class="title">包装列表</view>
  132. <view class="timeBox">
  133. <u-button class="firstBtn" size="small" type="primary" text="选择时间类型" @click="timeTypeShow = true"></u-button>
  134. <u-button type="warning" size="small" :text="`批量设置${curDateTypeLabel[curDateType]}`" @click="typeTimeClick(index)"></u-button>
  135. </view>
  136. </view>
  137. <u-list @scrolltolower="scrolltolower" class="z_list" style="height: 100% !important">
  138. <view class="material rx-ss" v-for="(ite, idx) in item.outInDetailRecordRequestList" :key="idx">
  139. <!-- <view class="left rx-ss" @click="deletePacking(index, idx)">
  140. <uni-icons custom-prefix="iconfont" type="icon-shanchu" size="20" color="#fa3534"></uni-icons>
  141. </view> -->
  142. <view class="content_table">
  143. <view class="item">
  144. <view class="lable rx-cc">序号</view>
  145. <view class="content">{{ idx + 1 }}</view>
  146. </view>
  147. <view class="item">
  148. <view class="lable rx-cc">包装编码</view>
  149. <view class="content">{{ ite.packageNo }}</view>
  150. </view>
  151. <view class="item">
  152. <view class="lable rx-cc">包装数量({{ ite.packingUnit }})</view>
  153. <view class="content">{{ ite.packingQuantity }}</view>
  154. </view>
  155. <view class="item">
  156. <view class="lable rx-cc">计量数量({{ ite.measureUnit }})</view>
  157. <view class="content">{{ ite.measureQuantity }}</view>
  158. </view>
  159. <view class="item">
  160. <view class="lable rx-cc">物料代号</view>
  161. <view class="content input_box"><u--input clearable placeholder="请输入" border="surround" v-model="ite.materielDesignation"></u--input></view>
  162. </view>
  163. <view class="item">
  164. <view class="lable rx-cc">客户代号</view>
  165. <view class="content input_box"><u--input clearable placeholder="请输入" border="surround" v-model="ite.clientCode"></u--input></view>
  166. </view>
  167. <view class="item">
  168. <view class="lable rx-cc">刻码</view>
  169. <view class="content input_box"><u--input clearable placeholder="请输入" border="surround" v-model="ite.engrave"></u--input></view>
  170. </view>
  171. <view class="item">
  172. <view class="lable rx-cc">重量({{ ite.weightUnit }})</view>
  173. <view class="content input_box">
  174. <u--input clearable placeholder="请输入" border="surround" v-model="ite.weight" @change="weightInput($event, ite, index)"></u--input>
  175. </view>
  176. </view>
  177. <view class="item">
  178. <view class="lable rx-cc">质检状态</view>
  179. <view class="content" @click="statusClick(index, idx)">
  180. {{ qualityResults[ite.status] }}
  181. </view>
  182. </view>
  183. <view class="item">
  184. <view class="lable rx-cc">{{ curDateTypeLabel[curDateType] }}</view>
  185. <view class="content input_box">
  186. <u--input clearable placeholder="请选择" border="surround" v-model="ite[curDateType]" @click.native="typeTimeClick(index, idx)"></u--input>
  187. </view>
  188. </view>
  189. </view>
  190. </view>
  191. </u-list>
  192. </view>
  193. </view>
  194. </u-form>
  195. </uni-collapse-item>
  196. </uni-collapse>
  197. <view class="footBox">
  198. <view class="reg" @click="submit">
  199. <uni-icons custom-prefix="iconfont" size="20" color="#fff"></uni-icons>
  200. 提交
  201. </view>
  202. </view>
  203. <!-- 选择物品类型 -->
  204. <ba-tree-picker ref="treePicker" :multiple="true" @select-change="confirm" title="选择物品类型" :localdata="goodsLists" valueKey="id" textKey="name" childrenKey="child" />
  205. <!-- 选择入库时间 -->
  206. <u-datetime-picker @confirm="timeConfirm" @cancel="timeCancel" :show="timeShow" v-model="storageTime" mode="datetime"></u-datetime-picker>
  207. <!-- 选择包装单位 -->
  208. <u-picker
  209. :show="packingUnitsShow"
  210. visibleItemCount="10"
  211. :columns="currentPackingSpecificationOption"
  212. keyName="conversionUnit"
  213. @confirm="selectPackingUnitInfo"
  214. @cancel="packingUnitsShow = false"
  215. title="选择包装单位"></u-picker>
  216. <!-- 选择供应商单位 -->
  217. <u-picker
  218. :show="suppliersShow"
  219. visibleItemCount="10"
  220. :columns="currentSupplierListOption"
  221. keyName="name"
  222. @confirm="selectSuppliersInfo"
  223. @cancel="suppliersShow = false"
  224. title="选择供应商"></u-picker>
  225. <!-- 选择仓库 -->
  226. <u-picker :show="warehouseShow" visibleItemCount="10" :columns="warehouseListOption" keyName="name" @confirm="selectWarehouseInfo" @cancel="warehouseShow = false" title="选择仓库"></u-picker>
  227. <!-- 选择时间类型 -->
  228. <u-picker :show="timeTypeShow" visibleItemCount="10" :columns="timeTypeOption" keyName="name" @confirm="selectTimeTypeInfo" @cancel="timeTypeShow = false" title="选择时间类型"></u-picker>
  229. <!-- 选择生产/采购日期 -->
  230. <u-datetime-picker @confirm="typeTimeConfirm" @cancel="typeTimeShow = false" :show="typeTimeShow" v-model="currentTypeTime" mode="datetime"></u-datetime-picker>
  231. <!-- 选择质检状态 -->
  232. <u-picker :show="statusShow" visibleItemCount="10" :columns="qualityResultsOption" keyName="label" @confirm="selectStautsInfo" @cancel="statusShow = false" title="选择质检状态"></u-picker>
  233. </view>
  234. </template>
  235. <script>
  236. // import ScanCode from '@/components/ScanCode.vue'
  237. import {
  238. getTreeByGroup,
  239. contactQueryByCategoryIdsAPI,
  240. getCode,
  241. getCategoryPackageDisposition,
  242. getWarehouseList,
  243. getAssetNum,
  244. storage,
  245. qualityInspectionTwo,
  246. submitTwo
  247. } from '@/api/warehouseManagement'
  248. import { getByCode } from '@/api/pda/common'
  249. import dayjs from 'dayjs'
  250. import { sceneState } from '../common'
  251. import { post, postJ, get, getJ } from '@/utils/api.js'
  252. import WarehouseChoose from '@/components/WarehouseChoose'
  253. import { warehousingType, inputStatus, emergencyState, warehousingMaterialListTable, getDictName, materialType } from '../enum.js'
  254. import baTreePicker from '@/components/ba-tree-picker/ba-tree-picker.vue'
  255. // import addDetails from '@/components/addDetails'
  256. import UploadFileNew from '@/components/UploadFileNew'
  257. // import { getRuleNo } from '@/utils/utils.js'
  258. import { tableHeader } from '../common'
  259. // import dictMixins from '@/mixins/dictMixins.js'
  260. export default {
  261. components: {
  262. WarehouseChoose,
  263. baTreePicker,
  264. UploadFileNew
  265. },
  266. // mixins: [dictMixins],
  267. data() {
  268. return {
  269. goodsLists: [], // 物品类型
  270. assetTypeName: '', // 物品类型名称
  271. timeShow: false,
  272. packingSpecificationOption: [], // 包装规格
  273. currentPackingSpecificationOption: [], // 当前包装规格
  274. currentSupplierListOption: [], // 当前供货商
  275. warehouseListOption: [], // 仓库列表
  276. currentTypeTime: Number(new Date()), // 当前时间类型的时间
  277. storageTime: '', // 入库时间
  278. currentProductIndex: null, // 当前产品索引
  279. currentPackingIndex: null, // 当前包装索引
  280. packingUnitsShow: false,
  281. typeTimeShow: false,
  282. suppliersShow: false,
  283. warehouseShow: false,
  284. timeTypeShow: false,
  285. statusShow: false,
  286. dictCodeList: [], // 字典列表
  287. curDateType: 'purchaseDate',
  288. qualityResultsOption: [
  289. [
  290. {
  291. label: '合格',
  292. value: 1
  293. },
  294. {
  295. label: '不合格',
  296. value: 2
  297. }
  298. ]
  299. ], // 质检状态 0未检 1已检
  300. qualityResults: {
  301. 1: '合格',
  302. 2: '不合格'
  303. }, // 质检结果 1合格 2不合格
  304. curDateTypeLabel: {
  305. purchaseDate: '采购日期',
  306. productionDate: '生产日期'
  307. },
  308. timeTypeOption: [
  309. [
  310. {
  311. name: '采购日期',
  312. prop: 'purchaseDate'
  313. },
  314. {
  315. name: '生产日期',
  316. prop: 'productionDate'
  317. }
  318. ]
  319. ], // 时间类型
  320. collapseOpen: 'collapse1',
  321. emergencyState,
  322. warehousingType,
  323. materialType,
  324. sceneState,
  325. inputStatus,
  326. getDictName,
  327. detailOpen: false,
  328. codeOpen: false,
  329. deptList: [], //部门
  330. supplierList: [], //供应商
  331. formData: {
  332. type: 1, // 入库
  333. bizType: '', // 入库场景
  334. storageTime: '', // 入库时间
  335. extInfo: {}, // 扩展信息
  336. sourceBizNo: '', // 来源单据编号
  337. fromUser: '', // 送货人
  338. remark: '' // 备注
  339. },
  340. statusList: [
  341. {
  342. id: 1,
  343. name: '紧急'
  344. },
  345. {
  346. id: 2,
  347. name: '中等'
  348. },
  349. {
  350. id: 1,
  351. name: '普通'
  352. }
  353. ], //紧急状态
  354. pickerIndex: 0,
  355. productList: [],
  356. userList: [],
  357. rules: {
  358. assetType: {
  359. type: 'number',
  360. required: true,
  361. message: '请选择入库产品类型',
  362. trigger: ['blur', 'change']
  363. },
  364. bizType: {
  365. type: 'number',
  366. required: true,
  367. message: '请选择入库场景',
  368. trigger: ['blur', 'change']
  369. }
  370. // contentImage: {
  371. // type: 'array',
  372. // required: true,
  373. // message: '请上传附件',
  374. // trigger: ['blur', 'change']
  375. // }
  376. },
  377. settingIndex: 0
  378. }
  379. },
  380. onShow() {
  381. // const _this = this
  382. // uni.$off('scancode') // 每次进来先 移除全局自定义事件监听器
  383. // uni.$on('scancode', function (data) {
  384. // uni.navigateBack({
  385. // delta: 1
  386. // })
  387. // _this.qrContent = data.code.trim()
  388. // _this.handleScan()
  389. // })
  390. this.collapseOpen = 'collapse1'
  391. },
  392. beforeDestroy() {
  393. uni.$off('setSelectList')
  394. uni.$off('requisitionSelect')
  395. },
  396. async onLoad(options) {
  397. await this.getListItems() // 物品类型
  398. await this.getwarehouseList() // 仓库列表
  399. await this.requireDictCode() // 字典列表
  400. // this.requestDict('物品类型')
  401. // this.getDept()
  402. // this.getSupplier()
  403. const userInfo = uni.getStorageSync('userInfo')
  404. console.log()
  405. this.formData.extInfo.createUserName = userInfo.name
  406. this.formData.createUserId = userInfo.name
  407. this.storageTime = Number(new Date())
  408. this.formData.storageTime = this.formatter(this.storageTime)
  409. // this.formData.registerId = userInfo.id
  410. uni.$on('setSelectList', async data => {
  411. if (data?.length) {
  412. this.formData.sourceBizNo = ''
  413. // 获取批次号
  414. const batchNo = await getCode('lot_number_code')
  415. // 获取供应商
  416. const supplierList = await contactQueryByCategoryIdsAPI({
  417. categoryIds: data.map(item => item.id)
  418. })
  419. // 获取包装规格
  420. let packingSpecification = await getCategoryPackageDisposition({
  421. categoryIds: data.map(item => item.id)
  422. })
  423. this.packingSpecificationOption = data.map(item => {
  424. return packingSpecification.filter(ite => item.id == ite.categoryId).sort((a, b) => a.sort - b.sort)
  425. })
  426. let productList = data.map((item, index) => {
  427. // 显示规格
  428. let packingSpecificationLabel = this.packingSpecificationOption[index]
  429. .map(item => {
  430. if (item.sort > 0) {
  431. return `${item.packageCell}${item.packageUnit}/${item.conversionUnit}`
  432. }
  433. })
  434. .filter(item => !!item)
  435. return {
  436. index: this.productList.length - 1 > -1 ? this.productList[this.productList.length - 1].index + index + 1 : this.productList.length + index,
  437. categoryId: item.id, // 物品id
  438. categoryName: item.name, // 物品名称
  439. categoryCode: item.code, // 物品编码
  440. categoryModel: item.modelType, // 物品型号
  441. specification: item.specification, // 规格
  442. brandNum: item.brandNum, // 牌号
  443. batchNo: batchNo, // 批次号
  444. supplierListOptions: supplierList[item.id], // 供应商列表
  445. supplierId: '', // 供应商id
  446. supplierName: '', // 供应商名称
  447. approvalNumber: item.approvalNumber, // 批准文号
  448. packingSpecification: item.packingSpecification, // 包装规格
  449. packingSpecificationOption: this.packingSpecificationOption[index], // 包装规格选项
  450. packingSpecificationLabel: packingSpecificationLabel, // 包装规格显示
  451. minPackingQuantity: '', // 最小包装单元数量
  452. packingQuantity: '', // 包装数量
  453. packingUnit: '', // 包装单位
  454. measureQuantity: 0, // 计量数量
  455. measureUnit: item.measuringUnit, // 计量单位
  456. netWeight: item.netWeight > -1 ? item.netWeight : 0, // 净重
  457. weight: 0, // 重量
  458. weightUnit: item.weightUnit, // 重量单位
  459. totalMoney: '', // 总价
  460. price: item.price, // 单价
  461. purpose: '', // 用途
  462. isUnpack: item.isUnpack, // 是否允许拆包
  463. outInDetailRecordRequestList: []
  464. }
  465. })
  466. this.productList = this.productList.concat(productList)
  467. console.log(this.productList, '------------------this.productList----111-----')
  468. setTimeout(() => {
  469. this.detailOpen = !this.detailOpen
  470. this.$refs.collapse && this.$refs.collapse.resize()
  471. }, 0)
  472. }
  473. })
  474. uni.$on('requisitionSelect', async (data, query) => {
  475. console.log(data)
  476. console.log(query)
  477. this.formData.sourceBizNo = query.sourceBizNo
  478. this.formData.bizType = query.bizType
  479. this.formData.extInfo.assetType = query.assetType.split(',')
  480. let filterArray = this.formData.extInfo.assetType.map(item => {
  481. return this.goodsLists.find(ite => ite.id == item).name
  482. })
  483. this.assetTypeName = Array.from(new Set(filterArray)).join('/')
  484. const batchNo = await getCode('lot_number_code')
  485. // 获取包装规格
  486. let packingSpecification = await getCategoryPackageDisposition({
  487. categoryIds: data.map(item => item.categoryId)
  488. })
  489. this.packingSpecificationOption = data.map(item => {
  490. return packingSpecification.filter(ite => item.categoryId == ite.categoryId).sort((a, b) => a.sort - b.sort)
  491. })
  492. this.productList = data.map((productItem, productIndex) => {
  493. // 显示规格
  494. let packingSpecificationLabel = this.packingSpecificationOption[productIndex]
  495. .map(item => {
  496. if (item.sort > 0) {
  497. return `${item.packageCell}${item.packageUnit}/${item.conversionUnit}`
  498. }
  499. })
  500. .filter(item => !!item)
  501. return {
  502. ...productItem,
  503. index: this.productList.length + productIndex,
  504. isSave: productItem.outInDetailRecordRequestList?.length > 0 ? true : false,
  505. batchNo: batchNo, // 批次号
  506. warehouseIds: [productItem.warehouseId], // 仓库Id
  507. warehouseNames: [productItem.warehouseName], // 仓库名称
  508. packingSpecificationOption: this.packingSpecificationOption[productIndex], // 包装规格选项
  509. packingSpecificationLabel: packingSpecificationLabel, // 包装规格显示
  510. outInDetailRecordRequestList:
  511. productItem.outInDetailRecordRequestList?.length > 0
  512. ? productItem.outInDetailRecordRequestList.map((packingItem, packingIndex) => {
  513. return {
  514. ...packingItem,
  515. index: this.productList.length + productIndex + '-' + packingIndex, // 包装索引
  516. batchNo: batchNo, // 批次号
  517. parentIndex: this.productList.length + productIndex, // 物品索引
  518. categoryName: productItem.categoryName,
  519. categoryCode: productItem.categoryCode,
  520. materialDetailList: packingItem.materialDetailList.map((materialItem, materialIndex) => {
  521. return {
  522. ...materialItem,
  523. index: this.productList.length + productIndex + '-' + packingIndex + '——' + materialIndex, // 包装索引
  524. parentIndex: this.productList.length + productIndex + '-' + packingIndex, // 物品索引
  525. batchNo: batchNo, // 批次号
  526. categoryName: productItem.categoryName,
  527. categoryCode: productItem.categoryCode
  528. }
  529. })
  530. }
  531. })
  532. : []
  533. }
  534. })
  535. setTimeout(() => {
  536. this.detailOpen = !this.detailOpen
  537. this.$refs.collapse && this.$refs.collapse.resize()
  538. }, 0)
  539. })
  540. // 明细信息填写
  541. uni.$on('batchNumBack', productList => {
  542. if (productList?.length) {
  543. this.productList = productList
  544. }
  545. })
  546. },
  547. mounted() {
  548. // this.getAddDetails();
  549. },
  550. computed: {
  551. tableHeader() {
  552. return tableHeader(this.formData.assetType)
  553. },
  554. materialCodeReqList() {
  555. return this.productList.map(i => i.warehouseLedgerDetails || []).flat()
  556. },
  557. isMaterial() {
  558. return this.formData.assetType == 3
  559. },
  560. warehousingName() {
  561. return []
  562. this.productList = []
  563. return this.getDictValue('物品类型', this.formData.assetType)
  564. },
  565. listRules() {
  566. return this.productList.reduce((cur, pre, index) => {
  567. return {
  568. ...cur,
  569. [`productList.${index}.batchNo`]: {
  570. type: 'string',
  571. required: true,
  572. trigger: ['blur', 'change']
  573. },
  574. [`productList.${index}.packingQuantity`]: {
  575. type: 'number',
  576. required: true,
  577. trigger: ['blur', 'change']
  578. },
  579. [`productList.${index}.packingUnit`]: {
  580. type: 'string',
  581. required: true,
  582. trigger: ['blur', 'change']
  583. },
  584. [`productList.${index}.warehouseId`]: {
  585. type: 'string',
  586. required: true,
  587. trigger: ['blur', 'change']
  588. }
  589. }
  590. }, {})
  591. }
  592. },
  593. methods: {
  594. goToRequisition() {
  595. uni.navigateTo({
  596. url: '/pages/warehouse/components/requisitionList?type=' + 1
  597. })
  598. },
  599. // 入库
  600. submit() {
  601. if (this.productList.length <= 0) {
  602. uni.showToast({
  603. icon: 'none',
  604. title: '请添加产品!'
  605. })
  606. return
  607. }
  608. let boolen = this.productList.every(item => item.isSave)
  609. if (!boolen) {
  610. uni.showToast({
  611. icon: 'none',
  612. title: '请先保存所有产品信息!'
  613. })
  614. return
  615. }
  616. uni.showLoading({
  617. title: '保存中...'
  618. })
  619. this.formData.outInDetailList = this.productList
  620. let obj = uni.$u.deepClone(this.formData)
  621. // 处理物品类型assetType
  622. obj.extInfo.assetType = obj.extInfo.assetType.join(',')
  623. // 处理仓库id
  624. let warehouseId = []
  625. let warehouseName = []
  626. let warehouseIds = this.productList.map(item => item.warehouseIds).flat()
  627. let warehouseNames = this.productList.map(item => item.warehouseNames).flat()
  628. warehouseIds.forEach((item, index) => {
  629. if (!warehouseId.includes(item)) {
  630. warehouseId.push(item)
  631. warehouseName.push(warehouseNames[index])
  632. }
  633. })
  634. obj.warehouseIds = warehouseId
  635. obj.warehouseNames = warehouseName
  636. // 是否需要审核(0审核 1跳过审核)
  637. if (obj.bizType == '12') {
  638. obj.isSkip = 1
  639. } else {
  640. obj.isSkip = 0
  641. }
  642. // obj.isSkip = 1;
  643. console.log(obj)
  644. storage(obj)
  645. .then(async res => {
  646. console.log('入库成功', res)
  647. if (res.code == 0) {
  648. try {
  649. // 委外入库(非采购)
  650. if (obj.bizType == '12') {
  651. await qualityInspectionTwo({
  652. outInId: res.data[0]
  653. })
  654. } else {
  655. await submitTwo({ outInId: res.data[0] })
  656. }
  657. uni.hideLoading()
  658. uni.showToast({
  659. icon: 'none',
  660. title: '入库成功',
  661. duration: 1500
  662. })
  663. uni.navigateBack({
  664. delta: 1
  665. })
  666. } catch (error) {
  667. uni.hideLoading()
  668. console.log('提交流程失败', error)
  669. }
  670. }
  671. })
  672. .catch(err => {
  673. console.log('入库失败', err)
  674. uni.hideLoading()
  675. uni.showToast({
  676. icon: 'none',
  677. title: '入库失败',
  678. duration: 2000
  679. })
  680. })
  681. },
  682. // 重量限制
  683. weightInput(value, row, productIndex) {
  684. const newValue = value.replace(/[^\d.]/g, '') // 保留数字和小数点
  685. const decimalCount = (newValue.match(/\./g) || []).length // 计算小数点的个数
  686. if (row.weight < 0) {
  687. row.weight = 0
  688. } else if (row.weight > 9999) {
  689. row.weight = 9999
  690. } else {
  691. if (decimalCount > 1) {
  692. // 如果小数点个数大于1,移除多余的小数点
  693. const lastIndex = newValue.lastIndexOf('.')
  694. row.weight = newValue.slice(0, lastIndex) + newValue.slice(lastIndex + 1)
  695. } else if (decimalCount === 1) {
  696. // 如果小数点个数等于1,允许小数点的输入
  697. row.weight = newValue
  698. } else {
  699. row.weight = newValue === '' ? 0 : parseFloat(newValue) // 如果输入为空,则设为0
  700. }
  701. }
  702. this.packingWeightCahnge(productIndex)
  703. },
  704. // 包装重量修改
  705. packingWeightCahnge(productIndex) {
  706. // 修改物品重量
  707. let totalWeight = this.productList[productIndex].outInDetailRecordRequestList.reduce((accumulator, currentValue) => {
  708. return Number(accumulator) + Number(currentValue.weight)
  709. }, 0)
  710. this.$set(this.productList[productIndex], 'weight', totalWeight)
  711. },
  712. scrolltolower() {
  713. console.log('滑动了~~~')
  714. },
  715. typeTimeClick(index, idx) {
  716. console.log('index-----', index)
  717. console.log('idx----', idx)
  718. this.currentProductIndex = index
  719. this.currentPackingIndex = idx > -1 ? idx : -1
  720. this.typeTimeShow = true
  721. },
  722. statusClick(index, idx) {
  723. this.currentProductIndex = index
  724. this.currentPackingIndex = idx > -1 ? idx : -1
  725. this.statusShow = true
  726. },
  727. selectStautsInfo(e) {
  728. this.productList[this.currentProductIndex].outInDetailRecordRequestList[this.currentPackingIndex].status = e.value[0]?.value
  729. this.statusShow = false
  730. },
  731. typeTimeConfirm() {
  732. this.typeTimeShow = false
  733. this.$nextTick(() => {
  734. console.log(this.currentPackingIndex)
  735. if (this.currentPackingIndex > -1) {
  736. // 单独
  737. this.productList[this.currentProductIndex].outInDetailRecordRequestList[this.currentPackingIndex][this.curDateType] = this.formatter(this.currentTypeTime)
  738. } else {
  739. // 批量
  740. this.productList[this.currentProductIndex].outInDetailRecordRequestList = this.productList[this.currentProductIndex].outInDetailRecordRequestList.map(item => {
  741. console.log(this.currentTypeTime)
  742. console.log(this.formatter(this.currentTypeTime))
  743. return {
  744. ...item,
  745. [this.curDateType]: this.formatter(this.currentTypeTime)
  746. }
  747. })
  748. }
  749. })
  750. },
  751. // 物品保存验证表单(单独)
  752. validateFormIndividually(index) {
  753. return new Promise(async resolve => {
  754. console.log('index----------------', index)
  755. let fileds = [`productList.${index}.batchNo`, `productList.${index}.packingQuantity`, `productList.${index}.packingUnit`, `productList.${index}.warehouseId`]
  756. Promise.all(
  757. fileds.map(
  758. item =>
  759. new Promise(async (res, rej) => {
  760. this.$refs.lisrFormRef.validateField(item, err => {
  761. console.log('err--', err)
  762. if (err?.length) {
  763. rej(err)
  764. } else {
  765. res(true)
  766. }
  767. })
  768. })
  769. )
  770. )
  771. .then(() => {
  772. resolve()
  773. })
  774. .catch(err => {
  775. uni.showToast({
  776. icon: 'none',
  777. title: '请填入必填项!'
  778. })
  779. })
  780. })
  781. },
  782. // 产品编辑
  783. listEdit(index) {
  784. this.currentProductIndex = index
  785. this.productList[index].isSave = false
  786. this.productList[index].outInDetailRecordRequestList = []
  787. },
  788. listSave(row, index) {
  789. console.log('index------', index)
  790. this.validateFormIndividually(index).then(async () => {
  791. console.log('通过了!!!')
  792. // 判断包装单位和计量单位是否为不拆物料层规格
  793. let packingBoolen = !!this.getDict(row.packingUnit).dictValue
  794. let measureBoolen = !!this.getDict(row.measureUnit).dictValue
  795. let packingNum = 0
  796. // 处理包装单位为KG类的情况
  797. if (packingBoolen) {
  798. let filterArr = row.packingSpecificationOption.filter(item => {
  799. return item.packageUnit == row.packingUnit && item.packageUnit != item.conversionUnit
  800. })
  801. packingNum = Math.ceil(row.packingQuantity / filterArr[0].packageCell)
  802. }
  803. // 处理包装单位不为KG类,计量单位为KG类的情况
  804. let measureNum = row.packingQuantity
  805. if (measureBoolen) {
  806. let splitIndex = row.packingSpecificationOption.findIndex(item => item.conversionUnit == row.packingUnit && item.packageUnit != item.conversionUnit)
  807. for (; splitIndex > 1; splitIndex--) {
  808. measureNum = measureNum * row.packingSpecificationOption[splitIndex].packageCell
  809. }
  810. }
  811. // 获取包装编码列表
  812. const { data } = await getAssetNum([
  813. {
  814. assetCode: row.categoryCode + row.index,
  815. batchNum: row.batchNo,
  816. num: packingBoolen ? packingNum : row.isUnpack ? (measureBoolen ? measureNum : row.measureQuantity) : row.packingQuantity
  817. }
  818. ])
  819. this.generateWrappers(row, index, data)
  820. this.$set(this.productList[index], 'isSave', true)
  821. })
  822. },
  823. // 获取当前时间函数
  824. getNowDate() {
  825. let date = new Date(),
  826. obj = {
  827. year: date.getFullYear(), //获取完整的年份(4位)
  828. month: date.getMonth() + 1, //获取当前月份(0-11,0代表1月)
  829. strDate: date.getDate(), // 获取当前日(1-31)
  830. hour: date.getHours(), //获取当前小时(0 ~ 23)
  831. minute: date.getMinutes(), //获取当前分钟(0 ~ 59)
  832. second: date.getSeconds() //获取当前秒数(0 ~ 59)
  833. }
  834. Object.keys(obj).forEach(key => {
  835. if (obj[key] < 10) obj[key] = `0${obj[key]}`
  836. })
  837. return obj
  838. },
  839. // 生成包装
  840. generateWrappers(row, productIndex, packingCodeList) {
  841. console.log('是否拆包----', row.isUnpack)
  842. console.log('包装规格----', row.packingSpecificationOption)
  843. console.log('计量单位----', row.measureUnit)
  844. console.log('包装数量----', row.packingQuantity)
  845. console.log('包装编码----', packingCodeList)
  846. let obj = this.getNowDate()
  847. let productionDate = ''
  848. let purchaseDate = ''
  849. if (this.formData.bizType == '1') {
  850. // 生产入库
  851. productionDate = `${obj.year}-${obj.month}-${obj.strDate} ${obj.hour}:${obj.minute}:${obj.second}`
  852. this.curDateType = 'productionDate'
  853. } else if (this.formData.bizType == '2') {
  854. // 采购入库
  855. purchaseDate = `${obj.year}-${obj.month}-${obj.strDate} ${obj.hour}:${obj.minute}:${obj.second}`
  856. this.curDateType = 'purchaseDate'
  857. }
  858. // 判断包装单位和计量单位是否为不拆物料层规格
  859. let packingBoolen = !!this.getDict(row.packingUnit).dictValue
  860. let measureBoolen = !!this.getDict(row.measureUnit).dictValue
  861. let num = row.packingQuantity
  862. let filterArr = []
  863. // 处理包装单位为KG类的情况
  864. if (packingBoolen) {
  865. filterArr = row.packingSpecificationOption.filter(item => {
  866. return item.packageUnit == row.packingUnit && item.packageUnit != item.conversionUnit
  867. })
  868. num = Math.ceil(row.packingQuantity / filterArr[0].packageCell)
  869. } else {
  870. if (row.isUnpack) {
  871. if (measureBoolen) {
  872. // 处理包装单位不为KG类,计量单位为KG类的情况
  873. let splitIndex = row.packingSpecificationOption.findIndex(item => item.conversionUnit == row.packingUnit && item.packageUnit != item.conversionUnit)
  874. for (; splitIndex > 1; splitIndex--) {
  875. // num = this.$math.format(num * row.packingSpecificationOption[splitIndex].packageCell, 14)
  876. num = num * row.packingSpecificationOption[splitIndex].packageCell
  877. }
  878. } else {
  879. console.log(row.packingSpecificationOption)
  880. let splitIndex = row.packingSpecificationOption.findIndex(item => item.conversionUnit == row.packingUnit && item.packageUnit != item.conversionUnit)
  881. console.log(splitIndex)
  882. for (; splitIndex > 0; splitIndex--) {
  883. console.log(splitIndex)
  884. // num = this.$math.format(num * row.packingSpecificationOption[splitIndex].packageCell, 14)
  885. num = num * row.packingSpecificationOption[splitIndex].packageCell
  886. }
  887. }
  888. } else {
  889. num = row.packingQuantity
  890. }
  891. }
  892. for (let index = 0; index < num; index++) {
  893. let measureQuantity = 1
  894. // 处理包装单位为KG类,计算每桶KG值
  895. if (packingBoolen) {
  896. // console.log(this.$math.format(filterArr[0].packageCell * (index + 1), 14))
  897. console.log(filterArr[0].packageCell * (index + 1))
  898. console.log(row.packingQuantity)
  899. // measureQuantity =
  900. // Number(row.packingQuantity) > this.$math.format(filterArr[0].packageCell * (index + 1), 14)
  901. // ? filterArr[0].packageCell
  902. // : Number(row.packingQuantity) - this.$math.format(filterArr[0].packageCell * index, 14)
  903. measureQuantity = Number(row.packingQuantity) > filterArr[0].packageCell * (index + 1) ? filterArr[0].packageCell : Number(row.packingQuantity) - filterArr[0].packageCell * index
  904. } else {
  905. if (!row.isUnpack) {
  906. if (measureBoolen) {
  907. // 处理包装单位不为KG类,计量单位为KG类的情况
  908. let splitIndex = row.packingSpecificationOption.findIndex(item => item.conversionUnit == row.packingUnit && item.packageUnit != item.conversionUnit)
  909. for (; splitIndex > 0; splitIndex--) {
  910. // measureQuantity = this.$math.format(measureQuantity * row.packingSpecificationOption[splitIndex].packageCell, 14)
  911. measureQuantity = measureQuantity * row.packingSpecificationOption[splitIndex].packageCell
  912. }
  913. } else {
  914. let splitIndex = row.packingSpecificationOption.findIndex(item => item.conversionUnit == row.packingUnit && item.packageUnit != item.conversionUnit)
  915. for (; splitIndex > 0; splitIndex--) {
  916. console.log(splitIndex)
  917. // measureQuantity = this.$math.format(measureQuantity * row.packingSpecificationOption[splitIndex].packageCell, 14)
  918. measureQuantity = measureQuantity * row.packingSpecificationOption[splitIndex].packageCell
  919. }
  920. }
  921. }
  922. }
  923. let item = {
  924. index: row.index + '-' + index, // 包装索引
  925. warehouseId: row.warehouseIds[0], // 仓库id
  926. warehouseName: row.warehouseNames[0], // 仓库名称
  927. categoryName: row.categoryName, // 产品名称
  928. categoryCode: row.categoryCode, // 产品编码
  929. categoryModel: row.categoryModel, // 物品型号
  930. specification: row.specification, // 规格
  931. brandNum: row.brandNum, // 牌号
  932. parentIndex: row.index, // 产品索引
  933. batchNo: row.batchNo, // 批次号
  934. packageNo: packingCodeList[index].onlyCode, // 包装编码
  935. packingQuantity: 1, // 包装数量
  936. packingUnit: row.isUnpack
  937. ? packingBoolen
  938. ? filterArr[0].conversionUnit
  939. : measureBoolen
  940. ? row.packingSpecificationOption[1].conversionUnit
  941. : row.measureUnit
  942. : packingBoolen
  943. ? filterArr[0].conversionUnit
  944. : row.packingUnit,
  945. measureQuantity: row.isUnpack ? (packingBoolen ? measureQuantity : measureBoolen ? row.packingSpecificationOption[1].packageCell : measureQuantity) : measureQuantity, // 计量数量
  946. measureUnit: row.isUnpack ? (measureBoolen ? row.packingSpecificationOption[1].packageUnit : row.measureUnit) : row.measureUnit, // 计量单位
  947. weight: 0, // 重量
  948. packingSpecificationOption: row.packingSpecificationOption, // 包装规格
  949. weightUnit: row.weightUnit, // 重量单位
  950. netWeight: row.netWeight, // 净重
  951. barcodes: '', // 发货条码
  952. clientCode: '', // 客户代号
  953. materielDesignation: '', // 物料代号
  954. engrave: '', // 刻码
  955. isUnpack: row.isUnpack, // 是否允许拆包
  956. productionDate: productionDate, // 生产日期
  957. purchaseDate: purchaseDate, // 采购时间
  958. result: 1, // 结果(1合格 2不合格)
  959. status: 1 // 状态(0=未质检 1已质检)
  960. }
  961. let outBoolen = !!this.getDict(item.measureUnit).dictValue
  962. console.log('this.dictCodeList-------', this.dictCodeList)
  963. console.log('item.measureUnit-------', item)
  964. console.log('!!this.getDict(item.measureUnit).dictValue--------', this.getDict(item.measureUnit))
  965. if (outBoolen) {
  966. // 计量单位为KG类,直接替换
  967. item.weight = item.measureQuantity
  968. } else {
  969. // 计量单位为不为KG类,重新统计计算
  970. let inBoolen = !!this.getDict(item.packingSpecificationOption[0].packageUnit).dictValue
  971. let startIndex = item.packingSpecificationOption.findIndex(ite => {
  972. return item.measureUnit == ite.packingUnit && ite.packingUnit != ite.conversionUnit
  973. })
  974. console.log(startIndex)
  975. let endIndex = item.packingSpecificationOption.findIndex(ite => item.packingUnit == ite.conversionUnit)
  976. console.log(endIndex)
  977. let total = item.packingQuantity
  978. for (; startIndex < endIndex; endIndex--) {
  979. // total = this.$math.format(item.packingSpecificationOption[endIndex].packageCell * total, 14)
  980. total = item.packingSpecificationOption[endIndex].packageCell * total
  981. }
  982. if (inBoolen) {
  983. // 第二层为KG类
  984. item.weight = total
  985. } else {
  986. // 第二层不为KG类
  987. // item.weight = this.$math.format(total * item.netWeight, 14)
  988. item.weight = total * item.netWeight
  989. }
  990. }
  991. row.outInDetailRecordRequestList.push(item)
  992. }
  993. // // 单独点击保存并插入对应位置(包装)
  994. // if (productIndex == 0) {
  995. // this.packingList.splice(productIndex, 0, ...packingList)
  996. // } else {
  997. // let packingIndex = this.packingList.findLastIndex(item => item.parentIndex == this.productList[productIndex - 1].index)
  998. // this.packingList.splice(packingIndex + 1, 0, ...packingList)
  999. // }
  1000. },
  1001. async requireDictCode() {
  1002. // 不拆物料层规格列表
  1003. const res = await getByCode('material_layer')
  1004. this.dictCodeList = res.map(item => {
  1005. const arr = Object.entries(item)
  1006. return {
  1007. dictCode: arr[0][0],
  1008. dictValue: arr[0][1]
  1009. }
  1010. })
  1011. },
  1012. getDict(dictCode) {
  1013. // 不拆物料层规格列表
  1014. if (this.dictCodeList.length > 0) {
  1015. return this.dictCodeList.find(item => item.dictCode == dictCode) || {}
  1016. } else {
  1017. return {}
  1018. }
  1019. },
  1020. async computeNum(row, index, isClear) {
  1021. console.log(row)
  1022. console.log(row.packingQuantity)
  1023. console.log(row.packingUnit)
  1024. // 清空仓库(包装数量输入)
  1025. if (isClear) {
  1026. // this.$set(this.productList[index], 'warehouseId', '')
  1027. // this.$set(this.productList[index], 'warehouseName', '')
  1028. if (row.packingQuantity < 1) {
  1029. this.$set(this.productList[index], 'packingQuantity', 1)
  1030. } else if (row.packingQuantity > 9999) {
  1031. this.$set(this.productList[index], 'packingQuantity', 9999)
  1032. } else {
  1033. this.$set(this.productList[index], 'packingQuantity', row.packingQuantity.replace(/[^\d\.{2,}]/g, ''))
  1034. }
  1035. }
  1036. if (row.packingQuantity && row.packingUnit) {
  1037. let startIndex = row.packingSpecificationOption.findIndex(ite => {
  1038. return row.measuringUnit == ite.packingUnit && ite.packingUnit != ite.conversionUnit
  1039. })
  1040. console.log(startIndex)
  1041. let endIndex = row.packingSpecificationOption.findIndex(ite => row.packingUnit == ite.conversionUnit)
  1042. console.log(endIndex)
  1043. let total = row.packingQuantity
  1044. for (; startIndex < endIndex; endIndex--) {
  1045. total = row.packingSpecificationOption[endIndex].packageCell * total
  1046. }
  1047. row.measureQuantity = total
  1048. // 判断包装单位和计量单位是否为不拆物料层规格
  1049. console.log(this.getDict(row.packingUnit))
  1050. let packingBoolen = !!this.getDict(row.packingUnit).dictValue
  1051. let measureBoolen = !!this.getDict(row.measureUnit).dictValue
  1052. if (packingBoolen || measureBoolen) {
  1053. row.weight = total
  1054. } else {
  1055. row.weight = total * row.netWeight
  1056. }
  1057. }
  1058. },
  1059. //获取仓库
  1060. async getwarehouseList() {
  1061. let res = await getWarehouseList()
  1062. this.warehouseListOption = [res.data]
  1063. },
  1064. showWarehousePicker(index) {
  1065. this.currentProductIndex = index
  1066. this.warehouseShow = true
  1067. },
  1068. showPackingUnitPicker(data, index) {
  1069. this.currentProductIndex = index
  1070. this.currentPackingSpecificationOption = [data.packingSpecificationOption]
  1071. this.packingUnitsShow = true
  1072. },
  1073. showSupplierPicker(data, index) {
  1074. this.currentProductIndex = index
  1075. this.currentSupplierListOption = [data.supplierListOptions]
  1076. this.suppliersShow = true
  1077. },
  1078. selectPackingUnitInfo(e) {
  1079. this.productList[this.currentProductIndex].packingUnit = e.value[0]?.conversionUnit
  1080. this.computeNum(this.productList[this.currentProductIndex], this.currentProductIndex)
  1081. this.packingUnitsShow = false
  1082. },
  1083. selectSuppliersInfo(e) {
  1084. this.productList[this.currentProductIndex].supplierName = e.value[0]?.name
  1085. this.productList[this.currentProductIndex].supplierId = e.value[0]?.id
  1086. this.suppliersShow = false
  1087. },
  1088. selectWarehouseInfo(e) {
  1089. this.productList[this.currentProductIndex].warehouseName = e.value[0]?.name
  1090. this.productList[this.currentProductIndex].warehouseId = e.value[0]?.id
  1091. this.productList[this.currentProductIndex].warehouseNames = [e.value[0]?.name]
  1092. this.productList[this.currentProductIndex].warehouseIds = [e.value[0]?.id]
  1093. this.warehouseShow = false
  1094. },
  1095. selectTimeTypeInfo(e) {
  1096. this.curDateType = e.value[0]?.prop
  1097. this.timeTypeShow = false
  1098. },
  1099. sceneStateFilter(bizType) {
  1100. if (bizType) {
  1101. return this.sceneState.filter(item => item.value == bizType)[0].text
  1102. }
  1103. },
  1104. formatter(dataTime) {
  1105. return dayjs(dataTime).format('YYYY-MM-DD HH:mm:ss')
  1106. },
  1107. timeConfirm() {
  1108. this.timeShow = false
  1109. this.$nextTick(() => {
  1110. console.log(this.storageTime)
  1111. console.log(this.formatter(this.storageTime))
  1112. this.formData.storageTime = this.formatter(this.storageTime)
  1113. console.log(this.formData)
  1114. })
  1115. },
  1116. timeCancel() {
  1117. this.timeShow = false
  1118. },
  1119. openPicker() {
  1120. this.$refs.treePicker._show()
  1121. },
  1122. // 获取物品列表
  1123. async getListItems() {
  1124. this.goodsLists = await getTreeByGroup({ type: 2 })
  1125. },
  1126. confirm(data, name, allList) {
  1127. console.log('name-------', name)
  1128. this.assetTypeName = name
  1129. this.formData.extInfo.assetType = allList.map(item => item.id)
  1130. },
  1131. handleScan() {
  1132. if (this.formData.bizType !== '' && this.formData.bizType != 5) {
  1133. uni.showModal({
  1134. title: '提示',
  1135. content: '仅退还入库支持扫码,是否清除已选明细并切换至退还入库?',
  1136. success: async res => {
  1137. if (res.confirm) {
  1138. this.productList = []
  1139. this.formData.bizType = 5
  1140. this.getData()
  1141. }
  1142. }
  1143. })
  1144. return
  1145. }
  1146. this.getData()
  1147. },
  1148. // goScan () {
  1149. // uni.navigateTo({
  1150. // url: '/pages/ScanCode/ScanCode'
  1151. // })
  1152. // },
  1153. // 根据条码请求设备数据 @_@
  1154. getData() {
  1155. let par = {
  1156. barType: this.qrContent.split('@_@')[1] || 0,
  1157. qrContent: this.qrContent
  1158. }
  1159. // uni.showLoading({
  1160. // title: '加载中',
  1161. // mask: true
  1162. // })
  1163. // postJ(this.apiUrl + '/scan/getAssetInfo', par)
  1164. // .then(res => {
  1165. // let data = res.data
  1166. // console.log(data, 'qrContent')
  1167. // if (data.assetType === undefined) {
  1168. // uni.showToast({
  1169. // title: '请扫码物品码',
  1170. // icon: 'none'
  1171. // })
  1172. // return
  1173. // } else if (data.source == 2) {
  1174. // uni.showModal({
  1175. // title: '提示',
  1176. // content: '当前物品已在库',
  1177. // success: async res => {}
  1178. // })
  1179. // return
  1180. // } else if (this.warehousingName && this.formData.assetType != data.assetType) {
  1181. // uni.showToast({
  1182. // title: `当前物品不属于${this.warehousingName}分类`,
  1183. // icon: 'none'
  1184. // })
  1185. // return
  1186. // }
  1187. // this.setScanMaterial(data)
  1188. // })
  1189. // .finally(() => {
  1190. // uni.hideLoading()
  1191. // })
  1192. },
  1193. async setScanMaterial(data) {
  1194. this.formData.assetType = data.assetType
  1195. this.formData.bizType = 5
  1196. const curMap = {
  1197. assetId: 'id',
  1198. assetCode: 'informationCode', //编码
  1199. assetName: 'informationName', //名称
  1200. materialId: 'id',
  1201. materialName: 'informationName',
  1202. batchNo: '', //批次号
  1203. unit: 'measuringUnit', //单位
  1204. minPackUnit: 'packingUnit' //最小包装单位
  1205. }
  1206. let obj = {}
  1207. for (const key in curMap) {
  1208. obj[key] = (curMap[key] && data.information[curMap[key]]) || ''
  1209. }
  1210. let detailObj = uni.$u.deepClone(obj)
  1211. detailObj.onlyCode = data.assetCode
  1212. obj = {
  1213. ...data.information,
  1214. ...obj,
  1215. ...{
  1216. cargoSpaceCode: '', //货位编码
  1217. cargoSpaceId: '', //货位id
  1218. shelfId: '', //货架id
  1219. shelfCode: '', //货架名称
  1220. areaId: '', //库区id
  1221. areaName: '', //库区名称
  1222. warehouseId: '', //仓库id
  1223. warehouseName: '', //仓库名称
  1224. measurementUnit: '',
  1225. bizStatus: 1,
  1226. contentImage: []
  1227. }
  1228. }
  1229. let warehouseLedgerDetails = [detailObj]
  1230. this.productList.push(obj)
  1231. this.$set(this.productList[this.productList.length - 1], 'warehouseLedgerDetails', warehouseLedgerDetails)
  1232. this.$set(this.productList[this.productList.length - 1], 'selfWarehouseLedgerDetails', uni.$u.deepClone(warehouseLedgerDetails))
  1233. this.handleBatchSetting(obj, this.productList.length - 1, true)
  1234. },
  1235. calcSum(a, b, c, row) {
  1236. if ((Number.isNaN(+a) && a !== '') || (Number.isNaN(+b) && b !== '') || (Number.isNaN(+c) && c !== '')) {
  1237. return ''
  1238. }
  1239. return a * b * c + { yuan: '元', wanyuan: '万元' }[row.univalenceUnit]
  1240. },
  1241. handleBatchSetting(item, index, isScan = false) {
  1242. this.settingIndex = index
  1243. uni.setStorageSync('inputData', item)
  1244. uni.setStorageSync('productList', this.productList || [])
  1245. uni.navigateTo({
  1246. url: '/pages/warehouse/enterHouse/batchNumEdit?bizType=' + this.formData.bizType + '&assetType=' + this.formData.assetType + '&index=' + index + '&isScan=' + isScan
  1247. })
  1248. },
  1249. chooseFile(file) {
  1250. console.log(file)
  1251. this.$refs.lFile.upload({
  1252. //替换为你的上传接口地址
  1253. url: this.apiUrl + '/data/doc/add',
  1254. // 服务端接收附件的key
  1255. name: 'file',
  1256. //根据你接口需求自定义 (优先不传content-type,安卓端无法收到参数再传)
  1257. header: {
  1258. Authorization: 'bearer eyJhbGciO',
  1259. uid: '27682',
  1260. client: 'app'
  1261. }
  1262. // 限制选择附件的大小上限,默认10M
  1263. // maxSize: 20,
  1264. // 若需要在body单独添加附件名或附件大小如下方式传入组件:
  1265. // addName: '后端要的附件名称字段key,此处请勿写name的同值如(file),会覆盖name',
  1266. // addSize: '后端要的附件大小字段key'
  1267. // body参数直接写key,value,如:
  1268. // date: '2020-1-1',
  1269. // key2: 'value2',
  1270. })
  1271. },
  1272. // 抬头下拉信息保存
  1273. handlePicker(e, list, idKey, nameKey) {
  1274. console.log('e?.detail--------------', e)
  1275. if (idKey) {
  1276. this.formData[idKey] = list[e?.detail.value]?.value
  1277. }
  1278. if (nameKey) {
  1279. this.formData[nameKey] = list[e?.detail.value]?.text
  1280. }
  1281. this.$nextTick(() => {
  1282. if (idKey === 'assetType' || idKey === 'bizType') {
  1283. this.$refs.formRef.validateField(idKey)
  1284. }
  1285. console.log('this.formData.bizType---', this.formData.bizType)
  1286. })
  1287. },
  1288. // 抬头下拉信息保存
  1289. handleDictPicker(e, list, idKey, nameKey) {
  1290. if (idKey) {
  1291. this.formData[idKey] = list[e?.detail.value]?.dictCode
  1292. }
  1293. if (nameKey) {
  1294. this.formData[nameKey] = list[e?.detail.value]?.dictValue
  1295. }
  1296. this.$nextTick(() => {
  1297. if (idKey === 'assetType' || idKey === 'bizType') {
  1298. this.$refs.formRef.validateField(idKey)
  1299. }
  1300. })
  1301. },
  1302. // 明细下拉信息保存
  1303. handleListPicker(e, list, item, idKey, nameKey) {
  1304. if (idKey) {
  1305. item[idKey] = list[e.detail.value].id
  1306. }
  1307. if (nameKey) {
  1308. item[nameKey] = list[e.detail.value].name
  1309. }
  1310. },
  1311. //获取仓库信息
  1312. handleWarehouseChoose(item) {
  1313. this.$refs.warehouseChooseRef.openDefault(item, res => {
  1314. Object.assign(item, res)
  1315. })
  1316. },
  1317. //状态
  1318. getstatus(e) {
  1319. this.formData.houseType = this.statusList[e.detail.value].name
  1320. },
  1321. //上传附件
  1322. getUpFlie(res) {
  1323. console.log(res)
  1324. let arr = []
  1325. res.forEach(item => {
  1326. let obj = {
  1327. accessUrl: item.accessUrl,
  1328. docId: item.docId,
  1329. name: item.name,
  1330. size: item.size,
  1331. url: item.url,
  1332. type: 1
  1333. }
  1334. // obj.type.id = item.type.id;
  1335. // obj.type.value = item.type.name;
  1336. arr.push(obj)
  1337. })
  1338. this.formData.attaments = arr
  1339. },
  1340. //选择入库类别跳转
  1341. selectType() {
  1342. if (!this.formData.extInfo.assetType) {
  1343. uni.showToast({
  1344. title: '请选择物品类型',
  1345. icon: 'none'
  1346. })
  1347. return
  1348. }
  1349. if (!this.formData.bizType) {
  1350. uni.showToast({
  1351. title: '请选择入库场景',
  1352. icon: 'none'
  1353. })
  1354. return
  1355. }
  1356. uni.navigateTo({
  1357. url: '/pages/warehouse/enterHouse/selectEnterType?assetType=' + this.formData.extInfo.assetType
  1358. })
  1359. },
  1360. //删除
  1361. getDelete(index) {
  1362. uni.showModal({
  1363. title: '提示',
  1364. content: '是否删除当前物品',
  1365. success: res => {
  1366. if (res.confirm) {
  1367. this.productList.splice(index, 1)
  1368. }
  1369. }
  1370. })
  1371. },
  1372. deletePacking(index, idx) {
  1373. uni.showModal({
  1374. title: '提示',
  1375. content: '是否删除当前包装',
  1376. success: res => {
  1377. if (res.confirm) {
  1378. this.productList[index].outInDetailRecordRequestList.splice(idx, 1)
  1379. this.productList[index].packingQuantity = this.productList[index].packingQuantity - 1
  1380. }
  1381. }
  1382. })
  1383. },
  1384. // 入库操作
  1385. // listEdit(row) {
  1386. // this.$set(row, 'isSave', false)
  1387. // },
  1388. // listSave(row, index) {
  1389. // const fileds = [`productList.${index}.cargoSpaceCode`, `productList.${index}.batchNum`]
  1390. // if (this.formData.bizType != 5) {
  1391. // fileds.push(...[`productList.${index}.outInNum`, `productList.${index}.measurementUnit`])
  1392. // } else if (this.productList.some(i => !i.selfWarehouseLedgerDetails?.length)) {
  1393. // uni.showToast({
  1394. // title: '请选择资产编号!',
  1395. // icon: 'none'
  1396. // })
  1397. // return
  1398. // }
  1399. // Promise.all(
  1400. // fileds.map(
  1401. // item =>
  1402. // new Promise(async (resolve, rej) => {
  1403. // this.$refs.lisrFormRef.validateField(item, err => {
  1404. // if (err?.length) {
  1405. // rej(err)
  1406. // } else {
  1407. // resolve()
  1408. // }
  1409. // })
  1410. // })
  1411. // )
  1412. // )
  1413. // .then(res => {
  1414. // this.$set(row, 'isSave', true)
  1415. // if (this.formData.bizType != 5) {
  1416. // this.createMaterialCode(row)
  1417. // } else {
  1418. // // 退还
  1419. // this.createMaterialCodeReturn(row)
  1420. // }
  1421. // })
  1422. // .catch(err => {
  1423. // uni.showToast({
  1424. // icon: 'error',
  1425. // title: '请填入必填项!'
  1426. // })
  1427. // })
  1428. // },
  1429. //入库明细删除
  1430. listDel(row, index) {
  1431. this.productList.splice(index, 1)
  1432. },
  1433. // 入库明细生成条码信息
  1434. async createMaterialCode(row) {
  1435. return
  1436. // 添加相同物品重新更新明细 原料编码
  1437. const list = this.productList.filter(i => i.assetCode === row.assetCode && i.batchNum === row.batchNum && i.isSave)
  1438. const num = list.reduce((num, pre) => {
  1439. num += row.isUnpack ? pre.outInNum * pre.measurementUnit : pre.outInNum
  1440. return num
  1441. }, 0)
  1442. const res = await postJ(this.apiUrl + '/outInWarehouse/getAssetNum', {
  1443. batchNum: row.batchNum,
  1444. assetCode: row.assetCode,
  1445. num
  1446. })
  1447. if (res?.success) {
  1448. list.forEach(item => {
  1449. if (item.warehouseLedgerDetails?.length) {
  1450. item.warehouseLedgerDetails.forEach(i => {
  1451. i.onlyCode = res.data.shift().onlyCode
  1452. })
  1453. } else {
  1454. this.$set(
  1455. item,
  1456. 'warehouseLedgerDetails',
  1457. Array.from(new Array(item.isUnpack ? item.outInNum * item.measurementUnit : +item.outInNum), (val, idx) => {
  1458. return {
  1459. ...item,
  1460. onlyCode: res.data.shift().onlyCode,
  1461. bizStatus: 1,
  1462. contentImage: []
  1463. }
  1464. })
  1465. )
  1466. }
  1467. })
  1468. }
  1469. // 添加相同物品,重复批次号 重新更新明细 包装编码
  1470. const batchList = this.productList.filter(i => i.batchNum === row.batchNum && i.isSave)
  1471. if (batchList.length) {
  1472. const num = batchList.reduce((num, pre) => {
  1473. num += +pre.outInNum
  1474. return num
  1475. }, 0)
  1476. const res1 = await postJ(this.apiUrl + '/outInWarehouse/getAssetNum', {
  1477. batchNum: row.batchNum,
  1478. num
  1479. })
  1480. if (res1?.success) {
  1481. batchList.forEach(item => {
  1482. let num = res1.data.shift()?.num
  1483. let measurementUnit = item.measurementUnit
  1484. if (item.warehouseLedgerDetails?.length) {
  1485. item.warehouseLedgerDetails.forEach((i, index) => {
  1486. this.$set(i, 'num', num)
  1487. if (!item.isUnpack) {
  1488. if (index < item.warehouseLedgerDetails.length - 1) {
  1489. num = res1.data.shift()?.num
  1490. }
  1491. } else {
  1492. // 拆包的包装编码一致
  1493. measurementUnit--
  1494. if (measurementUnit === 0 && index < item.warehouseLedgerDetails.length - 1) {
  1495. measurementUnit = item.measurementUnit
  1496. num = res1.data.shift()?.num
  1497. }
  1498. }
  1499. })
  1500. }
  1501. })
  1502. }
  1503. }
  1504. },
  1505. // 入库明细生成条码信息 退还
  1506. async createMaterialCodeReturn(row) {
  1507. return
  1508. // 添加相同物品重新更新明细 原料编码
  1509. const list = this.productList.filter(i => i.batchNum === row.batchNum && i.isSave)
  1510. // 退还
  1511. const res = await postJ(this.apiUrl + '/outInWarehouse/getAssetNum', {
  1512. batchNum: row.batchNum,
  1513. num: list.reduce((num, pre) => {
  1514. num += pre.selfWarehouseLedgerDetails.length
  1515. return num
  1516. }, 0)
  1517. })
  1518. if (res?.success) {
  1519. list.forEach(item => {
  1520. const num = res.data.shift().num
  1521. if (item.warehouseLedgerDetails?.length) {
  1522. item.warehouseLedgerDetails.forEach(i => {
  1523. i.num = num
  1524. if (!item.isUnpack) {
  1525. // 拆包的包装编码一致
  1526. num = res.data.shift()?.num
  1527. }
  1528. })
  1529. } else {
  1530. this.$set(
  1531. item,
  1532. 'warehouseLedgerDetails',
  1533. item.selfWarehouseLedgerDetails.map((val, idx) => {
  1534. let obj = {
  1535. ...val,
  1536. bizStatus: 1,
  1537. batchNum: item.batchNum,
  1538. cargoSpaceCode: item.cargoSpaceCode, //货位编码
  1539. cargoSpaceId: item.cargoSpaceId, //货位id
  1540. shelfId: item.shelfId, //货架id
  1541. shelfCode: item.shelfCode, //货架名称
  1542. areaId: item.areaId, //库区id
  1543. areaName: item.areaName, //库区名称
  1544. warehouseId: item.warehouseId, //仓库id
  1545. warehouseName: item.warehouseName, //仓库名称
  1546. num
  1547. }
  1548. if (!item.isUnpack) {
  1549. // 拆包的包装编码一致
  1550. num = res.data.shift()?.num
  1551. }
  1552. return obj
  1553. })
  1554. )
  1555. }
  1556. })
  1557. }
  1558. },
  1559. //确定提交
  1560. getsure() {
  1561. return
  1562. this.$refs.formRef.validate().then(res => {
  1563. if (!this.productList?.length) {
  1564. uni.showToast({
  1565. icon: 'error',
  1566. title: '请添加明细!'
  1567. })
  1568. return
  1569. } else if (this.productList.some(item => !item.warehouseLedgerDetails?.length)) {
  1570. uni.showToast({
  1571. icon: 'error',
  1572. title: '请完善明细信息!'
  1573. })
  1574. return
  1575. }
  1576. const params = {
  1577. outInWarehouse: { ...this.formData, bizStatus: 1 },
  1578. warehouseLedgerInfos: this.productList
  1579. }
  1580. postJ(this.apiUrl + '/outInWarehouse/add', params).then(res => {
  1581. if (res?.success) {
  1582. uni.showToast({
  1583. icon: 'success',
  1584. title: '保存成功'
  1585. })
  1586. setTimeout(() => {
  1587. uni.navigateBack({
  1588. delta: 1
  1589. })
  1590. }, 1500)
  1591. }
  1592. })
  1593. })
  1594. },
  1595. // 部门确认
  1596. deptConfirm(data, name) {
  1597. this.formData.deptName = name
  1598. this.formData.deptCode = data[0]
  1599. },
  1600. // 部门确认
  1601. verifyDeptConfirm(data, name) {
  1602. this.formData.verifyDeptCode = data[0]
  1603. this.formData.verifyDeptName = name
  1604. this.formData.verifyId = ''
  1605. this.formData.verifyName = ''
  1606. this.getUser(data[0])
  1607. },
  1608. // 获取部门
  1609. getDept() {
  1610. return
  1611. get(this.apiUrl + '/main/org/dept/effectiveTree').then(res => {
  1612. if (res?.success) {
  1613. this.deptList = res.data
  1614. }
  1615. })
  1616. },
  1617. // 获取供应商
  1618. getSupplier() {
  1619. // post(this.apiUrl + `/main/supplier/list?page=1&size=999`, {
  1620. // page: 1,
  1621. // size: 999
  1622. // }).then(res => {
  1623. // if (res?.success) {
  1624. // this.supplierList = res.data.items
  1625. // }
  1626. // })
  1627. },
  1628. // 获取人员
  1629. getUser(deptCode) {
  1630. // post(this.apiUrl + '/main/user/list', {
  1631. // deptCode,
  1632. // page: 1,
  1633. // size: 9999
  1634. // }).then(res => {
  1635. // if (res?.success) {
  1636. // this.userList = res.data.items.map(item => {
  1637. // item.name = item.trueName
  1638. // item.id = item.userId
  1639. // return item
  1640. // })
  1641. // }
  1642. // })
  1643. }
  1644. }
  1645. }
  1646. </script>
  1647. <style lang="scss" scoped>
  1648. .mainBox {
  1649. padding-bottom: 120rpx;
  1650. /deep/.required-form .u-form-item__body__left__content__label::before {
  1651. content: '*';
  1652. color: red;
  1653. }
  1654. }
  1655. .required-form-text {
  1656. /deep/ .u-form-item__body__right {
  1657. overflow: hidden;
  1658. .u-form-item__body__right__content {
  1659. width: 100%;
  1660. display: inline-block !important;
  1661. width: 100%;
  1662. }
  1663. }
  1664. }
  1665. .picList {
  1666. display: flex;
  1667. align-items: center;
  1668. justify-items: flex-start;
  1669. flex-wrap: wrap;
  1670. }
  1671. /deep/.baseForm {
  1672. .u-form-item__body {
  1673. padding: 0px !important;
  1674. }
  1675. .assetType_box {
  1676. padding: 12rpx 18rpx;
  1677. width: 100%;
  1678. overflow: hidden;
  1679. white-space: nowrap;
  1680. text-overflow: ellipsis;
  1681. }
  1682. }
  1683. /deep/.picList .u-image {
  1684. margin-right: 10rpx;
  1685. margin-bottom: 10rpx;
  1686. }
  1687. /deep/.cLine .u-line:nth-child(1) {
  1688. border-bottom: none !important;
  1689. }
  1690. .detail-box {
  1691. position: relative;
  1692. display: flex;
  1693. justify-content: space-between;
  1694. align-items: center;
  1695. /deep/uni-button {
  1696. margin: 0 !important;
  1697. width: 180rpx;
  1698. }
  1699. .selectEnterType {
  1700. margin-left: 10rpx !important;
  1701. }
  1702. }
  1703. .footBox {
  1704. position: fixed;
  1705. left: 0px;
  1706. bottom: 0px;
  1707. height: 100rpx;
  1708. width: 100%;
  1709. display: flex;
  1710. align-items: center;
  1711. justify-content: space-between;
  1712. view {
  1713. width: 100%;
  1714. height: 100%;
  1715. text-align: center;
  1716. color: #fff;
  1717. display: flex;
  1718. align-items: center;
  1719. justify-content: center;
  1720. }
  1721. .reg {
  1722. background: $u-success-dark;
  1723. }
  1724. .add {
  1725. background: $uni-color-primary;
  1726. }
  1727. .uni-icons {
  1728. margin-right: 8rpx !important;
  1729. }
  1730. }
  1731. .listBox {
  1732. padding: 20rpx 10rpx;
  1733. border-bottom: 1px #f2f2f2 solid;
  1734. position: relative;
  1735. &.code {
  1736. .label {
  1737. width: 120rpx !important;
  1738. }
  1739. }
  1740. .listTit {
  1741. width: 100%;
  1742. display: flex;
  1743. justify-content: space-between;
  1744. align-items: center;
  1745. /deep/uni-button {
  1746. margin-right: 20rpx;
  1747. width: 100rpx;
  1748. &.assets {
  1749. width: 180rpx;
  1750. }
  1751. }
  1752. .name {
  1753. width: 50%;
  1754. margin-left: 10px;
  1755. overflow: hidden;
  1756. white-space: nowrap;
  1757. -o-text-overflow: ellipsis;
  1758. text-overflow: ellipsis;
  1759. font-size: 30rpx;
  1760. }
  1761. .btn {
  1762. display: flex;
  1763. justify-content: flex-end;
  1764. }
  1765. .weight {
  1766. width: 30%;
  1767. font-size: 30rpx;
  1768. margin-left: auto;
  1769. margin-right: 60rpx;
  1770. position: relative;
  1771. display: flex;
  1772. input {
  1773. margin-right: 10rpx;
  1774. border: 1px solid black;
  1775. width: 40%;
  1776. height: 20rpx;
  1777. }
  1778. }
  1779. .weight::after {
  1780. position: absolute;
  1781. right: -30rpx;
  1782. top: 50%;
  1783. content: '';
  1784. background: #eee;
  1785. width: 1px;
  1786. height: 28rpx;
  1787. margin-top: -14rpx;
  1788. }
  1789. }
  1790. .z_list {
  1791. height: 100% !important;
  1792. max-height: 500rpx;
  1793. .material {
  1794. margin-top: 10rpx;
  1795. .left {
  1796. width: 40rpx;
  1797. }
  1798. .zdy_check {
  1799. width: 30rpx;
  1800. height: 30rpx;
  1801. border: 2rpx solid #c8c9cc;
  1802. border-radius: 4rpx;
  1803. }
  1804. .check_active {
  1805. background: $theme-color;
  1806. border: 2rpx solid $theme-color;
  1807. /deep/ .u-icon__icon {
  1808. color: #fff !important;
  1809. }
  1810. }
  1811. .content_table {
  1812. width: 670rpx;
  1813. border: 2rpx solid $border-color;
  1814. .item {
  1815. display: flex;
  1816. border-bottom: 2rpx solid $border-color;
  1817. .lable {
  1818. width: 200rpx;
  1819. text-align: center;
  1820. background-color: #f7f9fa;
  1821. font-size: 26rpx;
  1822. border-right: 2rpx solid $border-color;
  1823. flex-shrink: 0;
  1824. }
  1825. .ww80 {
  1826. width: 80rpx;
  1827. }
  1828. .content {
  1829. width: 500rpx;
  1830. min-height: 64rpx;
  1831. font-size: 28rpx;
  1832. line-height: 28rpx;
  1833. font-style: normal;
  1834. font-weight: 400;
  1835. padding: 18rpx 8rpx;
  1836. box-sizing: border-box;
  1837. word-wrap: break-word;
  1838. flex-grow: 1 !important;
  1839. }
  1840. .input_box {
  1841. padding: 0 !important;
  1842. }
  1843. .content_num {
  1844. display: flex;
  1845. align-items: center;
  1846. padding: 0 4rpx;
  1847. /deep/ .uni-input-input {
  1848. width: 200rpx;
  1849. border: 2rpx solid #f0f8f2;
  1850. background: #f0f8f2;
  1851. color: $theme-color;
  1852. }
  1853. .unit {
  1854. padding: 0 4rpx;
  1855. font-size: 24rpx;
  1856. color: #404446;
  1857. }
  1858. }
  1859. .ww400 {
  1860. /deep/ .uni-input-input {
  1861. width: 400rpx;
  1862. }
  1863. }
  1864. .pd4 {
  1865. padding: 4rpx 8rpx;
  1866. }
  1867. &:last-child {
  1868. border-bottom: none;
  1869. }
  1870. }
  1871. .ww55 {
  1872. width: 55%;
  1873. }
  1874. .ww45 {
  1875. width: 45%;
  1876. }
  1877. .ww50 {
  1878. width: 50%;
  1879. }
  1880. .ww30 {
  1881. width: 30%;
  1882. }
  1883. .ww70 {
  1884. width: 70%;
  1885. }
  1886. .ww80 {
  1887. width: 80%;
  1888. }
  1889. .ww20 {
  1890. width: 20%;
  1891. }
  1892. .check {
  1893. width: 30rpx;
  1894. height: 30rpx;
  1895. }
  1896. .tag_box {
  1897. padding: 2rpx 10rpx;
  1898. margin-right: 12rpx;
  1899. background: #e6a23c;
  1900. font-size: 22rpx;
  1901. color: #fff;
  1902. border-radius: 4rpx;
  1903. }
  1904. }
  1905. }
  1906. }
  1907. .more {
  1908. position: absolute;
  1909. bottom: 26rpx;
  1910. right: 30rpx;
  1911. font-size: 28rpx;
  1912. color: #666;
  1913. }
  1914. }
  1915. .listCont {
  1916. display: flex;
  1917. align-items: center;
  1918. flex-wrap: wrap;
  1919. margin-top: 20rpx;
  1920. margin-left: 10rpx;
  1921. &.save {
  1922. .u-input {
  1923. border: none;
  1924. }
  1925. }
  1926. .u-input {
  1927. border: 1px solid rgb(229, 229, 229);
  1928. height: 15rpx !important;
  1929. }
  1930. .item {
  1931. width: 47%;
  1932. font-size: 28rpx;
  1933. margin-bottom: 10rpx;
  1934. margin-right: 3%;
  1935. // line-height: 45rpx;
  1936. // overflow: hidden;
  1937. // white-space: nowrap;
  1938. // text-overflow: ellipsis;
  1939. // -o-text-overflow: ellipsis;
  1940. // color: #000;
  1941. // display: flex;
  1942. /deep/.u-form-item__body {
  1943. padding: 0 !important;
  1944. }
  1945. /deep/.u-input__content__field-wrapper__field,
  1946. /deep/.u-form-item {
  1947. font-size: 28rpx !important;
  1948. }
  1949. text.label {
  1950. width: 120rpx;
  1951. display: inline-block;
  1952. text-align: right;
  1953. margin-right: 20rpx;
  1954. margin-bottom: 20rpx;
  1955. }
  1956. /deep/.uni-date__x-input {
  1957. height: 40rpx;
  1958. font-size: 28rpx;
  1959. }
  1960. /deep/.uni-date {
  1961. width: 48%;
  1962. display: inline-block;
  1963. .uni-icons {
  1964. display: none !important;
  1965. }
  1966. .uni-date-x {
  1967. padding: 0 !important;
  1968. }
  1969. }
  1970. }
  1971. .item text {
  1972. color: #666;
  1973. }
  1974. }
  1975. .selectTime {
  1976. display: flex;
  1977. justify-content: flex-end;
  1978. align-items: center;
  1979. margin-bottom: 10rpx;
  1980. .title {
  1981. flex: 1;
  1982. font-size: 30rpx;
  1983. }
  1984. .timeBox {
  1985. display: flex;
  1986. width: 500rpx;
  1987. .firstBtn {
  1988. margin-right: 10rpx;
  1989. }
  1990. }
  1991. }
  1992. .listBox:last-child {
  1993. border: none !important;
  1994. }
  1995. .textBox {
  1996. border: 1px #f2f2f2 solid;
  1997. height: 160px;
  1998. display: block;
  1999. width: auto !important;
  2000. }
  2001. .saveBtn {
  2002. width: 50%;
  2003. margin: 40rpx auto;
  2004. }
  2005. .top-css {
  2006. border-bottom: 1px solid rgb(207, 204, 204);
  2007. }
  2008. </style>