index.vue 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. <template>
  2. <view class="content flex flex_column">
  3. <view class="tits">请选择产品的货架层号</view>
  4. <view class="tagbox flex">
  5. <view>
  6. <view class="tag" :class="curTag==item?'active':''" v-for="item in list" :key="item" @click="curTag=curTag==item?'':item">
  7. {{item}}层
  8. </view>
  9. </view>
  10. </view>
  11. <view class="newbtn flex justify_between" v-if="curTag">
  12. <u-button shape="circle" @click="searchProduct()" size="medium">按产品编码搜索</u-button>
  13. <u-button @click="scanProduct()" type='primary' shape="circle" size="medium">扫描条形码匹配</u-button>
  14. </view>
  15. </view>
  16. </template>
  17. <script>
  18. export default {
  19. data() {
  20. return {
  21. list:[],
  22. curTag: '',
  23. shelfSn: '',
  24. shelfName: '',
  25. customerSn: ''
  26. }
  27. },
  28. onLoad(opts) {
  29. this.list = 'A、B、C、D、E、F、G、H、I、J、K、L、M、N、O、P、Q、R、S、T、U、V、W、X、Y、Z'.split('、');
  30. this.shelfName = opts.shelfName
  31. this.shelfSn = opts.shelfSn
  32. this.customerSn = opts.customerSn
  33. },
  34. onBackPress() {
  35. uni.redirectTo({
  36. url: "/pages/shelfSetting/shelfSet?shelfSn="+this.shelfSn
  37. })
  38. return true
  39. },
  40. methods: {
  41. scanProduct(){
  42. uni.redirectTo({
  43. url: "/pages/batchShelves/scanProduct?shelfSn="+this.shelfSn+'&layer='+this.curTag+'&shelfName='+this.shelfName+'&customerSn='+this.customerSn
  44. })
  45. },
  46. searchProduct(){
  47. uni.redirectTo({
  48. url: "/pages/batchShelves/searchProduct?shelfSn="+this.shelfSn+'&layer='+this.curTag+'&shelfName='+this.shelfName+'&customerSn='+this.customerSn
  49. })
  50. }
  51. }
  52. }
  53. </script>
  54. <style lang="less">
  55. .content{
  56. width: 100%;
  57. height: 100vh;
  58. padding: 20upx;
  59. background-color: #fff;
  60. .tits{
  61. padding: 30upx 0;
  62. text-align: center;
  63. }
  64. .tagbox{
  65. flex-grow: 1;
  66. > view{
  67. margin: 0 auto;
  68. overflow: hidden;
  69. width: 100%;
  70. .tag{
  71. width: 16%;
  72. background-color: #fff;
  73. border:1rpx solid #aeaeae;
  74. box-shadow: 2rpx 4rpx 6rpx #eee;
  75. border-radius: 15rpx;
  76. text-align: center;
  77. padding: 10rpx 0;
  78. float: left;
  79. margin: 20rpx 2%;
  80. }
  81. .active{
  82. background-color: #55aaff;
  83. border-color: #55aaff;
  84. color: #fff;
  85. }
  86. }
  87. }
  88. .newbtn{
  89. padding: 30upx;
  90. button{
  91. width: 45%;
  92. }
  93. }
  94. }
  95. </style>