index.js 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. const STATUS_CONFIGE = {
  2. care_apply_status: [{
  3. dictCode: 119,
  4. dictLabel: "待指派人员",
  5. dictSort: 0,
  6. dictType: "care_apply_status",
  7. dictValue: "wait_assign_nurse"
  8. },
  9. {
  10. dictCode: 110,
  11. dictLabel: "待审核",
  12. dictSort: 1,
  13. dictType: "care_apply_status",
  14. dictValue: "wait_check"
  15. },
  16. {
  17. dictCode: 111,
  18. dictLabel: "已同意",
  19. dictSort: 2,
  20. dictType: "care_apply_status",
  21. dictValue: "agree"
  22. },
  23. {
  24. dictCode: 112,
  25. dictLabel: "不同意",
  26. dictSort: 3,
  27. dictType: "care_apply_status",
  28. dictValue: "disagree"
  29. },
  30. {
  31. dictCode: 113,
  32. dictLabel: "待指派公司",
  33. dictSort: 4,
  34. dictType: "care_apply_status",
  35. dictValue: "wait_assign_company"
  36. },
  37. {
  38. dictCode: 114,
  39. dictLabel: "已指派",
  40. dictSort: 5,
  41. dictType: "care_apply_status",
  42. dictValue: "assigned"
  43. },
  44. {
  45. dictCode: 121,
  46. dictLabel: "未送审",
  47. dictSort: 6,
  48. dictType: "care_apply_status",
  49. dictValue: "no_check"
  50. }
  51. ],
  52. sys_user_sex: [{
  53. dictCode: 1,
  54. dictLabel: "男",
  55. dictSort: 1,
  56. dictType: "sys_user_sex",
  57. dictValue: "0"
  58. }, {
  59. dictCode: 2,
  60. dictLabel: "女",
  61. dictSort: 2,
  62. dictType: "sys_user_sex",
  63. dictValue: "1"
  64. }, {
  65. dictCode: 3,
  66. dictLabel: "未知",
  67. dictSort: 3,
  68. dictType: "sys_user_sex",
  69. dictValue: "2"
  70. }],
  71. pay_status: [{
  72. dictCode: 117,
  73. dictLabel: "未结算",
  74. dictSort: 1,
  75. dictType: "pay_status",
  76. dictValue: "dis_pay"
  77. }, {
  78. dictCode: 118,
  79. dictLabel: "已结算",
  80. dictSort: 2,
  81. dictType: "pay_status",
  82. dictValue: "is_pay"
  83. }],
  84. deal_status: [{
  85. dictCode: 120,
  86. dictLabel: "未开始",
  87. dictSort: 0,
  88. dictType: "deal_status",
  89. dictValue: "no_start"
  90. }, {
  91. dictCode: 115,
  92. dictLabel: "进行中",
  93. dictSort: 1,
  94. dictType: "deal_status",
  95. dictValue: "in_progress"
  96. }, {
  97. dictCode: 116,
  98. dictLabel: "已完成",
  99. dictSort: 2,
  100. dictType: "deal_status",
  101. dictValue: "complete"
  102. }]
  103. }
  104. export function getDict(dbName = 'deal_status', query = {}) {
  105. if (typeof dbName !== 'string' && typeof query !== 'object') return {};
  106. if (Object.keys(query).length === 0) return {};
  107. let dbData = STATUS_CONFIGE[dbName];
  108. let distRes = {};
  109. // console.log('dbData=>', dbData);
  110. dbData.some((dict) => {
  111. let bool = true;
  112. for (var key in query) {
  113. if (dict.hasOwnProperty(key)) {
  114. if (query[key] != dict[key]) {
  115. bool = false;
  116. }
  117. } else {
  118. bool = false;
  119. }
  120. }
  121. if (bool) {
  122. distRes = dict;
  123. return bool;
  124. }
  125. })
  126. return distRes;
  127. }