diff --git a/public/config/config.json b/public/config/config.json index 03859f6..644726a 100644 --- a/public/config/config.json +++ b/public/config/config.json @@ -1,6 +1,6 @@ { "title":"计量业务系统", - "versionByEqpt":"1.2.0.1", + "versionByEqpt":"1.2.0.2", "baseUrl": "http://111.198.10.15:21611", "baseUrlBusiness": "http://111.198.10.15:21606", "baseUrlLaboratory": "http://111.198.10.15:21610", diff --git a/public/config/config.json b/public/config/config.json index 03859f6..644726a 100644 --- a/public/config/config.json +++ b/public/config/config.json @@ -1,6 +1,6 @@ { "title":"计量业务系统", - "versionByEqpt":"1.2.0.1", + "versionByEqpt":"1.2.0.2", "baseUrl": "http://111.198.10.15:21611", "baseUrlBusiness": "http://111.198.10.15:21606", "baseUrlLaboratory": "http://111.198.10.15:21610", diff --git a/src/api/system/dept.ts b/src/api/system/dept.ts index 8474420..24c256c 100644 --- a/src/api/system/dept.ts +++ b/src/api/system/dept.ts @@ -1,4 +1,4 @@ -// import request from '../index' +import request from '../index' import request1 from '../request' const prefix = 'sys' // const baseURL = window.localStorage.getItem('baseUrlAccount')! @@ -20,6 +20,14 @@ params, }) } +// 组织查询 -- 无权限 +export function getDeptTree(params: object) { + return request({ + url: '/system/deptTree', + method: 'get', + params, + }) +} // 组织机构树列表 export function getDeptTreeListByPid(pid: string) { diff --git a/public/config/config.json b/public/config/config.json index 03859f6..644726a 100644 --- a/public/config/config.json +++ b/public/config/config.json @@ -1,6 +1,6 @@ { "title":"计量业务系统", - "versionByEqpt":"1.2.0.1", + "versionByEqpt":"1.2.0.2", "baseUrl": "http://111.198.10.15:21611", "baseUrlBusiness": "http://111.198.10.15:21606", "baseUrlLaboratory": "http://111.198.10.15:21610", diff --git a/src/api/system/dept.ts b/src/api/system/dept.ts index 8474420..24c256c 100644 --- a/src/api/system/dept.ts +++ b/src/api/system/dept.ts @@ -1,4 +1,4 @@ -// import request from '../index' +import request from '../index' import request1 from '../request' const prefix = 'sys' // const baseURL = window.localStorage.getItem('baseUrlAccount')! @@ -20,6 +20,14 @@ params, }) } +// 组织查询 -- 无权限 +export function getDeptTree(params: object) { + return request({ + url: '/system/deptTree', + method: 'get', + params, + }) +} // 组织机构树列表 export function getDeptTreeListByPid(pid: string) { diff --git a/src/views/tested/MeasurementPlan/task/index.vue b/src/views/tested/MeasurementPlan/task/index.vue index 93012a1..1c31085 100644 --- a/src/views/tested/MeasurementPlan/task/index.vue +++ b/src/views/tested/MeasurementPlan/task/index.vue @@ -6,7 +6,7 @@ import { getUserDept } from '@/api/system/user' import { getPostList } from '@/api/system/post' import { getDictByCode } from '@/api/system/dict' -import { getDeptTreeList } from '@/api/system/dept' +import { getDeptTree, getDeptTreeList } from '@/api/system/dept' const listQuery = reactive({ orderNo: '', deliverer: '', @@ -187,11 +187,11 @@ usePositionList.value = res.data }) // 获取当前用户所在单位 - getUserDept().then((res) => { - getDeptTreeList({ pid: res.data.id }).then((res1) => { - deptList.value = res1.data.filter((item: any) => item.pid === res.data.id).map((item: any) => ({ id: item.id, value: item.id, name: item.name })) - }) + // getUserDept().then((res) => { + getDeptTree({ pid: '0' }).then((res1) => { + deptList.value = res1.data.filter((item: any) => item.pids.split(',').length === 3).map((item: any) => ({ id: item.id, value: item.id, name: item.fullName })) }) + // }) // 接收状态 getDictByCode('orderStatus').then((res) => { receiveStatusList.value = res.data diff --git a/public/config/config.json b/public/config/config.json index 03859f6..644726a 100644 --- a/public/config/config.json +++ b/public/config/config.json @@ -1,6 +1,6 @@ { "title":"计量业务系统", - "versionByEqpt":"1.2.0.1", + "versionByEqpt":"1.2.0.2", "baseUrl": "http://111.198.10.15:21611", "baseUrlBusiness": "http://111.198.10.15:21606", "baseUrlLaboratory": "http://111.198.10.15:21610", diff --git a/src/api/system/dept.ts b/src/api/system/dept.ts index 8474420..24c256c 100644 --- a/src/api/system/dept.ts +++ b/src/api/system/dept.ts @@ -1,4 +1,4 @@ -// import request from '../index' +import request from '../index' import request1 from '../request' const prefix = 'sys' // const baseURL = window.localStorage.getItem('baseUrlAccount')! @@ -20,6 +20,14 @@ params, }) } +// 组织查询 -- 无权限 +export function getDeptTree(params: object) { + return request({ + url: '/system/deptTree', + method: 'get', + params, + }) +} // 组织机构树列表 export function getDeptTreeListByPid(pid: string) { diff --git a/src/views/tested/MeasurementPlan/task/index.vue b/src/views/tested/MeasurementPlan/task/index.vue index 93012a1..1c31085 100644 --- a/src/views/tested/MeasurementPlan/task/index.vue +++ b/src/views/tested/MeasurementPlan/task/index.vue @@ -6,7 +6,7 @@ import { getUserDept } from '@/api/system/user' import { getPostList } from '@/api/system/post' import { getDictByCode } from '@/api/system/dict' -import { getDeptTreeList } from '@/api/system/dept' +import { getDeptTree, getDeptTreeList } from '@/api/system/dept' const listQuery = reactive({ orderNo: '', deliverer: '', @@ -187,11 +187,11 @@ usePositionList.value = res.data }) // 获取当前用户所在单位 - getUserDept().then((res) => { - getDeptTreeList({ pid: res.data.id }).then((res1) => { - deptList.value = res1.data.filter((item: any) => item.pid === res.data.id).map((item: any) => ({ id: item.id, value: item.id, name: item.name })) - }) + // getUserDept().then((res) => { + getDeptTree({ pid: '0' }).then((res1) => { + deptList.value = res1.data.filter((item: any) => item.pids.split(',').length === 3).map((item: any) => ({ id: item.id, value: item.id, name: item.fullName })) }) + // }) // 接收状态 getDictByCode('orderStatus').then((res) => { receiveStatusList.value = res.data diff --git a/src/views/tested/device/certificate/index.vue b/src/views/tested/device/certificate/index.vue index 5aa8c70..a55d8ae 100644 --- a/src/views/tested/device/certificate/index.vue +++ b/src/views/tested/device/certificate/index.vue @@ -5,7 +5,7 @@ import { getCertificateList } from '@/api/eqpt/device/certificate' import { getDeviceNameList, getModelAllList, getModelList } from '@/api/eqpt/device/model' import { getUserList } from '@/api/system/user' -import { getDeptList, getDeptTreeList, getDeptTreeListByPid } from '@/api/system/dept' +import { getDeptList, getDeptTree, getDeptTreeList, getDeptTreeListByPid } from '@/api/system/dept' import showPhoto from '@/views/tested/device/info/components/showPhotoSinge.vue' import { getPostList } from '@/api/system/post' const { proxy } = getCurrentInstance() as any @@ -175,12 +175,12 @@ modelList.value = Array.from(new Set(res.data.filter((item: any) => item.model).map((item: any) => item.model))).sort() }) // 获取使用单位 - getDeptList({}).then((res) => { + getDeptTree({ pid: '0' }).then((res) => { // 单位 - companyList.value = res.data.list.filter((item: any) => item.pid === '0').map((item: any) => ({ id: item.id, value: item.id, name: item.fullName })) + companyList.value = res.data.filter((item: any) => item.pid === '0').map((item: any) => ({ id: item.id, value: item.id, name: item.fullName })) // 部门 - deptList.value = res.data.list.filter((item: any) => item.pids.split(',').length === 3).map((item: any) => ({ id: item.id, value: item.id, name: item.fullName })) - deptListAll.value = res.data.list.filter((item: any) => item.pids.split(',').length === 3).map((item: any) => ({ id: item.id, value: item.id, name: item.fullName })) + deptList.value = res.data.filter((item: any) => item.pids.split(',').length === 3).map((item: any) => ({ id: item.id, value: item.id, name: item.fullName })) + deptListAll.value = res.data.filter((item: any) => item.pids.split(',').length === 3).map((item: any) => ({ id: item.id, value: item.id, name: item.fullName })) }) // 使用岗位 getPostList({}).then((res) => { @@ -209,8 +209,8 @@ watch(() => listQuery.companyId, (newVal) => { listQuery.deptId = '' if (newVal) { - getDeptTreeList({ pid: newVal }).then((res) => { - deptList.value = res.data.filter((item: any) => item.pid === newVal).map((item: any) => ({ id: item.id, value: item.id, name: item.name })) + getDeptTree({ pid: newVal }).then((res) => { + deptList.value = res.data.filter((item: any) => item.pid === newVal && item.pids.split(',').length === 3).map((item: any) => ({ id: item.id, value: item.id, name: item.fullName })) }) } else { diff --git a/public/config/config.json b/public/config/config.json index 03859f6..644726a 100644 --- a/public/config/config.json +++ b/public/config/config.json @@ -1,6 +1,6 @@ { "title":"计量业务系统", - "versionByEqpt":"1.2.0.1", + "versionByEqpt":"1.2.0.2", "baseUrl": "http://111.198.10.15:21611", "baseUrlBusiness": "http://111.198.10.15:21606", "baseUrlLaboratory": "http://111.198.10.15:21610", diff --git a/src/api/system/dept.ts b/src/api/system/dept.ts index 8474420..24c256c 100644 --- a/src/api/system/dept.ts +++ b/src/api/system/dept.ts @@ -1,4 +1,4 @@ -// import request from '../index' +import request from '../index' import request1 from '../request' const prefix = 'sys' // const baseURL = window.localStorage.getItem('baseUrlAccount')! @@ -20,6 +20,14 @@ params, }) } +// 组织查询 -- 无权限 +export function getDeptTree(params: object) { + return request({ + url: '/system/deptTree', + method: 'get', + params, + }) +} // 组织机构树列表 export function getDeptTreeListByPid(pid: string) { diff --git a/src/views/tested/MeasurementPlan/task/index.vue b/src/views/tested/MeasurementPlan/task/index.vue index 93012a1..1c31085 100644 --- a/src/views/tested/MeasurementPlan/task/index.vue +++ b/src/views/tested/MeasurementPlan/task/index.vue @@ -6,7 +6,7 @@ import { getUserDept } from '@/api/system/user' import { getPostList } from '@/api/system/post' import { getDictByCode } from '@/api/system/dict' -import { getDeptTreeList } from '@/api/system/dept' +import { getDeptTree, getDeptTreeList } from '@/api/system/dept' const listQuery = reactive({ orderNo: '', deliverer: '', @@ -187,11 +187,11 @@ usePositionList.value = res.data }) // 获取当前用户所在单位 - getUserDept().then((res) => { - getDeptTreeList({ pid: res.data.id }).then((res1) => { - deptList.value = res1.data.filter((item: any) => item.pid === res.data.id).map((item: any) => ({ id: item.id, value: item.id, name: item.name })) - }) + // getUserDept().then((res) => { + getDeptTree({ pid: '0' }).then((res1) => { + deptList.value = res1.data.filter((item: any) => item.pids.split(',').length === 3).map((item: any) => ({ id: item.id, value: item.id, name: item.fullName })) }) + // }) // 接收状态 getDictByCode('orderStatus').then((res) => { receiveStatusList.value = res.data diff --git a/src/views/tested/device/certificate/index.vue b/src/views/tested/device/certificate/index.vue index 5aa8c70..a55d8ae 100644 --- a/src/views/tested/device/certificate/index.vue +++ b/src/views/tested/device/certificate/index.vue @@ -5,7 +5,7 @@ import { getCertificateList } from '@/api/eqpt/device/certificate' import { getDeviceNameList, getModelAllList, getModelList } from '@/api/eqpt/device/model' import { getUserList } from '@/api/system/user' -import { getDeptList, getDeptTreeList, getDeptTreeListByPid } from '@/api/system/dept' +import { getDeptList, getDeptTree, getDeptTreeList, getDeptTreeListByPid } from '@/api/system/dept' import showPhoto from '@/views/tested/device/info/components/showPhotoSinge.vue' import { getPostList } from '@/api/system/post' const { proxy } = getCurrentInstance() as any @@ -175,12 +175,12 @@ modelList.value = Array.from(new Set(res.data.filter((item: any) => item.model).map((item: any) => item.model))).sort() }) // 获取使用单位 - getDeptList({}).then((res) => { + getDeptTree({ pid: '0' }).then((res) => { // 单位 - companyList.value = res.data.list.filter((item: any) => item.pid === '0').map((item: any) => ({ id: item.id, value: item.id, name: item.fullName })) + companyList.value = res.data.filter((item: any) => item.pid === '0').map((item: any) => ({ id: item.id, value: item.id, name: item.fullName })) // 部门 - deptList.value = res.data.list.filter((item: any) => item.pids.split(',').length === 3).map((item: any) => ({ id: item.id, value: item.id, name: item.fullName })) - deptListAll.value = res.data.list.filter((item: any) => item.pids.split(',').length === 3).map((item: any) => ({ id: item.id, value: item.id, name: item.fullName })) + deptList.value = res.data.filter((item: any) => item.pids.split(',').length === 3).map((item: any) => ({ id: item.id, value: item.id, name: item.fullName })) + deptListAll.value = res.data.filter((item: any) => item.pids.split(',').length === 3).map((item: any) => ({ id: item.id, value: item.id, name: item.fullName })) }) // 使用岗位 getPostList({}).then((res) => { @@ -209,8 +209,8 @@ watch(() => listQuery.companyId, (newVal) => { listQuery.deptId = '' if (newVal) { - getDeptTreeList({ pid: newVal }).then((res) => { - deptList.value = res.data.filter((item: any) => item.pid === newVal).map((item: any) => ({ id: item.id, value: item.id, name: item.name })) + getDeptTree({ pid: newVal }).then((res) => { + deptList.value = res.data.filter((item: any) => item.pid === newVal && item.pids.split(',').length === 3).map((item: any) => ({ id: item.id, value: item.id, name: item.fullName })) }) } else { diff --git a/src/views/tested/device/group/components/list.vue b/src/views/tested/device/group/components/list.vue index e000159..ca6d1fd 100644 --- a/src/views/tested/device/group/components/list.vue +++ b/src/views/tested/device/group/components/list.vue @@ -5,7 +5,7 @@ import useUserStore from '@/store/modules/user' import { delGroup, getGroupList } from '@/api/eqpt/device/group' import { getPostList } from '@/api/system/post' -import { getDeptList, getDeptTreeList, getDeptTreeListByPid } from '@/api/system/dept' +import { getDeptList, getDeptTree, getDeptTreeList, getDeptTreeListByPid } from '@/api/system/dept' const { proxy } = getCurrentInstance() as any const userStore = useUserStore() const listQuery = reactive({ @@ -158,15 +158,15 @@ usePositionList.value = res.data }) // 获取使用单位 - getDeptList({}).then((res) => { + getDeptTree({ pid: '0' }).then((res) => { // 单位 - companyList.value = res.data.list.filter((item: any) => item.pid === '0').map((item: any) => ({ id: item.id, value: item.id, name: item.fullName })) + companyList.value = res.data.filter((item: any) => item.pid === '0').map((item: any) => ({ id: item.id, value: item.id, name: item.fullName })) // 部门 - deptList.value = res.data.list.filter((item: any) => item.pids.split(',').length === 3).map((item: any) => ({ id: item.id, value: item.id, name: item.fullName })) - deptListAll.value = res.data.list.filter((item: any) => item.pids.split(',').length === 3).map((item: any) => ({ id: item.id, value: item.id, name: item.fullName })) + deptList.value = res.data.filter((item: any) => item.pids.split(',').length === 3).map((item: any) => ({ id: item.id, value: item.id, name: item.fullName })) + deptListAll.value = res.data.filter((item: any) => item.pids.split(',').length === 3).map((item: any) => ({ id: item.id, value: item.id, name: item.fullName })) // 分系统 - systemList.value = res.data.list.filter((item: any) => item.fullName.includes('系统')).map((item: any) => ({ id: item.id, value: item.id, name: item.fullName })) - systemListAll.value = res.data.list.filter((item: any) => item.fullName.includes('系统')).map((item: any) => ({ id: item.id, value: item.id, name: item.fullName })) + systemList.value = res.data.filter((item: any) => item.fullName.includes('系统')).map((item: any) => ({ id: item.id, value: item.id, name: item.fullName })) + systemListAll.value = res.data.filter((item: any) => item.fullName.includes('系统')).map((item: any) => ({ id: item.id, value: item.id, name: item.fullName })) }) } fetchDict() @@ -175,9 +175,9 @@ listQuery.deptId = '' listQuery.subSystemId = '' if (newVal) { - getDeptTreeList({ pid: newVal }).then((res) => { - deptList.value = res.data.filter((item: any) => item.pid === newVal).map((item: any) => ({ id: item.id, value: item.id, name: item.name })) - systemList.value = res.data.filter((item: any) => item.pid !== newVal).map((item: any) => ({ id: item.id, value: item.id, name: item.name })) + getDeptTree({ pid: newVal }).then((res) => { + deptList.value = res.data.filter((item: any) => item.pid === newVal).map((item: any) => ({ id: item.id, value: item.id, name: item.fullName })) + systemList.value = res.data.filter((item: any) => item.pid !== newVal).map((item: any) => ({ id: item.id, value: item.id, name: item.fullName })) }) } else { diff --git a/public/config/config.json b/public/config/config.json index 03859f6..644726a 100644 --- a/public/config/config.json +++ b/public/config/config.json @@ -1,6 +1,6 @@ { "title":"计量业务系统", - "versionByEqpt":"1.2.0.1", + "versionByEqpt":"1.2.0.2", "baseUrl": "http://111.198.10.15:21611", "baseUrlBusiness": "http://111.198.10.15:21606", "baseUrlLaboratory": "http://111.198.10.15:21610", diff --git a/src/api/system/dept.ts b/src/api/system/dept.ts index 8474420..24c256c 100644 --- a/src/api/system/dept.ts +++ b/src/api/system/dept.ts @@ -1,4 +1,4 @@ -// import request from '../index' +import request from '../index' import request1 from '../request' const prefix = 'sys' // const baseURL = window.localStorage.getItem('baseUrlAccount')! @@ -20,6 +20,14 @@ params, }) } +// 组织查询 -- 无权限 +export function getDeptTree(params: object) { + return request({ + url: '/system/deptTree', + method: 'get', + params, + }) +} // 组织机构树列表 export function getDeptTreeListByPid(pid: string) { diff --git a/src/views/tested/MeasurementPlan/task/index.vue b/src/views/tested/MeasurementPlan/task/index.vue index 93012a1..1c31085 100644 --- a/src/views/tested/MeasurementPlan/task/index.vue +++ b/src/views/tested/MeasurementPlan/task/index.vue @@ -6,7 +6,7 @@ import { getUserDept } from '@/api/system/user' import { getPostList } from '@/api/system/post' import { getDictByCode } from '@/api/system/dict' -import { getDeptTreeList } from '@/api/system/dept' +import { getDeptTree, getDeptTreeList } from '@/api/system/dept' const listQuery = reactive({ orderNo: '', deliverer: '', @@ -187,11 +187,11 @@ usePositionList.value = res.data }) // 获取当前用户所在单位 - getUserDept().then((res) => { - getDeptTreeList({ pid: res.data.id }).then((res1) => { - deptList.value = res1.data.filter((item: any) => item.pid === res.data.id).map((item: any) => ({ id: item.id, value: item.id, name: item.name })) - }) + // getUserDept().then((res) => { + getDeptTree({ pid: '0' }).then((res1) => { + deptList.value = res1.data.filter((item: any) => item.pids.split(',').length === 3).map((item: any) => ({ id: item.id, value: item.id, name: item.fullName })) }) + // }) // 接收状态 getDictByCode('orderStatus').then((res) => { receiveStatusList.value = res.data diff --git a/src/views/tested/device/certificate/index.vue b/src/views/tested/device/certificate/index.vue index 5aa8c70..a55d8ae 100644 --- a/src/views/tested/device/certificate/index.vue +++ b/src/views/tested/device/certificate/index.vue @@ -5,7 +5,7 @@ import { getCertificateList } from '@/api/eqpt/device/certificate' import { getDeviceNameList, getModelAllList, getModelList } from '@/api/eqpt/device/model' import { getUserList } from '@/api/system/user' -import { getDeptList, getDeptTreeList, getDeptTreeListByPid } from '@/api/system/dept' +import { getDeptList, getDeptTree, getDeptTreeList, getDeptTreeListByPid } from '@/api/system/dept' import showPhoto from '@/views/tested/device/info/components/showPhotoSinge.vue' import { getPostList } from '@/api/system/post' const { proxy } = getCurrentInstance() as any @@ -175,12 +175,12 @@ modelList.value = Array.from(new Set(res.data.filter((item: any) => item.model).map((item: any) => item.model))).sort() }) // 获取使用单位 - getDeptList({}).then((res) => { + getDeptTree({ pid: '0' }).then((res) => { // 单位 - companyList.value = res.data.list.filter((item: any) => item.pid === '0').map((item: any) => ({ id: item.id, value: item.id, name: item.fullName })) + companyList.value = res.data.filter((item: any) => item.pid === '0').map((item: any) => ({ id: item.id, value: item.id, name: item.fullName })) // 部门 - deptList.value = res.data.list.filter((item: any) => item.pids.split(',').length === 3).map((item: any) => ({ id: item.id, value: item.id, name: item.fullName })) - deptListAll.value = res.data.list.filter((item: any) => item.pids.split(',').length === 3).map((item: any) => ({ id: item.id, value: item.id, name: item.fullName })) + deptList.value = res.data.filter((item: any) => item.pids.split(',').length === 3).map((item: any) => ({ id: item.id, value: item.id, name: item.fullName })) + deptListAll.value = res.data.filter((item: any) => item.pids.split(',').length === 3).map((item: any) => ({ id: item.id, value: item.id, name: item.fullName })) }) // 使用岗位 getPostList({}).then((res) => { @@ -209,8 +209,8 @@ watch(() => listQuery.companyId, (newVal) => { listQuery.deptId = '' if (newVal) { - getDeptTreeList({ pid: newVal }).then((res) => { - deptList.value = res.data.filter((item: any) => item.pid === newVal).map((item: any) => ({ id: item.id, value: item.id, name: item.name })) + getDeptTree({ pid: newVal }).then((res) => { + deptList.value = res.data.filter((item: any) => item.pid === newVal && item.pids.split(',').length === 3).map((item: any) => ({ id: item.id, value: item.id, name: item.fullName })) }) } else { diff --git a/src/views/tested/device/group/components/list.vue b/src/views/tested/device/group/components/list.vue index e000159..ca6d1fd 100644 --- a/src/views/tested/device/group/components/list.vue +++ b/src/views/tested/device/group/components/list.vue @@ -5,7 +5,7 @@ import useUserStore from '@/store/modules/user' import { delGroup, getGroupList } from '@/api/eqpt/device/group' import { getPostList } from '@/api/system/post' -import { getDeptList, getDeptTreeList, getDeptTreeListByPid } from '@/api/system/dept' +import { getDeptList, getDeptTree, getDeptTreeList, getDeptTreeListByPid } from '@/api/system/dept' const { proxy } = getCurrentInstance() as any const userStore = useUserStore() const listQuery = reactive({ @@ -158,15 +158,15 @@ usePositionList.value = res.data }) // 获取使用单位 - getDeptList({}).then((res) => { + getDeptTree({ pid: '0' }).then((res) => { // 单位 - companyList.value = res.data.list.filter((item: any) => item.pid === '0').map((item: any) => ({ id: item.id, value: item.id, name: item.fullName })) + companyList.value = res.data.filter((item: any) => item.pid === '0').map((item: any) => ({ id: item.id, value: item.id, name: item.fullName })) // 部门 - deptList.value = res.data.list.filter((item: any) => item.pids.split(',').length === 3).map((item: any) => ({ id: item.id, value: item.id, name: item.fullName })) - deptListAll.value = res.data.list.filter((item: any) => item.pids.split(',').length === 3).map((item: any) => ({ id: item.id, value: item.id, name: item.fullName })) + deptList.value = res.data.filter((item: any) => item.pids.split(',').length === 3).map((item: any) => ({ id: item.id, value: item.id, name: item.fullName })) + deptListAll.value = res.data.filter((item: any) => item.pids.split(',').length === 3).map((item: any) => ({ id: item.id, value: item.id, name: item.fullName })) // 分系统 - systemList.value = res.data.list.filter((item: any) => item.fullName.includes('系统')).map((item: any) => ({ id: item.id, value: item.id, name: item.fullName })) - systemListAll.value = res.data.list.filter((item: any) => item.fullName.includes('系统')).map((item: any) => ({ id: item.id, value: item.id, name: item.fullName })) + systemList.value = res.data.filter((item: any) => item.fullName.includes('系统')).map((item: any) => ({ id: item.id, value: item.id, name: item.fullName })) + systemListAll.value = res.data.filter((item: any) => item.fullName.includes('系统')).map((item: any) => ({ id: item.id, value: item.id, name: item.fullName })) }) } fetchDict() @@ -175,9 +175,9 @@ listQuery.deptId = '' listQuery.subSystemId = '' if (newVal) { - getDeptTreeList({ pid: newVal }).then((res) => { - deptList.value = res.data.filter((item: any) => item.pid === newVal).map((item: any) => ({ id: item.id, value: item.id, name: item.name })) - systemList.value = res.data.filter((item: any) => item.pid !== newVal).map((item: any) => ({ id: item.id, value: item.id, name: item.name })) + getDeptTree({ pid: newVal }).then((res) => { + deptList.value = res.data.filter((item: any) => item.pid === newVal).map((item: any) => ({ id: item.id, value: item.id, name: item.fullName })) + systemList.value = res.data.filter((item: any) => item.pid !== newVal).map((item: any) => ({ id: item.id, value: item.id, name: item.fullName })) }) } else { diff --git a/src/views/tested/device/info/components/edit.vue b/src/views/tested/device/info/components/edit.vue index 2b0942b..0800622 100644 --- a/src/views/tested/device/info/components/edit.vue +++ b/src/views/tested/device/info/components/edit.vue @@ -8,7 +8,7 @@ import showPhoto from './showPhoto.vue' import certificateTable from './certificateTable.vue' import { delTextBtn, editBtn, submitBtn } from '@/utils/applyBtns' -import { getDeptTreeList } from '@/api/system/dept' +import { getDeptTree, getDeptTreeList, getDeptTreeListByPid } from '@/api/system/dept' import { toTreeList } from '@/utils/structure' import ApprovalDialog from '@/components/Approval/ApprovalDialog.vue' import { cancelInfo, defaultCheckDestination, deleteInfo, editInfo, editInfoNoApproval, getApprovalDetail, getInfoDetail, submitInfo } from '@/api/eqpt/device/info' @@ -345,8 +345,9 @@ ruleForm.value.companyId = res.data.id companyId.value = res.data.id ruleForm.value.companyName = res.data.fullName - getDeptTreeList({ pid: res.data.id }).then((res1) => { - deptList.value = res1.data.filter((item: any) => item.pid === res.data.id).map((item: any) => ({ id: item.id, value: item.id, name: item.name })) + getDeptTree({ pid: res.data.id }).then((res1) => { + // console.log(res1.data, '23213213') + deptList.value = res1.data.filter((item: any) => item.pids.split(',').length === 3).map((item: any) => ({ id: item.id, value: item.id, name: item.fullName })) }) }) } @@ -359,6 +360,11 @@ isFrist.value = false }, 2000) } + const fetchDept = (pid: string) => { + getDeptTree({ pid }).then((res1) => { + deptList.value = res1.data.filter((item: any) => item.pids.split(',').length === 3).map((item: any) => ({ id: item.id, value: item.id, name: item.fullName })) + }) + } if (statusName === '全部') { getInfoDetail({ equipmentId: $route.query.id as string }).then((res) => { ruleForm.value = res.data @@ -372,17 +378,16 @@ ruleForm.value.createTime = dayjs().format('YYYY-MM-DD HH:mm:ss') // 创建时间 } openSubmission() + fetchDept(ruleForm.value.companyId) }) } else { getApprovalDetail({ id: $route.query.id as string }).then((res) => { ruleForm.value = res.data openSubmission() + fetchDept(ruleForm.value.companyId) }) } - getDeptTreeList({}).then((res1) => { - deptList.value = res1.data.map((item: any) => ({ id: item.id, value: item.id, name: item.name })) - }) } } onMounted(async () => { diff --git a/public/config/config.json b/public/config/config.json index 03859f6..644726a 100644 --- a/public/config/config.json +++ b/public/config/config.json @@ -1,6 +1,6 @@ { "title":"计量业务系统", - "versionByEqpt":"1.2.0.1", + "versionByEqpt":"1.2.0.2", "baseUrl": "http://111.198.10.15:21611", "baseUrlBusiness": "http://111.198.10.15:21606", "baseUrlLaboratory": "http://111.198.10.15:21610", diff --git a/src/api/system/dept.ts b/src/api/system/dept.ts index 8474420..24c256c 100644 --- a/src/api/system/dept.ts +++ b/src/api/system/dept.ts @@ -1,4 +1,4 @@ -// import request from '../index' +import request from '../index' import request1 from '../request' const prefix = 'sys' // const baseURL = window.localStorage.getItem('baseUrlAccount')! @@ -20,6 +20,14 @@ params, }) } +// 组织查询 -- 无权限 +export function getDeptTree(params: object) { + return request({ + url: '/system/deptTree', + method: 'get', + params, + }) +} // 组织机构树列表 export function getDeptTreeListByPid(pid: string) { diff --git a/src/views/tested/MeasurementPlan/task/index.vue b/src/views/tested/MeasurementPlan/task/index.vue index 93012a1..1c31085 100644 --- a/src/views/tested/MeasurementPlan/task/index.vue +++ b/src/views/tested/MeasurementPlan/task/index.vue @@ -6,7 +6,7 @@ import { getUserDept } from '@/api/system/user' import { getPostList } from '@/api/system/post' import { getDictByCode } from '@/api/system/dict' -import { getDeptTreeList } from '@/api/system/dept' +import { getDeptTree, getDeptTreeList } from '@/api/system/dept' const listQuery = reactive({ orderNo: '', deliverer: '', @@ -187,11 +187,11 @@ usePositionList.value = res.data }) // 获取当前用户所在单位 - getUserDept().then((res) => { - getDeptTreeList({ pid: res.data.id }).then((res1) => { - deptList.value = res1.data.filter((item: any) => item.pid === res.data.id).map((item: any) => ({ id: item.id, value: item.id, name: item.name })) - }) + // getUserDept().then((res) => { + getDeptTree({ pid: '0' }).then((res1) => { + deptList.value = res1.data.filter((item: any) => item.pids.split(',').length === 3).map((item: any) => ({ id: item.id, value: item.id, name: item.fullName })) }) + // }) // 接收状态 getDictByCode('orderStatus').then((res) => { receiveStatusList.value = res.data diff --git a/src/views/tested/device/certificate/index.vue b/src/views/tested/device/certificate/index.vue index 5aa8c70..a55d8ae 100644 --- a/src/views/tested/device/certificate/index.vue +++ b/src/views/tested/device/certificate/index.vue @@ -5,7 +5,7 @@ import { getCertificateList } from '@/api/eqpt/device/certificate' import { getDeviceNameList, getModelAllList, getModelList } from '@/api/eqpt/device/model' import { getUserList } from '@/api/system/user' -import { getDeptList, getDeptTreeList, getDeptTreeListByPid } from '@/api/system/dept' +import { getDeptList, getDeptTree, getDeptTreeList, getDeptTreeListByPid } from '@/api/system/dept' import showPhoto from '@/views/tested/device/info/components/showPhotoSinge.vue' import { getPostList } from '@/api/system/post' const { proxy } = getCurrentInstance() as any @@ -175,12 +175,12 @@ modelList.value = Array.from(new Set(res.data.filter((item: any) => item.model).map((item: any) => item.model))).sort() }) // 获取使用单位 - getDeptList({}).then((res) => { + getDeptTree({ pid: '0' }).then((res) => { // 单位 - companyList.value = res.data.list.filter((item: any) => item.pid === '0').map((item: any) => ({ id: item.id, value: item.id, name: item.fullName })) + companyList.value = res.data.filter((item: any) => item.pid === '0').map((item: any) => ({ id: item.id, value: item.id, name: item.fullName })) // 部门 - deptList.value = res.data.list.filter((item: any) => item.pids.split(',').length === 3).map((item: any) => ({ id: item.id, value: item.id, name: item.fullName })) - deptListAll.value = res.data.list.filter((item: any) => item.pids.split(',').length === 3).map((item: any) => ({ id: item.id, value: item.id, name: item.fullName })) + deptList.value = res.data.filter((item: any) => item.pids.split(',').length === 3).map((item: any) => ({ id: item.id, value: item.id, name: item.fullName })) + deptListAll.value = res.data.filter((item: any) => item.pids.split(',').length === 3).map((item: any) => ({ id: item.id, value: item.id, name: item.fullName })) }) // 使用岗位 getPostList({}).then((res) => { @@ -209,8 +209,8 @@ watch(() => listQuery.companyId, (newVal) => { listQuery.deptId = '' if (newVal) { - getDeptTreeList({ pid: newVal }).then((res) => { - deptList.value = res.data.filter((item: any) => item.pid === newVal).map((item: any) => ({ id: item.id, value: item.id, name: item.name })) + getDeptTree({ pid: newVal }).then((res) => { + deptList.value = res.data.filter((item: any) => item.pid === newVal && item.pids.split(',').length === 3).map((item: any) => ({ id: item.id, value: item.id, name: item.fullName })) }) } else { diff --git a/src/views/tested/device/group/components/list.vue b/src/views/tested/device/group/components/list.vue index e000159..ca6d1fd 100644 --- a/src/views/tested/device/group/components/list.vue +++ b/src/views/tested/device/group/components/list.vue @@ -5,7 +5,7 @@ import useUserStore from '@/store/modules/user' import { delGroup, getGroupList } from '@/api/eqpt/device/group' import { getPostList } from '@/api/system/post' -import { getDeptList, getDeptTreeList, getDeptTreeListByPid } from '@/api/system/dept' +import { getDeptList, getDeptTree, getDeptTreeList, getDeptTreeListByPid } from '@/api/system/dept' const { proxy } = getCurrentInstance() as any const userStore = useUserStore() const listQuery = reactive({ @@ -158,15 +158,15 @@ usePositionList.value = res.data }) // 获取使用单位 - getDeptList({}).then((res) => { + getDeptTree({ pid: '0' }).then((res) => { // 单位 - companyList.value = res.data.list.filter((item: any) => item.pid === '0').map((item: any) => ({ id: item.id, value: item.id, name: item.fullName })) + companyList.value = res.data.filter((item: any) => item.pid === '0').map((item: any) => ({ id: item.id, value: item.id, name: item.fullName })) // 部门 - deptList.value = res.data.list.filter((item: any) => item.pids.split(',').length === 3).map((item: any) => ({ id: item.id, value: item.id, name: item.fullName })) - deptListAll.value = res.data.list.filter((item: any) => item.pids.split(',').length === 3).map((item: any) => ({ id: item.id, value: item.id, name: item.fullName })) + deptList.value = res.data.filter((item: any) => item.pids.split(',').length === 3).map((item: any) => ({ id: item.id, value: item.id, name: item.fullName })) + deptListAll.value = res.data.filter((item: any) => item.pids.split(',').length === 3).map((item: any) => ({ id: item.id, value: item.id, name: item.fullName })) // 分系统 - systemList.value = res.data.list.filter((item: any) => item.fullName.includes('系统')).map((item: any) => ({ id: item.id, value: item.id, name: item.fullName })) - systemListAll.value = res.data.list.filter((item: any) => item.fullName.includes('系统')).map((item: any) => ({ id: item.id, value: item.id, name: item.fullName })) + systemList.value = res.data.filter((item: any) => item.fullName.includes('系统')).map((item: any) => ({ id: item.id, value: item.id, name: item.fullName })) + systemListAll.value = res.data.filter((item: any) => item.fullName.includes('系统')).map((item: any) => ({ id: item.id, value: item.id, name: item.fullName })) }) } fetchDict() @@ -175,9 +175,9 @@ listQuery.deptId = '' listQuery.subSystemId = '' if (newVal) { - getDeptTreeList({ pid: newVal }).then((res) => { - deptList.value = res.data.filter((item: any) => item.pid === newVal).map((item: any) => ({ id: item.id, value: item.id, name: item.name })) - systemList.value = res.data.filter((item: any) => item.pid !== newVal).map((item: any) => ({ id: item.id, value: item.id, name: item.name })) + getDeptTree({ pid: newVal }).then((res) => { + deptList.value = res.data.filter((item: any) => item.pid === newVal).map((item: any) => ({ id: item.id, value: item.id, name: item.fullName })) + systemList.value = res.data.filter((item: any) => item.pid !== newVal).map((item: any) => ({ id: item.id, value: item.id, name: item.fullName })) }) } else { diff --git a/src/views/tested/device/info/components/edit.vue b/src/views/tested/device/info/components/edit.vue index 2b0942b..0800622 100644 --- a/src/views/tested/device/info/components/edit.vue +++ b/src/views/tested/device/info/components/edit.vue @@ -8,7 +8,7 @@ import showPhoto from './showPhoto.vue' import certificateTable from './certificateTable.vue' import { delTextBtn, editBtn, submitBtn } from '@/utils/applyBtns' -import { getDeptTreeList } from '@/api/system/dept' +import { getDeptTree, getDeptTreeList, getDeptTreeListByPid } from '@/api/system/dept' import { toTreeList } from '@/utils/structure' import ApprovalDialog from '@/components/Approval/ApprovalDialog.vue' import { cancelInfo, defaultCheckDestination, deleteInfo, editInfo, editInfoNoApproval, getApprovalDetail, getInfoDetail, submitInfo } from '@/api/eqpt/device/info' @@ -345,8 +345,9 @@ ruleForm.value.companyId = res.data.id companyId.value = res.data.id ruleForm.value.companyName = res.data.fullName - getDeptTreeList({ pid: res.data.id }).then((res1) => { - deptList.value = res1.data.filter((item: any) => item.pid === res.data.id).map((item: any) => ({ id: item.id, value: item.id, name: item.name })) + getDeptTree({ pid: res.data.id }).then((res1) => { + // console.log(res1.data, '23213213') + deptList.value = res1.data.filter((item: any) => item.pids.split(',').length === 3).map((item: any) => ({ id: item.id, value: item.id, name: item.fullName })) }) }) } @@ -359,6 +360,11 @@ isFrist.value = false }, 2000) } + const fetchDept = (pid: string) => { + getDeptTree({ pid }).then((res1) => { + deptList.value = res1.data.filter((item: any) => item.pids.split(',').length === 3).map((item: any) => ({ id: item.id, value: item.id, name: item.fullName })) + }) + } if (statusName === '全部') { getInfoDetail({ equipmentId: $route.query.id as string }).then((res) => { ruleForm.value = res.data @@ -372,17 +378,16 @@ ruleForm.value.createTime = dayjs().format('YYYY-MM-DD HH:mm:ss') // 创建时间 } openSubmission() + fetchDept(ruleForm.value.companyId) }) } else { getApprovalDetail({ id: $route.query.id as string }).then((res) => { ruleForm.value = res.data openSubmission() + fetchDept(ruleForm.value.companyId) }) } - getDeptTreeList({}).then((res1) => { - deptList.value = res1.data.map((item: any) => ({ id: item.id, value: item.id, name: item.name })) - }) } } onMounted(async () => { diff --git a/src/views/tested/device/info/components/list.vue b/src/views/tested/device/info/components/list.vue index 9bd395a..9f802ce 100644 --- a/src/views/tested/device/info/components/list.vue +++ b/src/views/tested/device/info/components/list.vue @@ -20,7 +20,7 @@ import { getLocationList } from '@/api/system/installation' import { getPostList } from '@/api/system/post' import { getGroupList } from '@/api/eqpt/device/group' -import { getDeptList, getDeptTreeList } from '@/api/system/dept' +import { getDeptList, getDeptTree, getDeptTreeList } from '@/api/system/dept' const $props = defineProps({ statusName: { type: String, @@ -353,12 +353,13 @@ groupList.value = res.data.rows.map((item: any) => ({ name: item.groupName, id: item.id, value: item.id })) }) // 单位部门 - getDeptList({}).then((res) => { + getDeptTree({ pid: '0' }).then((res) => { // 单位 - companyList.value = res.data.list.filter((item: any) => item.pid === '0').map((item: any) => ({ id: item.id, value: item.id, name: item.fullName })) + companyList.value = res.data.filter((item: any) => item.pid === '0').map((item: any) => ({ id: item.id, value: item.id, name: item.fullName })) + console.log(companyList, 'companyList') // 部门 - deptList.value = res.data.list.filter((item: any) => item.pids.split(',').length === 3).map((item: any) => ({ id: item.id, value: item.id, name: item.fullName })) - deptListAll.value = res.data.list.filter((item: any) => item.pids.split(',').length === 3).map((item: any) => ({ id: item.id, value: item.id, name: item.fullName })) + deptList.value = res.data.filter((item: any) => item.pid !== '0' && item.pids.split(',').length === 3).map((item: any) => ({ id: item.id, value: item.id, name: item.fullName })) + deptListAll.value = JSON.parse(JSON.stringify(deptList.value)) }) getDictByCode('eqptDeviceInUse').then((res) => { inUseList.value = res.data @@ -382,8 +383,8 @@ watch(() => listQuery.companyId, (newVal) => { listQuery.deptIds = '' if (newVal) { - getDeptTreeList({ pid: newVal }).then((res) => { - deptList.value = res.data.filter((item: any) => item.pid === newVal).map((item: any) => ({ id: item.id, value: item.id, name: item.name })) + getDeptTree({ pid: newVal }).then((res) => { + deptList.value = res.data.filter((item: any) => item.pids.split(',').length === 3).map((item: any) => ({ id: item.id, value: item.id, name: item.fullName })) }) } else { @@ -679,6 +680,7 @@ ElMessage.success('上传成功') fileRef.value.value = '' loading.close() + fetchData(true) } else { @@ -724,7 +726,8 @@ } bindTaskHandler(data).then((res) => { ElMessage.success('绑定成功') - // fetchTogetherData() + // + fetchTogetherData() search() }) } @@ -770,6 +773,7 @@ confirmButtonText: '确认', cancelButtonText: '取消', inputValidator: valiate, + inputErrorMessage: '请输入原因', }) .then(({ value }) => { @@ -817,6 +821,7 @@ '确认取消此申请吗?', '确认', { + confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning', @@ -862,7 +867,8 @@ // } // else { // // 获取聚合表格数据 - // fetchTogetherData() + // + fetchTogetherData() // } } @@ -902,7 +908,6 @@ add: `/tested/device/${$props.equipmentType === '1' ? 'info' : 'speciallist'}/add`, import: `/tested/device/${$props.equipmentType === '1' ? 'info' : 'speciallist'}/import`, }) -//