segmentation.vue 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. <template>
  2. <!-- 静态 分割加工 -->
  3. <div class="segmentation">
  4. <header id="header">
  5. <el-row type="flex">
  6. <el-col :span="4">
  7. <el-select v-model="value" placeholder="请选择">
  8. <el-option label="1区" value="11"></el-option>
  9. <el-option label="2区" value="22"></el-option>
  10. </el-select>
  11. </el-col>
  12. <el-col :span="4">
  13. <el-select v-model="value" placeholder="请选择">
  14. <el-option label="1舍" value="13"></el-option>
  15. <el-option label="2舍" value="24"></el-option>
  16. </el-select>
  17. </el-col>
  18. <el-col :span="4">
  19. <el-select v-model="value" placeholder="请选择">
  20. <el-option label="可用" value="15"></el-option>
  21. <el-option label="可用" value="26"></el-option>
  22. </el-select>
  23. </el-col>
  24. <el-col :span="4">
  25. <el-button type="primary">查找</el-button>
  26. </el-col>
  27. <el-col :span="4">
  28. <el-button type="primary">新增</el-button>
  29. </el-col>
  30. </el-row>
  31. </header>
  32. <section>
  33. <article class="table">
  34. <el-table
  35. ref="multipleTable"
  36. :data="tableData"
  37. tooltip-effect="dark"
  38. style="width: 100%"
  39. @selection-change="handleSelectionChange"
  40. >
  41. <el-table-column type="selection" width="55"></el-table-column>
  42. <el-table-column prop="id" label="筒体编号" width="180"></el-table-column>
  43. <el-table-column prop="date" label="加工时间" width="180"></el-table-column>
  44. <el-table-column prop="a" label="屠宰批次"></el-table-column>
  45. <el-table-column prop="b" label="加工前重量"></el-table-column>
  46. <el-table-column prop="c" label="确认人"></el-table-column>
  47. <el-table-column prop="d" label="备注"></el-table-column>
  48. <!-- <el-table-column label="操作" width="150">
  49. <template slot-scope="scope">
  50. <el-button @click="edit(scope.row)" type="text" size="small">编辑</el-button>
  51. <el-popconfirm title="是否删除此设备的信息?" @onConfirm="del(scope.row)">
  52. <el-button slot="reference" type="text" size="small">删除</el-button>
  53. </el-popconfirm>
  54. </template>
  55. </el-table-column> -->
  56. </el-table>
  57. <div style="margin-top: 20px">
  58. <el-button @click="toggleSelection([tableData[1], tableData[2]])">切换第二、第三行的选中状态</el-button>
  59. <el-button @click="toggleSelection()">取消选择</el-button>
  60. <el-button @click="inStore">入库</el-button>
  61. </div>
  62. <el-row type="flex" justify="end">
  63. <el-col :span="8" class="pagination">
  64. <el-pagination
  65. @current-change="pageChange"
  66. background
  67. layout="prev, pager, next"
  68. :page-count="10"
  69. ></el-pagination>
  70. </el-col>
  71. </el-row>
  72. </article>
  73. </section>
  74. </div>
  75. </template>
  76. <script>
  77. const pageSize = 10
  78. const tableData = [
  79. {
  80. id: "12425",
  81. date: "2020-07-14",
  82. a: "24563",
  83. b: "52kg",
  84. c: "张小刚",
  85. d: "暂无备注"
  86. },
  87. {
  88. id: "12426",
  89. date: "2020-07-14",
  90. a: "24563",
  91. b: "49kg",
  92. c: "张小刚",
  93. d: "暂无备注"
  94. },
  95. {
  96. id: "12427",
  97. date: "2020-07-14",
  98. a: "24563",
  99. b: "46kg",
  100. c: "张小刚",
  101. d: "暂无备注"
  102. },
  103. {
  104. id: "12428",
  105. date: "2020-07-14",
  106. a: "24563",
  107. b: "50kg",
  108. c: "张小刚",
  109. d: "暂无备注"
  110. },
  111. ]
  112. export default {
  113. data() {
  114. return {
  115. value: "",
  116. multipleSelection: [],
  117. page: 1,
  118. tableData
  119. };
  120. },
  121. created() {},
  122. methods: {
  123. toggleSelection(rows) {
  124. if (rows) {
  125. rows.forEach(row => {
  126. this.$refs.multipleTable.toggleRowSelection(row);
  127. });
  128. } else {
  129. this.$refs.multipleTable.clearSelection();
  130. }
  131. },
  132. // 入待宰栏
  133. inStore() {},
  134. handleSelectionChange(val) {
  135. this.multipleSelection = val;
  136. },
  137. edit(row) {},
  138. del(row) {},
  139. pageChange(p) {
  140. console.log(p);
  141. }
  142. }
  143. };
  144. </script>
  145. <style lang="scss" scoped>
  146. #header {
  147. margin-bottom: 15px;
  148. }
  149. .table {
  150. .pagination {
  151. margin-top: 20px;
  152. }
  153. }
  154. </style>