baseInfoMixins.js 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. import {
  2. getAllbaseInfo,
  3. safetycheck,
  4. getAllresumption,
  5. getSyntheticQuestion,
  6. getSyntheticResumption,
  7. getotherHandler
  8. } from '@/api/cockpit.js'
  9. export const baseInfoApi = {
  10. data() {
  11. return {
  12. property: 'value'
  13. }
  14. },
  15. methods: {
  16. //获取基础信息
  17. getBaseInfoHandler(data) {
  18. getAllbaseInfo(data).then(res => {
  19. let { code, data } = res
  20. if (code == 200) {
  21. this.baseData = data
  22. this.baseInit()
  23. }
  24. })
  25. },
  26. //获取履职情况信息
  27. getResumptionfoHandler(data) {
  28. getAllresumption(data).then(res => {
  29. let { code, data } = res
  30. if (code == 200) {
  31. this.resumptionList = data
  32. this.resumptionInit()
  33. }
  34. })
  35. },
  36. //获取综合数据日常履职
  37. getsynthesisResumptionfo(data) {
  38. getSyntheticResumption(data).then(res => {
  39. let { code, data } = res
  40. if (code == 200) {
  41. let { rateByType, infoByType } = data
  42. this.infoByType = infoByType
  43. this.keysList = Object.keys(infoByType)
  44. let list = []
  45. Object.keys(rateByType).forEach(item => {
  46. list.push({ orgName: item + '', rate: rateByType[item] })
  47. })
  48. this.syntheticResumptionInit(list)
  49. }
  50. })
  51. },
  52. //获取综合隐患问题
  53. getSyntheticQuestionHandler(data) {
  54. getSyntheticQuestion(data).then(res => {
  55. let { code, data } = res
  56. if (code == 200) {
  57. console.log(data, 'data')
  58. let { rateByState, resumption, offATMCheck, safetyCheck } = data
  59. // this.infoByType = infoByType
  60. this.resumptionList = resumption //履职
  61. this.offATMCheckList = offATMCheck //巡检
  62. this.safetyCheck = safetyCheck //安全检查
  63. let list = []
  64. Object.keys(rateByState).forEach(item => {
  65. if (item == '整改率') {
  66. list.push({ orgName: item + '', rate: rateByState[item], isNo: true })
  67. } else {
  68. list.push({ orgName: item + '', rate: rateByState[item] })
  69. }
  70. })
  71. this.syntheticquestionInit(list)
  72. }
  73. })
  74. },
  75. //获取安全检查
  76. getSafetycheck(data) {
  77. safetycheck(data).then(res => {
  78. let { code, data } = res
  79. if (code == 200) {
  80. let { rateByType, taskInfoByType } = data
  81. this.taskInfoByTypeList = taskInfoByType
  82. this.safetyKeysList = Object.keys(taskInfoByType)
  83. let list = []
  84. Object.keys(rateByType).forEach(item => {
  85. list.push({ orgName: item + '', rate: rateByType[item] })
  86. })
  87. this.safetyInit(list)
  88. }
  89. })
  90. },
  91. //获取其他接口
  92. getQtHandler(data) {
  93. getotherHandler(data).then(res => {
  94. let { code, data } = res
  95. if (code == 200) {
  96. console.log(data);
  97. let { drill, edu,inout,monitor } = data
  98. this.otherDrill = drill
  99. this.otherMonitor = monitor
  100. this.otherInout = inout
  101. this.otherEdu = edu
  102. }
  103. })
  104. }
  105. }
  106. }