From ce6ace5c0f5f6299e62a80caa3c8bf75e43480ab Mon Sep 17 00:00:00 2001 From: laishajiang <12977614+laishajiang@user.noreply.gitee.com> Date: Thu, 14 Mar 2024 15:32:31 +0800 Subject: [PATCH] =?UTF-8?q?=E5=80=BC=E7=8F=AD=E7=AE=A1=E7=90=86=E6=90=9C?= =?UTF-8?q?=E7=B4=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/perms/admin.ts | 7 ++++ src/views/duty/edit.vue | 80 ++++++++++++++++++++++++++++++++++++----- 2 files changed, 79 insertions(+), 8 deletions(-) diff --git a/src/api/perms/admin.ts b/src/api/perms/admin.ts index e452aa6..53bdaf3 100644 --- a/src/api/perms/admin.ts +++ b/src/api/perms/admin.ts @@ -50,6 +50,13 @@ export function listByEmpNo(query) { return request.get({ url: '/system/admin/listByEmpNo', query}) } +export function listByCurrentDeptAndDeptPid(query) { + return request.get({ url: '/system/admin/listByCurrentDeptAndDeptPid', query}) +} + +export function listByCurrentEmpNo(query) { + return request.get({ url: '/system/admin/listByCurrentEmpNo', query}) +} // 重置密码 export function resetPassword(params: any) { diff --git a/src/views/duty/edit.vue b/src/views/duty/edit.vue index f7daaae..8cbf15d 100644 --- a/src/views/duty/edit.vue +++ b/src/views/duty/edit.vue @@ -67,11 +67,28 @@ - + + + + + + + - - - @@ -95,7 +112,7 @@ import { useDictOptions } from '@/hooks/useDictOptions' import { roleAll } from '@/api/perms/role' import { postAll } from '@/api/org/post' import { deptLists } from '@/api/org/department' -import { listByCurrentDept ,listByEmpNo } from '@/api/perms/admin' +import { listByCurrentDeptAndDeptPid ,listByEmpNo ,listByCurrentEmpNo} from '@/api/perms/admin' import { usePaging } from '@/hooks/usePaging' import { loginCaptcha } from '@/api/user' import { isFunction } from 'lodash' @@ -128,7 +145,8 @@ const formData = reactive({ const { optionsData } = useDictOptions<{ deptTypes: any[], policeList: any[], - dept: any[] + dept: any[], + empNolist:any[] }>({ dept: { api: deptLists @@ -233,9 +251,10 @@ const searchPoliceUser = (query: string) => { setTimeout(() => { console.log(query) const params= { - name: query + name: query, + departId:formData.departId } - const policeList = listByCurrentDept(params).then((res: any) => { + const policeList = listByCurrentDeptAndDeptPid(params).then((res: any) => { optionsData.policeList=res; return Promise.resolve(res) }) @@ -251,6 +270,51 @@ const searchPoliceUser = (query: string) => { } +const searchEmpNolist = (query: string) => { + if (query) { + setTimeout(() => { + console.log(query) + const params= { + departId:formData.departId, + EmpNo:query + } + const empNoList = listByCurrentEmpNo(params).then((res: any) => { + optionsData.empNolist=res; + return Promise.resolve(res) + }) + .catch((err: any) => { + return Promise.reject(err) + }) + + + }, 200) + } else { + optionsData.empNolist = [] + } +} + +const handleEmpNoSelectChange = (newValue) => { + formData.empNo=newValue + console.log("newValue"+newValue) + const params= { + EmpNo: newValue + } + listByEmpNo(params).then((res: any) => { + formData.policeName=res.name + return Promise.resolve(res) + }) + .catch((err: any) => { + return Promise.reject(err) + }) + console.log('选中的值:', newValue); +}; + + + + + + + const handleSelectChange = (newValue) => { formData.empNo=newValue console.log("newValue"+newValue)