123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- var vm = new Vue({
- el: '#app',
- data: {
- lineDtos: [],
- machineDtos: []
- },
- mounted() {
- this.init()
- this.initDatepicker()
- },
- methods: {
- init() {
- },
- initDatepicker() {
- $("#date1").datepicker({
- format: 'yyyy-mm-dd',
- language: "zh-CN",
- autoclose: true,
- todayBtn: "linked"
- }).on('keydown', function (e) {
- return false;
- })
- $("#date2").datepicker({
- format: 'yyyy-mm-dd',
- language: "zh-CN",
- autoclose: true,
- todayBtn: "linked"
- }).on('keydown', function (e) {
- return false;
- })
- },
- getEnergyConsumptionReport() {
- let _this = this
- axios
- .get('/EnergyConsumptionReport/GetEnergyConsumptionReport',
- {
- params: {
- startDate: $("#date1").val(),
- endDate: $("#date2").val()
- }
- })
- .then(function (response) {
- _this.lineDtos = response.data.lineDtos;
- })
- .catch(function (error) {
- console.log(error)
- });
- }
- }
- })
|