index.vue 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224
  1. <template>
  2. <div class="ele-body">
  3. <el-card shadow="never" v-loading="loading">
  4. <equipment-search
  5. @search="reload"
  6. :networkCounts="networkCounts"
  7. ref="search"
  8. />
  9. <!-- 数据表格 -->
  10. <ele-pro-table
  11. ref="table"
  12. :columns="columns"
  13. :datasource="datasource"
  14. height="calc(100vh - 400px)"
  15. tool-class="ele-toolbar-form"
  16. cache-key="systemOrgUserTable"
  17. :initLoad="false"
  18. @select="selectChange"
  19. @select-all="changeSelectAll"
  20. >
  21. <!-- 表头工具栏 -->
  22. <template v-slot:toolbar="{ row }">
  23. <el-button
  24. size="small"
  25. type="primary"
  26. icon="el-icon-plus"
  27. class="ele-btn-icon"
  28. @click="add"
  29. >
  30. 新建
  31. </el-button>
  32. <!-- <el-button size="small" class="ele-btn-icon" @click="handlDelete"
  33. >删除</el-button
  34. >
  35. <el-button
  36. size="small"
  37. @click="moveTo(checkRadioData, 'move')"
  38. :disabled="checkRadioData.length == 0"
  39. class="ele-btn-icon"
  40. >移动到</el-button
  41. > -->
  42. </template>
  43. <!-- 编码列 -->
  44. <template v-slot:code="{ row }">
  45. <el-link type="primary" :underline="false" @click="details(row)">
  46. {{ row.code }}
  47. </el-link>
  48. </template>
  49. <!-- 操作列 -->
  50. <template v-slot:action="{ row }">
  51. <el-link
  52. type="primary"
  53. :underline="false"
  54. icon="el-icon-edit"
  55. @click="handEdit(row)"
  56. >
  57. 编辑
  58. </el-link>
  59. </template>
  60. </ele-pro-table>
  61. </el-card></div
  62. >
  63. </template>
  64. <script>
  65. import { getAssetList } from '@/api/ledgerAssets';
  66. import dictMixins from '@/mixins/dictMixins';
  67. import equipmentSearch from './components/search.vue';
  68. export default {
  69. mixins: [dictMixins],
  70. components: {
  71. equipmentSearch
  72. },
  73. data() {
  74. return {
  75. isConsumer: false,
  76. // 表格列配置
  77. columns: [
  78. {
  79. width: 45,
  80. type: 'selection',
  81. columnKey: 'selection',
  82. align: 'center'
  83. },
  84. {
  85. columnKey: 'index',
  86. type: 'index',
  87. label: '序号',
  88. width: 55,
  89. align: 'center',
  90. showOverflowTooltip: true,
  91. fixed: 'left'
  92. },
  93. {
  94. columnKey: 'code',
  95. prop: 'code',
  96. slot: 'code',
  97. align: 'center',
  98. label: '名称',
  99. showOverflowTooltip: true,
  100. minWidth: 110
  101. },
  102. {
  103. columnKey: 'code',
  104. align: 'center',
  105. prop: 'code',
  106. slot: 'code',
  107. label: '编码',
  108. showOverflowTooltip: true,
  109. minWidth: 180
  110. },
  111. {
  112. columnKey: 'code',
  113. prop: 'code',
  114. align: 'center',
  115. slot: 'code',
  116. label: '处置方式',
  117. showOverflowTooltip: true
  118. },
  119. {
  120. columnKey: 'code',
  121. prop: 'code',
  122. align: 'center',
  123. slot: 'code',
  124. label: '物品编码',
  125. showOverflowTooltip: true,
  126. minWidth: 180
  127. },
  128. {
  129. prop: 'name',
  130. align: 'center',
  131. label: '物品名称',
  132. showOverflowTooltip: true,
  133. minWidth: 110
  134. },
  135. {
  136. prop: 'category.modelType',
  137. align: 'center',
  138. label: '型号',
  139. showOverflowTooltip: true,
  140. minWidth: 110
  141. },
  142. {
  143. prop: 'category.specification',
  144. align: 'center',
  145. label: '规格',
  146. showOverflowTooltip: true,
  147. minWidth: 110
  148. },
  149. {
  150. align: 'center',
  151. prop: 'usePerson',
  152. label: '使用人',
  153. showOverflowTooltip: true,
  154. minWidth: 80
  155. },
  156. {
  157. prop: 'chargePerson',
  158. align: 'center',
  159. label: '负责人',
  160. showOverflowTooltip: true,
  161. minWidth: 80
  162. },
  163. {
  164. prop: 'status',
  165. align: 'center',
  166. label: '状态',
  167. showOverflowTooltip: true
  168. },
  169. {
  170. columnKey: 'action',
  171. slot: 'action',
  172. align: 'center',
  173. label: '操作',
  174. minWidth: 100,
  175. fixed: 'right'
  176. }
  177. ],
  178. networkCounts: {},
  179. checkRadioData: [],
  180. QRvisible: false
  181. };
  182. },
  183. computed: {},
  184. created() {},
  185. methods: {
  186. /* 表格数据源 */
  187. datasource({ page, limit, where, order }) {
  188. console.log('------reload-------');
  189. // this.getNetWork(page, limit, where, order);
  190. return getAssetList({
  191. ...where,
  192. ...order,
  193. pageNum: page,
  194. size: limit,
  195. categoryLevelId: this.categoryId,
  196. rootCategoryLevelId: this.rootId
  197. });
  198. },
  199. /* 刷新表格 */
  200. reload(where) {
  201. this.$refs.table.reload({ pageNum: 1, where: where });
  202. }
  203. }
  204. };
  205. </script>
  206. <style lang="scss" scoped>
  207. @media print {
  208. #printSection {
  209. font-size: 34px;
  210. span {
  211. font-size: 34px;
  212. }
  213. }
  214. }
  215. </style>