BOM.vue 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. <template>
  2. <view class=" card-content">
  3. <view v-for="item in list" :key="item.name">
  4. <view class="collapse-title">
  5. <view class="report-item" :class="{'text-danger' : item.bdmng < 0}">
  6. <view class="report-col full">物料代码:{{item.matnr}}</view>
  7. <view class="report-col full">物料描述:{{item.maktx}}</view>
  8. <view class="report-col full">BOM用量:{{item.bdmng}}</view>
  9. </view>
  10. </view>
  11. </view>
  12. </view>
  13. </template>
  14. <script>
  15. import {
  16. getBomInfo,
  17. } from "@/api/report/index";
  18. export default {
  19. props: {
  20. orderId: [Number, String],
  21. },
  22. data() {
  23. return {
  24. detailObj: {},
  25. list: [],
  26. };
  27. },
  28. watch: {
  29. orderId: {
  30. immediate: true,
  31. handler() {
  32. if (this.orderId) {
  33. this.getDetail();
  34. }
  35. },
  36. },
  37. },
  38. methods: {
  39. getDetail() {
  40. getBomInfo(this.orderId).then((res) => {
  41. this.list = res;
  42. });
  43. },
  44. handleClose() {
  45. this.$refs.inputDialog.close();
  46. },
  47. },
  48. };
  49. </script>
  50. <style lang="scss" scoped>
  51. .card-content{
  52. padding:10rpx 10rpx 20rpx;
  53. font-size: $uni-font-size-lg;
  54. .collapse-title{
  55. display: flex;
  56. justify-content: space-between;
  57. padding:16rpx 3% 16rpx;
  58. }
  59. }
  60. .report-item{
  61. display: flex;
  62. justify-content: space-between;
  63. align-items: flex-start;
  64. flex-wrap: wrap;
  65. margin-bottom: 30rpx;
  66. padding: 10rpx 0;
  67. border-bottom: 1rpx solid #ccc;
  68. .report-col{
  69. width: 50%;
  70. margin-bottom: 10rpx;
  71. font-size: $uni-font-size-lg;
  72. &.full{
  73. width: 100%;
  74. }
  75. .view-detail{
  76. width: 180rpx;
  77. height: 60rpx;
  78. line-height: 60rpx;
  79. color: $j-primary-green;
  80. margin: 0 0 0 auto;
  81. }
  82. }
  83. }
  84. </style>