prod-management-details-dialog.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. <template>
  2. <el-dialog
  3. title="查看"
  4. width="70%"
  5. :close-on-click-modal="false"
  6. :visible.sync="visible"
  7. @close="onChose"
  8. >
  9. <div class="production">
  10. <el-table
  11. :data="dataList"
  12. border
  13. style="width: 100%;">
  14. <el-table-column
  15. label="序号"
  16. type="index"
  17. width="50"
  18. align="center">
  19. </el-table-column>
  20. <el-table-column
  21. prop="productName"
  22. header-align="center"
  23. align="center"
  24. min-width="120"
  25. :show-tooltip-when-overflow="true"
  26. label="物料名称"/>
  27. <el-table-column
  28. prop="productSpec"
  29. header-align="center"
  30. align="center"
  31. min-width="120"
  32. :show-tooltip-when-overflow="true"
  33. label="物料规格"/>
  34. <el-table-column
  35. prop="productNumber"
  36. header-align="center"
  37. align="center"
  38. min-width="120"
  39. :show-tooltip-when-overflow="true"
  40. label="物料编号"/>
  41. <el-table-column
  42. prop="batchNumber"
  43. header-align="center"
  44. align="center"
  45. min-width="120"
  46. :show-tooltip-when-overflow="true"
  47. label="批次号"/>
  48. <el-table-column
  49. prop="startTime"
  50. header-align="center"
  51. align="center"
  52. min-width="120"
  53. :show-tooltip-when-overflow="true"
  54. label="开始时间"/>
  55. <el-table-column
  56. prop="endTime"
  57. header-align="center"
  58. align="center"
  59. min-width="120"
  60. :show-tooltip-when-overflow="true"
  61. label="结束时间"/>
  62. <el-table-column
  63. header-align="center"
  64. align="center"
  65. fixed="right"
  66. min-width="80"
  67. :show-tooltip-when-overflow="true"
  68. label="状态">
  69. <template slot-scope="scope">{{stateFormat(scope.row)}}</template>
  70. </el-table-column>
  71. </el-table>
  72. </div>
  73. <span slot="footer">
  74. <el-button @click="onChose">返回</el-button>
  75. </span>
  76. </el-dialog>
  77. </template>
  78. <script>
  79. import AttachDetail from '@/views/modules/common/attach-detail'
  80. import AttachDetailDialog from '@/views/modules/common/attach-detail-dialog'
  81. import InspectTypeDialog from '@/views/modules/production/inspect-type-dialog'
  82. import {optionsMaterialState} from '@/utils/enums'
  83. export default {
  84. name: 'prod-management-details-dialog',
  85. components: {InspectTypeDialog, AttachDetailDialog, AttachDetail},
  86. data () {
  87. return {
  88. visible: false,
  89. dataList: [],
  90. optionsState: optionsMaterialState
  91. }
  92. },
  93. methods: {
  94. onChose () {
  95. this.visible = false
  96. },
  97. // 初始化表单
  98. async init (productList) {
  99. this.dataList = productList
  100. this.visible = true
  101. },
  102. // 转换属性“状态”
  103. stateFormat (row) {
  104. if (this.optionsState) {
  105. for (let i = 0; i < this.optionsState.length; i++) {
  106. if (this.optionsState[i].code === row.prodState) {
  107. return this.optionsState[i].value
  108. }
  109. }
  110. }
  111. }
  112. }
  113. }
  114. </script>
  115. <style scoped lang="scss">
  116. /deep/ .my-row .super-flow__node {
  117. width: 180px;
  118. height: 80px;
  119. }
  120. </style>