index.js 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. import Vue from 'vue'
  2. import Vuex from 'vuex'
  3. Vue.use(Vuex)
  4. const store = new Vuex.Store({
  5. /* 状态对象 */
  6. state: {
  7. result: false, // 获取信息是否成功
  8. // eslint-disable-next-line no-mixed-spaces-and-tabs
  9. code: '',
  10. msg: '', // 获取成功失败时返回的错误信息
  11. bcode: '',
  12. cbData: null,
  13. wxData: {},
  14. unfaresearchdata: {},
  15. revfaresearchdata: {},
  16. data: {}, // {userId,userName,staffCode,deptCode}
  17. token: {} // 令牌
  18. },
  19. mutations: {
  20. setResult (state, result) {
  21. state.result = result
  22. },
  23. setCode (state, code) {
  24. state.code = code
  25. },
  26. setMsg (state, msg) {
  27. state.msg = msg
  28. },
  29. setBcode (state, bcode) {
  30. state.bcode = bcode
  31. },
  32. setcbData (state, cbData) {
  33. state.cbData = cbData
  34. },
  35. setwxData (state, wxData) {
  36. state.wxData.vrepairapplycode = wxData.vrepairapplycode
  37. state.wxData.vbillstatus = wxData.vbillstatus
  38. },
  39. setvrepairapplycode (state, vrepairapplycode) {
  40. state.vrepairapplycode = vrepairapplycode
  41. },
  42. setunfaresearchData (state, unfaresearchdata) {
  43. state.unfaresearchdata.hname = unfaresearchdata.hname
  44. state.unfaresearchdata.ownername = unfaresearchdata.ownername
  45. },
  46. setrevfaresearchData (state, revfaresearchdata) {
  47. state.revfaresearchdata.hname = revfaresearchdata.hname
  48. state.revfaresearchdata.ownername = revfaresearchdata.ownername
  49. },
  50. setData (state, data) {
  51. state.data.staffCode = data.staffCode
  52. state.data.userID = data.userID
  53. state.data.deptCode = data.deptCode
  54. state.data.userName = data.userName
  55. },
  56. setToken (state, token) {
  57. state.token = token
  58. }
  59. },
  60. getters: {
  61. },
  62. actions: {
  63. // lazy loading openid
  64. }
  65. })
  66. export default store