|
@@ -181,13 +181,19 @@ class TransportService extends CrudService {
|
|
|
const countArr = this.getCount(data, eletter);
|
|
|
arr.push(...countArr);
|
|
|
|
|
|
-
|
|
|
- const excelData = this.getExcelData(data);
|
|
|
+
|
|
|
+ let excelData = this.getExcelData(data);
|
|
|
+ excelData = excelData.map(i => {
|
|
|
+ const obj = { content: i };
|
|
|
+ return obj;
|
|
|
+ });
|
|
|
+ arr.push(...excelData);
|
|
|
+ console.log(arr);
|
|
|
|
|
|
- const text = { vertAlign: 'superscript', size: 16 };
|
|
|
+ const text = { vertAlign: 'superscript', size: 18 };
|
|
|
const alignment = { vertical: 'middle', horizontal: 'center' };
|
|
|
arr = arr.map(i => {
|
|
|
- i.alignment = alignment;
|
|
|
+ i.alignment = i.alignment = { ...alignment, ..._.get(i, alignment, {}) };
|
|
|
i.font = { ...text, ..._.get(i, 'font', {}) };
|
|
|
return i;
|
|
|
});
|
|
@@ -203,7 +209,51 @@ class TransportService extends CrudService {
|
|
|
const outBill = _.get(data, 'outBill', []);
|
|
|
const daily = _.get(data, 'daily', []);
|
|
|
const max = _.max([ inBill.length, outBill.length, daily.length ]);
|
|
|
-
|
|
|
+ const lineSeven = {
|
|
|
+ A7: '订单号',
|
|
|
+ B7: '运输单号',
|
|
|
+ C7: '货物',
|
|
|
+ D7: '收入金额',
|
|
|
+ E7: '运输单号',
|
|
|
+ F7: '支出项目',
|
|
|
+ G7: '支出金额',
|
|
|
+ H7: '运输支出备注',
|
|
|
+ I7: '维护项目',
|
|
|
+ J7: '维护金额',
|
|
|
+ K7: '维护日期',
|
|
|
+ L7: '维护备注',
|
|
|
+ };
|
|
|
+
|
|
|
+ const num = 8;
|
|
|
+ const arr = [];
|
|
|
+ arr.push(lineSeven);
|
|
|
+
|
|
|
+ for (let i = 1; i <= max; i++) {
|
|
|
+ const lineInBill = _.get(inBill, i - 1, {});
|
|
|
+ const lineOutBill = _.get(outBill, i - 1, {});
|
|
|
+ const lineDaily = _.get(daily, i - 1, {});
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ const obj = {};
|
|
|
+ obj[`A${num - 1 + i}`] = _.get(lineInBill, 'order_no');
|
|
|
+ obj[`B${num - 1 + i}`] = _.get(lineInBill, 'no');
|
|
|
+ obj[`C${num - 1 + i}`] = _.get(lineInBill, 'name');
|
|
|
+ obj[`D${num - 1 + i}`] = _.get(lineInBill, 'sh_ss');
|
|
|
+
|
|
|
+ obj[`E${num - 1 + i}`] = _.get(lineOutBill, 'no');
|
|
|
+ obj[`F${num - 1 + i}`] = _.get(lineOutBill, 'item');
|
|
|
+ obj[`G${num - 1 + i}`] = _.get(lineOutBill, 'money');
|
|
|
+ obj[`H${num - 1 + i}`] = _.get(lineOutBill, 'remark');
|
|
|
+
|
|
|
+ obj[`I${num - 1 + i}`] = _.get(lineDaily, 'item');
|
|
|
+ obj[`J${num - 1 + i}`] = _.get(lineDaily, 'money');
|
|
|
+ obj[`K${num - 1 + i}`] = _.get(lineDaily, 'date');
|
|
|
+ obj[`L${num - 1 + i}`] = _.get(lineDaily, 'remark');
|
|
|
+ arr.push(obj);
|
|
|
+ }
|
|
|
+ return arr;
|
|
|
}
|
|
|
|
|
|
|
|
@@ -247,7 +297,7 @@ class TransportService extends CrudService {
|
|
|
|
|
|
if (count.dm || count.dm === 0) {
|
|
|
const countDaily = {
|
|
|
- content: `日常维修支出${count.om || 0}`,
|
|
|
+ content: `日常维护支出${count.om || 0}`,
|
|
|
scell: 'I6',
|
|
|
ecell: 'L6',
|
|
|
};
|
|
@@ -266,7 +316,9 @@ class TransportService extends CrudService {
|
|
|
content: '核算单',
|
|
|
scell: 'A1',
|
|
|
ecell: `${letter}4`,
|
|
|
- font: { size: 20, bold: true },
|
|
|
+ font: { size: 22, bold: true },
|
|
|
+ alignment: { vertical: 'middle' },
|
|
|
+
|
|
|
};
|
|
|
return headObj;
|
|
|
}
|