scheduleDialog.vue 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. <template>
  2. <el-dialog :title="title" :visible.sync="visible" v-if="visible" :before-close="handleClose"
  3. :close-on-click-modal="false" :close-on-press-escape="false" append-to-body width="75%">
  4. <el-card shadow="never">
  5. <ele-pro-table ref="table" :columns="columns" :datasource="datasource" row-key="id" height="calc(100vh - 350px)"
  6. class="dict-table" @cell-click="cellClick">
  7. <!-- 表头工具栏 -->
  8. <template v-slot:action="{ row }">
  9. <el-radio class="radio" v-model="radio" :label="row.id"><i></i></el-radio>
  10. </template>
  11. </ele-pro-table>
  12. </el-card>
  13. <div class="btns">
  14. <el-button type="primary" size="small" @click="selected">选择</el-button>
  15. <el-button size="small" @click="handleClose">关闭</el-button>
  16. </div>
  17. </el-dialog>
  18. </template>
  19. <script>
  20. import {
  21. teamqueuepage,
  22. } from '@/api/workforceManagement/schedule';
  23. export default {
  24. components: {},
  25. data() {
  26. return {
  27. visible: false,
  28. // 表格列配置
  29. columns: [
  30. {
  31. columnKey: 'index',
  32. type: 'index',
  33. width: 45,
  34. align: 'center',
  35. reserveSelection: true
  36. },
  37. {
  38. prop: 'name',
  39. label: '排班组名称'
  40. },
  41. {
  42. label: '总人数',
  43. prop: 'totalPersonNumber'
  44. },
  45. {
  46. label: '创建人',
  47. prop: 'createUserName'
  48. },
  49. {
  50. label: '状态',
  51. prop: 'status',
  52. slot: 'status',
  53. },
  54. {
  55. action: 'action',
  56. slot: 'action',
  57. align: 'center',
  58. label: '选择'
  59. }
  60. ],
  61. title: null,
  62. categoryLevelId: null,
  63. radio: null,
  64. idx: null,
  65. }
  66. },
  67. watch: {
  68. },
  69. methods: {
  70. /* 表格数据源 */
  71. datasource({ page, where, limit }) {
  72. let data = teamqueuepage({
  73. ...where,
  74. pageNum: page,
  75. size: limit
  76. });
  77. return data;
  78. },
  79. /* 刷新表格 */
  80. reload(where) {
  81. this.isCategory = false
  82. this.$refs.table.reload({ pageNum: 1, where: where });
  83. },
  84. open(item, type, idx) {
  85. this.visible = true
  86. },
  87. // 单击获取id
  88. cellClick(row) {
  89. this.current = row
  90. this.radio = row.id
  91. },
  92. handleClose() {
  93. this.visible = false
  94. this.current = null
  95. this.radio = ''
  96. },
  97. selected() {
  98. if (!this.current) {
  99. return this.$message.warning('请选择排班组')
  100. }
  101. this.$emit('changeProduct', this.title, this.current, this.idx)
  102. this.handleClose()
  103. },
  104. }
  105. }
  106. </script>
  107. <style lang="scss" scoped>
  108. .tree_col {
  109. border: 1px solid #eee;
  110. padding: 10px 0;
  111. box-sizing: border-box;
  112. height: 500px;
  113. overflow: auto;
  114. }
  115. .table_col {
  116. padding-left: 10px;
  117. ::v-deep .el-table th.el-table__cell {
  118. background: #f2f2f2;
  119. }
  120. }
  121. .pagination {
  122. text-align: right;
  123. padding: 10px 0;
  124. }
  125. .btns {
  126. text-align: center;
  127. padding: 10px 0;
  128. }
  129. .topsearch {
  130. margin-bottom: 15px;
  131. }
  132. </style>