jieSuanDanXiuGai.js 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. import {ref} from "vue";
  2. import {maZuiFangShi} from "../../api/public-api";
  3. import store from '@/store';
  4. const getRoles = store.state.user.info.roles
  5. export function shenHeQuanXian() {
  6. return getRoles.indexOf(1) > -1 || getRoles.indexOf(8) > -1
  7. // return getRoles.indexOf(8) > -1
  8. }
  9. /**
  10. * 获取医保诊断
  11. * @param val 诊断编码
  12. * @returns {string} 返回名称
  13. */
  14. export function getsiDiagTypeName(val) {
  15. switch (val) {
  16. case "1":
  17. return "西医主要诊断"
  18. case "2":
  19. return "西医其他诊断"
  20. case "3":
  21. return "中医主要诊断"
  22. case "4":
  23. return "中医其他诊断"
  24. default:
  25. return "没有选择"
  26. }
  27. }
  28. /**
  29. * 判断这个人是否有申请了
  30. * @param val
  31. * @returns {string}
  32. */
  33. export function auditName(val) {
  34. switch (val.auditFlag) {
  35. case 0:
  36. return `<span style="color: #909399">${val.psnName}</span>`
  37. case 1:
  38. return `<span style="color: #67C23A">${val.psnName}</span>`
  39. case 2:
  40. return `<span style="color: #F56C6C">${val.psnName}</span>`
  41. case 3:
  42. return `<span style="color: #E6A23C">${val.psnName}</span>`
  43. default:
  44. return `${val.psnName}`
  45. }
  46. }
  47. export const qks = ref([
  48. {code: '0/0', name: '0/0'},
  49. {code: '1/3', name: 'Ⅰ/丙'},
  50. {code: '1/1', name: 'Ⅰ/甲'},
  51. {code: '1/2', name: 'Ⅰ/乙'},
  52. {code: '2/3', name: 'Ⅱ/丙'},
  53. {code: '2/1', name: 'Ⅱ/甲'},
  54. {code: '2/2', name: 'Ⅱ/乙'},
  55. {code: '3/3', name: 'Ⅲ/丙'},
  56. {code: '3/1', name: 'Ⅲ/甲'},
  57. {code: '3/2', name: 'Ⅲ/乙'}
  58. ])
  59. export const auditFlags = ref([
  60. {code: 0, name: '待审核'},
  61. {code: 1, name: '审核通过'},
  62. {code: 2, name: '驳回'},
  63. {code: 3, name: '正在审核'},
  64. {code: 4, name: '全部'},
  65. ])
  66. /**
  67. *
  68. * @param qkjb 切口级别
  69. * @param yhqk 愈合级别
  70. * @returns {string} 返回信息
  71. */
  72. export function qieKouName(qkjb, yhqk) {
  73. let code = qkjb + '/' + yhqk
  74. let name = ''
  75. qks.value.forEach(item => {
  76. if (item.code === code) {
  77. return name = item.name
  78. }
  79. })
  80. return name
  81. }
  82. /**
  83. *
  84. * @type {ToRef<*[]>} 麻醉数组
  85. */
  86. export const maZuiFangShis = ref([])
  87. /**
  88. * 远程获取麻醉方式
  89. */
  90. maZuiFangShi().then((res) => {
  91. maZuiFangShis.value = res
  92. })
  93. /**
  94. * 麻醉的名字
  95. * @param val code
  96. * @returns {string} 名称
  97. */
  98. export function maZuiName(val) {
  99. let name = '未知'
  100. maZuiFangShis.value.forEach(item => {
  101. if (item.code === val) {
  102. return name = item.name
  103. }
  104. })
  105. return name
  106. }
  107. /**
  108. * 医生默认可以默认选择的信息
  109. * @param arr 数组
  110. * @param notNode 不需要的 code
  111. * @returns {*[]} 返回科室
  112. */
  113. export function xianZhongChuQu(arr, notNode) {
  114. let data = []
  115. arr.forEach(item => {
  116. if (notNode.indexOf(item.code) === -1) {
  117. data.push(item.code)
  118. }
  119. })
  120. return data
  121. }