index.vue 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. <template>
  2. <div class="ele-body">
  3. <el-card shadow="never">
  4. <ProductSearch @search="reload" />
  5. <ele-split-layout
  6. width="244px"
  7. allow-collapse
  8. :right-style="{ overflow: 'hidden' }"
  9. >
  10. <div class="ele-border-lighter split-layout-right-content">
  11. <AssetTree
  12. ref="assetTreeRef"
  13. type="1"
  14. @handleNodeClick="handleNodeClick"
  15. />
  16. </div>
  17. <!-- 表格 -->
  18. <template v-slot:content>
  19. <ele-pro-table
  20. ref="table"
  21. :columns="columns"
  22. :datasource="datasource"
  23. height="calc(100vh - 350px)"
  24. class="dict-table"
  25. >
  26. <!-- 表头工具栏 -->
  27. <template v-slot:action="{ row }">
  28. <el-link
  29. type="primary"
  30. :underline="false"
  31. icon="el-icon-edit"
  32. @click="handleEdit(row)"
  33. >
  34. 修改
  35. </el-link>
  36. </template>
  37. </ele-pro-table>
  38. </template>
  39. </ele-split-layout>
  40. </el-card>
  41. </div>
  42. </template>
  43. <script>
  44. import AssetTree from '@/components/AssetTree/group.vue';
  45. import ProductSearch from './components/product-search.vue';
  46. import { getList } from '@/api/classifyManage/itemInformation';
  47. export default {
  48. name: 'SystemDictionary',
  49. components: { AssetTree, ProductSearch },
  50. data () {
  51. return {
  52. // 表格列配置
  53. columns: [
  54. {
  55. columnKey: 'index',
  56. type: 'index',
  57. width: 55,
  58. align: 'center',
  59. reserveSelection: true,
  60. label: '序号',
  61. showOverflowTooltip: true
  62. },
  63. {
  64. prop: 'code',
  65. label: '产品编码',
  66. minWidth: 100
  67. },
  68. {
  69. prop: 'name',
  70. label: '产品名称',
  71. showOverflowTooltip: true,
  72. minWidth: 130
  73. },
  74. {
  75. prop: 'categoryLevelGroupCode',
  76. label: '物料组编码',
  77. showOverflowTooltip: true,
  78. width: 100
  79. },
  80. {
  81. prop: 'brandNum',
  82. label: '牌号',
  83. width: 70
  84. },
  85. {
  86. prop: 'modelType',
  87. label: '型号',
  88. minWidth: 130
  89. },
  90. {
  91. prop: 'measuringUnit',
  92. label: '计量单位',
  93. width: 80
  94. },
  95. {
  96. prop: 'weightUnit',
  97. label: '重量单位',
  98. width: 80
  99. },
  100. {
  101. prop: 'roughWeight',
  102. label: '毛重',
  103. width: 100
  104. },
  105. {
  106. prop: 'netWeight',
  107. label: '净重',
  108. width: 100
  109. },
  110. {
  111. prop: 'packingUnit',
  112. label: '包装单位',
  113. width: 80
  114. },
  115. {
  116. action: 'action',
  117. slot: 'action',
  118. label: '操作'
  119. }
  120. ],
  121. categoryLevelId: '9'
  122. };
  123. },
  124. methods: {
  125. /* 表格数据源 */
  126. datasource ({ page, where, limit }) {
  127. return getList({
  128. ...where,
  129. pageNum: page,
  130. size: limit,
  131. isProduct: true,
  132. categoryLevelId: this.categoryLevelId
  133. });
  134. },
  135. handleNodeClick (data) {
  136. this.categoryLevelId = data.id;
  137. this.reload();
  138. },
  139. /* 刷新表格 */
  140. reload (where) {
  141. this.$refs.table.reload({ where });
  142. },
  143. handleEdit ({ id }) {
  144. this.$router.push({
  145. path: '/material/product/detail',
  146. query: {
  147. id
  148. }
  149. });
  150. }
  151. }
  152. };
  153. </script>
  154. <style lang="scss" scoped></style>