user-list.vue 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  1. <template>
  2. <div>
  3. <user-search @search="reload" ref="searchRef"> </user-search>
  4. <!-- 数据表格 -->
  5. <ele-pro-table
  6. ref="table"
  7. :columns="columns"
  8. :datasource="datasource"
  9. height="calc(100vh - 365px)"
  10. full-height="calc(100vh - 116px)"
  11. tool-class="ele-toolbar-form"
  12. cache-key="systemOrgUserTable"
  13. >
  14. <!-- 编码列 -->
  15. <template v-slot:name="{ row }">
  16. {{ row.qualityStandard && row.qualityStandard.name }}
  17. </template>
  18. <template v-slot:code="{ row }">
  19. <el-link
  20. @click="openDetail(row.qualityStandard)"
  21. type="primary"
  22. :underline="false"
  23. >
  24. {{ row.qualityStandard && row.qualityStandard.code }}
  25. </el-link>
  26. </template>
  27. <template v-slot:type="{ row }">
  28. {{ getDictValue('质检标准类型', row.qualityStandard && row.qualityStandard.type) }}
  29. </template>
  30. <template v-slot:standardCode="{ row }">
  31. {{ row.qualityStandard && row.qualityStandard.standardCode }}
  32. </template>
  33. <template v-slot:status="{ row }">
  34. {{ row.qualityStandard && row.qualityStandard.status == 1 ? '启用' : '停用' }}
  35. </template>
  36. <template v-slot:mode="{ row }">
  37. {{ getDictValue('质检方式', row.mode) }}
  38. </template>
  39. <template v-slot:version="{ row }">
  40. {{ row.qualityStandard && row.qualityStandard.version }}
  41. </template>
  42. </ele-pro-table>
  43. <Detail ref="detailRef"></Detail>
  44. </div>
  45. </template>
  46. <script>
  47. import userSearch from './user-search.vue';
  48. import { getList } from '@/api/material/inspectionClassify';
  49. import dictMixins from '@/mixins/dictMixins';
  50. import Detail from './edit.vue';
  51. export default {
  52. mixins: [dictMixins],
  53. components: { userSearch, Detail },
  54. props: {
  55. // 类别id
  56. rootId: [Number, String]
  57. },
  58. data() {
  59. return {
  60. // 当前编辑数据
  61. current: null,
  62. // 表格列配置
  63. columns: [
  64. {
  65. columnKey: 'index',
  66. type: 'index',
  67. label: '序号',
  68. width: 55,
  69. align: 'center'
  70. },
  71. {
  72. prop: 'code',
  73. label: '标准编码',
  74. showOverflowTooltip: true,
  75. minWidth: 110,
  76. slot: 'code'
  77. },
  78. {
  79. prop: 'name',
  80. label: '标准名称',
  81. showOverflowTooltip: true,
  82. minWidth: 110,
  83. slot: 'name'
  84. },
  85. {
  86. label: '标准类型',
  87. prop: 'type',
  88. slot: 'type'
  89. },
  90. {
  91. label: '标准代码',
  92. prop: 'standardCode'
  93. },
  94. {
  95. prop: 'status',
  96. label: '状态',
  97. align: 'center',
  98. minWidth: 110,
  99. slot: 'status'
  100. },
  101. {
  102. prop: 'version',
  103. label: '版本号',
  104. align: 'center',
  105. minWidth: 110,
  106. slot: 'version'
  107. }
  108. ]
  109. };
  110. },
  111. created() {
  112. this.requestDict('质检方式');
  113. this.requestDict('质检标准类型');
  114. },
  115. methods: {
  116. /* 表格数据源 */
  117. datasource({ page, limit, where }) {
  118. let _data = null;
  119. _data = getList({
  120. ...where,
  121. pageNum: page,
  122. size: limit,
  123. categoryLevelId: this.categoryLevelId || 12,
  124. rootCategoryLevelId: this.rootId
  125. });
  126. console.log(_data,555);
  127. return _data
  128. },
  129. /* 刷新表格 */
  130. reload(where) {
  131. this.$refs.table.reload({
  132. pageNum: 1,
  133. where: where,
  134. categoryLevelId: this.categoryLevelId,
  135. rootCategoryLevelId: this.rootId
  136. });
  137. },
  138. clickSearch(info) {
  139. this.categoryLevelId = info.id;
  140. this.rootCategoryLevelId = info.rootCategoryLevelId;
  141. this.reload();
  142. },
  143. openDetail(row) {
  144. this.$refs.detailRef.open('detail',row);
  145. }
  146. }
  147. };
  148. </script>