血透系统pad前端

user.js 2.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. const user = {
  2. state: {
  3. role_type: 1, // 1.医生 2.护士
  4. user: {
  5. id: 0,
  6. mobile: "",
  7. avatar: "",
  8. user_name: "",
  9. intro: "",
  10. user_type: 0,
  11. user_title: 0,
  12. },
  13. org: {
  14. id: 0,
  15. org_short_name: "",
  16. org_name: "",
  17. org_intro: "",
  18. org_logo: "",
  19. address: "",
  20. province: 0,
  21. city: 0,
  22. district: 0,
  23. },
  24. serve:{
  25. state:0,
  26. status:1,
  27. start:0,
  28. end:0,
  29. },
  30. subscibe: {
  31. id: 0,
  32. period_start: 0,
  33. period_end: 0,
  34. state: 3,
  35. },
  36. template_info:{
  37. id: 0,
  38. org_id:0,
  39. template_id:0,
  40. },
  41. fileds:[],
  42. },
  43. mutations: {
  44. SET_FILEDS: (state, payload) => {
  45. state.fileds = payload.fileds
  46. console.log(payload.fileds)
  47. console.log(state.fileds)
  48. },
  49. SET_USER: (state, user) => {
  50. state.user.id = user.id
  51. state.user.mobile = user.mobile
  52. state.user.avatar = user.avatar
  53. state.user.user_name = user.user_name
  54. state.user.intro = user.intro
  55. state.user.user_type = user.user_type
  56. state.user.user_title = user.user_title
  57. },
  58. SET_ORG: (state, org) => {
  59. state.org.id = org.id
  60. state.org.org_short_name = org.org_short_name
  61. state.org.org_name = org.org_name
  62. state.org.org_intro = org.org_intro
  63. state.org.org_logo = org.org_logo
  64. state.org.address = org.address
  65. state.org.province = org.province
  66. state.org.city = org.city
  67. state.org.district = org.district
  68. },
  69. SET_SUBSCIBE: (state, subscibe) => {
  70. state.subscibe.id = subscibe.id
  71. state.subscibe.period_start = subscibe.period_start
  72. state.subscibe.period_end = subscibe.period_end
  73. state.subscibe.state = subscibe.state
  74. },
  75. SET_ROLE_TYPE: (state, type) => {
  76. state.role_type = type
  77. },
  78. SET_ORG_SERVE:(state, serve)=>{
  79. state.serve.state = serve.state
  80. state.serve.status = serve.status
  81. state.serve.start = serve.start
  82. state.serve.end = serve.end
  83. },SET_TEMPLATE:(state, template_info) =>{
  84. state.template_info.id = template_info.id
  85. state.template_info.org_id = template_info.org_id
  86. state.template_info.template_id = template_info.template_id
  87. }
  88. },
  89. actions: {
  90. InitUserInfo({commit}, userInfo) {
  91. var user = userInfo.user
  92. var org = userInfo.org
  93. var subscibe = userInfo.subscibe
  94. var template_info = userInfo.template_info
  95. var fileds = userInfo.filed_list
  96. console.log(userInfo.filed_list)
  97. console.log(fileds)
  98. commit("SET_USER", user)
  99. commit("SET_ORG", org)
  100. commit("SET_SUBSCIBE", subscibe)
  101. commit("SET_TEMPLATE", template_info)
  102. commit('SET_FILEDS', {
  103. fileds
  104. })
  105. },
  106. SwitchRoleTypeToDoctor({commit}) {
  107. commit("SET_ROLE_TYPE", 1)
  108. }
  109. }
  110. }
  111. export default user