reserved.vue 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. <template>
  2. <div class="reserved">
  3. <el-dialog
  4. :visible.sync="visible"
  5. :before-close="handleClose"
  6. width="70%"
  7. >
  8. <el-descriptions class="margin-top" title="货权预留单" :column="3" size="small" border>
  9. <el-descriptions-item>
  10. <template slot="label">
  11. 预留单据号
  12. </template>
  13. {{ resData.code }}
  14. </el-descriptions-item>
  15. <el-descriptions-item>
  16. <template slot="label">
  17. 来源单据号
  18. </template>
  19. {{ resData.source }}
  20. </el-descriptions-item>
  21. <el-descriptions-item>
  22. <template slot="label">
  23. 客户名称
  24. </template>
  25. {{ resData.customerName }}
  26. </el-descriptions-item>
  27. <el-descriptions-item>
  28. <template slot="label">
  29. 创建人
  30. </template>
  31. {{ resData.createByName }}
  32. </el-descriptions-item>
  33. <el-descriptions-item>
  34. <template slot="label">
  35. 创建人编码
  36. </template>
  37. {{ resData.createBy }}
  38. </el-descriptions-item>
  39. <el-descriptions-item>
  40. <template slot="label">
  41. 创建时间
  42. </template>
  43. {{ resData.createTime }}
  44. </el-descriptions-item>
  45. </el-descriptions>
  46. <el-table style="margin-top: 50px" :data="items" @row-click="rowClick" height="300px">
  47. <el-table-column show-overflow-tooltip prop="materialCode" label="物料编码" width="150"></el-table-column>
  48. <el-table-column show-overflow-tooltip prop="materialName" label="物料名称" width="150"></el-table-column>
  49. <el-table-column show-overflow-tooltip prop="unitName" label="单位名称" width="150"></el-table-column>
  50. <el-table-column show-overflow-tooltip prop="reservedQty" label="预留数量" width="150"></el-table-column>
  51. <el-table-column show-overflow-tooltip prop="totalIn" label="累计入库数量" width="150"></el-table-column>
  52. <el-table-column show-overflow-tooltip prop="qty" label="可用量" width="150"></el-table-column>
  53. <el-table-column show-overflow-tooltip prop="usedQty" label="已用量" width="150"></el-table-column>
  54. <el-table-column show-overflow-tooltip prop="warehouseName" label="仓库名称" width="150"></el-table-column>
  55. <el-table-column show-overflow-tooltip prop="allocationName" label="货位名称" width="150"></el-table-column>
  56. <el-table-column show-overflow-tooltip prop="createTime" label="创建时间" width="200"></el-table-column>
  57. </el-table>
  58. <el-table style="margin-top: 50px" :data="showHistoryItems" height="300px">
  59. <el-table-column show-overflow-tooltip prop="materialCode" label="物料编码" width="150"></el-table-column>
  60. <el-table-column show-overflow-tooltip prop="materialName" label="物料名称" width="150"></el-table-column>
  61. <el-table-column show-overflow-tooltip prop="unitName" label="单位名称" width="150"></el-table-column>
  62. <el-table-column show-overflow-tooltip prop="operateBill" label="操作单据" width="150"></el-table-column>
  63. <el-table-column show-overflow-tooltip prop="operateBillcode" label="操作单据编码" width="150"></el-table-column>
  64. <el-table-column show-overflow-tooltip prop="operateBillitem" label="操作明细行号" width="150"></el-table-column>
  65. <el-table-column show-overflow-tooltip prop="allotQty" label="操作数量" width="150">
  66. <template slot-scope="scope">
  67. {{scope.row.allotQty > 0 ? "+" + scope.row.allotQty : scope.row.allotQty}}
  68. </template>
  69. </el-table-column>
  70. <el-table-column show-overflow-tooltip prop="createTime" label="操作时间" width="200"></el-table-column>
  71. </el-table>
  72. </el-dialog>
  73. </div>
  74. </template>
  75. <script>
  76. import {getDetailBySource} from '@/api/purchase/ownership.js'
  77. export default {
  78. props: {
  79. isVisible: {
  80. type: Boolean,
  81. default: false
  82. },
  83. info: {
  84. type: Object,
  85. default: null
  86. }
  87. },
  88. mounted() {
  89. this.getDetails(this.info)
  90. },
  91. data() {
  92. return {
  93. visible:this.isVisible,
  94. resData: {},
  95. items: [],
  96. historyItems: [],
  97. showHistoryItems: [],
  98. }
  99. },
  100. methods: {
  101. getDetails(row) {
  102. getDetailBySource(row.code).then(res => {
  103. if (res.code === 200) {
  104. this.resData = res.data;
  105. this.items = res.data.stMaterialOwnershipItemList;
  106. this.historyItems = res.data.stMaterialOwnershipHistoryList;
  107. this.showHistoryItems = this.historyItems.filter(ele => ele.ownerId == this.items[0].id);
  108. }
  109. })
  110. },
  111. handleClose() {
  112. this.$emit('updateReserved', false)
  113. },
  114. rowClick(row){
  115. this.showHistoryItems = this.historyItems.filter(ele => ele.ownerId == row.id);
  116. }
  117. }
  118. }
  119. </script>