selectUser.vue 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  1. <!-- 选择用户 -->
  2. <template>
  3. <div class="page-container selectUser-addPage">
  4. <div class="page-form-title-box">
  5. <el-form :model="queryParams" class="form-box" ref="queryForm"
  6. :inline="true" style="width:100%;">
  7. <el-form-item label="" prop="queryParamsData1">
  8. <el-select v-model="queryParams.queryParamsData1" multiple placeholder="学年" style="width: 120px">
  9. <el-option
  10. v-for="dict in optionListA"
  11. :key="dict.value"
  12. :label="dict.label"
  13. :value="dict.value"
  14. />
  15. </el-select>
  16. </el-form-item>
  17. <el-form-item label="" prop="queryParamsData2">
  18. <el-select v-model="queryParams.queryParamsData2" placeholder="学院单位" style="width: 140px">
  19. <el-option
  20. v-for="dict in optionListB"
  21. :key="dict.deptId"
  22. :label="dict.deptName"
  23. :value="dict.deptId"
  24. />
  25. </el-select>
  26. </el-form-item>
  27. <el-form-item label="" prop="queryParamsData3">
  28. <el-select v-model="queryParams.queryParamsData3" multiple placeholder="用户类别" style="width: 120px">
  29. <el-option
  30. v-for="dict in optionListC"
  31. :key="dict.value"
  32. :label="dict.label"
  33. :value="dict.value"
  34. />
  35. </el-select>
  36. </el-form-item>
  37. <el-form-item label="" prop="queryParamsData5">
  38. <el-select v-model="queryParams.queryParamsData5" placeholder="专业" style="width: 140px">
  39. <el-option
  40. v-for="dict in optionListE"
  41. :key="dict.id"
  42. :label="dict.disciplineName"
  43. :value="dict.id"
  44. />
  45. </el-select>
  46. </el-form-item>
  47. <el-form-item label="" prop="queryParamsData6">
  48. <el-input
  49. maxLength="30"
  50. v-model="queryParams.queryParamsData6"
  51. placeholder="姓名/学工号"
  52. style="width: 140px"
  53. />
  54. </el-form-item>
  55. <p class="page-inquire-common-style-button" @click="handleQuery">查询</p>
  56. <p class="page-reset-common-style-button" @click="resetQuery">重置</p>
  57. <p class="page-submit-common-style-button"
  58. style="float: right;"
  59. @click="checkButton()"
  60. >确定</p>
  61. </el-form>
  62. </div>
  63. <div class="page-content-box">
  64. <el-table class="table-box" v-loading="loading" border :data="dataList"
  65. ref="multipleTable" :row-key="getRowKey" @selection-change="handleSelectionChange">
  66. <el-table-column type="selection" width="55" :reserve-selection="true"></el-table-column>
  67. <el-table-column label="姓名" prop="name" show-overflow-tooltip/>
  68. <el-table-column label="学工号" prop="content" width="200" show-overflow-tooltip/>
  69. <el-table-column label="专业" prop="content" width="200" show-overflow-tooltip/>
  70. <el-table-column label="学年" prop="content" width="200" show-overflow-tooltip/>
  71. <el-table-column label="学院单位" prop="content" width="200" show-overflow-tooltip/>
  72. </el-table>
  73. <pagination :page-sizes="[20, 30, 40, 50]"
  74. v-show="total>0"
  75. :total="total"
  76. :page.sync="queryParams.page"
  77. :limit.sync="queryParams.pageSize"
  78. @pagination="getList"
  79. />
  80. </div>
  81. </div>
  82. </template>
  83. <script>
  84. import { examElDisciplineTypeList,systemDeptCurrentDept, } from "@/api/safetyEducationExaminationNew/index";
  85. export default {
  86. name: 'addPage',
  87. props: {
  88. propsData: {}
  89. },
  90. data() {
  91. return {
  92. //页面遮罩
  93. loading:false,
  94. //下拉列表数据
  95. optionListA:[],
  96. optionListB:[],
  97. optionListC:[],
  98. optionListD:[],
  99. optionListE:[],
  100. //查询条件
  101. queryParams:{
  102. page:1,
  103. pageSize:20,
  104. queryParamsData1:null,
  105. queryParamsData2 :null,
  106. queryParamsData3 :null,
  107. queryParamsData4 :null,
  108. queryParamsData5 :null,
  109. queryParamsData6 :'',
  110. },
  111. //列表数据
  112. dataList:[{}],
  113. //数据数量
  114. total:0,
  115. //存储所有被勾选的数据
  116. multipleSelection: [],
  117. }
  118. },
  119. created() {
  120. },
  121. mounted() {
  122. this.examElDisciplineTypeList();
  123. this.systemDeptCurrentDept();
  124. },
  125. methods: {
  126. // 提交按钮
  127. checkButton() {
  128. if(!this.multipleSelection[0]){
  129. this.msgError('请勾选用户')
  130. return
  131. }
  132. this.$parent.$parent.drawerOffButton()
  133. },
  134. //查询按钮
  135. handleQuery(){
  136. this.$set(this.queryParams,'page',1);
  137. this.getList();
  138. },
  139. //重置按钮
  140. resetQuery(){
  141. this.$set(this,'queryParams',{
  142. page:1,
  143. pageSize:20,
  144. queryParamsData1:null,
  145. queryParamsData2 :null,
  146. queryParamsData3 :null,
  147. queryParamsData4 :null,
  148. queryParamsData5 :null,
  149. });
  150. this.getList();
  151. },
  152. //获取数据列表
  153. getList(){
  154. this.$set(this,'loading',true);
  155. let obj = JSON.parse(JSON.stringify(this.queryParams))
  156. getListFunction(obj).then(response => {
  157. this.$set(this,'loading',false);
  158. this.$set(this,'dataList',response.data.records);
  159. this.$set(this,'total',response.data.total);
  160. });
  161. },
  162. //查询全部专业类别
  163. examElDisciplineTypeList(){
  164. examElDisciplineTypeList({}).then(response => {
  165. this.$set(this,'optionListE',response.data);
  166. });
  167. },
  168. //学院列表
  169. systemDeptCurrentDept(){
  170. systemDeptCurrentDept({}).then(response => {
  171. this.$set(this,'optionListB',response.data);
  172. });
  173. },
  174. getRowKey(row) {
  175. return row.id;
  176. },
  177. handleSelectionChange(val) {
  178. this.multipleSelection = val;
  179. console.log('当前所有选中的数据:', this.multipleSelection);
  180. },
  181. }
  182. }
  183. </script>
  184. <style scoped lang="scss">
  185. .selectUser-addPage {
  186. flex:1;
  187. display: flex;
  188. flex-direction: column;
  189. overflow: hidden;
  190. }
  191. </style>