Bladeren bron

修复人员管理页面跳转岗位管理后查看岗位人员问题;并替换人员管理页面左侧岗位内容

wyn 2 maanden geleden
bovenliggende
commit
5ee8106ba4

+ 1 - 1
src/views/system/marsdept/index.vue

@@ -204,7 +204,7 @@ const handleDelete = async (id: number) => {
 
 /** 查看岗位人员 */
 const handleLookWorkStation = (row: any) => {
-  router.push(`/user/user?workstationId=${row.workstationId}`)
+  router.push(`/system/user?workstationId=${row.id}`)
 }
 
 // 监听路由参数变化 - 移到最后,确保所有函数都已定义

+ 12 - 5
src/views/system/user/DeptTree.vue

@@ -1,18 +1,19 @@
 <template>
   <div class="head-container">
-    <el-input v-model="deptName" class="mb-20px" clearable placeholder="请输入部门名称">
+    <el-input v-model="deptName" class="mb-20px" clearable placeholder="请输入岗位名称">
       <template #prefix>
         <Icon icon="ep:search" />
       </template>
     </el-input>
   </div>
   <div class="head-container">
+<!--     :props="defaultProps"-->
     <el-tree
       ref="treeRef"
       :data="deptList"
       :expand-on-click-node="false"
       :filter-node-method="filterNode"
-      :props="defaultProps"
+      :props="{ label: 'workstationName', value: 'id', children: 'children' }"
       default-expand-all
       highlight-current
       node-key="id"
@@ -23,9 +24,11 @@
 
 <script lang="ts" setup>
 import { ElTree } from 'element-plus'
-import * as DeptApi from '@/api/system/dept'
+// import * as DeptApi from '@/api/system/dept'
+import * as MarsDeptApi from '@/api/system/marsdept'
 import { defaultProps, handleTree } from '@/utils/tree'
 
+
 defineOptions({ name: 'SystemUserDeptTree' })
 
 const deptName = ref('')
@@ -34,9 +37,13 @@ const treeRef = ref<InstanceType<typeof ElTree>>()
 
 /** 获得部门树 */
 const getTree = async () => {
-  const res = await DeptApi.getSimpleDeptList()
+  // const res = await DeptApi.getSimpleDeptList()
+  const res=await MarsDeptApi.listMarsDept({pageNo: 1, pageSize: -1})
+  console.log(res,'mars岗位')
   deptList.value = []
-  deptList.value.push(...handleTree(res))
+  // deptList.value.push(...handleTree(res.list))
+  deptList.value = handleTree(res.list, 'id', 'parentId', 'children')
+
 }
 
 /** 基于名字过滤 */

+ 37 - 35
src/views/system/user/UserForm.vue

@@ -14,16 +14,28 @@
           </el-form-item>
         </el-col>
         <el-col :span="12">
-          <el-form-item label="归属部门" prop="deptId">
+          <!--          锁控原来的岗位-->
+          <el-form-item label="岗位">
             <el-tree-select
-              v-model="formData.deptId"
-              :data="deptList"
-              :props="defaultProps"
+              v-model="formData.workstationIds"
+              :data="workstationList"
+              multiple
               check-strictly
-              node-key="id"
-              placeholder="请选择归属部门"
+              :props="{ label: 'workstationName', value: 'id', children: 'children' }"
+              placeholder="选择岗位"
+              style="width: 300px"
             />
           </el-form-item>
+<!--          <el-form-item label="归属部门" prop="deptId">-->
+<!--            <el-tree-select-->
+<!--              v-model="formData.deptId"-->
+<!--              :data="deptList"-->
+<!--              :props="defaultProps"-->
+<!--              check-strictly-->
+<!--              node-key="id"-->
+<!--              placeholder="请选择归属部门"-->
+<!--            />-->
+<!--          </el-form-item>-->
         </el-col>
       </el-row>
       <el-row>
@@ -70,39 +82,29 @@
           </el-form-item>
         </el-col>
         <el-col :span="12">
-<!--          锁控原来的岗位-->
-          <el-form-item label="职位">
-            <el-select v-model="formData.postIds" multiple placeholder="请选择">
-              <el-option
-                v-for="item in postList"
-                :key="item.id"
-                :label="item.name"
-                :value="item.id!"
-              />
-            </el-select>
-          </el-form-item>
-        </el-col>
-      </el-row>
-      <el-row>
-        <el-col :span="12">
-          <el-form-item label="岗位">
-            <el-tree-select
-              v-model="formData.workstationIds"
-              :data="workstationList"
-              multiple
-              check-strictly
-              style="width: 290px"
-              :props="{ label: 'workstationName', value: 'id', children: 'children' }"
-              placeholder="选择岗位"
-              class="!w-240px"
-            />
-          </el-form-item>
-        </el-col>
-        <el-col :span="12">
           <el-form-item label="备注">
             <el-input v-model="formData.remark" placeholder="请输入内容" type="textarea" />
           </el-form-item>
         </el-col>
+
+      </el-row>
+      <el-row>
+        <!--        <el-col :span="12">-->
+
+        <!--          <el-form-item label="职位">-->
+        <!--            <el-select v-model="formData.postIds" multiple placeholder="请选择">-->
+        <!--              <el-option-->
+        <!--                v-for="item in postList"-->
+        <!--                :key="item.id"-->
+        <!--                :label="item.name"-->
+        <!--                :value="item.id!"-->
+        <!--              />-->
+        <!--            </el-select>-->
+        <!--          </el-form-item>-->
+        <!--        </el-col>-->
+<!--        <el-col :span="12">-->
+
+<!--        </el-col>-->
       </el-row>
     </el-form>
     <template #footer>

+ 13 - 8
src/views/system/user/index.vue

@@ -109,13 +109,13 @@
             prop="nickname"
             :show-overflow-tooltip="true"
           />
-          <el-table-column
-            label="部门"
-            align="center"
-            key="deptName"
-            prop="deptName"
-            :show-overflow-tooltip="true"
-          />
+<!--          <el-table-column-->
+<!--            label="部门"-->
+<!--            align="center"-->
+<!--            key="deptName"-->
+<!--            prop="deptName"-->
+<!--            :show-overflow-tooltip="true"-->
+<!--          />-->
           <el-table-column label="手机号码" align="center" prop="mobile" width="120" />
           <el-table-column
             label="岗位"
@@ -266,9 +266,11 @@ const queryParams = reactive({
   mobile: undefined,
   status: undefined,
   deptId: undefined,
+  workstationId: undefined,
   createTime: []
 })
 const router=useRouter()
+const route=useRoute()
 const queryFormRef = ref() // 搜索的表单
 // 打开指纹或人脸弹框
 // 弹窗引用
@@ -306,7 +308,7 @@ const resetQuery = () => {
 
 /** 处理部门被点击 */
 const handleDeptNodeClick = async (row) => {
-  queryParams.deptId = row.id
+  queryParams.workstationId = row.id
   await getList()
 }
 
@@ -408,6 +410,9 @@ const handleRole = (row: UserApi.UserVO) => {
 
 /** 初始化 */
 onMounted(() => {
+  if(route.query.workstationId){
+    queryParams.workstationId=route.query.workstationId
+  }
   getList()
 })
 </script>