From 6a7257f9d8f659c508cf826726126c0fa4363eef Mon Sep 17 00:00:00 2001 From: YangYuGang <1378265336@qq.com> Date: 星期一, 14 四月 2025 17:04:39 +0800 Subject: [PATCH] 盘点单没有数据时一直加载中 --- src/api/tigerapi/dept.ts | 21 +++++++++++++++++++-- 1 files changed, 19 insertions(+), 2 deletions(-) diff --git a/src/api/tigerapi/dept.ts b/src/api/tigerapi/dept.ts index 53c483d..faa42b7 100644 --- a/src/api/tigerapi/dept.ts +++ b/src/api/tigerapi/dept.ts @@ -1,3 +1,11 @@ +/* + * @Description: file content + * @Author: Ben Lin + * @version: + * @Date: 2024-06-18 15:09:47 + * @LastEditors: Ben Lin + * @LastEditTime: 2024-07-17 03:22:44 + */ import { buildUUID } from '../../utils/uuid'; import { ApiActionPage } from '../model/baseModel'; import { DeptListGetResultModel, DeptListItem, DeptPageParams } from './model/systemModel'; @@ -32,6 +40,15 @@ res[1].Data.Items.some((item) => item.PROD_CODE == x.deptCode), ); return treeData; +} + +export async function getOrgTree(user: {}) { + let res = await Promise.all([getTreeList(), optionsListApi(user['userId'])]); + let treeData = res[0]; + treeData = treeData.filter((x) => + res[1].Data.Items.some((item) => item.ORG_CODE == x.deptCode), + ); + return treeData; } export const getDeptListByPage = async (params: DeptPageParams) => { @@ -128,11 +145,11 @@ // params: Recordable // userid: string // 鎹偣涓嬫媺鏍� -export const optionsListApi = async (params: Recordable) => { +export const optionsListApi = async (userId: string) => { // const usParams = genAction('V_USER_ORG', `USER_ID='${userid}'`); const usParams = genAction('V_USER_ORG', { QueryAble_T: '', - where: "USER_ID = '" + params + "'", + where: "USER_ID = '" + userId + "'", order: '', }); const data = await defHttp.post( -- Gitblit v1.9.3