addStock.vue 62 KB

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