index.vue 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202
  1. <template>
  2. <div class="ele-body">
  3. <el-card shadow="never" v-loading="loading">
  4. <work-search @search="reload">
  5. </work-search>
  6. <!-- 数据表格 -->
  7. <ele-pro-table
  8. ref="table"
  9. :columns="columns"
  10. :datasource="datasource"
  11. cache-key="systemRoleTable"
  12. >
  13. <!-- 表头工具栏 -->
  14. <template v-slot:toolbar>
  15. <el-button
  16. size="small"
  17. type="primary"
  18. class="ele-btn-icon"
  19. @click="goDetail()"
  20. >
  21. 详情
  22. </el-button>
  23. </template>
  24. <!-- 操作列 -->
  25. <template v-slot:action="{ row }">
  26. <el-link
  27. type="primary"
  28. :underline="false"
  29. icon="el-icon-edit"
  30. >
  31. 报工
  32. </el-link>
  33. <el-link
  34. type="primary"
  35. :underline="false"
  36. icon="el-icon-edit"
  37. @click="toRedeploy(row)"
  38. >
  39. 转派
  40. </el-link>
  41. </template>
  42. </ele-pro-table>
  43. </el-card>
  44. <!-- 转派弹窗 -->
  45. <redeployOther ref="redeployOtherRef" @refresh="reload" />
  46. </div>
  47. </template>
  48. <script>
  49. import WorkSearch from './components/work-search.vue';
  50. import { pageRoles } from '@/api/system/role';
  51. import redeployOther from '@/views/maintenance/components/redeployOther.vue';
  52. export default {
  53. components: {
  54. WorkSearch,
  55. redeployOther
  56. },
  57. data () {
  58. return {
  59. // 表格列配置
  60. columns: [
  61. {
  62. columnKey: 'index',
  63. label: '序号',
  64. type: 'index',
  65. width: 55,
  66. align: 'center',
  67. showOverflowTooltip: true,
  68. fixed: 'left'
  69. },
  70. {
  71. prop: 'code',
  72. label: '工单单号',
  73. align: 'center',
  74. showOverflowTooltip: true,
  75. minWidth: 110
  76. },
  77. {
  78. prop: 'planCode',
  79. label: '计划单号',
  80. align: 'center',
  81. showOverflowTooltip: true,
  82. slot: 'planCode',
  83. minWidth: 110
  84. },
  85. {
  86. prop: 'planName',
  87. label: '保养名称',
  88. align: 'center',
  89. showOverflowTooltip: true,
  90. minWidth: 110
  91. },
  92. {
  93. prop: 'executorDeptName',
  94. label: '保养部门',
  95. align: 'center',
  96. showOverflowTooltip: true,
  97. minWidth: 110
  98. },
  99. {
  100. prop: 'executeUserName',
  101. label: '保养人员',
  102. align: 'center',
  103. showOverflowTooltip: true,
  104. minWidth: 110
  105. },
  106. {
  107. prop: 'acceptTime',
  108. label: '开工时间',
  109. align: 'center',
  110. showOverflowTooltip: true,
  111. minWidth: 110
  112. },
  113. {
  114. prop: 'finishTime',
  115. label: '报工时间',
  116. align: 'center',
  117. showOverflowTooltip: true,
  118. minWidth: 110
  119. },
  120. {
  121. prop: 'sj',
  122. label: '时间工时',
  123. align: 'center',
  124. showOverflowTooltip: true,
  125. minWidth: 110
  126. },
  127. {
  128. prop: 'status',
  129. label: '状态',
  130. align: 'center',
  131. showOverflowTooltip: true,
  132. minWidth: 110
  133. },
  134. {
  135. prop: 'executeResult',
  136. label: '执行结果',
  137. align: 'center',
  138. showOverflowTooltip: true,
  139. minWidth: 110
  140. },
  141. {
  142. columnKey: 'action',
  143. label: '操作',
  144. width: 150,
  145. align: 'center',
  146. resizable: false,
  147. slot: 'action',
  148. showOverflowTooltip: true
  149. }
  150. ],
  151. // 加载状态
  152. loading: false,
  153. pageType: 'add',
  154. dialogTitle: '',
  155. isBindPlan:false,
  156. };
  157. },
  158. computed: {
  159. },
  160. methods: {
  161. /* 表格数据源 */
  162. datasource({ page, limit, where, order }) {
  163. return pageRoles({ pageNum: page, size: limit, ...where });
  164. },
  165. async changeEnable(row) {
  166. const res = await putRoles(row);
  167. if (res.code == 0) {
  168. this.$message({
  169. type: 'success',
  170. message: '修改成功',
  171. customClass: 'ele-message-border'
  172. });
  173. this.reload();
  174. }
  175. },
  176. /* 刷新表格 */
  177. reload(where) {
  178. this.$refs.table.reload({ page: 1, where });
  179. },
  180. goDetail(){
  181. this.$router.push({
  182. path: '/maintenance/equipment/work/details',
  183. // query: {
  184. // id
  185. // }
  186. })
  187. },
  188. toRedeploy(row) {
  189. this.$refs.redeployOtherRef.open(row);
  190. },
  191. }
  192. };
  193. </script>
  194. <style lang="scss" scoped>
  195. </style>