index.vue 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  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,i) in taskList" :key="i">
  33. <task-item :item="item" @toStorage="toStorage" @toDetail="toDetail"></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. taskList:[
  62. {
  63. type:0
  64. },
  65. {
  66. type:1
  67. }
  68. ]
  69. }
  70. },
  71. onLoad() {
  72. let systemInfo = uni.getSystemInfoSync();
  73. let statusBarHeight = systemInfo.statusBarHeight;
  74. this.offsetTop = statusBarHeight + 40
  75. },
  76. methods:{
  77. stashClick() {
  78. this.pickType = 1
  79. this.columnsList = this.stashColumns
  80. this.defaultIndex = this.getDefaultIndex(this.cangName)
  81. this.stashShow = true
  82. },
  83. pickerConfirm(val) {
  84. if(this.pickType == 1) {
  85. this.cangName = val.value[0]
  86. }
  87. this.stashShow = false
  88. },
  89. // 获取picker默认index
  90. getDefaultIndex(val) {
  91. let arr = []
  92. let index = this.columnsList[0].findIndex(item=>item == val)
  93. arr = [index]
  94. return arr
  95. },
  96. // 出库
  97. toStorage(val) {
  98. uni.navigateTo({
  99. url:'/pages/picking-task/delivery'
  100. })
  101. },
  102. toDetail(val) {
  103. uni.navigateTo({
  104. url:'/pages/picking-task/detail'
  105. })
  106. }
  107. }
  108. }
  109. </script>
  110. <style lang="scss" scoped>
  111. .btn-right {
  112. display: flex;
  113. align-items: center;
  114. .cang-name {
  115. color: #0256FF;
  116. text-align: center;
  117. font-family: "PingFang SC";
  118. font-size: 28rpx;
  119. font-weight: 600;
  120. margin-right: 10rpx;
  121. }
  122. }
  123. .picking-task-page {
  124. min-height: 100vh;
  125. background: #F0F6FB;
  126. .container_main {
  127. .search-box {
  128. display: flex;
  129. align-items: center;
  130. padding: 0 32rpx;
  131. .scan-text {
  132. color: #333;
  133. font-family: "PingFang SC";
  134. font-size: 24rpx;
  135. font-weight: 400;
  136. margin-right: 20rpx;
  137. margin-left: 30rpx;
  138. }
  139. .scan-icon {
  140. width: 36rpx;
  141. height: 36rpx;
  142. background-color: #fff;
  143. border-radius: 50%;
  144. display: flex;
  145. align-items: center;
  146. justify-content: center;
  147. image {
  148. width: 24rpx;
  149. height: 24rpx;
  150. }
  151. }
  152. }
  153. .type-box {
  154. .type-item {
  155. width: 50%;
  156. height: 88rpx;
  157. display: flex;
  158. align-items: center;
  159. justify-content: center;
  160. .type-val {
  161. color: #000;
  162. font-family: "PingFang SC";
  163. font-size: 28rpx;
  164. font-weight: 400;
  165. margin-right: 10rpx;
  166. }
  167. }
  168. }
  169. .task-cont {
  170. padding: 0 24rpx;
  171. }
  172. }
  173. }
  174. </style>