index.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. <template>
  2. <view class="picking-task-page">
  3. <u-navbar height="40px" title="拣货任务" bgColor="#F0F6FB" autoBack placeholder>
  4. <view class="u-nav-slot btn-right" slot="right" @click="stashClick">
  5. <view class="cang-name">{{cangName}}</view>
  6. <u-icon name="arrow-down-fill" color="#999999" size="12"></u-icon>
  7. </view>
  8. </u-navbar>
  9. <view class="container_main">
  10. <u-sticky :offsetTop="offsetTop" bgColor="#F0F6FB">
  11. <view class="search-box">
  12. <u-search placeholder="请输入单据编号" bgColor="#fff" shape="square" v-model="searchKey" :showAction="false"></u-search>
  13. <view class="flex_box">
  14. <view class="scan-text">扫描单据二维码</view>
  15. <view class="scan-icon">
  16. <image src="@/static/image/scan-icon.png" mode=""></image>
  17. </view>
  18. </view>
  19. </view>
  20. <view class="type-box flex_box">
  21. <view class="type-item">
  22. <view class="type-val">{{type1}}</view>
  23. <u-icon name="arrow-down-fill" color="#999999" size="12"></u-icon>
  24. </view>
  25. <view class="type-item">
  26. <view class="type-val">{{type2}}</view>
  27. <u-icon name="arrow-down-fill" color="#999999" size="12"></u-icon>
  28. </view>
  29. </view>
  30. </u-sticky>
  31. <view class="task-cont">
  32. <block v-for="item in 10" :key="">
  33. <task-item @toStorage="toStorage"></task-item>
  34. </block>
  35. </view>
  36. </view>
  37. <!-- 中心仓弹窗 -->
  38. <u-picker :show="stashShow" :defaultIndex="defaultIndex" :columns="columnsList" @confirm="pickerConfirm" @cancel="stashShow= false"></u-picker>
  39. </view>
  40. </template>
  41. <script>
  42. import taskItem from '@/components/task-item/task-item.vue'
  43. export default{
  44. components:{
  45. taskItem
  46. },
  47. data() {
  48. return {
  49. offsetTop:0,
  50. cangName:'鹏越中心仓',
  51. searchKey:'',
  52. type1:'全部',
  53. type2:'月份',
  54. stashShow:false,
  55. columnsList:[],
  56. stashColumns:[
  57. ['鹏越中心仓','美团中心仓']
  58. ],
  59. defaultIndex:[],
  60. pickType:0,//1.中心仓
  61. }
  62. },
  63. onLoad() {
  64. let systemInfo = uni.getSystemInfoSync();
  65. let statusBarHeight = systemInfo.statusBarHeight;
  66. this.offsetTop = statusBarHeight + 40
  67. },
  68. methods:{
  69. stashClick() {
  70. this.pickType = 1
  71. this.columnsList = this.stashColumns
  72. this.defaultIndex = this.getDefaultIndex(this.cangName)
  73. this.stashShow = true
  74. },
  75. pickerConfirm(val) {
  76. if(this.pickType == 1) {
  77. this.cangName = val.value[0]
  78. }
  79. this.stashShow = false
  80. },
  81. // 获取picker默认index
  82. getDefaultIndex(val) {
  83. let arr = []
  84. let index = this.columnsList[0].findIndex(item=>item == val)
  85. arr = [index]
  86. return arr
  87. },
  88. // 出库
  89. toStorage(val) {
  90. uni.navigateTo({
  91. url:'/pages/picking-task/delivery'
  92. })
  93. }
  94. }
  95. }
  96. </script>
  97. <style lang="scss" scoped>
  98. .btn-right {
  99. display: flex;
  100. align-items: center;
  101. .cang-name {
  102. color: #0256FF;
  103. text-align: center;
  104. font-family: "PingFang SC";
  105. font-size: 28rpx;
  106. font-weight: 600;
  107. margin-right: 10rpx;
  108. }
  109. }
  110. .picking-task-page {
  111. min-height: 100vh;
  112. background: #F0F6FB;
  113. .container_main {
  114. .search-box {
  115. display: flex;
  116. align-items: center;
  117. padding: 0 32rpx;
  118. .scan-text {
  119. color: #333;
  120. font-family: "PingFang SC";
  121. font-size: 24rpx;
  122. font-weight: 400;
  123. margin-right: 20rpx;
  124. margin-left: 30rpx;
  125. }
  126. .scan-icon {
  127. width: 36rpx;
  128. height: 36rpx;
  129. background-color: #fff;
  130. border-radius: 50%;
  131. display: flex;
  132. align-items: center;
  133. justify-content: center;
  134. image {
  135. width: 24rpx;
  136. height: 24rpx;
  137. }
  138. }
  139. }
  140. .type-box {
  141. .type-item {
  142. width: 50%;
  143. height: 88rpx;
  144. display: flex;
  145. align-items: center;
  146. justify-content: center;
  147. .type-val {
  148. color: #000;
  149. font-family: "PingFang SC";
  150. font-size: 28rpx;
  151. font-weight: 400;
  152. margin-right: 10rpx;
  153. }
  154. }
  155. }
  156. .task-cont {
  157. padding: 0 24rpx;
  158. }
  159. }
  160. }
  161. </style>