CargoSpaceInfoDialog.vue 14 KB

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