|
@@ -49,6 +49,30 @@ const posSpreadSetting = {
|
|
readOnly: true,
|
|
readOnly: true,
|
|
selectedBackColor: '#fffacd',
|
|
selectedBackColor: '#fffacd',
|
|
};
|
|
};
|
|
|
|
+const exportBillsSpreadSetting = {
|
|
|
|
+ baseCols: [
|
|
|
|
+ {title: '项目节编号', colSpan: '1', rowSpan: '2', field: 'code', hAlign: 0, width: 150, formatter: '@', cellType: 'tree'},
|
|
|
|
+ {title: '清单编号', colSpan: '1', rowSpan: '2', field: 'b_code', hAlign: 0, width: 80, formatter: '@'},
|
|
|
|
+ {title: '名称', colSpan: '1', rowSpan: '2', field: 'name', hAlign: 0, width: 230, formatter: '@'},
|
|
|
|
+ {title: '单位', colSpan: '1', rowSpan: '2', field: 'unit', hAlign: 1, width: 50, formatter: '@', cellType: 'unit'},
|
|
|
|
+ {title: '单价', colSpan: '1', rowSpan: '2', field: 'unit_price', hAlign: 2, width: 60, type: 'Number'},
|
|
|
|
+ {title: '台账|数量', colSpan: '2|1', rowSpan: '1|1', field: 'quantity', hAlign: 2, width: 60, type: 'Number', },
|
|
|
|
+ {title: '|金额', colSpan: '|1', rowSpan: '|1', field: 'total_price', hAlign: 2, width: 60, type: 'Number', },
|
|
|
|
+ ],
|
|
|
|
+ extraCols: [
|
|
|
|
+ {title: '%s|数量', colSpan: '2|1', rowSpan: '1|1', field: '{%s}_qty{%d}', hAlign: 2, width: 60, type: 'Number', },
|
|
|
|
+ {title: '|金额', colSpan: '|1', rowSpan: '|1', field: '{%s}_tp{%d}', hAlign: 2, width: 60, type: 'Number', },
|
|
|
|
+ ],
|
|
|
|
+ endCols: [],
|
|
|
|
+ emptyRows: 3,
|
|
|
|
+ headRows: 2,
|
|
|
|
+ headRowHeight: [25, 25],
|
|
|
|
+ headerFont: '12px 微软雅黑',
|
|
|
|
+ font: '12px 微软雅黑',
|
|
|
|
+ defaultRowHeight: 21,
|
|
|
|
+ readOnly: true,
|
|
|
|
+ selectedBackColor: '#fffacd',
|
|
|
|
+};
|
|
|
|
|
|
const gclSpreadSetting = {
|
|
const gclSpreadSetting = {
|
|
baseCols: [
|
|
baseCols: [
|
|
@@ -97,6 +121,39 @@ const leafXmjSpreadSetting = {
|
|
font: '12px 微软雅黑',
|
|
font: '12px 微软雅黑',
|
|
readOnly: true,
|
|
readOnly: true,
|
|
};
|
|
};
|
|
|
|
+const exportGclSpreadSetting = {
|
|
|
|
+ baseCols: [
|
|
|
|
+ {title: '清单编号', colSpan: '1', rowSpan: '2', field: 'b_code', hAlign: 0, width: 80, formatter: '@'},
|
|
|
|
+ {title: '名称', colSpan: '1', rowSpan: '2', field: 'name', hAlign: 0, width: 230, formatter: '@'},
|
|
|
|
+ {title: '项目节编号', colSpan: '1', rowSpan: '2', field: 'code', hAlign: 0, width: 100, formatter: '@'},
|
|
|
|
+ {title: '单位工程', colSpan: '1', rowSpan: '2', field: 'dwgc', hAlign: 0, width: 80, formatter: '@'},
|
|
|
|
+ {title: '分部工程', colSpan: '1', rowSpan: '2', field: 'fbgc', hAlign: 0, width: 80, formatter: '@'},
|
|
|
|
+ {title: '分项工程', colSpan: '1', rowSpan: '2', field: 'fxgc', hAlign: 0, width: 80, formatter: '@'},
|
|
|
|
+ {title: '细目', colSpan: '1', rowSpan: '2', field: 'jldy', hAlign: 0, width: 80, formatter: '@'},
|
|
|
|
+ {title: '计量单元', colSpan: '1', rowSpan: '2', field: 'bwmx', hAlign: 0, width: 80, formatter: '@'},
|
|
|
|
+ {title: '单位', colSpan: '1', rowSpan: '2', field: 'unit', hAlign: 1, width: 60, formatter: '@', cellType: 'unit'},
|
|
|
|
+ {title: '单价', colSpan: '1', rowSpan: '2', field: 'unit_price', hAlign: 2, width: 60, type: 'Number'},
|
|
|
|
+ {title: '签约清单|数量', colSpan: '2|1', rowSpan: '1|1', field: 'deal_bills_qty', hAlign: 2, width: 60, type: 'Number'},
|
|
|
|
+ {title: '|金额', colSpan: '|1', rowSpan: '|1', field: 'deal_bills_tp', hAlign: 2, width: 60, type: 'Number'},
|
|
|
|
+ {title: '台账|数量', colSpan: '2|1', rowSpan: '1|1', field: 'quantity', hAlign: 2, width: 60, type: 'Number'},
|
|
|
|
+ {title: '|金额', colSpan: '|1', rowSpan: '|1', field: 'total_price', hAlign: 2, width: 60, type: 'Number'},
|
|
|
|
+ ],
|
|
|
|
+ extraCols: [
|
|
|
|
+ {title: '%s|数量', colSpan: '2|1', rowSpan: '1|1', field: '{%s}_qty{%d}', hAlign: 2, width: 60, type: 'Number', },
|
|
|
|
+ {title: '|金额', colSpan: '|1', rowSpan: '|1', field: '{%s}_tp{%d}', hAlign: 2, width: 60, type: 'Number', },
|
|
|
|
+ ],
|
|
|
|
+ endCols: [
|
|
|
|
+ {title: '图册号', colSpan: '1', rowSpan: '2', field: 'drawing_code', hAlign: 0, width: 80, formatter: '@'},
|
|
|
|
+ ],
|
|
|
|
+ emptyRows: 0,
|
|
|
|
+ headRows: 2,
|
|
|
|
+ headRowHeight: [25, 25],
|
|
|
|
+ headColWidth: [30],
|
|
|
|
+ defaultRowHeight: 21,
|
|
|
|
+ headerFont: '12px 微软雅黑',
|
|
|
|
+ font: '12px 微软雅黑',
|
|
|
|
+ readOnly: true,
|
|
|
|
+};
|
|
|
|
|
|
function initSpreadSettingWithRoles(compareRoles) {
|
|
function initSpreadSettingWithRoles(compareRoles) {
|
|
function setSpreadSettingCols(setting, fieldSufs, Roles) {
|
|
function setSpreadSettingCols(setting, fieldSufs, Roles) {
|
|
@@ -118,6 +175,11 @@ function initSpreadSettingWithRoles(compareRoles) {
|
|
for (const index in fieldSufs) {
|
|
for (const index in fieldSufs) {
|
|
addExtraCols(fieldSufs[index], Roles[index]);
|
|
addExtraCols(fieldSufs[index], Roles[index]);
|
|
}
|
|
}
|
|
|
|
+ if (setting.endCols) {
|
|
|
|
+ for (const col of setting.endCols) {
|
|
|
|
+ setting.cols.push(col);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
const fieldSufs = [], roles = [], trs = $('tr[stage-id]');
|
|
const fieldSufs = [], roles = [], trs = $('tr[stage-id]');
|
|
for (let r of compareRoles) {
|
|
for (let r of compareRoles) {
|
|
@@ -131,8 +193,10 @@ function initSpreadSettingWithRoles(compareRoles) {
|
|
}
|
|
}
|
|
setSpreadSettingCols(billsSpreadSetting, fieldSufs, roles);
|
|
setSpreadSettingCols(billsSpreadSetting, fieldSufs, roles);
|
|
setSpreadSettingCols(posSpreadSetting, fieldSufs, roles);
|
|
setSpreadSettingCols(posSpreadSetting, fieldSufs, roles);
|
|
|
|
+ setSpreadSettingCols(exportBillsSpreadSetting, fieldSufs, roles);
|
|
setSpreadSettingCols(gclSpreadSetting, fieldSufs, roles);
|
|
setSpreadSettingCols(gclSpreadSetting, fieldSufs, roles);
|
|
setSpreadSettingCols(leafXmjSpreadSetting, fieldSufs, roles);
|
|
setSpreadSettingCols(leafXmjSpreadSetting, fieldSufs, roles);
|
|
|
|
+ setSpreadSettingCols(exportGclSpreadSetting, fieldSufs, roles);
|
|
}
|
|
}
|
|
function calculateStageLedgerData(datas) {
|
|
function calculateStageLedgerData(datas) {
|
|
for (const d of datas) {
|
|
for (const d of datas) {
|
|
@@ -379,19 +443,39 @@ $(document).ready(() => {
|
|
})('a[name=showLevel]', billsSheet);
|
|
})('a[name=showLevel]', billsSheet);
|
|
|
|
|
|
$('#exportExcel').click(function () {
|
|
$('#exportExcel').click(function () {
|
|
- const data = [];
|
|
|
|
- if (!billsSheet.zh_tree) return;
|
|
|
|
- for (const node of billsSheet.zh_tree.nodes) {
|
|
|
|
- data.push(node);
|
|
|
|
- const posRange = cPos.getLedgerPos(node.id);
|
|
|
|
- if (posRange && posRange.length > 0) {
|
|
|
|
- for (const pr of posRange) {
|
|
|
|
- data.push(pr);
|
|
|
|
|
|
+ const exportLedger = function () {
|
|
|
|
+ const data = [];
|
|
|
|
+ if (!billsSheet.zh_tree) return;
|
|
|
|
+ for (const node of billsSheet.zh_tree.nodes) {
|
|
|
|
+ data.push(node);
|
|
|
|
+ const posRange = cPos.getLedgerPos(node.id);
|
|
|
|
+ if (posRange && posRange.length > 0) {
|
|
|
|
+ for (const pr of posRange) {
|
|
|
|
+ data.push(pr);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ SpreadExcelObj.exportSimpleXlsxSheet(exportBillsSpreadSetting, data, $('.sidebar-title').attr('data-original-title') + "-多期比较.xlsx");
|
|
|
|
+ };
|
|
|
|
+ const exportGcl = function () {
|
|
|
|
+ const data = [];
|
|
|
|
+ if (!gclSheet.zh_data) return;
|
|
|
|
+ for (const node of gclSheet.zh_data) {
|
|
|
|
+ data.push(node);
|
|
|
|
+ for (const leafXmj of node.leafXmjs) {
|
|
|
|
+ data.push(leafXmj);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- }
|
|
|
|
|
|
|
|
- SpreadExcelObj.exportSimpleXlsxSheet(billsSpreadSetting, data, $('.sidebar-title').attr('data-original-title') + "-多期比较.xlsx");
|
|
|
|
|
|
+ SpreadExcelObj.exportSimpleXlsxSheet(exportGclSpreadSetting, data, $('.sidebar-title').attr('data-original-title') + "-多期比较.xlsx");
|
|
|
|
+ };
|
|
|
|
+ const cur = $('.active[name=compareType]').attr('href');
|
|
|
|
+ if (cur.indexOf('gcl') >= 0) {
|
|
|
|
+ exportGcl();
|
|
|
|
+ } else {
|
|
|
|
+ exportLedger();
|
|
|
|
+ }
|
|
});
|
|
});
|
|
|
|
|
|
$('[name=compare-data]').click(function () {
|
|
$('[name=compare-data]').click(function () {
|