addStock.vue 27 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106
  1. <template>
  2. <view class="mainBox">
  3. <uni-nav-bar fixed="true" statusBar="true" left-icon="back" title="新增出库单" @clickLeft="back">
  4. <!--右菜单-->
  5. <template slot="float">
  6. <!-- <view class="nav-icon-caozuo rightNav" @click="getsure">
  7. <u-button type="success" size="small" class="u-reset-button" text="确定"></u-button>
  8. </view> -->
  9. </template>
  10. </uni-nav-bar>
  11. <u-form labelPosition="left" :model="formData" :rules="rules" ref="formRef" labelWidth="200" labelAlign="right"
  12. class="baseForm">
  13. <u-form-item label="物品类型" class="required-form" borderBottom prop="assetType">
  14. <view :style="{ color: assetTypeName ? 'black' : '#c0c4cc' }" class="assetType_box" @click="openPicker">
  15. {{ assetTypeName ? assetTypeName : '请选择产品类型' }}
  16. </view>
  17. </u-form-item>
  18. <u-form-item label="来源单据" prop="documentSource" borderBottom>
  19. <u-input type="text" placeholder="请输入" v-model="formData.sourceBizNo" @click.native="goToRequisition" />
  20. </u-form-item>
  21. <u-form-item label="出库类型" class="required-form" prop="bizType" borderBottom>
  22. <uni-data-select v-model="formData.bizType" :localdata="outputSceneState"
  23. @change="changeType"></uni-data-select>
  24. </u-form-item>
  25. <u-form-item label="出库登记人" prop="createUserName" borderBottom>
  26. <u-input disableColor="#ffffff" v-model="formData.extInfo.createUserName" placeholder="请选择" disabled
  27. type="text" />
  28. </u-form-item>
  29. <u-form-item class="required-form" label="领料部门" prop="deliveryName" borderBottom>
  30. <view :style="{ color: formData.extInfo.verifyDeptName ? 'black' : '#c0c4cc' }" class="assetType_box"
  31. @click="openDepartmentPicker">
  32. {{ formData.extInfo.verifyDeptName ? formData.extInfo.verifyDeptName : '请选择领料部门' }}
  33. </view>
  34. </u-form-item>
  35. <u-form-item class="required-form" label="领料人" prop="deliveryPhone" borderBottom>
  36. <view :style="{ color: formData.fromUser ? 'black' : '#c0c4cc' }" class="assetType_box"
  37. @click="openUserPicker">
  38. {{ formData.fromUser ? formData.fromUser : '请选择领料人' }}
  39. </view>
  40. </u-form-item>
  41. <u-form-item label="备注" prop="remark" borderBottom>
  42. <u-input disableColor="#ffffff" v-model="formData.remark" placeholder="请输入内容" type="text" />
  43. </u-form-item>
  44. </u-form>
  45. <uni-collapse ref="collapse" v-model="collapseOpen">
  46. <uni-collapse-item :typeOpen="1" title="" name="collapse1" :open="true" :key="detailOpen"
  47. :show-animation="true">
  48. <template v-slot:title>
  49. <view class="detail-box">
  50. <view data-v-41027c34="" class="uni-collapse-item__title-wrap">
  51. <view data-v-41027c34=""
  52. class="uni-collapse-item__title-box uni-collapse-item__title-box-base">
  53. <text data-v-41027c34="" class="tag tag-base"><text></text></text>
  54. <text data-v-41027c34="" class="uni-collapse-item__title-text"><text>出库明细</text></text>
  55. </view>
  56. </view>
  57. <u-button type="primary" size="small" text="扫码添加" @click.native.stop="selectType2"></u-button>
  58. <u-button type="success" size="small" class="selectEnterType" text="手动添加"
  59. @click.native.stop="selectType"></u-button>
  60. </view>
  61. </template>
  62. <u-form labelPosition="left" :model="{ productList: productList }" ref="lisrFormRef" labelWidth="150"
  63. :rules="listRules" errorType="none" labelAlign="right" :labelStyle="{
  64. fontSize: '28rpx'
  65. }">
  66. <view class="listContent">
  67. <view class="listBox" v-for="(item, index) in productList" :key="index">
  68. <view class="main" :class="{ save: item.isSave }">
  69. <view class="row">
  70. <view class="row-item">
  71. <text class="t1">物品名称</text>
  72. <text class="t2">{{ item.categoryName }}</text>
  73. </view>
  74. </view>
  75. <view class="row">
  76. <view class="row-item">
  77. <text class="t1">物品编码</text>
  78. <text class="t2">{{ item.categoryCode }}</text>
  79. </view>
  80. </view>
  81. <view class="row">
  82. <view class="row-item" style="display: flex;width: 100%;">
  83. <text class="t1">包装规格</text>
  84. <view style="display: flex;"><u-tag style="display: flex;margin-right: 10px;"
  85. v-for="ite in item.packingSpecificationLabel" :text="ite"></u-tag>
  86. </view>
  87. </view>
  88. </view>
  89. <view class="row">
  90. <view class="row-item">
  91. <text class="t1">批次号</text>
  92. <text class="t2">{{ item.batchNo }}</text>
  93. </view>
  94. <view class="row-item">
  95. <text class="t1">是否拆包</text>
  96. <text class="t2">{{ item.isUnpack ? '是' : '否' }}</text>
  97. </view>
  98. </view>
  99. <view class="row">
  100. <view class="row-item">
  101. <text class="t1">数量</text>
  102. <text class="t2">{{ item.packingQuantity }}</text>
  103. </view>
  104. <view class="row-item">
  105. <text class="t1">包装单位</text>
  106. <text class="t2">{{ item.packingUnit }}</text>
  107. </view>
  108. </view>
  109. <view class="row">
  110. <view class="row-item">
  111. <text class="t1">供应商</text>
  112. <text class="t2">{{ item.supplierName }}</text>
  113. </view>
  114. </view>
  115. <view class="row">
  116. <view class="row-item">
  117. <text class="t1">计量数量</text>
  118. <text class="t2">{{ item.measureQuantity }}</text>
  119. </view>
  120. <view class="row-item">
  121. <text class="t1">计量单位</text>
  122. <text class="t2">{{ item.measureUnit }}</text>
  123. </view>
  124. </view>
  125. <view class="row">
  126. <view class="row-item">
  127. <text class="t1">重量</text>
  128. <text class="t2">{{ item.weight }}</text>
  129. </view>
  130. <view class="row-item">
  131. <text class="t1">重量单位</text>
  132. <text class="t2">{{ item.weightUnit }}</text>
  133. </view>
  134. </view>
  135. <view class="row">
  136. <view class="row-item">
  137. <text class="t1">仓库</text>
  138. <text class="t2">{{ item.warehouseName }}</text>
  139. </view>
  140. </view>
  141. </view>
  142. <view class="main">
  143. <view class="selectTime">
  144. <view class="title">包装列表</view>
  145. </view>
  146. <u-list @scrolltolower="scrolltolower" class="z_list" style="height: 100% !important">
  147. <view class="material rx-ss" v-for="(ite, idx) in item.outInDetailRecordRequestList"
  148. :key="idx">
  149. <view class="content_table">
  150. <view class="item">
  151. <view class="lable rx-cc">序号</view>
  152. <view class="content">{{ idx + 1 }}</view>
  153. </view>
  154. <view class="item">
  155. <view class="lable rx-cc">包装编码</view>
  156. <view class="content">{{ ite.packageNo }}</view>
  157. </view>
  158. <view class="item">
  159. <view class="lable rx-cc">包装数量({{ ite.packingUnit }})</view>
  160. <view class="content">{{ ite.packingQuantity }}</view>
  161. </view>
  162. <view class="item">
  163. <view class="lable rx-cc">计量数量({{ ite.measureUnit }})</view>
  164. <view class="content">{{ ite.measureQuantity }}</view>
  165. </view>
  166. <view class="item">
  167. <view class="lable rx-cc">物料代号</view>
  168. <view class="content">{{ ite.materielDesignation }}</view>
  169. </view>
  170. <view class="item">
  171. <view class="lable rx-cc">客户代号</view>
  172. <view class="content">{{ ite.clientCode }}</view>
  173. </view>
  174. <view class="item">
  175. <view class="lable rx-cc">刻码</view>
  176. <view class="content">{{ ite.engrave }}</view>
  177. </view>
  178. <view class="item">
  179. <view class="lable rx-cc">重量({{ ite.weightUnit }})</view>
  180. <view class="content">
  181. {{ ite.weight }}
  182. </view>
  183. </view>
  184. <view class="item">
  185. <view class="lable rx-cc">质检状态</view>
  186. <view class="content">
  187. {{ qualityResults[ite.status] }}
  188. </view>
  189. </view>
  190. <view class="item">
  191. <view class="lable rx-cc">采购日期</view>
  192. <view class="content">
  193. {{ ite.purchaseDate }}
  194. </view>
  195. </view>
  196. <view class="item">
  197. <view class="lable rx-cc">生产日期</view>
  198. <view class="content">
  199. {{ ite.productionDate }}
  200. </view>
  201. </view>
  202. </view>
  203. </view>
  204. </u-list>
  205. </view>
  206. </view>
  207. </view>
  208. </u-form>
  209. </uni-collapse-item>
  210. </uni-collapse>
  211. <view class="footBox">
  212. <view class="reg" @click="submit">
  213. <uni-icons custom-prefix="iconfont" size="20" color="#fff"></uni-icons>
  214. 提交
  215. </view>
  216. </view>
  217. <!-- 选择出库场景 -->
  218. <ba-tree-picker ref="treePicker" :multiple="true" @select-change="confirm" title="选择物品类型"
  219. :localdata="goodsLists" valueKey="id" textKey="name" childrenKey="child" />
  220. <!-- 选择物品类型 -->
  221. <ba-tree-picker ref="treePicker" :multiple="true" @select-change="confirm" title="选择物品类型"
  222. :localdata="goodsLists" valueKey="id" textKey="name" childrenKey="child" />
  223. <!-- 选择领料部门 -->
  224. <ba-tree-picker ref="departmentPicker" :multiple="false" @select-change="departmentConfirm" title="选择领料部门"
  225. :localdata="departmentOption" valueKey="id" textKey="name" childrenKey="children" />
  226. <!-- 选择领料人 -->
  227. <ba-tree-picker ref="userPicker" :multiple="false" @select-change="userConfirm" title="选择领料人"
  228. :localdata="userOption" valueKey="id" textKey="name" childrenKey="children" />
  229. </view>
  230. </template>
  231. <script>
  232. // import ScanCode from '@/components/ScanCode.vue'
  233. import {
  234. toTreeData
  235. } from '@/utils/utils.js'
  236. import {
  237. getTreeByGroup,
  238. submitInsideTwo,
  239. outStorage
  240. } from '@/api/warehouseManagement'
  241. import {
  242. listOrganizations,
  243. getUserPage
  244. } from '@/api/common'
  245. import {
  246. getByCode
  247. } from '@/api/pda/common'
  248. import dayjs from 'dayjs'
  249. import {
  250. outputSceneState
  251. } from '../common'
  252. import {
  253. post,
  254. postJ,
  255. get,
  256. getJ
  257. } from '@/utils/api.js'
  258. import WarehouseChoose from '@/components/WarehouseChoose'
  259. import {
  260. warehousingType,
  261. inputStatus,
  262. emergencyState,
  263. warehousingMaterialListTable,
  264. getDictName,
  265. materialType
  266. } from '../enum.js'
  267. import baTreePicker from '@/components/ba-tree-picker/ba-tree-picker.vue'
  268. // import addDetails from '@/components/addDetails'
  269. import UploadFileNew from '@/components/UploadFileNew'
  270. // import dictMixins from '@/mixins/dictMixins.js'
  271. export default {
  272. components: {
  273. WarehouseChoose,
  274. baTreePicker,
  275. UploadFileNew
  276. },
  277. data() {
  278. return {
  279. userOption: [], // 用户列表
  280. departmentOption: [], // 部门列表
  281. goodsLists: [], // 物品类型
  282. assetTypeName: '', // 物品类型名称
  283. timeShow: false,
  284. packingSpecificationOption: [], // 包装规格
  285. currentPackingSpecificationOption: [], // 当前包装规格
  286. currentSupplierListOption: [], // 当前供货商
  287. warehouseListOption: [], // 仓库列表
  288. currentTypeTime: Number(new Date()), // 当前时间类型的时间
  289. storageTime: '', // 入库时间
  290. currentProductIndex: null, // 当前产品索引
  291. currentPackingIndex: null, // 当前包装索引
  292. packingUnitsShow: false,
  293. typeTimeShow: false,
  294. suppliersShow: false,
  295. warehouseShow: false,
  296. timeTypeShow: false,
  297. statusShow: false,
  298. dictCodeList: [], // 字典列表
  299. curDateType: 'purchaseDate',
  300. qualityResultsOption: [
  301. [{
  302. label: '合格',
  303. value: 1
  304. },
  305. {
  306. label: '不合格',
  307. value: 2
  308. }
  309. ]
  310. ], // 质检状态 0未检 1已检
  311. qualityResults: {
  312. 1: '合格',
  313. 2: '不合格'
  314. }, // 质检结果 1合格 2不合格
  315. curDateTypeLabel: {
  316. purchaseDate: '采购日期',
  317. productionDate: '生产日期'
  318. },
  319. timeTypeOption: [
  320. [{
  321. name: '采购日期',
  322. prop: 'purchaseDate'
  323. },
  324. {
  325. name: '生产日期',
  326. prop: 'productionDate'
  327. }
  328. ]
  329. ], // 时间类型
  330. collapseOpen: 'collapse1',
  331. emergencyState,
  332. warehousingType,
  333. materialType,
  334. outputSceneState,
  335. inputStatus,
  336. getDictName,
  337. detailOpen: false,
  338. codeOpen: false,
  339. deptList: [], //部门
  340. supplierList: [], //供应商
  341. formData: {
  342. type: 1, // 入库
  343. bizType: '', // 入库场景
  344. storageTime: '', // 入库时间
  345. extInfo: {}, // 扩展信息
  346. sourceBizNo: '', // 来源单据编号
  347. fromUser: '', // 送货人
  348. remark: '' // 备注
  349. },
  350. statusList: [{
  351. id: 1,
  352. name: '紧急'
  353. },
  354. {
  355. id: 2,
  356. name: '中等'
  357. },
  358. {
  359. id: 1,
  360. name: '普通'
  361. }
  362. ], //紧急状态
  363. pickerIndex: 0,
  364. productList: [],
  365. userList: [],
  366. rules: {
  367. assetType: {
  368. type: 'number',
  369. required: true,
  370. message: '请选择入库产品类型',
  371. trigger: ['blur', 'change']
  372. },
  373. bizType: {
  374. type: 'number',
  375. required: true,
  376. message: '请选择入库场景',
  377. trigger: ['blur', 'change']
  378. }
  379. // contentImage: {
  380. // type: 'array',
  381. // required: true,
  382. // message: '请上传附件',
  383. // trigger: ['blur', 'change']
  384. // }
  385. },
  386. settingIndex: 0
  387. }
  388. },
  389. onShow() {
  390. this.collapseOpen = 'collapse1'
  391. },
  392. beforeDestroy() {
  393. uni.$off('setSelectList')
  394. uni.$off('setCategory')
  395. uni.$off('requisitionSelectC')
  396. },
  397. onLoad() {
  398. this.getListItems() // 物品类型
  399. this.initDeptData() // 部门列表
  400. const userInfo = uni.getStorageSync('userInfo')
  401. this.formData.extInfo.createUserName = userInfo.name
  402. this.formData.createUserId = userInfo.userId
  403. uni.$on('setCategory', data => {
  404. this.formData.extInfo.assetType = data
  405. let filterArray = this.formData.extInfo.assetType.map(item => {
  406. return this.goodsLists.find(ite => ite.id == item).name
  407. })
  408. this.assetTypeName = Array.from(new Set(filterArray)).join('/')
  409. })
  410. uni.$on('setSelectList', async data => {
  411. if (data?.length) {
  412. console.log('data------------', data)
  413. this.formData.sourceBizNo = ''
  414. this.productList = data.map(item => {
  415. return {
  416. ...item,
  417. packingSpecificationLabel: item.extField.packingSpecification ? item
  418. .extField.packingSpecification.split(',') : []
  419. }
  420. })
  421. this.formData.outInDetailList = data
  422. setTimeout(() => {
  423. this.detailOpen = !this.detailOpen
  424. this.$refs.collapse && this.$refs.collapse.resize()
  425. }, 0)
  426. }
  427. })
  428. uni.$on('requisitionSelectC', async (data, query) => {
  429. console.log(data, 'data')
  430. console.log(query, 'queryqueryqueryqueryqueryqueryqueryqueryquery')
  431. this.formData.sourceBizNo = query.sourceBizNo
  432. this.formData.bizType = parseInt(query.bizType)
  433. this.formData.extInfo.assetType = query.assetType.split(',')
  434. let filterArray = this.formData.extInfo.assetType.map(item => {
  435. return this.goodsLists.find(ite => ite.id == item).name
  436. })
  437. this.assetTypeName = Array.from(new Set(filterArray)).join('/')
  438. this.formData.outInDetailList = data
  439. this.productList = data.map(productItem => {
  440. return {
  441. ...productItem,
  442. packingSpecificationLabel: productItem.extField.packingSpecification.split(
  443. ','),
  444. outInDetailRecordRequestList: productItem.outInDetailRecordRequestList.map(
  445. packingItem => {
  446. return {
  447. ...packingItem,
  448. categoryName: productItem.categoryName,
  449. categoryCode: productItem.categoryCode,
  450. materialDetailList: packingItem.materialDetailList.map(
  451. materialItem => {
  452. return {
  453. ...materialItem,
  454. categoryName: productItem.categoryName,
  455. categoryCode: productItem.categoryCode
  456. }
  457. })
  458. }
  459. })
  460. }
  461. })
  462. setTimeout(() => {
  463. this.detailOpen = !this.detailOpen
  464. this.$refs.collapse && this.$refs.collapse.resize()
  465. }, 0)
  466. })
  467. // 明细信息填写
  468. uni.$on('batchNumBack', productList => {
  469. if (productList?.length) {
  470. this.productList = productList
  471. }
  472. })
  473. },
  474. mounted() {
  475. // this.getAddDetails();
  476. },
  477. computed: {
  478. listRules() {
  479. return this.productList.reduce((cur, pre, index) => {
  480. return {
  481. ...cur,
  482. [`productList.${index}.batchNo`]: {
  483. type: 'string',
  484. required: true,
  485. trigger: ['blur', 'change']
  486. },
  487. [`productList.${index}.packingQuantity`]: {
  488. type: 'number',
  489. required: true,
  490. trigger: ['blur', 'change']
  491. },
  492. [`productList.${index}.packingUnit`]: {
  493. type: 'string',
  494. required: true,
  495. trigger: ['blur', 'change']
  496. },
  497. [`productList.${index}.warehouseId`]: {
  498. type: 'string',
  499. required: true,
  500. trigger: ['blur', 'change']
  501. }
  502. }
  503. }, {})
  504. }
  505. },
  506. methods: {
  507. changeType(e) {
  508. this.formData.bizType = e
  509. },
  510. goToRequisition() {
  511. uni.navigateTo({
  512. url: '/pages/warehouse/components/requisitionList?type=' + 2
  513. })
  514. },
  515. scrolltolower() {
  516. console.log('滑动了~~~')
  517. },
  518. async submit() {
  519. if (this.productList.length <= 0) {
  520. uni.showToast({
  521. title: '请添加出库明细',
  522. icon: 'none'
  523. })
  524. return
  525. }
  526. if (!this.formData.extInfo.verifyDeptName) {
  527. uni.showToast({
  528. title: '请选择领料部门',
  529. icon: 'none'
  530. })
  531. return
  532. }
  533. if (!this.formData.fromUser) {
  534. uni.showToast({
  535. title: '请选择领料人',
  536. icon: 'none'
  537. })
  538. return
  539. }
  540. console.log(this.formData)
  541. let obj = uni.$u.deepClone({
  542. ...this.formData,
  543. type: 2
  544. })
  545. obj.extInfo.sourceBizNo = obj.sourceBizNo
  546. obj.fromType = obj.type
  547. this.saveLoading = true
  548. // 处理物品类型assetType
  549. obj.extInfo.assetType = obj.extInfo.assetType.join(',')
  550. // 处理仓库id
  551. let warehouseId = []
  552. let warehouseName = []
  553. let warehouseIds = this.productList.map(item => item.warehouseId).flat()
  554. let warehouseNames = this.productList.map(item => item.warehouseName).flat()
  555. warehouseIds.forEach((item, index) => {
  556. if (!warehouseId.includes(item)) {
  557. warehouseId.push(item)
  558. warehouseName.push(warehouseNames[index])
  559. }
  560. })
  561. obj.warehouseIds = warehouseId
  562. obj.warehouseNames = warehouseName
  563. console.log('2222', obj)
  564. uni.showLoading({
  565. title: '保存中...'
  566. })
  567. try {
  568. const res = await outStorage(obj)
  569. if (res.code == 0) {
  570. await submitInsideTwo({
  571. outInIds: res.data
  572. })
  573. uni.hideLoading()
  574. uni.showToast({
  575. icon: 'none',
  576. title: '出库成功',
  577. duration: 1500
  578. })
  579. setTimeout(() => {
  580. uni.navigateBack({
  581. delta: 1
  582. })
  583. }, 1500)
  584. }
  585. } catch (error) {
  586. console.log('出库失败', err)
  587. uni.hideLoading()
  588. uni.showToast({
  589. icon: 'none',
  590. title: '出库失败',
  591. duration: 2000
  592. })
  593. }
  594. },
  595. // 部门列表
  596. async initDeptData() {
  597. let deptTreeList = await listOrganizations()
  598. this.departmentOption = toTreeData({
  599. data: deptTreeList,
  600. idField: 'id',
  601. parentIdField: 'parentId'
  602. })
  603. },
  604. async getStaffList(id) {
  605. uni.showLoading({
  606. title: '加载中',
  607. mask: true
  608. })
  609. let res = await getUserPage({
  610. groupId: id,
  611. size: 9999,
  612. page: 1
  613. })
  614. uni.hideLoading()
  615. this.userOption = res.list
  616. },
  617. // 打开领料部门选择器
  618. openDepartmentPicker() {
  619. this.$refs.departmentPicker._show()
  620. },
  621. // 打开领料人选择器
  622. openUserPicker() {
  623. this.$refs.userPicker._show()
  624. },
  625. sceneStateFilter(bizType) {
  626. if (bizType) {
  627. return this.outputSceneState.filter(item => item.value == bizType)[0].text
  628. }
  629. },
  630. formatter(dataTime) {
  631. return dayjs(dataTime).format('YYYY-MM-DD HH:mm:ss')
  632. },
  633. openPicker() {
  634. this.$refs.treePicker._show()
  635. },
  636. // 获取物品列表
  637. getListItems() {
  638. getTreeByGroup({
  639. type: 2
  640. }).then(res => {
  641. this.goodsLists = res
  642. })
  643. },
  644. selectType2() {
  645. if (!this.formData.bizType) {
  646. uni.showToast({
  647. title: '请选择出库场景',
  648. icon: 'none'
  649. })
  650. return
  651. }
  652. uni.navigateTo({
  653. url: '/pages/warehouse/outHouse/QRCode'
  654. })
  655. },
  656. selectType() {
  657. console.log(this.formData);
  658. if (!this.formData.extInfo.assetType) {
  659. uni.showToast({
  660. title: '请选择物品类型',
  661. icon: 'none'
  662. })
  663. return
  664. }
  665. if (!this.formData.bizType) {
  666. uni.showToast({
  667. title: '请选择出库场景',
  668. icon: 'none'
  669. })
  670. return
  671. }
  672. // const storageKey = Date.now() + ''
  673. // uni.setStorageSync(storageKey, this.warehousingMaterialList)
  674. uni.navigateTo({
  675. url: '/pages/warehouse/outHouse/selectOutType?assetType=' + this.formData.extInfo.assetType
  676. })
  677. },
  678. userConfirm(data, name) {
  679. this.formData.fromId = data[0]
  680. this.formData.fromUser = name
  681. },
  682. departmentConfirm(data, name, allList) {
  683. this.formData.extInfo.verifyDeptCode = data[0]
  684. this.formData.extInfo.verifyDeptName = name
  685. this.formData.fromId = ''
  686. this.formData.fromUser = ''
  687. this.getStaffList(data[0])
  688. },
  689. confirm(data, name, allList) {
  690. this.assetTypeName = name
  691. this.formData.extInfo.assetType = allList.map(item => item.id)
  692. },
  693. // 抬头下拉信息保存
  694. handlePicker(e, list, idKey, nameKey) {
  695. if (idKey) {
  696. this.formData[idKey] = list[e?.detail.value]?.value
  697. }
  698. if (nameKey) {
  699. this.formData[nameKey] = list[e?.detail.value]?.text
  700. }
  701. this.$nextTick(() => {
  702. if (idKey === 'assetType' || idKey === 'bizType') {
  703. this.$refs.formRef.validateField(idKey)
  704. }
  705. })
  706. },
  707. // 部门确认
  708. deptConfirm(data, name) {
  709. this.formData.deptName = name
  710. this.formData.deptCode = data[0]
  711. },
  712. // 部门确认
  713. verifyDeptConfirm(data, name) {
  714. this.formData.verifyDeptCode = data[0]
  715. this.formData.verifyDeptName = name
  716. this.formData.verifyId = ''
  717. this.formData.verifyName = ''
  718. this.getUser(data[0])
  719. }
  720. }
  721. }
  722. </script>
  723. <style lang="scss" scoped>
  724. .mainBox {
  725. padding-bottom: 120rpx;
  726. /deep/.required-form .u-form-item__body__left__content__label::before {
  727. content: '*';
  728. color: red;
  729. }
  730. }
  731. /deep/.baseForm {
  732. .u-form-item__body {
  733. padding: 4px !important;
  734. }
  735. .assetType_box {
  736. padding: 12rpx 18rpx;
  737. width: 100%;
  738. overflow: hidden;
  739. white-space: nowrap;
  740. text-overflow: ellipsis;
  741. font-size: 30rpx;
  742. }
  743. }
  744. .detail-box {
  745. position: relative;
  746. display: flex;
  747. justify-content: space-between;
  748. align-items: center;
  749. /deep/uni-button {
  750. margin: 0 !important;
  751. width: 180rpx;
  752. }
  753. .selectEnterType {
  754. margin-left: 10rpx !important;
  755. }
  756. }
  757. .footBox {
  758. position: fixed;
  759. left: 0px;
  760. bottom: 0px;
  761. height: 100rpx;
  762. width: 100%;
  763. display: flex;
  764. align-items: center;
  765. justify-content: space-between;
  766. view {
  767. width: 100%;
  768. height: 100%;
  769. text-align: center;
  770. color: #fff;
  771. display: flex;
  772. align-items: center;
  773. justify-content: center;
  774. }
  775. .reg {
  776. background: $u-success-dark;
  777. }
  778. .add {
  779. background: $uni-color-primary;
  780. }
  781. .uni-icons {
  782. margin-right: 8rpx !important;
  783. }
  784. }
  785. .main {
  786. padding: 0 30rpx;
  787. .row {
  788. display: flex;
  789. align-items: center;
  790. justify-content: space-between;
  791. padding: 20rpx 0;
  792. border-bottom: 1px dashed #dedede;
  793. .row-item {
  794. .t1 {
  795. font-weight: bold;
  796. font-size: 28rpx;
  797. color: #333333;
  798. margin-right: 20rpx;
  799. }
  800. .t2 {
  801. font-size: 28rpx;
  802. color: #333333;
  803. }
  804. }
  805. }
  806. .ckmx {
  807. color: #70b603;
  808. font-size: 28rpx;
  809. font-weight: bold;
  810. padding: 20rpx;
  811. display: flex;
  812. justify-content: flex-end;
  813. }
  814. }
  815. .listBox {
  816. padding: 20rpx 10rpx;
  817. border-bottom: 1px #f2f2f2 solid;
  818. position: relative;
  819. &.code {
  820. .label {
  821. width: 120rpx !important;
  822. }
  823. }
  824. .listTit {
  825. width: 100%;
  826. display: flex;
  827. justify-content: space-between;
  828. align-items: center;
  829. /deep/uni-button {
  830. margin-right: 20rpx;
  831. width: 100rpx;
  832. &.assets {
  833. width: 180rpx;
  834. }
  835. }
  836. .name {
  837. width: 50%;
  838. margin-left: 10px;
  839. overflow: hidden;
  840. white-space: nowrap;
  841. -o-text-overflow: ellipsis;
  842. text-overflow: ellipsis;
  843. font-size: 24rpx;
  844. }
  845. .btn {
  846. display: flex;
  847. justify-content: flex-end;
  848. }
  849. .weight {
  850. width: 30%;
  851. font-size: 24rpx;
  852. margin-left: auto;
  853. margin-right: 60rpx;
  854. position: relative;
  855. display: flex;
  856. input {
  857. margin-right: 10rpx;
  858. border: 1px solid black;
  859. width: 40%;
  860. height: 20rpx;
  861. }
  862. }
  863. .weight::after {
  864. position: absolute;
  865. right: -30rpx;
  866. top: 50%;
  867. content: '';
  868. background: #eee;
  869. width: 1px;
  870. height: 28rpx;
  871. margin-top: -14rpx;
  872. }
  873. }
  874. .z_list {
  875. height: 100% !important;
  876. max-height: 500rpx;
  877. .material {
  878. margin-top: 10rpx;
  879. .left {
  880. width: 40rpx;
  881. }
  882. .zdy_check {
  883. width: 30rpx;
  884. height: 30rpx;
  885. border: 2rpx solid #c8c9cc;
  886. border-radius: 4rpx;
  887. }
  888. .check_active {
  889. background: $theme-color;
  890. border: 2rpx solid $theme-color;
  891. /deep/ .u-icon__icon {
  892. color: #fff !important;
  893. }
  894. }
  895. .content_table {
  896. width: 670rpx;
  897. border: 2rpx solid $border-color;
  898. .item {
  899. display: flex;
  900. border-bottom: 2rpx solid $border-color;
  901. .lable {
  902. width: 200rpx;
  903. text-align: center;
  904. background-color: #f7f9fa;
  905. font-size: 26rpx;
  906. border-right: 2rpx solid $border-color;
  907. flex-shrink: 0;
  908. }
  909. .ww80 {
  910. width: 80rpx;
  911. }
  912. .content {
  913. width: 500rpx;
  914. min-height: 64rpx;
  915. font-size: 28rpx;
  916. line-height: 28rpx;
  917. font-style: normal;
  918. font-weight: 400;
  919. padding: 18rpx 8rpx;
  920. box-sizing: border-box;
  921. word-wrap: break-word;
  922. flex-grow: 1 !important;
  923. }
  924. .input_box {
  925. padding: 0 !important;
  926. }
  927. .content_num {
  928. display: flex;
  929. align-items: center;
  930. padding: 0 4rpx;
  931. /deep/ .uni-input-input {
  932. width: 200rpx;
  933. border: 2rpx solid #f0f8f2;
  934. background: #f0f8f2;
  935. color: $theme-color;
  936. }
  937. .unit {
  938. padding: 0 4rpx;
  939. font-size: 24rpx;
  940. color: #404446;
  941. }
  942. }
  943. .ww400 {
  944. /deep/ .uni-input-input {
  945. width: 400rpx;
  946. }
  947. }
  948. .pd4 {
  949. padding: 4rpx 8rpx;
  950. }
  951. &:last-child {
  952. border-bottom: none;
  953. }
  954. }
  955. .ww55 {
  956. width: 55%;
  957. }
  958. .ww45 {
  959. width: 45%;
  960. }
  961. .ww50 {
  962. width: 50%;
  963. }
  964. .ww30 {
  965. width: 30%;
  966. }
  967. .ww70 {
  968. width: 70%;
  969. }
  970. .ww80 {
  971. width: 80%;
  972. }
  973. .ww20 {
  974. width: 20%;
  975. }
  976. .check {
  977. width: 30rpx;
  978. height: 30rpx;
  979. }
  980. .tag_box {
  981. padding: 2rpx 10rpx;
  982. margin-right: 12rpx;
  983. background: #e6a23c;
  984. font-size: 22rpx;
  985. color: #fff;
  986. border-radius: 4rpx;
  987. }
  988. }
  989. }
  990. }
  991. .more {
  992. position: absolute;
  993. bottom: 26rpx;
  994. right: 30rpx;
  995. font-size: 28rpx;
  996. color: #666;
  997. }
  998. }
  999. .selectTime {
  1000. display: flex;
  1001. justify-content: flex-end;
  1002. align-items: center;
  1003. margin-top: 10px;
  1004. .title {
  1005. flex: 1;
  1006. font-size: 28rpx;
  1007. font-weight: bold;
  1008. }
  1009. .timeBox {
  1010. display: flex;
  1011. width: 500rpx;
  1012. .firstBtn {
  1013. margin-right: 10rpx;
  1014. }
  1015. }
  1016. }
  1017. .listBox:last-child {
  1018. border: none !important;
  1019. }
  1020. .textBox {
  1021. border: 1px #f2f2f2 solid;
  1022. height: 160px;
  1023. display: block;
  1024. width: auto !important;
  1025. }
  1026. .saveBtn {
  1027. width: 50%;
  1028. margin: 40rpx auto;
  1029. }
  1030. .top-css {
  1031. border-bottom: 1px solid rgb(207, 204, 204);
  1032. }
  1033. </style>