CargoSpaceInfoDialog.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635
  1. <template>
  2. <uni-popup ref="popup" background-color="#fff" :is-mask-click="false">
  3. <view class="mainBox">
  4. <view class="main">
  5. <uni-nav-bar fixed="true" statusBar="true" left-icon="back" :title="`调拨(${cargoSpace})`"
  6. @clickLeft="backAdd"></uni-nav-bar>
  7. <!-- <view class="searchBox">
  8. <input v-model="searchVal" placeholder="请输入编码/名称" class="searchInput" />
  9. <u-button type="icon-shixiangxinzeng" size="30" @click="doSearch" data-icon="Search" class="searchBtn">
  10. <view class="iconfont icon-sousuo"></view>
  11. <view class="text">搜索</view>
  12. </u-button>
  13. </view> -->
  14. <view class="top-wrapper">
  15. <uni-section>
  16. <uni-easyinput prefixIcon="search" style="width: 460rpx" v-model="searchVal"
  17. placeholder="请输入编码/名称">
  18. </uni-easyinput>
  19. </uni-section>
  20. <view style="display: flex;">
  21. <button class="search_btn" @click="doSearch">搜索</button>
  22. </view>
  23. </view>
  24. <view class="wrapper">
  25. <u-list @scrolltolower="scrolltolower" class="listContent">
  26. <checkbox-group v-for="(item, index) in listData" :key="index"
  27. @change.stop="e => selectVal(e, item, index)">
  28. <label>
  29. <view class="listBox">
  30. <view class="listBox-sel">
  31. <checkbox :value="item.code" color="#fff" :disabled="item.disabled"
  32. :checked="item.checked" />
  33. </view>
  34. <view class="listBox-con">
  35. <view class="listBox-top">
  36. <view class="listBox-name">
  37. {{ item.categoryName }}
  38. </view>
  39. <view class="listBox-code">
  40. {{ item.categoryCode }}
  41. </view>
  42. </view>
  43. <view class="listBox-bottom">
  44. <view>牌号:{{ item.brandNum }}</view>
  45. <view>型号:{{ item.modelType }}</view>
  46. <view>规格:{{ item.specification }}</view>
  47. <view>批次号:{{ item.batchNo }}</view>
  48. <view>计量数量:{{ item.measureQuantity }}({{ item.measureUnit }})</view>
  49. <view class="w100">包装编码:{{ item.packageNo }}</view>
  50. <view>包装数量:{{ item.packingQuantity }}({{ item.packingUnit }})</view>
  51. <view>重量:{{ item.weight }}({{ item.weightUnit }})</view>
  52. <view>发货条码:{{ item.barcodes }}</view>
  53. <view>物料代号:{{ item.materielDesignation }}</view>
  54. <view>客户代号:{{ item.clientCode }}</view>
  55. <view>刻码:{{ item.engrave }}</view>
  56. <view class="w100">仓库:{{ item.warehouseName }}</view>
  57. <view class="w100">区域:{{ getLocation(item) }}</view>
  58. </view>
  59. </view>
  60. </view>
  61. </label>
  62. </checkbox-group>
  63. <u-empty class="noDate" style="margin-top: 20vh" v-if="!listData.length"></u-empty>
  64. </u-list>
  65. </view>
  66. <view class="footer">
  67. <view class="bottom">
  68. <checkbox v-if="!seletedAll" color="#fff" :checked="seletedAll" @tap="_seletedAll">全选</checkbox>
  69. <checkbox class="select-all" color="#fff" v-else :checked="seletedAll" @tap="_seletedAll">取消全选
  70. </checkbox>
  71. </view>
  72. <u-button type="success" size="small" class="u-reset-button" :disabled="!checkListLen"
  73. @click="jumpAdd">
  74. <view class="selBtn">选择( {{ checkListLen }} )</view>
  75. </u-button>
  76. </view>
  77. </view>
  78. </view>
  79. </uni-popup>
  80. </template>
  81. <script>
  82. import {
  83. getPackingList
  84. } from '@/api/warehouseManagement'
  85. export default {
  86. data() {
  87. return {
  88. warehouse: {},
  89. cargoSpace: '',
  90. popupInfo: {
  91. dimension: 3,
  92. warehouseId: ''
  93. },
  94. dimension: 3,
  95. warehouseId: '',
  96. page: 1,
  97. size: 20,
  98. isEnd: true,
  99. searchVal: '',
  100. pickTabIndex: 1,
  101. popupShow: false, //右侧搜索窗
  102. typeIndex: 1,
  103. listData: [], //列表数据
  104. seletedAll: false, //全选状态
  105. bizScene: '',
  106. warehousingName: '',
  107. warehousingType: ''
  108. }
  109. },
  110. //选择的列表长度
  111. computed: {
  112. checkListLen() {
  113. return this.listData.filter(el => el.checked).length
  114. }
  115. },
  116. // onLoad(warehouse) {
  117. // if (warehouse.areaName) {
  118. // if (warehouse.shelfCode) {
  119. // if (warehouse.cargoSpaceCode) {
  120. // this.cargoSpace = warehouse.warehouseName + '-' + warehouse.areaName + '-' + warehouse.shelfCode + '-' + warehouse.cargoSpaceCode
  121. // } else {
  122. // this.cargoSpace = warehouse.warehouseName + '-' + warehouse.areaName + '-' + warehouse.shelfCode
  123. // }
  124. // } else {
  125. // this.cargoSpace = warehouse.warehouseName + '-' + warehouse.areaName
  126. // }
  127. // } else {
  128. // this.cargoSpace = warehouse.warehouseName
  129. // }
  130. // this.warehouse = warehouse
  131. // },
  132. //触底刷新
  133. // onReachBottom: function () {
  134. // if (this.isEnd) {
  135. // return
  136. // }
  137. // // 显示加载图标
  138. // uni.showLoading({
  139. // title: '数据加载中'
  140. // })
  141. // //获取更多数据
  142. // this.page++
  143. // this.getList()
  144. // },
  145. // onShow() {
  146. // this.doSearch()
  147. // },
  148. methods: {
  149. getLocation(item) {
  150. if (item.areaName && item.goodsShelfName && item.goodsAllocationName) {
  151. return item.areaName + '/' + item.goodsShelfName + '/' + item.goodsAllocationName
  152. } else if (item.areaName && item.goodsShelfName) {
  153. return item.areaName + '/' + item.goodsShelfName
  154. } else if (item.areaName) {
  155. return item.areaName
  156. } else {
  157. return ''
  158. }
  159. },
  160. async open(warehouse) {
  161. this.warehouse = {}
  162. console.log('warehouse---------', warehouse)
  163. if (warehouse.areaName) {
  164. if (warehouse.shelfCode) {
  165. if (warehouse.cargoSpaceCode) {
  166. this.cargoSpace = warehouse.warehouseName + '-' + warehouse.areaName + '-' + warehouse
  167. .shelfCode + '-' + warehouse.cargoSpaceCode
  168. } else {
  169. this.cargoSpace = warehouse.warehouseName + '-' + warehouse.areaName + '-' + warehouse
  170. .shelfCode
  171. }
  172. } else {
  173. this.cargoSpace = warehouse.warehouseName + '-' + warehouse.areaName
  174. }
  175. } else {
  176. this.cargoSpace = warehouse.warehouseName
  177. }
  178. this.warehouse = warehouse
  179. this.$refs.popup.open('right')
  180. this.doSearch()
  181. },
  182. scrolltolower() {
  183. if (this.isEnd) {
  184. return
  185. }
  186. // 显示加载图标
  187. uni.showLoading({
  188. title: '数据加载中'
  189. })
  190. //获取更多数据
  191. this.page++
  192. this.getList()
  193. },
  194. //列表数据
  195. async getList() {
  196. this.isEnd = false
  197. this._getClassifyList()
  198. },
  199. async _getClassifyList() {
  200. uni.showLoading({
  201. title: '数据加载中'
  202. })
  203. let res = null
  204. const params = {
  205. pageNum: this.page,
  206. size: this.size,
  207. keyWord: this.searchVal,
  208. warehouseId: this.warehouse.warehouseId,
  209. warehouseAreaId: this.warehouse.areaId,
  210. warehouseAreaGoodsId: this.warehouse.shelfId,
  211. warehouseAreaGoodsShelvesId: this.warehouse.cargoSpaceId
  212. }
  213. res = await getPackingList(params)
  214. uni.hideLoading()
  215. if (this.page == 1) {
  216. this.listData = res.list.map(item => {
  217. return {
  218. ...item,
  219. checked: false
  220. }
  221. })
  222. } else {
  223. this.listData = this.listData.concat(res.list)
  224. }
  225. console.log('this.listData--------------', this.listData)
  226. this.isEnd = this.listData.length >= res.count
  227. this.$forceUpdate()
  228. },
  229. doSearch() {
  230. this.page = 1
  231. this.getList()
  232. },
  233. //勾选
  234. selectVal(e, val, index) {
  235. this.$set(this.listData[index], 'checked', !this.listData[index].checked)
  236. // this.listData[index].checked = !this.listData[index].checked
  237. this.seletedAll = !this.listData.some(item => !item.checked)
  238. },
  239. //全选按钮
  240. _seletedAll() {
  241. if (!this.seletedAll) {
  242. this.seletedAll = true
  243. this.listData.map(item => {
  244. this.$set(item, 'checked', true)
  245. })
  246. } else {
  247. this.seletedAll = false
  248. //this.checkListLen = 0;
  249. this.listData.map(item => {
  250. this.$set(item, 'checked', false)
  251. })
  252. }
  253. },
  254. //跳转回添加页面
  255. async jumpAdd() {
  256. let selectionList = this.listData.filter(item => item.checked)
  257. this.$emit('success', selectionList)
  258. this.backAdd()
  259. },
  260. //返回添加页
  261. backAdd() {
  262. this.$refs.popup.close()
  263. this.$emit('cancel')
  264. this.listData = []
  265. }
  266. }
  267. }
  268. </script>
  269. <style lang="scss" scoped>
  270. .mainBox {
  271. height: 100vh;
  272. width: 100vw;
  273. .main {
  274. height: 100%;
  275. display: flex;
  276. flex-direction: column;
  277. }
  278. .wrapper {
  279. flex: 1;
  280. overflow: hidden;
  281. }
  282. .top-wrapper {
  283. display: flex;
  284. height: 88rpx;
  285. align-items: center;
  286. justify-content: space-between;
  287. padding: 20rpx;
  288. /deep/.uni-section {
  289. margin-top: 0px;
  290. }
  291. /deep/.uni-section-header {
  292. padding: 0px;
  293. }
  294. .search_btn {
  295. width: 120rpx;
  296. height: 70rpx;
  297. line-height: 70rpx;
  298. background: $theme-color;
  299. font-size: 28rpx;
  300. color: #fff;
  301. }
  302. .menu_icon {
  303. width: 44rpx;
  304. height: 44rpx;
  305. margin-left: 14rpx;
  306. }
  307. .more_search {
  308. display: flex;
  309. align-items: center;
  310. height: 70rpx;
  311. line-height: 70rpx;
  312. }
  313. /deep/.u-input {
  314. border: 1rpx solid #ccc;
  315. .u-input__content__field-wrapper__field {
  316. height: 40rpx !important;
  317. }
  318. }
  319. image {
  320. width: 52rpx;
  321. height: 52rpx;
  322. margin-left: 10rpx;
  323. }
  324. }
  325. // .searchBox {
  326. // padding: 10rpx 0;
  327. // box-sizing: border-box;
  328. // background-color: #dedede;
  329. // height: 90rpx;
  330. // width: 100%;
  331. // line-height: 90rpx;
  332. // display: flex;
  333. // justify-content: space-around;
  334. // align-items: center;
  335. // input {
  336. // height: 78rpx;
  337. // width: 65%;
  338. // background: #f9f9f9 !important;
  339. // margin: 0 10rpx;
  340. // padding: 0 10rpx;
  341. // box-sizing: border-box;
  342. // border-radius: 5rpx;
  343. // }
  344. // .searchBtn {
  345. // height: 80rpx;
  346. // background: #f9f9f9 !important;
  347. // color: #676767;
  348. // font-size: 28rpx;
  349. // padding: 0 42rpx;
  350. // box-sizing: border-box;
  351. // outline: none;
  352. // border: none;
  353. // width: 260rpx;
  354. // .icon-sousuo {
  355. // font-size: 22px;
  356. // }
  357. // .text {
  358. // font-size: 16px;
  359. // margin-left: 10px;
  360. // }
  361. // }
  362. // .search-icon {
  363. // display: flex;
  364. // align-items: center;
  365. // justify-content: space-around;
  366. // font-size: 28rpx;
  367. // white-space: nowrap;
  368. // margin-left: 10rpx;
  369. // image {
  370. // width: 30rpx;
  371. // height: 30rpx;
  372. // }
  373. // }
  374. // }
  375. .tab-title {
  376. position: fixed;
  377. top: 190rpx;
  378. z-index: 99;
  379. width: 100%;
  380. display: flex;
  381. justify-content: space-between;
  382. align-items: center;
  383. height: $tab-height;
  384. line-height: $tab-height;
  385. background-color: #ffffff;
  386. border-bottom: 2rpx solid #f2f2f2;
  387. box-sizing: border-box;
  388. .tab-item {
  389. width: 25%;
  390. text-align: center;
  391. font-size: 32rpx;
  392. color: $uni-text-color-grey;
  393. }
  394. .tab-item.active {
  395. color: $j-primary-border-green;
  396. border-bottom: 1px solid $j-primary-border-green;
  397. font-weight: bold;
  398. }
  399. .tab-item.filter {
  400. flex: 1;
  401. padding: 0px 30rpx;
  402. .uni-icons {
  403. display: flex;
  404. padding-top: 5px;
  405. }
  406. }
  407. .screenIcon {
  408. display: flex;
  409. width: 80px;
  410. justify-content: center;
  411. .screenText {
  412. font-size: 32rpx;
  413. color: $uni-text-color-grey;
  414. }
  415. }
  416. }
  417. .listContent {
  418. height: 100% !important;
  419. .listBox {
  420. display: flex;
  421. // height: 180rpx;
  422. padding: 20rpx 0;
  423. border-top: 2rpx solid #e5e5e5;
  424. .listBox-sel {
  425. height: 90rpx;
  426. width: 80rpx;
  427. // line-height: 90rpx;
  428. text-align: center;
  429. checkbox {
  430. transform: scale(1.2);
  431. }
  432. }
  433. .listBox-con {
  434. width: 100%;
  435. // display: flex;
  436. // flex-wrap: wrap;
  437. // justify-content: space-between;
  438. align-items: center;
  439. padding: 0 18rpx 0 0;
  440. .listBox-top {
  441. width: 100%;
  442. display: flex;
  443. justify-content: space-between;
  444. padding-bottom: 10rpx;
  445. .listBox-name,
  446. .listBox-code {
  447. display: inline-block;
  448. font-size: $uni-font-size-sm;
  449. font-weight: bold;
  450. }
  451. }
  452. .listBox-bottom {
  453. width: 100%;
  454. display: flex;
  455. justify-content: space-between;
  456. font-size: $uni-font-size-sm;
  457. flex-wrap: wrap;
  458. >view {
  459. width: 50%;
  460. overflow: hidden;
  461. white-space: nowrap;
  462. text-overflow: ellipsis;
  463. }
  464. .input_view {
  465. display: flex;
  466. align-items: center;
  467. justify-content: center;
  468. .u-input {
  469. height: 36rpx;
  470. padding: 0 !important;
  471. margin-right: 10rpx;
  472. border: 1px solid #ddd;
  473. }
  474. }
  475. .w100 {
  476. width: 100%;
  477. }
  478. }
  479. }
  480. }
  481. .noDate {
  482. height: 100%;
  483. }
  484. }
  485. //底部按钮
  486. .footer {
  487. height: 90rpx;
  488. position: relative;
  489. display: flex;
  490. justify-content: space-between;
  491. align-items: center;
  492. bottom: 0;
  493. width: 100%;
  494. height: 100rpx;
  495. border-top: 1rpx solid #eeecec;
  496. background-color: #ffffff;
  497. z-index: 999;
  498. .bottom {
  499. margin-left: 10rpx;
  500. }
  501. .u-reset-button {
  502. position: absolute;
  503. right: 10rpx;
  504. top: 20rpx;
  505. width: 150rpx;
  506. }
  507. }
  508. .search-container {
  509. width: 70vw;
  510. padding: 30rpx 36rpx;
  511. .footer {
  512. position: absolute;
  513. bottom: 0;
  514. left: 0;
  515. width: 100%;
  516. display: flex;
  517. box-shadow: 0 10rpx 30rpx 0 #000;
  518. .btn {
  519. width: 50%;
  520. height: 80rpx;
  521. border-radius: 0 !important;
  522. flex: 1;
  523. display: flex;
  524. justify-content: center;
  525. align-items: center;
  526. &.reset {
  527. color: $j-primary-border-green;
  528. }
  529. &.search {
  530. color: #fff;
  531. background-color: $j-primary-border-green;
  532. }
  533. }
  534. }
  535. .title {
  536. font-weight: bold;
  537. font-size: 30rpx;
  538. }
  539. .status-wrapper {
  540. display: flex;
  541. align-items: center;
  542. justify-content: space-between;
  543. view {
  544. background-color: rgba(242, 242, 242, 1);
  545. height: 60rpx;
  546. border-radius: 30rpx;
  547. line-height: 60rpx;
  548. text-align: center;
  549. width: 160rpx;
  550. border: 1rpx solid rgba(242, 242, 242, 1);
  551. &.active {
  552. color: #157a2c;
  553. border-color: rgba(21, 122, 44, 1);
  554. }
  555. }
  556. }
  557. /deep/.uni-date {
  558. .uni-icons {
  559. display: none;
  560. }
  561. .uni-date-x {
  562. padding: 0;
  563. view {
  564. margin: 0 20rpx;
  565. }
  566. }
  567. }
  568. /deep/.uni-date__x-input,
  569. /deep/.uni-easyinput__content-input {
  570. height: 60rpx;
  571. border-radius: 30rpx;
  572. overflow: hidden;
  573. background-color: rgba(242, 242, 242, 1);
  574. }
  575. }
  576. }
  577. </style>