panorama.js 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. // 涉及全景相关配置信息
  2. export const PAYROLL_HEADER = [
  3. { label: '月份', prop: 'month' },
  4. { label: '机构', prop: 'organizationName', width: 150 },
  5. { label: '姓名', prop: 'employeeName', align: 'center', width: 100 },
  6. { label: '统一认证号', prop: 'unifiedCertificationNumber', align: 'center', width: 120 },
  7. { label: '起薪类型', prop: 'payrollCategory', width: 120 },
  8. { label: '绩效工资', prop: 'meritPay', align: 'center', width: 120 },
  9. { label: '加班工资', prop: 'workOvertime', align: 'center', width: 120 },
  10. { label: '交通补贴', prop: 'commuteSubsidy', width: 120 },
  11. { label: '通讯补贴', prop: 'communicationSubsidy', width: 120 },
  12. { label: '午餐费补贴', prop: 'lunchSubsidy', width: 120 },
  13. { label: '岗位贡献补贴', prop: 'jobContributionSubsidy', width: 150 },
  14. { label: '交流干部补贴', prop: 'exchangeCadresSubsidy', width: 150 },
  15. { label: '网点岗位津贴', prop: 'networkJobSubsidy', width: 150 },
  16. { label: '网讯稿酬', prop: 'newsSubsidy', width: 120 },
  17. { label: '独生子女费', prop: 'onlyChild', width: 120 },
  18. { label: '养老保险', prop: 'pensionInsurance', width: 120 },
  19. { label: '医疗保险', prop: 'medicalInsurance', width: 120 },
  20. { label: '失业保险', prop: 'unemploymentInsurance', width: 120 },
  21. { label: '住房公积金', prop: 'housingProvidentFund', width: 120 },
  22. { label: '企业年金', prop: 'enterpriseAnnuity', width: 120 },
  23. { label: '个人所得税', prop: 'individualIncomeTax', width: 120 },
  24. { label: '工资扣款', prop: 'payrollDeduction', width: 120 },
  25. { label: '合计', prop: 'totalSalary', align: 'center', fixed: 'right', width: 120 }
  26. ]
  27. /**
  28. * 查询节点返回完整路径数组
  29. * @param {Array} tree 树形结构数据
  30. * @param {String} targetCode 目标节点
  31. * @param {Array} path 路径存储
  32. * @param {Object} obj 节点属性
  33. * @returns
  34. */
  35. export function findPath (tree, targetCode, path = [], obj = { children: 'child', value: 'organizationNo', label: 'organizationName' }) {
  36. for (const node of tree) {
  37. // 将当前节点加入路径
  38. const currentPath = [...path, { value: node[obj.value], label: node[obj.label] }]
  39. // 如果当前节点是目标节点,返回路径
  40. if (node[obj.value] === targetCode) {
  41. return currentPath
  42. }
  43. // 如果当前节点有子节点,递归查找
  44. if (node[obj.children] && node[obj.children].length > 0) {
  45. const result = findPath(node[obj.children], targetCode, currentPath, obj)
  46. if (result) {
  47. return result
  48. }
  49. }
  50. }
  51. // 如果没有找到目标节点,返回 null
  52. return null
  53. }