production-device.vue 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. <!-- 生产设备 -->
  2. <template>
  3. <div class="productionDevice">
  4. <div class="tabs">
  5. <el-tabs v-model="activeName" type="card">
  6. <el-tab-pane label="匹配模具" name="first">
  7. <div class="table">
  8. <ele-pro-table
  9. ref="table"
  10. :columns="columns"
  11. :datasource="datasource"
  12. height="calc(100vh - 500px)"
  13. class="dict-table"
  14. >
  15. <template v-slot:toolbar>
  16. <el-button
  17. size="small"
  18. type="primary"
  19. icon="el-icon-plus"
  20. class="ele-btn-icon"
  21. @click="add"
  22. >
  23. 添加
  24. </el-button>
  25. </template>
  26. <!-- 表头工具栏 -->
  27. <template v-slot:action="{ row }">
  28. <el-link
  29. type="danger"
  30. :underline="false"
  31. icon="el-icon-delete"
  32. @click="handleDel(row)"
  33. >
  34. 删除
  35. </el-link>
  36. </template>
  37. </ele-pro-table>
  38. </div>
  39. </el-tab-pane>
  40. <el-tab-pane label="匹配备品备件" name="second">
  41. <div class="one">
  42. <el-button type="primary">添加</el-button>
  43. </div>
  44. <div class="table">
  45. <el-table :data="tableData" style="width: 100%">
  46. <el-table-column prop="date" label="序号" width="60">
  47. </el-table-column>
  48. <el-table-column prop="wpmc" label="物品名称"> </el-table-column>
  49. <el-table-column prop="wpmc" label="物品名称"> </el-table-column>
  50. <el-table-column prop="wpmc" label="型号"> </el-table-column>
  51. <el-table-column prop="wpmc" label="物品类型"> </el-table-column>
  52. <el-table-column prop="wpmc" label="分类"> </el-table-column>
  53. <el-table-column prop="wpmc" label="操作"> </el-table-column>
  54. </el-table>
  55. </div>
  56. </el-tab-pane>
  57. </el-tabs>
  58. </div>
  59. <addTable
  60. ref="addTableRef"
  61. @successTable="addTableList"
  62. :categoryLevelId="categoryLevelId"
  63. />
  64. </div>
  65. </template>
  66. <script>
  67. import addTable from './add-table.vue';
  68. export default {
  69. components: { addTable },
  70. props: {
  71. categoryLevelId: {
  72. typeof: String,
  73. default: ''
  74. }
  75. },
  76. data() {
  77. return {
  78. tableData: [],
  79. activeName: 'first',
  80. columns: [
  81. {
  82. columnKey: 'index',
  83. type: 'index',
  84. width: 55,
  85. align: 'center',
  86. reserveSelection: true,
  87. label: '序号',
  88. showOverflowTooltip: true
  89. },
  90. {
  91. prop: 'code',
  92. label: '物品编码',
  93. minWidth: 100
  94. },
  95. {
  96. prop: 'name',
  97. label: '物品名称',
  98. showOverflowTooltip: true,
  99. minWidth: 130
  100. },
  101. {
  102. prop: 'brandNum',
  103. label: '牌号',
  104. width: 70
  105. },
  106. {
  107. prop: 'modelType',
  108. label: '型号',
  109. minWidth: 130
  110. },
  111. {
  112. prop: 'ssxs',
  113. label: '收缩系数',
  114. width: 80
  115. },
  116. {
  117. prop: 'dmtxh',
  118. label: '大模体型号',
  119. width: 80
  120. },
  121. {
  122. prop: 'weightUnit',
  123. label: '物品类型',
  124. width: 80
  125. },
  126. {
  127. prop: 'productCategoryLevelName',
  128. label: '分类',
  129. width: 100
  130. },
  131. {
  132. action: 'action',
  133. slot: 'action',
  134. label: '操作'
  135. }
  136. ],
  137. datasource: []
  138. };
  139. },
  140. methods: {
  141. handleDel(row) {
  142. const index = this.datasource.indexOf(row);
  143. if (index !== -1) {
  144. this.datasource.splice(index, 1);
  145. }
  146. },
  147. addTableList(list) {
  148. this.datasource = list;
  149. },
  150. add() {
  151. const dialogParams = { title: '选择设备' };
  152. this.$refs.addTableRef.open(dialogParams, this.datasource);
  153. }
  154. }
  155. };
  156. </script>
  157. <style lang="scss" scoped>
  158. .table {
  159. margin-top: 10px;
  160. }
  161. </style>