warehouse-list.vue 2.9 KB

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