index1.js 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. const herfurl = window.location.href.split('index')[0] //跳转地址
  2. let app = new Vue({
  3. el: '#app',
  4. data() {
  5. return {
  6. time: '',
  7. timeout: 15000, // 一分钟发一次心跳
  8. pageindex: 0,
  9. planCompletionRate:0,
  10. productionGoodProductRate:0,
  11. dataCount:0,
  12. comprehensive: [],
  13. dataList: [],
  14. shortageConfig: []
  15. }
  16. },
  17. mounted() {
  18. setTimeout(() => {
  19. this.handleTime()
  20. let token = getQueryVariable('token')
  21. //顶部统计信息
  22. get('/mbwb/api/v1/erpscs/productionScreen/getTopStatistics',{},{
  23. Authorization:token +'='
  24. }).then(res => {
  25. this.planCompletionRate = res.info.planCompletionRate
  26. this.productionGoodProductRate = res.info.productionGoodProductRate
  27. })
  28. //领料库存情况
  29. get('/mbwb/api/v1/erpscs/productionScreen/getNeedMaterialStock',{},{
  30. Authorization:token +'='
  31. }).then(res => {
  32. this.comprehensive = res.infos
  33. })
  34. //生产排产情况
  35. get('/mbwb/api/v1/erpscs/productionScreen/getProductionScheduleInfo',{},{
  36. Authorization:token +'='
  37. }).then(res => {
  38. this.dataList = res.infos
  39. this.dataCount = res.totalCount
  40. })
  41. //获取报工情况
  42. get('/mbwb/api/v1/erpscs/productionScreen/getWorkReportInfo',{},{
  43. Authorization:token +'='
  44. }).then(res => {
  45. })
  46. }, 0)
  47. },
  48. methods: {
  49. handleTime() {
  50. setInterval(() => {
  51. this.time = dayjs().format('YYYY-MM-DD HH:mm:ss')
  52. }, 1000)
  53. },
  54. },
  55. })