addStock.vue 28 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108
  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. dimension: '3',
  280. userOption: [], // 用户列表
  281. departmentOption: [], // 部门列表
  282. goodsLists: [], // 物品类型
  283. assetTypeName: '', // 物品类型名称
  284. timeShow: false,
  285. packingSpecificationOption: [], // 包装规格
  286. currentPackingSpecificationOption: [], // 当前包装规格
  287. currentSupplierListOption: [], // 当前供货商
  288. warehouseListOption: [], // 仓库列表
  289. currentTypeTime: Number(new Date()), // 当前时间类型的时间
  290. storageTime: '', // 入库时间
  291. currentProductIndex: null, // 当前产品索引
  292. currentPackingIndex: null, // 当前包装索引
  293. packingUnitsShow: false,
  294. typeTimeShow: false,
  295. suppliersShow: false,
  296. warehouseShow: false,
  297. timeTypeShow: false,
  298. statusShow: false,
  299. dictCodeList: [], // 字典列表
  300. curDateType: 'purchaseDate',
  301. qualityResultsOption: [
  302. [{
  303. label: '合格',
  304. value: 1
  305. },
  306. {
  307. label: '不合格',
  308. value: 2
  309. }
  310. ]
  311. ], // 质检状态 0未检 1已检
  312. qualityResults: {
  313. 1: '合格',
  314. 2: '不合格'
  315. }, // 质检结果 1合格 2不合格
  316. curDateTypeLabel: {
  317. purchaseDate: '采购日期',
  318. productionDate: '生产日期'
  319. },
  320. timeTypeOption: [
  321. [{
  322. name: '采购日期',
  323. prop: 'purchaseDate'
  324. },
  325. {
  326. name: '生产日期',
  327. prop: 'productionDate'
  328. }
  329. ]
  330. ], // 时间类型
  331. collapseOpen: 'collapse1',
  332. emergencyState,
  333. warehousingType,
  334. materialType,
  335. outputSceneState,
  336. inputStatus,
  337. getDictName,
  338. detailOpen: false,
  339. codeOpen: false,
  340. deptList: [], //部门
  341. supplierList: [], //供应商
  342. formData: {
  343. type: 1, // 入库
  344. bizType: '', // 入库场景
  345. storageTime: '', // 入库时间
  346. extInfo: {}, // 扩展信息
  347. sourceBizNo: '', // 来源单据编号
  348. fromUser: '', // 送货人
  349. remark: '' // 备注
  350. },
  351. statusList: [{
  352. id: 1,
  353. name: '紧急'
  354. },
  355. {
  356. id: 2,
  357. name: '中等'
  358. },
  359. {
  360. id: 1,
  361. name: '普通'
  362. }
  363. ], //紧急状态
  364. pickerIndex: 0,
  365. productList: [],
  366. userList: [],
  367. rules: {
  368. assetType: {
  369. type: 'number',
  370. required: true,
  371. message: '请选择入库产品类型',
  372. trigger: ['blur', 'change']
  373. },
  374. bizType: {
  375. type: 'number',
  376. required: true,
  377. message: '请选择入库场景',
  378. trigger: ['blur', 'change']
  379. }
  380. // contentImage: {
  381. // type: 'array',
  382. // required: true,
  383. // message: '请上传附件',
  384. // trigger: ['blur', 'change']
  385. // }
  386. },
  387. settingIndex: 0
  388. }
  389. },
  390. onShow() {
  391. this.collapseOpen = 'collapse1'
  392. },
  393. beforeDestroy() {
  394. uni.$off('setSelectList')
  395. uni.$off('setCategory')
  396. uni.$off('requisitionSelectC')
  397. },
  398. onLoad() {
  399. this.getListItems() // 物品类型
  400. this.initDeptData() // 部门列表
  401. const userInfo = uni.getStorageSync('userInfo')
  402. this.formData.extInfo.createUserName = userInfo.name
  403. this.formData.createUserId = userInfo.userId
  404. uni.$on('setCategory', data => {
  405. this.formData.extInfo.assetType = data
  406. let filterArray = this.formData.extInfo.assetType.map(item => {
  407. return this.goodsLists.find(ite => ite.id == item).name
  408. })
  409. this.assetTypeName = Array.from(new Set(filterArray)).join('/')
  410. })
  411. uni.$on('setSelectList', async (data, dimension) => {
  412. this.dimension = dimension;
  413. if (data?.length) {
  414. console.log('data------------', data)
  415. this.formData.sourceBizNo = ''
  416. this.productList = data.map(item => {
  417. return {
  418. ...item,
  419. packingSpecificationLabel: item.extField.packingSpecification ? item
  420. .extField.packingSpecification.split(',') : []
  421. }
  422. })
  423. this.formData.outInDetailList = data
  424. setTimeout(() => {
  425. this.detailOpen = !this.detailOpen
  426. this.$refs.collapse && this.$refs.collapse.resize()
  427. }, 0)
  428. }
  429. })
  430. uni.$on('requisitionSelectC', async (data, query) => {
  431. console.log(data, 'data')
  432. console.log(query, 'queryqueryqueryqueryqueryqueryqueryqueryquery')
  433. this.formData.sourceBizNo = query.sourceBizNo
  434. this.formData.bizType = parseInt(query.bizType)
  435. this.formData.extInfo.assetType = query.assetType.split(',')
  436. let filterArray = this.formData.extInfo.assetType.map(item => {
  437. return this.goodsLists.find(ite => ite.id == item).name
  438. })
  439. this.assetTypeName = Array.from(new Set(filterArray)).join('/')
  440. this.formData.outInDetailList = data
  441. this.productList = data.map(productItem => {
  442. return {
  443. ...productItem,
  444. packingSpecificationLabel: productItem.extField.packingSpecification.split(
  445. ','),
  446. outInDetailRecordRequestList: productItem.outInDetailRecordRequestList.map(
  447. packingItem => {
  448. return {
  449. ...packingItem,
  450. categoryName: productItem.categoryName,
  451. categoryCode: productItem.categoryCode,
  452. materialDetailList: packingItem.materialDetailList.map(
  453. materialItem => {
  454. return {
  455. ...materialItem,
  456. categoryName: productItem.categoryName,
  457. categoryCode: productItem.categoryCode
  458. }
  459. })
  460. }
  461. })
  462. }
  463. })
  464. setTimeout(() => {
  465. this.detailOpen = !this.detailOpen
  466. this.$refs.collapse && this.$refs.collapse.resize()
  467. }, 0)
  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. listRules() {
  481. return this.productList.reduce((cur, pre, index) => {
  482. return {
  483. ...cur,
  484. [`productList.${index}.batchNo`]: {
  485. type: 'string',
  486. required: true,
  487. trigger: ['blur', 'change']
  488. },
  489. [`productList.${index}.packingQuantity`]: {
  490. type: 'number',
  491. required: true,
  492. trigger: ['blur', 'change']
  493. },
  494. [`productList.${index}.packingUnit`]: {
  495. type: 'string',
  496. required: true,
  497. trigger: ['blur', 'change']
  498. },
  499. [`productList.${index}.warehouseId`]: {
  500. type: 'string',
  501. required: true,
  502. trigger: ['blur', 'change']
  503. }
  504. }
  505. }, {})
  506. }
  507. },
  508. methods: {
  509. changeType(e) {
  510. this.formData.bizType = e
  511. },
  512. goToRequisition() {
  513. uni.navigateTo({
  514. url: '/pages/warehouse/components/requisitionList?type=' + 2
  515. })
  516. },
  517. scrolltolower() {
  518. console.log('滑动了~~~')
  519. },
  520. async submit() {
  521. if (this.productList.length <= 0) {
  522. uni.showToast({
  523. title: '请添加出库明细',
  524. icon: 'none'
  525. })
  526. return
  527. }
  528. if (!this.formData.extInfo.verifyDeptName) {
  529. uni.showToast({
  530. title: '请选择领料部门',
  531. icon: 'none'
  532. })
  533. return
  534. }
  535. if (!this.formData.fromUser) {
  536. uni.showToast({
  537. title: '请选择领料人',
  538. icon: 'none'
  539. })
  540. return
  541. }
  542. console.log(this.formData)
  543. let obj = uni.$u.deepClone({
  544. ...this.formData,
  545. type: 2
  546. })
  547. obj.extInfo.sourceBizNo = obj.sourceBizNo
  548. obj.fromType = obj.type
  549. this.saveLoading = true
  550. // 处理物品类型assetType
  551. obj.extInfo.assetType = obj.extInfo.assetType.join(',')
  552. // 处理仓库id
  553. let warehouseId = []
  554. let warehouseName = []
  555. let warehouseIds = this.productList.map(item => item.warehouseId).flat()
  556. let warehouseNames = this.productList.map(item => item.warehouseName).flat()
  557. warehouseIds.forEach((item, index) => {
  558. if (!warehouseId.includes(item)) {
  559. warehouseId.push(item)
  560. warehouseName.push(warehouseNames[index])
  561. }
  562. })
  563. obj.warehouseIds = warehouseId
  564. obj.warehouseNames = warehouseName
  565. console.log('2222', obj)
  566. uni.showLoading({
  567. title: '保存中...'
  568. })
  569. try {
  570. const res = await outStorage(obj)
  571. if (res.code == 0) {
  572. await submitInsideTwo({
  573. outInIds: res.data
  574. })
  575. uni.hideLoading()
  576. uni.showToast({
  577. icon: 'none',
  578. title: '出库成功',
  579. duration: 1500
  580. })
  581. setTimeout(() => {
  582. uni.navigateBack({
  583. delta: 1
  584. })
  585. }, 1500)
  586. }
  587. } catch (error) {
  588. console.log('出库失败', err)
  589. uni.hideLoading()
  590. uni.showToast({
  591. icon: 'none',
  592. title: '出库失败',
  593. duration: 2000
  594. })
  595. }
  596. },
  597. // 部门列表
  598. async initDeptData() {
  599. let deptTreeList = await listOrganizations()
  600. this.departmentOption = toTreeData({
  601. data: deptTreeList,
  602. idField: 'id',
  603. parentIdField: 'parentId'
  604. })
  605. },
  606. async getStaffList(id) {
  607. uni.showLoading({
  608. title: '加载中',
  609. mask: true
  610. })
  611. let res = await getUserPage({
  612. groupId: id,
  613. size: 9999,
  614. page: 1
  615. })
  616. uni.hideLoading()
  617. this.userOption = res.list
  618. },
  619. // 打开领料部门选择器
  620. openDepartmentPicker() {
  621. this.$refs.departmentPicker._show()
  622. },
  623. // 打开领料人选择器
  624. openUserPicker() {
  625. this.$refs.userPicker._show()
  626. },
  627. sceneStateFilter(bizType) {
  628. if (bizType) {
  629. return this.outputSceneState.filter(item => item.value == bizType)[0].text
  630. }
  631. },
  632. formatter(dataTime) {
  633. return dayjs(dataTime).format('YYYY-MM-DD HH:mm:ss')
  634. },
  635. openPicker() {
  636. this.$refs.treePicker._show()
  637. },
  638. // 获取物品列表
  639. getListItems() {
  640. getTreeByGroup({
  641. type: 2
  642. }).then(res => {
  643. this.goodsLists = res
  644. })
  645. },
  646. selectType2() {
  647. if (!this.formData.bizType) {
  648. uni.showToast({
  649. title: '请选择出库场景',
  650. icon: 'none'
  651. })
  652. return
  653. }
  654. uni.navigateTo({
  655. url: '/pages/warehouse/outHouse/QRCode'
  656. })
  657. },
  658. selectType() {
  659. console.log(this.formData);
  660. if (!this.formData.extInfo.assetType) {
  661. uni.showToast({
  662. title: '请选择物品类型',
  663. icon: 'none'
  664. })
  665. return
  666. }
  667. if (!this.formData.bizType) {
  668. uni.showToast({
  669. title: '请选择出库场景',
  670. icon: 'none'
  671. })
  672. return
  673. }
  674. // const storageKey = Date.now() + ''
  675. // uni.setStorageSync(storageKey, this.warehousingMaterialList)
  676. uni.navigateTo({
  677. url: '/pages/warehouse/outHouse/selectOutType?assetType=' + this.formData.extInfo.assetType
  678. })
  679. },
  680. userConfirm(data, name) {
  681. this.formData.fromId = data[0]
  682. this.formData.fromUser = name
  683. },
  684. departmentConfirm(data, name, allList) {
  685. this.formData.extInfo.verifyDeptCode = data[0]
  686. this.formData.extInfo.verifyDeptName = name
  687. this.formData.fromId = ''
  688. this.formData.fromUser = ''
  689. this.getStaffList(data[0])
  690. },
  691. confirm(data, name, allList) {
  692. this.assetTypeName = name
  693. this.formData.extInfo.assetType = allList.map(item => item.id)
  694. },
  695. // 抬头下拉信息保存
  696. handlePicker(e, list, idKey, nameKey) {
  697. if (idKey) {
  698. this.formData[idKey] = list[e?.detail.value]?.value
  699. }
  700. if (nameKey) {
  701. this.formData[nameKey] = list[e?.detail.value]?.text
  702. }
  703. this.$nextTick(() => {
  704. if (idKey === 'assetType' || idKey === 'bizType') {
  705. this.$refs.formRef.validateField(idKey)
  706. }
  707. })
  708. },
  709. // 部门确认
  710. deptConfirm(data, name) {
  711. this.formData.deptName = name
  712. this.formData.deptCode = data[0]
  713. },
  714. // 部门确认
  715. verifyDeptConfirm(data, name) {
  716. this.formData.verifyDeptCode = data[0]
  717. this.formData.verifyDeptName = name
  718. this.formData.verifyId = ''
  719. this.formData.verifyName = ''
  720. this.getUser(data[0])
  721. }
  722. }
  723. }
  724. </script>
  725. <style lang="scss" scoped>
  726. .mainBox {
  727. padding-bottom: 120rpx;
  728. /deep/.required-form .u-form-item__body__left__content__label::before {
  729. content: '*';
  730. color: red;
  731. }
  732. }
  733. /deep/.baseForm {
  734. .u-form-item__body {
  735. padding: 4px !important;
  736. }
  737. .assetType_box {
  738. padding: 12rpx 18rpx;
  739. width: 100%;
  740. overflow: hidden;
  741. white-space: nowrap;
  742. text-overflow: ellipsis;
  743. font-size: 30rpx;
  744. }
  745. }
  746. .detail-box {
  747. position: relative;
  748. display: flex;
  749. justify-content: space-between;
  750. align-items: center;
  751. /deep/uni-button {
  752. margin: 0 !important;
  753. width: 180rpx;
  754. }
  755. .selectEnterType {
  756. margin-left: 10rpx !important;
  757. }
  758. }
  759. .footBox {
  760. position: fixed;
  761. left: 0px;
  762. bottom: 0px;
  763. height: 100rpx;
  764. width: 100%;
  765. display: flex;
  766. align-items: center;
  767. justify-content: space-between;
  768. view {
  769. width: 100%;
  770. height: 100%;
  771. text-align: center;
  772. color: #fff;
  773. display: flex;
  774. align-items: center;
  775. justify-content: center;
  776. }
  777. .reg {
  778. background: $u-success-dark;
  779. }
  780. .add {
  781. background: $uni-color-primary;
  782. }
  783. .uni-icons {
  784. margin-right: 8rpx !important;
  785. }
  786. }
  787. .main {
  788. padding: 0 30rpx;
  789. .row {
  790. display: flex;
  791. align-items: center;
  792. justify-content: space-between;
  793. padding: 20rpx 0;
  794. border-bottom: 1px dashed #dedede;
  795. .row-item {
  796. .t1 {
  797. font-weight: bold;
  798. font-size: 28rpx;
  799. color: #333333;
  800. margin-right: 20rpx;
  801. }
  802. .t2 {
  803. font-size: 28rpx;
  804. color: #333333;
  805. }
  806. }
  807. }
  808. .ckmx {
  809. color: #70b603;
  810. font-size: 28rpx;
  811. font-weight: bold;
  812. padding: 20rpx;
  813. display: flex;
  814. justify-content: flex-end;
  815. }
  816. }
  817. .listBox {
  818. padding: 20rpx 10rpx;
  819. border-bottom: 1px #f2f2f2 solid;
  820. position: relative;
  821. &.code {
  822. .label {
  823. width: 120rpx !important;
  824. }
  825. }
  826. .listTit {
  827. width: 100%;
  828. display: flex;
  829. justify-content: space-between;
  830. align-items: center;
  831. /deep/uni-button {
  832. margin-right: 20rpx;
  833. width: 100rpx;
  834. &.assets {
  835. width: 180rpx;
  836. }
  837. }
  838. .name {
  839. width: 50%;
  840. margin-left: 10px;
  841. overflow: hidden;
  842. white-space: nowrap;
  843. -o-text-overflow: ellipsis;
  844. text-overflow: ellipsis;
  845. font-size: 24rpx;
  846. }
  847. .btn {
  848. display: flex;
  849. justify-content: flex-end;
  850. }
  851. .weight {
  852. width: 30%;
  853. font-size: 24rpx;
  854. margin-left: auto;
  855. margin-right: 60rpx;
  856. position: relative;
  857. display: flex;
  858. input {
  859. margin-right: 10rpx;
  860. border: 1px solid black;
  861. width: 40%;
  862. height: 20rpx;
  863. }
  864. }
  865. .weight::after {
  866. position: absolute;
  867. right: -30rpx;
  868. top: 50%;
  869. content: '';
  870. background: #eee;
  871. width: 1px;
  872. height: 28rpx;
  873. margin-top: -14rpx;
  874. }
  875. }
  876. .z_list {
  877. height: 100% !important;
  878. max-height: 500rpx;
  879. .material {
  880. margin-top: 10rpx;
  881. .left {
  882. width: 40rpx;
  883. }
  884. .zdy_check {
  885. width: 30rpx;
  886. height: 30rpx;
  887. border: 2rpx solid #c8c9cc;
  888. border-radius: 4rpx;
  889. }
  890. .check_active {
  891. background: $theme-color;
  892. border: 2rpx solid $theme-color;
  893. /deep/ .u-icon__icon {
  894. color: #fff !important;
  895. }
  896. }
  897. .content_table {
  898. width: 670rpx;
  899. border: 2rpx solid $border-color;
  900. .item {
  901. display: flex;
  902. border-bottom: 2rpx solid $border-color;
  903. .lable {
  904. width: 200rpx;
  905. text-align: center;
  906. background-color: #f7f9fa;
  907. font-size: 26rpx;
  908. border-right: 2rpx solid $border-color;
  909. flex-shrink: 0;
  910. }
  911. .ww80 {
  912. width: 80rpx;
  913. }
  914. .content {
  915. width: 500rpx;
  916. min-height: 64rpx;
  917. font-size: 28rpx;
  918. line-height: 28rpx;
  919. font-style: normal;
  920. font-weight: 400;
  921. padding: 18rpx 8rpx;
  922. box-sizing: border-box;
  923. word-wrap: break-word;
  924. flex-grow: 1 !important;
  925. }
  926. .input_box {
  927. padding: 0 !important;
  928. }
  929. .content_num {
  930. display: flex;
  931. align-items: center;
  932. padding: 0 4rpx;
  933. /deep/ .uni-input-input {
  934. width: 200rpx;
  935. border: 2rpx solid #f0f8f2;
  936. background: #f0f8f2;
  937. color: $theme-color;
  938. }
  939. .unit {
  940. padding: 0 4rpx;
  941. font-size: 24rpx;
  942. color: #404446;
  943. }
  944. }
  945. .ww400 {
  946. /deep/ .uni-input-input {
  947. width: 400rpx;
  948. }
  949. }
  950. .pd4 {
  951. padding: 4rpx 8rpx;
  952. }
  953. &:last-child {
  954. border-bottom: none;
  955. }
  956. }
  957. .ww55 {
  958. width: 55%;
  959. }
  960. .ww45 {
  961. width: 45%;
  962. }
  963. .ww50 {
  964. width: 50%;
  965. }
  966. .ww30 {
  967. width: 30%;
  968. }
  969. .ww70 {
  970. width: 70%;
  971. }
  972. .ww80 {
  973. width: 80%;
  974. }
  975. .ww20 {
  976. width: 20%;
  977. }
  978. .check {
  979. width: 30rpx;
  980. height: 30rpx;
  981. }
  982. .tag_box {
  983. padding: 2rpx 10rpx;
  984. margin-right: 12rpx;
  985. background: #e6a23c;
  986. font-size: 22rpx;
  987. color: #fff;
  988. border-radius: 4rpx;
  989. }
  990. }
  991. }
  992. }
  993. .more {
  994. position: absolute;
  995. bottom: 26rpx;
  996. right: 30rpx;
  997. font-size: 28rpx;
  998. color: #666;
  999. }
  1000. }
  1001. .selectTime {
  1002. display: flex;
  1003. justify-content: flex-end;
  1004. align-items: center;
  1005. margin-top: 10px;
  1006. .title {
  1007. flex: 1;
  1008. font-size: 28rpx;
  1009. font-weight: bold;
  1010. }
  1011. .timeBox {
  1012. display: flex;
  1013. width: 500rpx;
  1014. .firstBtn {
  1015. margin-right: 10rpx;
  1016. }
  1017. }
  1018. }
  1019. .listBox:last-child {
  1020. border: none !important;
  1021. }
  1022. .textBox {
  1023. border: 1px #f2f2f2 solid;
  1024. height: 160px;
  1025. display: block;
  1026. width: auto !important;
  1027. }
  1028. .saveBtn {
  1029. width: 50%;
  1030. margin: 40rpx auto;
  1031. }
  1032. .top-css {
  1033. border-bottom: 1px solid rgb(207, 204, 204);
  1034. }
  1035. </style>