reserved.vue 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  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="warehouseName" label="仓库" width="150"></el-table-column>
  51. <el-table-column show-overflow-tooltip prop="allocationName" label="货位" width="150"></el-table-column>
  52. <el-table-column show-overflow-tooltip prop="reservedQty" label="预留数量" width="150"></el-table-column>
  53. <el-table-column show-overflow-tooltip prop="totalIn" label="累计入库数量" width="150"></el-table-column>
  54. <el-table-column show-overflow-tooltip prop="qty" label="可用量" width="150"></el-table-column>
  55. <el-table-column show-overflow-tooltip prop="usedQty" label="已用量" width="150"></el-table-column>
  56. </el-table>
  57. <el-table style="margin-top: 50px" :data="showHistoryItems" height="300px">
  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="warehouseName" label="仓库" width="150"></el-table-column>
  62. <el-table-column label="操作单据" align="center" prop="operateBill" width="150">
  63. <template slot-scope="scope">
  64. <dict-tag :options="dict.type.ow_operatetype" :value="scope.row.operateBill"/>
  65. </template>
  66. </el-table-column>
  67. <el-table-column show-overflow-tooltip prop="operateBillcode" label="操作单据编码" width="200"></el-table-column>
  68. <el-table-column show-overflow-tooltip prop="operateBillitem" label="操作明细行号" width="150"></el-table-column>
  69. <el-table-column show-overflow-tooltip prop="allotQty" label="操作数量" width="150">
  70. <template slot-scope="scope">
  71. {{scope.row.allotQty > 0 ? "+" + scope.row.allotQty : scope.row.allotQty}}
  72. </template>
  73. </el-table-column>
  74. <el-table-column show-overflow-tooltip prop="createTime" label="操作时间" width="150"></el-table-column>
  75. </el-table>
  76. </el-dialog>
  77. </div>
  78. </template>
  79. <script>
  80. import {getDetailBySource} from '@/api/purchase/ownership.js'
  81. export default {
  82. props: {
  83. isVisible: {
  84. type: Boolean,
  85. default: false
  86. },
  87. info: {
  88. type: Object,
  89. default: null
  90. }
  91. },
  92. mounted() {
  93. this.getDetails(this.info)
  94. },
  95. data() {
  96. return {
  97. visible:this.isVisible,
  98. resData: {},
  99. items: [],
  100. historyItems: [],
  101. showHistoryItems: [],
  102. }
  103. },
  104. methods: {
  105. getDetails(row) {
  106. getDetailBySource(row.code).then(res => {
  107. if (res.code === 200) {
  108. this.resData = res.data;
  109. this.items = res.data.stMaterialOwnershipItemList;
  110. this.historyItems = res.data.stMaterialOwnershipHistoryList;
  111. this.showHistoryItems = this.historyItems.filter(ele => ele.ownerId == this.items[0].id);
  112. }
  113. })
  114. },
  115. handleClose() {
  116. this.$emit('updateReserved', false)
  117. },
  118. rowClick(row){
  119. this.showHistoryItems = this.historyItems.filter(ele => ele.ownerId == row.id);
  120. }
  121. }
  122. }
  123. </script>