|
@@ -167,7 +167,7 @@ class TransportService extends CrudService {
|
|
|
let data = {};
|
|
|
if (type === 'car') data = await this.carCalculate(query);
|
|
|
else data = await this.calculate(query);
|
|
|
- const res = await this.export({ data, ...query });
|
|
|
+ const res = await this.export({ data, ...query, type });
|
|
|
return res;
|
|
|
}
|
|
|
|
|
@@ -175,7 +175,7 @@ class TransportService extends CrudService {
|
|
|
* 核算整理数据导出
|
|
|
* @param {Object} Object { data } data:数据
|
|
|
*/
|
|
|
- async export({ data, car_no }) {
|
|
|
+ async export({ data, car_no, type }) {
|
|
|
|
|
|
|
|
|
const car = await this.ctx.model.Car.findById(car_no);
|
|
@@ -193,7 +193,7 @@ class TransportService extends CrudService {
|
|
|
arr.push(...countArr);
|
|
|
|
|
|
|
|
|
- let excelData = this.getExcelData(data);
|
|
|
+ let excelData = this.getExcelData(data, type);
|
|
|
excelData = excelData.map(i => {
|
|
|
const obj = { content: i };
|
|
|
return obj;
|
|
@@ -214,8 +214,9 @@ class TransportService extends CrudService {
|
|
|
|
|
|
* 整理收入/支出数据
|
|
|
* @param {Object} data 核算结果集
|
|
|
+ * @param {String} type 类型,car/once once没有I-L
|
|
|
*/
|
|
|
- getExcelData(data) {
|
|
|
+ getExcelData(data, type) {
|
|
|
const inBill = _.get(data, 'inBill', []);
|
|
|
const outBill = _.get(data, 'outBill', []);
|
|
|
const daily = _.get(data, 'daily', []);
|
|
@@ -229,11 +230,13 @@ class TransportService extends CrudService {
|
|
|
F7: '支出项目',
|
|
|
G7: '支出金额',
|
|
|
H7: '运输支出备注',
|
|
|
- I7: '维护项目',
|
|
|
- J7: '维护金额',
|
|
|
- K7: '维护日期',
|
|
|
- L7: '维护备注',
|
|
|
};
|
|
|
+ if (type === 'car') {
|
|
|
+ lineSeven.I7 = '维护项目';
|
|
|
+ lineSeven.J7 = '维护金额';
|
|
|
+ lineSeven.K7 = '维护日期';
|
|
|
+ lineSeven.L7 = '维护备注';
|
|
|
+ }
|
|
|
|
|
|
const num = 8;
|
|
|
const arr = [];
|