CargoSpaceInfoDialog.vue 15 KB

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