addStock.vue 27 KB

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