reserved.vue 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  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">
  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="qty" label="可用量" width="150"></el-table-column>
  52. <el-table-column show-overflow-tooltip prop="usedQty" label="已用量" width="150"></el-table-column>
  53. <el-table-column show-overflow-tooltip prop="warehouseName" label="仓库名称" width="150"></el-table-column>
  54. <el-table-column show-overflow-tooltip prop="allocationName" label="货位名称" width="150"></el-table-column>
  55. <el-table-column show-overflow-tooltip prop="createTime" label="创建时间" width="200"></el-table-column>
  56. </el-table>
  57. <el-table style="margin-top: 50px" :data="showHistoryItems">
  58. <el-table-column show-overflow-tooltip prop="materialCode" label="物料编码" width="150"></el-table-column>
  59. <el-table-column show-overflow-tooltip prop="materialName" label="物料名称" width="150"></el-table-column>
  60. <el-table-column show-overflow-tooltip prop="unitName" label="单位名称" width="150"></el-table-column>
  61. <el-table-column show-overflow-tooltip prop="allotQty" label="操作数量" width="150"></el-table-column>
  62. <el-table-column show-overflow-tooltip prop="createTime" label="操作时间" width="200"></el-table-column>
  63. </el-table>
  64. </el-dialog>
  65. </div>
  66. </template>
  67. <script>
  68. import {getDetailBySource} from '@/api/purchase/ownership.js'
  69. export default {
  70. props: {
  71. isVisible: {
  72. type: Boolean,
  73. default: false
  74. },
  75. info: {
  76. type: Object,
  77. default: null
  78. }
  79. },
  80. mounted() {
  81. this.getDetails(this.info)
  82. },
  83. data() {
  84. return {
  85. visible:this.isVisible,
  86. resData: {},
  87. items: [],
  88. historyItems: [],
  89. showHistoryItems: [],
  90. }
  91. },
  92. methods: {
  93. getDetails(row) {
  94. getDetailBySource(row.code).then(res => {
  95. if (res.code === 200) {
  96. this.resData = res.data;
  97. this.items = res.data.stMaterialOwnershipItemList;
  98. this.historyItems = res.data.stMaterialOwnershipHistoryList;
  99. this.showHistoryItems = this.historyItems.filter(ele => ele.ownerId == this.items[0].id);
  100. }
  101. })
  102. },
  103. handleClose() {
  104. this.$emit('updateReserved', false)
  105. },
  106. rowClick(row){
  107. this.showHistoryItems = this.historyItems.filter(ele => ele.ownerId == row.id);
  108. }
  109. }
  110. }
  111. </script>