12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- // 涉及全景相关配置信息
- export const PAYROLL_HEADER = [
- { label: '月份', prop: 'month' },
- { label: '机构', prop: 'organizationName', width: 150 },
- { label: '姓名', prop: 'employeeName', align: 'center', width: 100 },
- { label: '统一认证号', prop: 'unifiedCertificationNumber', align: 'center', width: 120 },
- { label: '起薪类型', prop: 'payrollCategory', width: 120 },
- { label: '绩效工资', prop: 'meritPay', align: 'center', width: 120 },
- { label: '加班工资', prop: 'workOvertime', align: 'center', width: 120 },
- { label: '交通补贴', prop: 'commuteSubsidy', width: 120 },
- { label: '通讯补贴', prop: 'communicationSubsidy', width: 120 },
- { label: '午餐费补贴', prop: 'lunchSubsidy', width: 120 },
- { label: '岗位贡献补贴', prop: 'jobContributionSubsidy', width: 150 },
- { label: '交流干部补贴', prop: 'exchangeCadresSubsidy', width: 150 },
- { label: '网点岗位津贴', prop: 'networkJobSubsidy', width: 150 },
- { label: '网讯稿酬', prop: 'newsSubsidy', width: 120 },
- { label: '独生子女费', prop: 'onlyChild', width: 120 },
- { label: '养老保险', prop: 'pensionInsurance', width: 120 },
- { label: '医疗保险', prop: 'medicalInsurance', width: 120 },
- { label: '失业保险', prop: 'unemploymentInsurance', width: 120 },
- { label: '住房公积金', prop: 'housingProvidentFund', width: 120 },
- { label: '企业年金', prop: 'enterpriseAnnuity', width: 120 },
- { label: '个人所得税', prop: 'individualIncomeTax', width: 120 },
- { label: '工资扣款', prop: 'payrollDeduction', width: 120 },
- { label: '合计', prop: 'totalSalary', align: 'center', fixed: 'right', width: 120 }
- ]
- /**
- * 查询节点返回完整路径数组
- * @param {Array} tree 树形结构数据
- * @param {String} targetCode 目标节点
- * @param {Array} path 路径存储
- * @param {Object} obj 节点属性
- * @returns
- */
- export function findPath (tree, targetCode, path = [], obj = { children: 'child', value: 'organizationNo', label: 'organizationName' }) {
- for (const node of tree) {
- // 将当前节点加入路径
- const currentPath = [...path, { value: node[obj.value], label: node[obj.label] }]
- // 如果当前节点是目标节点,返回路径
- if (node[obj.value] === targetCode) {
- return currentPath
- }
- // 如果当前节点有子节点,递归查找
- if (node[obj.children] && node[obj.children].length > 0) {
- const result = findPath(node[obj.children], targetCode, currentPath, obj)
- if (result) {
- return result
- }
- }
- }
- // 如果没有找到目标节点,返回 null
- return null
- }
|