addQrcode.vue 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. <template>
  2. <view class="addQrcode">
  3. <uni-search-bar @confirm="getData" v-model="req.keyword" @cancel="reload">
  4. </uni-search-bar>
  5. <view class="addQrcode-list" v-for="i in listData" :key="i.materialId" @click="toRouter(i)">
  6. <view class="fl">
  7. <view class="code">
  8. <view class="">
  9. {{i.code}}
  10. </view>
  11. <view class="">
  12. {{i.count}}个入库单
  13. </view>
  14. </view>
  15. <view class="name">
  16. {{i.name}}
  17. </view>
  18. </view>
  19. <view class="fr">
  20. <uni-icons type="forward" size="30"></uni-icons>
  21. </view>
  22. </view>
  23. <view class="commons-no-data" v-if="listData.length == 0">
  24. 已经没有数据了。。
  25. </view>
  26. </view>
  27. </template>
  28. <script>
  29. import {
  30. getInfo
  31. } from "@/util/api.js";
  32. export default {
  33. data() {
  34. return {
  35. listData:[],
  36. req:{
  37. keyword:null,
  38. }
  39. }
  40. },
  41. onLoad() {
  42. const v = this
  43. v.getData()
  44. },
  45. methods: {
  46. reload(){
  47. this.req.keyword = null
  48. this.getData()
  49. },
  50. getData(){
  51. const v = this
  52. v.$post('/wx/createQrcode/getMaterialGroupList',v.req).then(res=>{
  53. v.listData = res.data
  54. })
  55. },
  56. toRouter(i){
  57. uni.navigateTo({
  58. url: '/pages/addQrcode/selectQrcode?data=' + encodeURIComponent(JSON.stringify(i))
  59. })
  60. },
  61. },
  62. }
  63. </script>
  64. <style lang="less">
  65. .addQrcode-list {
  66. height: 100rpx;
  67. display: flex;
  68. justify-content: space-between;
  69. padding: 15rpx;
  70. border-bottom: 1rpx solid #dcdcdc;
  71. .fl {
  72. display: flex;
  73. .code {
  74. margin-right: 20rpx;
  75. }
  76. }
  77. .fr {
  78. line-height: 100rpx;
  79. }
  80. }
  81. </style>