ProductionVersion.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. <template>
  2. <ele-modal
  3. :visible.sync="visible"
  4. title="选择生产版本"
  5. width="75vw"
  6. append-to-body
  7. >
  8. <el-table :data="tableData" border ref="tableData" @row-click="single">
  9. <el-table-column
  10. label="生产版本"
  11. align="center"
  12. prop="produceVersionName"
  13. >
  14. </el-table-column>
  15. <el-table-column
  16. label="未完成工单数量"
  17. align="center"
  18. prop="incompleteOrderNum"
  19. >
  20. </el-table-column>
  21. <el-table-column
  22. label="未成型数量"
  23. align="center"
  24. prop="incompleteFormingNum"
  25. >
  26. </el-table-column>
  27. <el-table-column
  28. label="预计完成时间"
  29. align="center"
  30. prop="planCompleteDate"
  31. >
  32. </el-table-column>
  33. <el-table-column label="标准产能" align="center" prop="model">
  34. <template slot-scope="{ row }">
  35. {{ row.capacityNum }}{{ row.capacityUnit }}/{{ row.capacityTime }}
  36. </template>
  37. </el-table-column>
  38. <el-table-column label="原料库存" align="center" prop="materialInventory">
  39. </el-table-column>
  40. <el-table-column label="改型仓" align="center" prop="model">
  41. </el-table-column>
  42. <el-table-column label="选择" align="center">
  43. <template slot-scope="scope">
  44. <el-radio
  45. class="radio"
  46. v-model="radio"
  47. :label="scope.row.produceVersionId"
  48. ><i></i
  49. ></el-radio>
  50. </template>
  51. </el-table-column>
  52. </el-table>
  53. <template v-slot:footer>
  54. <el-button @click="cancel">取消</el-button>
  55. <el-button type="primary" @click="save" :loading="loading">
  56. 确定
  57. </el-button>
  58. </template>
  59. </ele-modal>
  60. </template>
  61. <script>
  62. import { getProductVersion , getPlanProductVersion } from '@/api/saleOrder';
  63. export default {
  64. props: {
  65. productCode: String,
  66. produceVersionId: String
  67. },
  68. data () {
  69. return {
  70. visible: false,
  71. tableData: [],
  72. loading: false,
  73. radio: '',
  74. current: null
  75. };
  76. },
  77. computed: {},
  78. created () {},
  79. methods: {
  80. open (from) {
  81. this.visible = true;
  82. this.radio = this.produceVersionId
  83. this.getPageList(from);
  84. },
  85. getPageList (from) {
  86. const getFn = from?getPlanProductVersion:getProductVersion
  87. getFn(this.productCode).then((res) => {
  88. this.tableData = res;
  89. });
  90. },
  91. cancel () {
  92. this.visible = false;
  93. this.radio = '';
  94. this.current = null;
  95. },
  96. // 单击获取id
  97. single (row) {
  98. this.current = row;
  99. this.radio = row.produceVersionId;
  100. },
  101. /* 保存编辑 */
  102. save () {
  103. this.visible = false;
  104. this.$emit('confirm', this.current);
  105. }
  106. }
  107. };
  108. </script>
  109. <style lang="scss" scoped>
  110. .basic-details-title {
  111. margin: 10px 0;
  112. }
  113. .add-product {
  114. width: 100%;
  115. display: flex;
  116. align-items: center;
  117. justify-content: flex-end;
  118. font-size: 30px;
  119. color: #1890ff;
  120. margin: 10px 0;
  121. cursor: pointer;
  122. }
  123. </style>