selectQrcode.vue 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. <template>
  2. <view class="selectQrcode">
  3. <uni-search-bar @confirm="getData" v-model="req.keyword" @cancel="reload">
  4. </uni-search-bar>
  5. <view class="dtl">
  6. <view class="">
  7. 物料编码:{{option.code}}
  8. </view>
  9. <view class="">
  10. 物料名称:{{option.name}}
  11. </view>
  12. <view class="" style="color:#C280FF">
  13. {{option.count}} 个入库单
  14. </view>
  15. </view>
  16. <view class="addQrcode-list" v-for="(i,index) in listData" :key="i.materialId" @click="toRouter(index)">
  17. <view class="fl" >
  18. <view class="code">
  19. <view class="">
  20. 供应商:{{i.supplierName}}
  21. </view>
  22. <view class="">
  23. 合同编号:{{i.purchaseBillNo}}
  24. </view>
  25. <view class="">
  26. <span style="color:#02A7F0">待入库:{{i.notArrivalQty}} </span>
  27. <span style="margin-left:40rpx;color:#D9001B">已生成:{{i.arrivalQty}}</span>
  28. </view>
  29. </view>
  30. </view>
  31. <view class="fr">
  32. <uni-icons type="forward" size="30"></uni-icons>
  33. </view>
  34. </view>
  35. </view>
  36. </template>
  37. <script>
  38. import {
  39. getInfo
  40. } from "@/util/api.js";
  41. export default {
  42. data() {
  43. return {
  44. listData:[],
  45. req:{
  46. keyword:null,
  47. materialId:null
  48. },
  49. option:{},
  50. }
  51. },
  52. onLoad(option) {
  53. const v = this
  54. v.option = JSON.parse(decodeURIComponent(option.data))
  55. console.log(v.option)
  56. v.req.materialId = v.option.materialId
  57. v.getData()
  58. },
  59. methods: {
  60. reload(){
  61. this.req.keyword = null
  62. this.getData()
  63. },
  64. getData(){
  65. const v = this
  66. v.$post('/wx/createQrcode/getPurchaseByMaterialIdList',v.req).then(res=>{
  67. v.listData = res.data
  68. })
  69. },
  70. toRouter(i){
  71. const v = this
  72. console.log(i)
  73. v.option = Object.assign(v.option,v.listData[i])
  74. uni.navigateTo({
  75. url: '/pages/addQrcode/addBatch?data=' + encodeURIComponent(JSON.stringify(v.option))
  76. })
  77. // uni.navigateTo({
  78. // url: '/pages/addQrcode/selectQrcode?id=' + i.materialId
  79. // })
  80. },
  81. },
  82. }
  83. </script>
  84. <style lang="less">
  85. .selectQrcode {
  86. font-size: 28rpx;
  87. .dtl{
  88. padding: 30rpx;
  89. border-bottom: 1rpx solid #dcdcdc;
  90. }
  91. .addQrcode-list {
  92. height: 120rpx;
  93. display: flex;
  94. justify-content: space-between;
  95. padding: 15rpx;
  96. border-bottom: 1rpx solid #dcdcdc;
  97. .fl {
  98. display: flex;
  99. padding-left: 20rpx;
  100. .code {
  101. margin-right: 20rpx;
  102. }
  103. }
  104. .fr {
  105. line-height: 120rpx;
  106. }
  107. }
  108. }
  109. </style>