From 2d1f7bd9e68a2ee60bbd1adcc9cd43c94db08c0d Mon Sep 17 00:00:00 2001
From: 龚焕茏 <2842157468@qq.com>
Date: 星期三, 24 七月 2024 15:05:37 +0800
Subject: [PATCH] feat:选人增加姓名

---
 src/views/user/student/list.vue |   43 ++++++++++++++++++++++++++++---------------
 1 files changed, 28 insertions(+), 15 deletions(-)

diff --git a/src/views/user/student/list.vue b/src/views/user/student/list.vue
index 880a8ac..2608227 100644
--- a/src/views/user/student/list.vue
+++ b/src/views/user/student/list.vue
@@ -4,6 +4,14 @@
       <el-form-item label="鐪熷疄濮撳悕锛�">
         <el-input v-model="queryParam.userName" size="small" clearable></el-input>
       </el-form-item>
+      <el-form-item label="閮ㄩ棬锛�">
+        <el-cascader
+          clearable
+          v-model="queryParam.departmentId"
+          :options="depts"
+          :props="{ emitPath: false, value: 'id', label: 'name',  checkStrictly: true, multiple: true }"
+          ></el-cascader>
+      </el-form-item>
       <el-form-item >
        <div style="display: flex">
          <el-button type="primary" @click="submitForm" size="small">鏌ヨ</el-button>
@@ -29,9 +37,9 @@
       <el-table-column prop="userName" label="鐢ㄦ埛鍚�"/>
       <el-table-column prop="realName" label="鐪熷疄濮撳悕" width="150"/>
       <el-table-column prop="deptNames" label="閮ㄩ棬" />
-      <el-table-column label="鏍囩" prop="tagNames" width="80px">
+      <el-table-column label="鏍囩" prop="tagNames" align="center">
         <template slot-scope="{row}">
-          <el-tag style="margin: 5px;" v-for="(item,index) in row.tagNames" :key="index">{{ item }}</el-tag>
+          <el-tag v-for="item, index in row.tagNames" :key="index">{{ item }}</el-tag>
         </template>
       </el-table-column>
       <el-table-column label="浜哄憳鐘舵��" prop="condition" align="center" width="100px">
@@ -49,7 +57,7 @@
           </el-tag>
         </template>
       </el-table-column>
-      <el-table-column :width="deptAdmin() ? '310px' : '400px'" label="鎿嶄綔" fixed="right" align="center">
+      <el-table-column :width="deptAdmin() ? '310px' : '350px'" label="鎿嶄綔" fixed="right" align="center">
         <template slot-scope="{row}">
           <el-button size="mini" v-if="!deptAdmin()" @click="changeStatus(row)" class="link-left">
             {{ statusBtnFormatter(row.status) }}
@@ -57,9 +65,9 @@
           <router-link :to="{path:'/user/student/edit', query:{id:row.id}}" class="link-left">
             <el-button size="mini" >缂栬緫</el-button>
           </router-link>
-          <router-link :to="{path:'/log/user/list', query:{userId:row.id}}" class="link-left">
+          <!-- <router-link :to="{path:'/log/user/list', query:{userId:row.id}}" class="link-left">
             <el-button size="mini" >鏃ュ織</el-button>
-          </router-link>
+          </router-link> -->
           <el-button type="primary" size="mini" @click="status(row)" class="link-left">鐘舵��</el-button>
           <el-button type="primary" size="mini" @click="transposition(row)" class="link-left">璋冨姩</el-button>
           <el-popconfirm title="纭鍒犻櫎鍚�" @confirm="deleteUser(row)">
@@ -92,14 +100,13 @@
       :title="title"
       :visible.sync="dialogVisible"
       width="400px">
-      <el-select v-model="examine.departmentId" multiple filterable placeholder="璇烽�夋嫨閮ㄩ棬">
-        <el-option
-          v-for="item in deptList"
-          :key="item.id"
-          :label="item.name"
-          :value="item.id">
-        </el-option>
-      </el-select>
+      <el-cascader
+        clearable
+        :disabled="this.$route.query.id"
+        v-model="examine.departmentId"
+        :options="deptList"
+        :props="{ emitPath: false, multiple: true, value: 'id', label: 'name',  checkStrictly: true }"
+      ></el-cascader>
       <el-input type="textarea" maxlength="100" show-word-limit :autosize="{ minRows: 4}" :rows="2" v-model="examine.reason" placeholder="璇疯緭鍏ユ儏鍐佃鏄�" style="margin-top: 30px;"></el-input>
       <upload :fileUrl="examine.contentUrl" :fileSizeLimitM="1024" :uploadNum="1" @getUploadUrl="getUploadAttachmentUrl" @removeFile="removeAttachmentFile" style="margin-top: 30px;"/>
       <span slot="footer" class="dialog-footer">
@@ -115,6 +122,7 @@
 import Pagination from '@/components/Pagination'
 import userApi from '@/api/user'
 import departmentExamineApi from '@/api/departmentExamine'
+import department from '@/api/department'
 import Upload from '@/components/UploadC'
 
 export default {
@@ -126,12 +134,14 @@
   },
   data () {
     return {
+      depts: [],
       user:{},
       statusVisible: false,
       upLoadUrl:'/api/admin/user/import',
       fileList:[],
       queryParam: {
         userName: '',
+        departmentId: [],
         roles: [1],
         pageIndex: 1,
         pageSize: 10
@@ -162,7 +172,10 @@
     }
   },
   created () {
-    this.search()
+    this.search();
+    department.getDeptAdmins().then(res => {
+      this.depts = res.response;
+    })
   },
   methods: {
     deptAdmin() {
@@ -204,7 +217,7 @@
       this.examine.userId = item.id
       this.examine.departmentId = item.deptIdList
       this.examine.nowDepartmentIds = item.deptIdList.join(',')
-      departmentExamineApi.getDeptList().then(res => {
+      department.getDeptAdmins().then(res => {
         if (res.code === 1) {
           this.deptList = res.response
           this.dialogVisible = true

--
Gitblit v1.8.0