|  |  |  | 
|---|
|  |  |  | import util from "@/libs/util.js"; | 
|---|
|  |  |  | import excel from "@/libs/excel.js"; | 
|---|
|  |  |  | import {exportColumn} from "./exportColumn"; | 
|---|
|  |  |  | import {getSessionStore} from "../../../libs/storage"; | 
|---|
|  |  |  | export default { | 
|---|
|  |  |  | name: "car-manage", | 
|---|
|  |  |  | data() { | 
|---|
|  |  |  | 
|---|
|  |  |  | key: "carNo", | 
|---|
|  |  |  | width: 120, | 
|---|
|  |  |  | render: (h, params) => { | 
|---|
|  |  |  | return h("div",params.row.car.carNo); | 
|---|
|  |  |  | return h("div",params.row.car.carNo=="undefined" ? '':params.row.car.carNo); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | { | 
|---|
|  |  |  | title: "加油卡号", | 
|---|
|  |  |  | key: "addOilCode", | 
|---|
|  |  |  | width: 140, | 
|---|
|  |  |  | sortable: true, | 
|---|
|  |  |  | render: (h, params) => { | 
|---|
|  |  |  | return h("div",params.row.car.addOilCode); | 
|---|
|  |  |  | return h("div",params.row.car.addOilCode=="undefined" ? '':params.row.car.addOilCode); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | { | 
|---|
|  |  |  | 
|---|
|  |  |  | return h("div",params.row.endMileage-params.row.beginMileage); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | // { | 
|---|
|  |  |  | //   title: "送货户数", | 
|---|
|  |  |  | //   // key: "oilWear", | 
|---|
|  |  |  | //   width: 130, | 
|---|
|  |  |  | // }, | 
|---|
|  |  |  | // { | 
|---|
|  |  |  | //   title: "送货量(件)", | 
|---|
|  |  |  | //   // key: "oilWear", | 
|---|
|  |  |  | //   width: 130, | 
|---|
|  |  |  | //   render: (h, params) => { | 
|---|
|  |  |  | //     return h("div",0); | 
|---|
|  |  |  | //   } | 
|---|
|  |  |  | // }, | 
|---|
|  |  |  | { | 
|---|
|  |  |  | title: "月油耗(升)", | 
|---|
|  |  |  | key: "oilWear", | 
|---|
|  |  |  | width: 130, | 
|---|
|  |  |  | render: (h, params) => { | 
|---|
|  |  |  | return h("div",0); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | { | 
|---|
|  |  |  | title: "月燃油费(元)", | 
|---|
|  |  |  | key: "money", | 
|---|
|  |  |  | width: 140, | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | { | 
|---|
|  |  |  | title: "百公里油耗", | 
|---|
|  |  |  | 
|---|
|  |  |  | render: (h, params) => { | 
|---|
|  |  |  | return h("div",params.row.car.nickName); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | { | 
|---|
|  |  |  | title: "月加油金额(元)", | 
|---|
|  |  |  | key: "money", | 
|---|
|  |  |  | width: 140, | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | { | 
|---|
|  |  |  | title: "操作", | 
|---|
|  |  |  | key: "action", | 
|---|
|  |  |  | align: "center", | 
|---|
|  |  |  | width: 120, | 
|---|
|  |  |  | render: (h, params) => { | 
|---|
|  |  |  | return h("div", [ | 
|---|
|  |  |  | h( | 
|---|
|  |  |  | "a", | 
|---|
|  |  |  | { | 
|---|
|  |  |  | on: { | 
|---|
|  |  |  | click: () => { | 
|---|
|  |  |  | this.remove(params.row); | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | "删除" | 
|---|
|  |  |  | ), | 
|---|
|  |  |  | ]); | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | ], | 
|---|
|  |  |  | data: [], | 
|---|
|  |  |  | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | getDataList() { | 
|---|
|  |  |  | this.loading = true; | 
|---|
|  |  |  | if (this.value[0]!="" && this.value[1]!=""){ | 
|---|
|  |  |  | if (this.value.length >0){ | 
|---|
|  |  |  | this.searchForm.beginTime = this.selectDate(this.value[0]); | 
|---|
|  |  |  | this.searchForm.endTime = this.selectDate(this.value[1]); | 
|---|
|  |  |  | }else{ | 
|---|
|  |  |  | var date = new Date(); | 
|---|
|  |  |  | this.searchForm.endTime = this.selectDate(date); | 
|---|
|  |  |  | this.value[1] = this.searchForm.endTime; | 
|---|
|  |  |  | date.setDate(1); | 
|---|
|  |  |  | this.value[0] = date; | 
|---|
|  |  |  | this.searchForm.beginTime = this.selectDate(date); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | // else{ | 
|---|
|  |  |  | //   var date = new Date(); | 
|---|
|  |  |  | //   this.searchForm.endTime = this.selectDate(date); | 
|---|
|  |  |  | //   this.value[1] = this.searchForm.endTime; | 
|---|
|  |  |  | //   date.setDate(1); | 
|---|
|  |  |  | //   this.value[0] = date; | 
|---|
|  |  |  | //   this.searchForm.beginTime = this.selectDate(date); | 
|---|
|  |  |  | // } | 
|---|
|  |  |  | getCar(this.searchForm).then((res) => { | 
|---|
|  |  |  | this.loading = false; | 
|---|
|  |  |  | if (res.success) { | 
|---|
|  |  |  | this.data = res.result; | 
|---|
|  |  |  | this.total = res.result.length; | 
|---|
|  |  |  | this.total = res.result[0].total; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | 
|---|
|  |  |  | title.push(e.title); | 
|---|
|  |  |  | key.push(e.key); | 
|---|
|  |  |  | }); | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | console.log(this.exportData) | 
|---|
|  |  |  | const params = { | 
|---|
|  |  |  | 
|---|
|  |  |  | this.init(); | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | }; | 
|---|
|  |  |  | </script> | 
|---|
|  |  |  | </script> | 
|---|