CargoSpaceInfoDialog.vue 13 KB

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