aptitudeDialog.vue 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  1. <template>
  2. <div>
  3. <ele-modal
  4. width="960px"
  5. :visible="visible"
  6. append-to-body
  7. :close-on-click-modal="false"
  8. custom-class="ele-dialog-form"
  9. title="资质列表"
  10. @update:visible="updateVisible"
  11. :maxable="true"
  12. >
  13. <div class="main">
  14. <ele-pro-table
  15. ref="table"
  16. :initLoad="false"
  17. :columns="columns"
  18. :current.sync="current"
  19. highlight-current-row
  20. :datasource="datasource"
  21. tool-class="ele-toolbar-form"
  22. cache-key="systemOrgUserTable"
  23. @selection-change="handleSelectionChange"
  24. >
  25. </ele-pro-table>
  26. </div>
  27. <template v-slot:footer>
  28. <el-button @click="updateVisible(false)">取 消</el-button>
  29. <el-button type="primary" @click="handleMine"> 确 定 </el-button>
  30. </template>
  31. </ele-modal>
  32. </div>
  33. </template>
  34. <script>
  35. import dictMixins from '@/mixins/dictMixins';
  36. import { getProfessionCertificationPageList } from '@/api/factoryModel';
  37. export default {
  38. mixins: [dictMixins],
  39. data() {
  40. return {
  41. multipleSelection: [],
  42. visible: false,
  43. levelOptions: [
  44. {
  45. label: '初级',
  46. value: '1'
  47. },
  48. {
  49. label: '中级',
  50. value: '2'
  51. },
  52. {
  53. label: '高级',
  54. value: '3'
  55. }
  56. ],
  57. isView: false,
  58. // 表格列配置
  59. columns: [
  60. {
  61. columnKey: 'selection',
  62. type: 'selection',
  63. width: 45,
  64. align: 'center',
  65. fixed: 'left'
  66. },
  67. {
  68. label: '序号',
  69. type: 'index',
  70. width: 55,
  71. align: 'center'
  72. },
  73. {
  74. slot: 'type',
  75. label: '类型',
  76. showOverflowTooltip: true,
  77. align: 'center',
  78. minWidth: 110,
  79. formatter: (_row) => {
  80. return this.getDictValue('工种类型', _row.type);
  81. }
  82. },
  83. {
  84. align: 'center',
  85. prop: 'code',
  86. label: '编码',
  87. showOverflowTooltip: true,
  88. minWidth: 110
  89. },
  90. {
  91. slot: 'name',
  92. prop: 'name',
  93. label: '名称',
  94. showOverflowTooltip: true,
  95. align: 'center',
  96. minWidth: 110
  97. },
  98. {
  99. slot: 'level',
  100. prop: 'level',
  101. label: '等级',
  102. showOverflowTooltip: true,
  103. align: 'center',
  104. minWidth: 110,
  105. formatter: (_row) => {
  106. return this.levelOptions.filter(
  107. (item) => _row.level == item.value
  108. )[0].label;
  109. }
  110. },
  111. {
  112. slot: 'startTime',
  113. prop: 'startTime',
  114. label: '有效开始时间',
  115. showOverflowTooltip: true,
  116. align: 'center',
  117. minWidth: 110
  118. },
  119. {
  120. slot: 'endTime',
  121. prop: 'endTime',
  122. label: '有效结束时间',
  123. showOverflowTooltip: true,
  124. align: 'center',
  125. minWidth: 110
  126. },
  127. {
  128. slot: 'accessory.name',
  129. prop: 'accessory.name',
  130. label: '附件',
  131. showOverflowTooltip: true,
  132. align: 'center',
  133. minWidth: 110
  134. }
  135. ]
  136. };
  137. },
  138. methods: {
  139. updateVisible(value) {
  140. this.visible = value;
  141. this.$emit('update:visible', value);
  142. },
  143. handleSelectionChange(val) {
  144. this.multipleSelection = val;
  145. },
  146. async handleMine() {
  147. if (this.multipleSelection?.length <= 0) {
  148. this.$message.warning('请至少选择一个资质!');
  149. return;
  150. }
  151. this.$emit('success', this.multipleSelection);
  152. this.updateVisible(false);
  153. },
  154. async datasource({ page, limit, where, order }) {
  155. const res = await getProfessionCertificationPageList({
  156. ...where,
  157. ...order,
  158. pageNum: page,
  159. size: limit
  160. });
  161. return res;
  162. },
  163. async open() {
  164. this.current = {};
  165. this.radio = null;
  166. this.visible = true;
  167. this.$nextTick(() => {
  168. this.$refs.table.reload({
  169. pageNum: 1,
  170. size: 10,
  171. where: {}
  172. });
  173. });
  174. }
  175. }
  176. };
  177. </script>