detailComp.vue 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. <template>
  2. <view class="aa">
  3. <view class="card-content">
  4. <uni-collapse accordion :show-animation="true">
  5. <uni-collapse-item
  6. :show-animation="true"
  7. :typeOpen="1"
  8. v-for="item in list"
  9. :key="item.matnr"
  10. >
  11. <view slot="title" class="collapse-title">
  12. <view class="report-item">
  13. <view class="report-col">{{ item.matnr }}</view>
  14. <view class="report-col">收货数量:{{ item.menge }}</view>
  15. </view>
  16. </view>
  17. <view class="card-list">
  18. <view
  19. class="list-item"
  20. v-for="(itm, index) in processeDetail"
  21. :key="index"
  22. >
  23. <view class="label">{{ itm.label }}</view>
  24. <view>{{ item[itm.key] }}</view>
  25. </view>
  26. </view>
  27. </uni-collapse-item>
  28. </uni-collapse>
  29. <view class="noData" v-if="!list.length"> 暂无数据 </view>
  30. </view>
  31. </view>
  32. </template>
  33. <script>
  34. import {
  35. getProductReciverInfoOne,
  36. getProductReciverInfoFive,
  37. } from "@/api/report/index";
  38. export default {
  39. props: {
  40. // processesList:{
  41. // type: Array,
  42. // default: () => []
  43. // },
  44. orderId: [Number, String],
  45. name: String,
  46. },
  47. data() {
  48. return {
  49. processeDetail: [
  50. { label: "收货时间", key: "reciverTime" },
  51. { label: "收货库存地点", key: "lgort" },
  52. { label: "物料代码", key: "matnr" },
  53. { label: "物料描述", key: "maktx" },
  54. { label: "收货批次", key: "charg" },
  55. { label: "收货数量", key: "menge" },
  56. ],
  57. detailObj: {},
  58. list: [],
  59. curId: null,
  60. };
  61. },
  62. watch: {
  63. orderId: {
  64. immediate: true,
  65. handler() {
  66. console.log(this.orderId, "orderInfo");
  67. if (this.orderId) {
  68. this.getDetail();
  69. }
  70. },
  71. },
  72. },
  73. methods: {
  74. getDetail() {
  75. if (this.name == "101") {
  76. getProductReciverInfoOne(this.orderId).then((res) => {
  77. console.log(res, "res");
  78. this.list = res;
  79. });
  80. } else {
  81. getProductReciverInfoFive(this.orderId).then((res) => {
  82. console.log(res, "res");
  83. this.list = res;
  84. });
  85. }
  86. },
  87. handleClose() {
  88. this.$refs.inputDialog.close();
  89. },
  90. },
  91. };
  92. </script>
  93. <style lang="scss" scoped>
  94. .report-item {
  95. display: flex;
  96. justify-content: space-between;
  97. align-items: flex-start;
  98. flex-wrap: wrap;
  99. margin-bottom: 30rpx;
  100. padding: 10rpx 0;
  101. border-bottom: 1rpx solid #ccc;
  102. .report-col {
  103. width: 50%;
  104. margin-bottom: 10rpx;
  105. font-size: $uni-font-size-lg;
  106. .view-detail {
  107. width: 180rpx;
  108. height: 60rpx;
  109. line-height: 60rpx;
  110. color: $j-primary-green;
  111. margin: 0 0 0 auto;
  112. }
  113. }
  114. }
  115. .card-list{
  116. padding: 30rpx;
  117. border-bottom: 1rpx solid #ccc;
  118. .list-item{
  119. border-bottom: 1rpx dashed #ccc;
  120. font-size: $uni-font-size-lg;
  121. display: flex;
  122. justify-content: space-between;
  123. align-items: center;
  124. padding: 16rpx 0;
  125. }
  126. }
  127. .noData {
  128. font-size: $uni-font-size-lg;
  129. text-align: center;
  130. padding: 20rpx 0;
  131. }
  132. </style>