addStock.vue 27 KB

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