Files
dingding-oa-server/src/pages/api/receivable_accounts/util.ts
2026-05-27 14:12:10 +08:00

48 lines
1.4 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { ProcessedInvoiceDataItemFromFunction } from '@/pages/api/type'
export const departmentList = [
"运营",
"招聘",
"总务",
"薪酬",
"退休衔接",
"统筹-计核",
"统筹-社保",
"统筹-医保",
"统筹-支持",
"入转离",
"评鉴",
"培训-会务",
"国际化服务",
"管理咨询",
"客户服务",
"福利",
"法务",
"培训-数交",
"培训-科技",
"培训-经管",
"培训-技能",
"党校-党建",
"数字化"
];
export function processReceivableAccounts(invoiceData: ProcessedInvoiceDataItemFromFunction, projectMap: Map<string, any>) {
// const projectInfo = projectMap.get(invoiceData.projectNumber)
const obj: {
[k: string]: any
} = {
...invoiceData,
// delivery_area: projectInfo?.delivery_area,
// project_group: obj?.zhuan_ye_zu,
// 将departmentList中的每个部门作为key值为空字符串
...Object.fromEntries(departmentList.map(department => [department, ""]))
}
// delivery_area 交付区域 对应负责地区
// project_group 项目组别 申请口
// departmentList
// 如果申请口在 departmentList 内,那么将值设置为申请口
if (departmentList.includes(obj.zhuan_ye_zu)) {
obj[obj.zhuan_ye_zu as string] = `${obj.bu_han_shui_jin_e}`;
}
return obj;
}