details.vue 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774
  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. <view class="main">
  15. <view class="row">
  16. <view class="row-item">
  17. <text class="t1">出库单号</text>
  18. <text class="t2">{{ formData.bizNo }}</text>
  19. </view>
  20. </view>
  21. <view class="row">
  22. <view class="row-item">
  23. <text class="t1">物品类型</text>
  24. <text class="t2">{{ getGoodsListsLabel(formData.extInfo.assetType) }}</text>
  25. </view>
  26. </view>
  27. <view class="row">
  28. <view class="row-item">
  29. <text class="t1">出库场景</text>
  30. <text
  31. class="t2">{{ outputSceneState.filter(item => item.value == formData.bizType)[0].text }}</text>
  32. </view>
  33. </view>
  34. <view class="row">
  35. <view class="row-item">
  36. <text class="t1">来源单据</text>
  37. <text class="t2">{{ formData.sourceBizNo }}</text>
  38. </view>
  39. </view>
  40. <view class="row">
  41. <view class="row-item" @click="timeShow = true">
  42. <text class="t1">出库登记人</text>
  43. <text class="t2">{{ formData.extInfo.createUserName }}</text>
  44. </view>
  45. </view>
  46. <view class="row">
  47. <view class="row-item" @click="timeShow = true">
  48. <text class="t1">领料人</text>
  49. <text class="t2">{{ formData.fromUser}}</text>
  50. </view>
  51. </view>
  52. <view class="row">
  53. <view class="row-item" @click="timeShow = true">
  54. <text class="t1">领料部门</text>
  55. <text class="t2">{{ formData.extInfo.verifyDeptName }}</text>
  56. </view>
  57. </view>
  58. <view class="row">
  59. <view class="row-item" @click="timeShow = true">
  60. <text class="t1">状态</text>
  61. <text class="t2">{{ statusLabelList[formData.verifyStatus]}}</text>
  62. </view>
  63. </view>
  64. <view class="row">
  65. <view class="row-item" @click="timeShow = true">
  66. <text class="t1">备注</text>
  67. <text class="t2">{{ formData.remark}}</text>
  68. </view>
  69. </view>
  70. </view>
  71. <uni-collapse ref="collapse" v-model="collapseOpen">
  72. <uni-collapse-item :typeOpen="1" title="" name="collapse1" :open="true" :key="detailOpen"
  73. :show-animation="true">
  74. <template v-slot:title>
  75. <view class="detail-box">
  76. <view data-v-41027c34="" class="uni-collapse-item__title-wrap">
  77. <view data-v-41027c34=""
  78. class="uni-collapse-item__title-box uni-collapse-item__title-box-base">
  79. <text data-v-41027c34="" class="tag tag-base"><text></text></text>
  80. <text data-v-41027c34="" class="uni-collapse-item__title-text"><text>出库明细</text></text>
  81. </view>
  82. </view>
  83. <!-- <u-button type="primary" size="small" text="扫码添加" @click.native.stop="selectType"></u-button> -->
  84. <!-- <u-button type="success" size="small" class="selectEnterType" text="手动添加" @click.native.stop="selectType"></u-button> -->
  85. </view>
  86. </template>
  87. <u-form labelPosition="left" :model="{ productList: productList }" ref="lisrFormRef" labelWidth="150"
  88. :rules="listRules" errorType="none" labelAlign="right" :labelStyle="{
  89. fontSize: '28rpx'
  90. }">
  91. <view class="listContent">
  92. <view class="listBox" v-for="(item, index) in productList" :key="index">
  93. <view class="main" :class="{ save: item.isSave }">
  94. <view class="row">
  95. <view class="row-item">
  96. <text class="t1">物品名称</text>
  97. <text class="t2">{{ item.categoryName }}</text>
  98. </view>
  99. </view>
  100. <view class="row">
  101. <view class="row-item">
  102. <text class="t1">物品编码</text>
  103. <text class="t2">{{ item.categoryCode }}</text>
  104. </view>
  105. </view>
  106. <view class="row">
  107. <view class="row-item" style="display: flex;width: 100%;">
  108. <text class="t1">包装规格</text>
  109. <view style="display: flex;"><u-tag style="display: flex;margin-right: 10px;"
  110. v-for="ite in item.packingSpecificationLabel" :text="ite"></u-tag>
  111. </view>
  112. </view>
  113. </view>
  114. <view class="row">
  115. <view class="row-item">
  116. <text class="t1">批次号</text>
  117. <text class="t2">{{ item.batchNo }}</text>
  118. </view>
  119. <view class="row-item">
  120. <text class="t1">是否拆包</text>
  121. <text class="t2">{{ item.isUnpack ? '是' : '否' }}</text>
  122. </view>
  123. </view>
  124. <view class="row">
  125. <view class="row-item">
  126. <text class="t1">数量</text>
  127. <text class="t2">{{ item.packingQuantity }}</text>
  128. </view>
  129. <view class="row-item">
  130. <text class="t1">包装单位</text>
  131. <text class="t2">{{ item.packingUnit }}</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 class="row">
  141. <view class="row-item">
  142. <text class="t1">供应商</text>
  143. <text class="t2">{{ item.supplierName }}</text>
  144. </view>
  145. </view>
  146. <view class="row">
  147. <view class="row-item">
  148. <text class="t1">计量数量</text>
  149. <text class="t2">{{ item.measureQuantity }}</text>
  150. </view>
  151. <view class="row-item">
  152. <text class="t1">计量单位</text>
  153. <text class="t2">{{ item.measureUnit }}</text>
  154. </view>
  155. </view>
  156. <view class="row">
  157. <view class="row-item">
  158. <text class="t1">重量</text>
  159. <text class="t2">{{ item.weight }}</text>
  160. </view>
  161. <view class="row-item">
  162. <text class="t1">重量单位</text>
  163. <text class="t2">{{ item.weightUnit }}</text>
  164. </view>
  165. </view>
  166. </view>
  167. <view class="main">
  168. <view class="selectTime">
  169. <view class="title">包装列表</view>
  170. </view>
  171. <u-list class="z_list" style="height: 100% !important">
  172. <view class="material rx-ss" v-for="(ite, idx) in item.outInDetailRecordRequestList"
  173. :key="idx">
  174. <view class="content_table">
  175. <view class="item">
  176. <view class="lable rx-cc">序号</view>
  177. <view class="content">{{ idx + 1 }}</view>
  178. </view>
  179. <view class="item">
  180. <view class="lable rx-cc">包装编码</view>
  181. <view class="content">{{ ite.packageNo }}</view>
  182. </view>
  183. <view class="item">
  184. <view class="lable rx-cc">包装数量({{ ite.packingUnit }})</view>
  185. <view class="content">{{ ite.packingQuantity }}</view>
  186. </view>
  187. <view class="item">
  188. <view class="lable rx-cc">计量数量({{ ite.measureUnit }})</view>
  189. <view class="content">{{ ite.measureQuantity }}</view>
  190. </view>
  191. <view class="item">
  192. <view class="lable rx-cc">物料代号</view>
  193. <view class="content">{{ ite.materielDesignation }}</view>
  194. </view>
  195. <view class="item">
  196. <view class="lable rx-cc">客户代号</view>
  197. <view class="content">{{ ite.clientCode }}</view>
  198. </view>
  199. <view class="item">
  200. <view class="lable rx-cc">刻码</view>
  201. <view class="content">{{ ite.engrave }}</view>
  202. </view>
  203. <view class="item">
  204. <view class="lable rx-cc">重量({{ ite.weightUnit }})</view>
  205. <view class="content">
  206. {{ ite.weight }}
  207. </view>
  208. </view>
  209. <view class="item">
  210. <view class="lable rx-cc">质检状态</view>
  211. <view class="content">
  212. {{ qualityResults[ite.status] }}
  213. </view>
  214. </view>
  215. <view class="item">
  216. <view class="lable rx-cc">采购日期</view>
  217. <view class="content">
  218. {{ ite.purchaseDate }}
  219. </view>
  220. </view>
  221. <view class="item">
  222. <view class="lable rx-cc">生产日期</view>
  223. <view class="content">
  224. {{ ite.productionDate }}
  225. </view>
  226. </view>
  227. </view>
  228. </view>
  229. </u-list>
  230. </view>
  231. </view>
  232. </view>
  233. </u-form>
  234. </uni-collapse-item>
  235. </uni-collapse>
  236. </view>
  237. </template>
  238. <script>
  239. // import ScanCode from '@/components/ScanCode.vue'
  240. import {
  241. getInboundDetailsById,
  242. getTreeByGroup,
  243. getInboundDetailsByBizNo
  244. } from '@/api/warehouseManagement'
  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 { getRuleNo } from '@/utils/utils.js'
  271. // import dictMixins from '@/mixins/dictMixins.js'
  272. export default {
  273. components: {
  274. WarehouseChoose,
  275. baTreePicker,
  276. UploadFileNew
  277. },
  278. // mixins: [dictMixins],
  279. data() {
  280. return {
  281. statusLabelList: ['未提交', '审核中', '审核通过', '已驳回'],
  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: '1', // 入库场景
  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. onLoad(options) {
  394. this.getListItems() // 物品类型
  395. if (options.id) {
  396. getInboundDetailsById(options.id).then(res => {
  397. this.productList = res.outInDetailList.map(item => {
  398. return {
  399. ...item,
  400. packingSpecificationLabel: item.extField.packingSpecification ? item.extField
  401. .packingSpecification.split(',') : [],
  402. isSave: true
  403. }
  404. })
  405. this.formData = res
  406. })
  407. } else {
  408. getInboundDetailsByBizNo(options.bizNo).then(res => {
  409. this.productList = res.outInDetailList.map(item => {
  410. return {
  411. ...item,
  412. packingSpecificationLabel: item.extField.packingSpecification ? item.extField
  413. .packingSpecification.split(',') : [],
  414. isSave: true
  415. }
  416. })
  417. this.formData = res
  418. })
  419. }
  420. },
  421. computed: {
  422. listRules() {
  423. return this.productList.reduce((cur, pre, index) => {
  424. return {
  425. ...cur,
  426. [`productList.${index}.batchNo`]: {
  427. type: 'string',
  428. required: true,
  429. trigger: ['blur', 'change']
  430. },
  431. [`productList.${index}.packingQuantity`]: {
  432. type: 'number',
  433. required: true,
  434. trigger: ['blur', 'change']
  435. },
  436. [`productList.${index}.packingUnit`]: {
  437. type: 'string',
  438. required: true,
  439. trigger: ['blur', 'change']
  440. },
  441. [`productList.${index}.warehouseId`]: {
  442. type: 'string',
  443. required: true,
  444. trigger: ['blur', 'change']
  445. }
  446. }
  447. }, {})
  448. }
  449. },
  450. methods: {
  451. getGoodsListsLabel(assetType) {
  452. let arr = assetType ? assetType.split(',') : []
  453. let label = arr.reduce((pre, cur) => {
  454. console.log(cur)
  455. console.log(pre)
  456. return (pre ? pre + '/' : '') + this.goodsLists.find(item => item.id == cur)?.name
  457. }, '')
  458. return label
  459. },
  460. formatter(dataTime) {
  461. return dayjs(dataTime).format('YYYY-MM-DD HH:mm:ss')
  462. },
  463. // 获取物品列表
  464. getListItems() {
  465. getTreeByGroup({
  466. type: 2
  467. }).then(res => {
  468. this.goodsLists = res
  469. })
  470. }
  471. }
  472. }
  473. </script>
  474. <style lang="scss" scoped>
  475. .mainBox {
  476. /deep/.required-form .u-form-item__body__left__content__label::before {
  477. content: '*';
  478. color: red;
  479. }
  480. }
  481. .main {
  482. padding: 0 30rpx;
  483. .row {
  484. display: flex;
  485. align-items: center;
  486. justify-content: space-between;
  487. padding: 20rpx 0;
  488. border-bottom: 1px dashed #dedede;
  489. .row-item {
  490. .t1 {
  491. font-weight: bold;
  492. font-size: 28rpx;
  493. color: #333333;
  494. margin-right: 20rpx;
  495. }
  496. .t2 {
  497. font-size: 28rpx;
  498. color: #333333;
  499. }
  500. }
  501. }
  502. .ckmx {
  503. color: #70b603;
  504. font-size: 28rpx;
  505. font-weight: bold;
  506. padding: 20rpx;
  507. display: flex;
  508. justify-content: flex-end;
  509. }
  510. }
  511. .collapse {
  512. padding-bottom: 120rpx;
  513. box-sizing: border-box;
  514. }
  515. /deep/.cLine .u-line:nth-child(1) {
  516. border-bottom: none !important;
  517. }
  518. .detail-box {
  519. position: relative;
  520. display: flex;
  521. justify-content: space-between;
  522. align-items: center;
  523. /deep/uni-button {
  524. margin: 0 !important;
  525. width: 180rpx;
  526. }
  527. .selectEnterType {
  528. margin-left: 10rpx !important;
  529. }
  530. }
  531. .footBox {
  532. position: fixed;
  533. left: 0px;
  534. bottom: 0px;
  535. height: 100rpx;
  536. width: 100%;
  537. display: flex;
  538. align-items: center;
  539. justify-content: space-between;
  540. view {
  541. width: 100%;
  542. height: 100%;
  543. text-align: center;
  544. color: #fff;
  545. display: flex;
  546. align-items: center;
  547. justify-content: center;
  548. }
  549. .reg {
  550. background: $u-success-dark;
  551. }
  552. .add {
  553. background: $uni-color-primary;
  554. }
  555. .uni-icons {
  556. margin-right: 8rpx !important;
  557. }
  558. }
  559. .listBox {
  560. padding: 20rpx 10rpx;
  561. border-bottom: 1px #f2f2f2 solid;
  562. position: relative;
  563. &.code {
  564. .label {
  565. width: 120rpx !important;
  566. }
  567. }
  568. .z_list {
  569. height: 100% !important;
  570. max-height: 500rpx;
  571. .material {
  572. margin-top: 10rpx;
  573. .left {
  574. width: 40rpx;
  575. }
  576. .zdy_check {
  577. width: 30rpx;
  578. height: 30rpx;
  579. border: 2rpx solid #c8c9cc;
  580. border-radius: 4rpx;
  581. }
  582. .check_active {
  583. background: $theme-color;
  584. border: 2rpx solid $theme-color;
  585. /deep/ .u-icon__icon {
  586. color: #fff !important;
  587. }
  588. }
  589. .content_table {
  590. width: 100%;
  591. border: 2rpx solid $border-color;
  592. .item {
  593. display: flex;
  594. border-bottom: 2rpx solid $border-color;
  595. .lable {
  596. width: 200rpx;
  597. text-align: center;
  598. background-color: #f7f9fa;
  599. font-size: 26rpx;
  600. border-right: 2rpx solid $border-color;
  601. flex-shrink: 0;
  602. }
  603. .ww80 {
  604. width: 80rpx;
  605. }
  606. .content {
  607. width: 500rpx;
  608. min-height: 64rpx;
  609. font-size: 28rpx;
  610. line-height: 28rpx;
  611. font-style: normal;
  612. font-weight: 400;
  613. padding: 18rpx 8rpx;
  614. box-sizing: border-box;
  615. word-wrap: break-word;
  616. flex-grow: 1 !important;
  617. }
  618. .input_box {
  619. padding: 0 !important;
  620. }
  621. .content_num {
  622. display: flex;
  623. align-items: center;
  624. padding: 0 4rpx;
  625. /deep/ .uni-input-input {
  626. width: 200rpx;
  627. border: 2rpx solid #f0f8f2;
  628. background: #f0f8f2;
  629. color: $theme-color;
  630. }
  631. .unit {
  632. padding: 0 4rpx;
  633. font-size: 28rpx;
  634. color: #404446;
  635. }
  636. }
  637. &:last-child {
  638. border-bottom: none;
  639. }
  640. }
  641. }
  642. }
  643. }
  644. .more {
  645. position: absolute;
  646. bottom: 26rpx;
  647. right: 30rpx;
  648. font-size: 28rpx;
  649. color: #666;
  650. }
  651. }
  652. .selectTime {
  653. display: flex;
  654. justify-content: flex-end;
  655. align-items: center;
  656. margin-top: 10px;
  657. .title {
  658. flex: 1;
  659. font-size: 28rpx;
  660. font-weight: bold;
  661. }
  662. .timeBox {
  663. display: flex;
  664. width: 500rpx;
  665. .firstBtn {
  666. margin-right: 10rpx;
  667. }
  668. }
  669. }
  670. .listBox:last-child {
  671. border: none !important;
  672. }
  673. .textBox {
  674. border: 1px #f2f2f2 solid;
  675. height: 160px;
  676. display: block;
  677. width: auto !important;
  678. }
  679. .saveBtn {
  680. width: 50%;
  681. margin: 40rpx auto;
  682. }
  683. .top-css {
  684. border-bottom: 1px solid rgb(207, 204, 204);
  685. }
  686. .footBox-container {
  687. // height: 100rpx;
  688. width: 100vw;
  689. }
  690. .footBox {
  691. position: fixed;
  692. left: 0px;
  693. bottom: 0px;
  694. height: 100rpx;
  695. width: 100%;
  696. display: flex;
  697. align-items: center;
  698. justify-content: space-between;
  699. view {
  700. width: 100%;
  701. height: 100%;
  702. text-align: center;
  703. color: #fff;
  704. display: flex;
  705. align-items: center;
  706. justify-content: center;
  707. }
  708. .add {
  709. background: $uni-color-success;
  710. }
  711. .reg {
  712. background: $u-success-dark;
  713. }
  714. .uni-icons {
  715. margin-right: 8rpx !important;
  716. font-weight: bold;
  717. }
  718. }
  719. </style>