historyModal.vue 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  1. <template>
  2. <el-dialog title="历史版本" :visible.sync="visible" v-if="visible" :before-close="handleClose" :close-on-click-modal="false"
  3. :close-on-press-escape="false" append-to-body width="60%">
  4. <el-col :span="8">
  5. <el-form-item label="工艺路线编码:">
  6. <span> {{ form.code }} </span>
  7. </el-form-item>
  8. </el-col>
  9. <el-col :span="8">
  10. <el-form-item label="工艺路线名称:">
  11. <span> {{ form.name }} </span>
  12. </el-form-item>
  13. </el-col>
  14. <el-col :span="8">
  15. <el-form-item label="产品编码:">
  16. <span> {{ form.categoryCode }} </span>
  17. </el-form-item>
  18. </el-col>
  19. <el-col :span="8">
  20. <el-form-item label="产品名称:">
  21. <span> {{ form.categoryName }} </span>
  22. </el-form-item>
  23. </el-col>
  24. <ele-pro-table ref="table" :columns="columns" :datasource="datasource" height="calc(100vh - 350px)"
  25. class="dict-table">
  26. <!-- 表头工具栏 -->
  27. <!-- 状态列 -->
  28. <template v-slot:status="{ row }">
  29. {{ checkStatus(row) }}
  30. </template>
  31. </ele-pro-table>
  32. </el-dialog>
  33. </template>
  34. <script>
  35. import AssetTree from '@/components/AssetTree';
  36. import route from '@/api/technology/route';
  37. export default {
  38. components: { AssetTree },
  39. data() {
  40. return {
  41. visible: false,
  42. // 表格列配置
  43. columns: [
  44. {
  45. columnKey: 'index',
  46. type: 'index',
  47. width: 45,
  48. align: 'center',
  49. reserveSelection: true
  50. },
  51. {
  52. prop: 'version',
  53. label: '版本',
  54. align: 'center',
  55. showOverflowTooltip: true,
  56. minWidth: 110
  57. },
  58. {
  59. prop: 'status',
  60. label: '状态',
  61. align: 'center',
  62. slot: 'status',
  63. showOverflowTooltip: true,
  64. minWidth: 110
  65. },
  66. {
  67. prop: 'createTime',
  68. label: '创建日期',
  69. align: 'center',
  70. showOverflowTooltip: true,
  71. minWidth: 110
  72. },
  73. {
  74. prop: 'releaseTime',
  75. label: '发布日期',
  76. align: 'center',
  77. showOverflowTooltip: true,
  78. minWidth: 110
  79. },
  80. {
  81. prop: 'downTime',
  82. label: '停用时间',
  83. align: 'center',
  84. showOverflowTooltip: true,
  85. minWidth: 110
  86. },
  87. ],
  88. statusList: [
  89. { label: '草稿', value: -1 },
  90. { label: '失效', value: 0 },
  91. { label: '生效', value: 1 }
  92. ],
  93. form: null
  94. }
  95. },
  96. watch: {
  97. },
  98. methods: {
  99. /* 表格数据源 */
  100. async datasource({ page, limit }) {
  101. const res = await route.list({
  102. code: this.form.code,
  103. pageNum: page,
  104. size: limit
  105. });
  106. return res;
  107. },
  108. open(item) {
  109. if (item) {
  110. this.form = item
  111. }
  112. this.visible = true
  113. },
  114. handleClose() {
  115. this.visible = false
  116. this.form = null
  117. },
  118. checkStatus(row) {
  119. let obj = this.statusList.find((it) => it.value == row.status);
  120. return obj.label;
  121. },
  122. }
  123. }
  124. </script>
  125. <style lang="scss" scoped>
  126. .tree_col {
  127. border: 1px solid #eee;
  128. padding: 10px 0;
  129. box-sizing: border-box;
  130. height: 500px;
  131. overflow: auto;
  132. }
  133. .table_col {
  134. padding-left: 10px;
  135. ::v-deep .el-table th.el-table__cell {
  136. background: #f2f2f2;
  137. }
  138. }
  139. .pagination {
  140. text-align: right;
  141. padding: 10px 0;
  142. }
  143. .btns {
  144. text-align: center;
  145. padding: 10px 0;
  146. }
  147. .topsearch {
  148. margin-bottom: 15px;
  149. }
  150. </style>