From 8e977a7ec92bc1845079eda2473e9c3fc4691c8d Mon Sep 17 00:00:00 2001 From: Ben Lin <maobin001@msn.com> Date: 星期二, 11 三月 2025 15:45:51 +0800 Subject: [PATCH] 仓库汇总报表 --- src/api/tigerapi/dept.ts | 39 +++++++++++++++++++++++++++++++++++---- 1 files changed, 35 insertions(+), 4 deletions(-) diff --git a/src/api/tigerapi/dept.ts b/src/api/tigerapi/dept.ts index 7e7a0e2..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'; @@ -19,6 +27,29 @@ isTransformResponse: false, }, ); + +/** + * @description: 鑾峰彇宸ュ巶鍒楄〃甯︽潈闄愭帶鍒� + * @param {string} userId + * @return {*} + */ +export async function getProdTree(user: {}) { + let res = await Promise.all([getProdTreeList(), prodListApi(user['userId'])]); + let treeData = res[0]; + treeData = treeData.filter((x) => + 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) => { let sqlcmd = ''; @@ -114,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( @@ -132,11 +163,11 @@ return data; }; -export const prodListApi = async (params: Recordable) => { +export const prodListApi = async (userId: string) => { // const usParams = genAction('V_USER_ORG', `USER_ID='${userid}'`); const usParams = genAction('V_USER_PROD', { QueryAble_T: '', - where: "USER_ID = '" + params + "'", + where: "USER_ID = '" + userId + "'", order: '', }); const data = await defHttp.post( -- Gitblit v1.9.3