material.vue 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. <template>
  2. <div class="pane-box">
  3. <HeaderTitle title="物料信息表"> </HeaderTitle>
  4. <ele-pro-table
  5. ref="table"
  6. :columns="columns"
  7. :needPage="false"
  8. :initLoad="false"
  9. :datasource="datasource"
  10. >
  11. </ele-pro-table>
  12. </div>
  13. </template>
  14. <script>
  15. import { getMaterialinfo } from '@/api/productionPlan/index';
  16. export default {
  17. props: {
  18. planId: {
  19. type: [String, Number],
  20. default: ''
  21. }
  22. },
  23. data () {
  24. return {
  25. columns: [
  26. {
  27. type: 'index',
  28. label: '序号',
  29. width: '80'
  30. },
  31. {
  32. prop: 'materialCode',
  33. label: '编码'
  34. },
  35. {
  36. prop: 'materialName',
  37. label: '名称'
  38. },
  39. {
  40. prop: 'materialType',
  41. label: '类型'
  42. },
  43. {
  44. prop: 'materialUnit',
  45. label: '单位'
  46. },
  47. {
  48. prop: 'requiredNum',
  49. label: '需求数量'
  50. },
  51. {
  52. prop: 'claimNum',
  53. label: '领用数量'
  54. },
  55. {
  56. prop: 'inputNum',
  57. label: '投入数量'
  58. },
  59. {
  60. prop: 'returnNum',
  61. label: '退还数量'
  62. }
  63. ]
  64. };
  65. },
  66. watch: {
  67. planId: {
  68. immediate: true,
  69. handler (val) {
  70. if (val) {
  71. this.$nextTick(() => {
  72. this.$refs.table.reload();
  73. });
  74. }
  75. }
  76. }
  77. },
  78. methods: {
  79. async datasource () {
  80. return getMaterialinfo(this.planId);
  81. }
  82. }
  83. };
  84. </script>