energyConsumptionReport.js 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. var vm = new Vue({
  2. el: '#app',
  3. data: {
  4. lineDtos: [],
  5. machineDtos: []
  6. },
  7. mounted() {
  8. this.init()
  9. this.initDatepicker()
  10. },
  11. methods: {
  12. init() {
  13. },
  14. initDatepicker() {
  15. $("#date1").datepicker({
  16. format: 'yyyy-mm-dd',
  17. language: "zh-CN",
  18. autoclose: true,
  19. todayBtn: "linked"
  20. }).on('keydown', function (e) {
  21. return false;
  22. })
  23. $("#date2").datepicker({
  24. format: 'yyyy-mm-dd',
  25. language: "zh-CN",
  26. autoclose: true,
  27. todayBtn: "linked"
  28. }).on('keydown', function (e) {
  29. return false;
  30. })
  31. },
  32. getEnergyConsumptionReport() {
  33. let _this = this
  34. axios
  35. .get('/EnergyConsumptionReport/GetEnergyConsumptionReport',
  36. {
  37. params: {
  38. startDate: $("#date1").val(),
  39. endDate: $("#date2").val()
  40. }
  41. })
  42. .then(function (response) {
  43. _this.lineDtos = response.data.lineDtos;
  44. })
  45. .catch(function (error) {
  46. console.log(error)
  47. });
  48. }
  49. }
  50. })