index.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. <template>
  2. <div class="ele-body">
  3. <el-card shadow="never">
  4. <!-- 搜索表单 -->
  5. <user-search @search="reload" />
  6. <!-- 数据表格 -->
  7. <ele-pro-table
  8. ref="table"
  9. :columns="columns"
  10. :datasource="datasource"
  11. :selection.sync="selection"
  12. row-key="code"
  13. >
  14. <!-- 表头工具栏 -->
  15. <template v-slot:toolbar>
  16. <el-button
  17. size="small"
  18. type="primary"
  19. icon="el-icon-refresh-left"
  20. class="ele-btn-icon"
  21. @click="toRefresh()"
  22. >
  23. 刷新
  24. </el-button>
  25. </template>
  26. <!-- 状态列 -->
  27. <!-- <template v-slot:status="{ row }">
  28. {{ checkStatus(row) }}
  29. </template> -->
  30. <!-- 操作列 -->
  31. <template v-slot:action="{ row }">
  32. <el-link
  33. type="primary"
  34. :underline="false"
  35. icon="el-icon-edit"
  36. @click="openEdit(row)"
  37. >
  38. 查看
  39. </el-link>
  40. </template>
  41. </ele-pro-table>
  42. </el-card>
  43. </div>
  44. </template>
  45. <script>
  46. import UserSearch from './components/user-search.vue';
  47. import { pageList } from '@/api/technology/version/version.js';
  48. export default {
  49. name: 'technologyVersion',
  50. components: {
  51. UserSearch,
  52. },
  53. data() {
  54. return {
  55. // 表格列配置
  56. columns: [
  57. {
  58. prop: 'categoryCode',
  59. label: '产品编码',
  60. showOverflowTooltip: true,
  61. align: 'center',
  62. minWidth: 110
  63. },
  64. {
  65. prop: 'categoryName',
  66. label: '产品名称',
  67. showOverflowTooltip: true,
  68. align: 'center',
  69. minWidth: 110
  70. },
  71. {
  72. align: 'center',
  73. prop: 'code',
  74. label: '版本号',
  75. showOverflowTooltip: true,
  76. minWidth: 110
  77. },
  78. {
  79. prop: 'name',
  80. label: '版本名称',
  81. align: 'center',
  82. showOverflowTooltip: true,
  83. minWidth: 110
  84. },
  85. {
  86. prop: 'routingCode',
  87. label: '工艺路线编码',
  88. align: 'center',
  89. showOverflowTooltip: true,
  90. minWidth: 110
  91. },
  92. {
  93. prop: 'routingVersion',
  94. label: '工艺版本号',
  95. align: 'center',
  96. showOverflowTooltip: true,
  97. minWidth: 110
  98. },
  99. {
  100. columnKey: 'action',
  101. label: '操作',
  102. width: 220,
  103. align: 'center',
  104. resizable: false,
  105. slot: 'action',
  106. showOverflowTooltip: true
  107. }
  108. ],
  109. // 表格选中数据
  110. selection: [],
  111. // 当前编辑数据
  112. current: null,
  113. // 是否显示编辑弹窗
  114. showEdit: false,
  115. // 是否显示导入弹窗
  116. showImport: false,
  117. statusList: [
  118. { label: '草稿', value: -1 },
  119. { label: '失效', value: 0 },
  120. { label: '生效', value: 1 }
  121. ]
  122. };
  123. },
  124. methods: {
  125. /* 表格数据源 */
  126. datasource({ page, limit, where, order }) {
  127. return pageList({ pageNum: page, size: limit, ...where });
  128. },
  129. // async datasource({ page, limit, where, order }) {
  130. // const res = await pageList({
  131. // ...where,
  132. // ...order,
  133. // pageNum: page,
  134. // size: limit
  135. // });
  136. // return res;
  137. // },
  138. /* 点击刷新 */
  139. toRefresh(){
  140. },
  141. /* 刷新表格 */
  142. reload(where) {
  143. this.$refs.table.reload({ page: 1, where: where });
  144. },
  145. /* 查看详情 */
  146. openEdit({id}) {
  147. this.$router.push({
  148. path: '/technology/version/details',
  149. query: {id}
  150. })
  151. }
  152. }
  153. };
  154. </script>