warehouse-list.vue 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. <template>
  2. <div>
  3. <view class="ul">
  4. <view class="li" v-for="i in dataList" :key="i.id">
  5. <view class="line">
  6. 物料编码:{{i.materialCode}}
  7. </view>
  8. <view class="line">
  9. 物料名称:{{i.materialName}}
  10. </view>
  11. <view class="line">
  12. 出库时间:{{i.createTime}}
  13. <view class="span">
  14. 数量:<span style="color:red">{{i.changeName}}</span>
  15. </view>
  16. </view>
  17. <view class="line">
  18. 接收人员:{{i.realName}}
  19. </view>
  20. <view class="btn-warp">
  21. <button @click="operation(4,i.id)">退回</button>
  22. <button @click="operation(3,i.id)">确认接收</button>
  23. </view>
  24. </view>
  25. </view>
  26. <button class="footer-btn" @click="operation('all')">
  27. 批量接受物料
  28. </button>
  29. </div>
  30. </template>
  31. <script>
  32. export default{
  33. name:"xx",
  34. data(){
  35. return{
  36. userInfo:null,
  37. dataList:[],
  38. }
  39. },
  40. created(){
  41. setTimeout(()=>{
  42. this.getList()
  43. },100)
  44. },
  45. methods:{
  46. operation(_type,_id){
  47. const v = this
  48. var idList = []
  49. var operation = ''
  50. if(_type == 'all'){
  51. operation = 3
  52. for (var i = 0; i < this.dataList.length; i++) {
  53. idList.push(this.dataList[i].id)
  54. }
  55. }else{
  56. operation = _type
  57. idList = [_id]
  58. }
  59. console.log(idList,operation)
  60. v.$post('/materialReceive/operation',{
  61. idList: idList,
  62. operation:operation,
  63. }).then(res=>{
  64. console.log(res)
  65. v.getList()
  66. if(res.data.code == 200){
  67. v.$msg.showToast('操作成功!')
  68. }
  69. })
  70. },
  71. getList(){
  72. const v = this
  73. uni.getStorage({
  74. key: 'Authorization',
  75. success: function (res) {
  76. v.$post('/materialReceive/list',{
  77. account:res.data.account
  78. }).then(res=>{
  79. console.log(res)
  80. v.dataList = res.data
  81. })
  82. }
  83. });
  84. },
  85. },
  86. }
  87. </script>
  88. <style scoped lang="less">
  89. .ul{
  90. padding-bottom: 200rpx;
  91. }
  92. .li{
  93. background-color: #fff;
  94. margin: 20rpx 20rpx 0;
  95. padding: 20rpx;
  96. list-style: none;
  97. .line{
  98. line-height: 70rpx;
  99. border: none;
  100. display: flex;
  101. padding: 0 20rpx;
  102. .span{
  103. margin-left: 50rpx;
  104. }
  105. }
  106. }
  107. .btn-warp{
  108. display: flex;
  109. button{
  110. width: 48%;
  111. }
  112. }
  113. .footer-btn{
  114. position: fixed;
  115. bottom: 10rpx;
  116. left: 10rpx;
  117. right: 10rpx;
  118. background-color: red;
  119. color: #fff;
  120. }
  121. </style>