|
@@ -38,13 +38,13 @@ const billsSpreadSetting = {
|
|
|
const posSpreadSetting = {
|
|
|
baseCols: [
|
|
|
{title: '名称', colSpan: '1', rowSpan: '1', field: 'name', hAlign: 0, width: 230, formatter: '@'},
|
|
|
- {title: '台账数量', colSpan: '1', rowSpan: '1', field: 'quantity', hAlign: 2, width: 60, type: 'Number'},
|
|
|
+ {title: '台账数量', colSpan: '1', rowSpan: '1', field: 'quantity', hAlign: 2, width: 80, type: 'Number'},
|
|
|
],
|
|
|
extraCols: [
|
|
|
- {title: '%s数量', colSpan: '1', rowSpan: '1', field: '{%s}_qty{%d}', hAlign: 2, width: 60, type: 'Number'},
|
|
|
+ {title: '%s\n数量', colSpan: '1', rowSpan: '1', field: '{%s}_qty{%d}', hAlign: 2, width: 80, type: 'Number'},
|
|
|
],
|
|
|
specExtraCols: [
|
|
|
- {title: '合计数量', colSpan: '1', rowSpan: '1', field: 'sum_{%s}_qty', hAlign: 2, width: 60, type: 'Number', },
|
|
|
+ {title: '合计数量', colSpan: '1', rowSpan: '1', field: 'sum_{%s}_qty', hAlign: 2, width: 80, type: 'Number', },
|
|
|
],
|
|
|
emptyRows: 3,
|
|
|
headRows: 1,
|
|
@@ -122,13 +122,13 @@ const leafXmjSpreadSetting = {
|
|
|
{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: 'drawing_code', hAlign: 0, width: 80, formatter: '@'},
|
|
|
- {title: '台账数量', colSpan: '1', rowSpan: '2', field: 'quantity', hAlign: 2, width: 60, type: 'Number'},
|
|
|
+ {title: '台账数量', colSpan: '1', rowSpan: '2', field: 'quantity', hAlign: 2, width: 80, type: 'Number'},
|
|
|
],
|
|
|
extraCols: [
|
|
|
- {title: '%s数量', colSpan: '1', rowSpan: '2', field: '{%s}_qty{%d}', hAlign: 2, width: 60},
|
|
|
+ {title: '%s\n数量', colSpan: '1', rowSpan: '2', field: '{%s}_qty{%d}', hAlign: 2, width: 80},
|
|
|
],
|
|
|
specExtraCols: [
|
|
|
- {title: '合计数量', colSpan: '1', rowSpan: '2', field: 'sum_{%s}_qty', hAlign: 2, width: 60, type: 'Number', },
|
|
|
+ {title: '合计数量', colSpan: '1', rowSpan: '2', field: 'sum_{%s}_qty', hAlign: 2, width: 80, type: 'Number', },
|
|
|
],
|
|
|
emptyRows: 0,
|
|
|
headRows: 2,
|
|
@@ -177,6 +177,29 @@ const exportGclSpreadSetting = {
|
|
|
readOnly: true,
|
|
|
};
|
|
|
|
|
|
+const chapterSpreadSetting = {
|
|
|
+ baseCols: [
|
|
|
+ {title: '章节', colSpan: '1', rowSpan: '1', field: 'code', hAlign: 0, width: 80, formatter: '@'},
|
|
|
+ {title: '名称', colSpan: '1', rowSpan: '1', field: 'name', hAlign: 0, width: 230, formatter: '@'},
|
|
|
+ {title: '签约金额', colSpan: '1', rowSpan: '1', field: 'deal_bills_tp', hAlign: 2, width: 80, type: 'Number'},
|
|
|
+ {title: '台账金额', colSpan: '1', rowSpan: '1', field: 'total_price', hAlign: 2, width: 80, type: 'Number'},
|
|
|
+ ],
|
|
|
+ extraCols: [
|
|
|
+ {title: '%s\n金额', colSpan: '1', rowSpan: '1', field: '{%s}_tp{%d}', hAlign: 2, width: 80, type: 'Number', },
|
|
|
+ ],
|
|
|
+ specExtraCols: [
|
|
|
+ {title: '合计金额', colSpan: '1', rowSpan: '1', field: 'sum_{%s}_tp', hAlign: 2, width: 80, type: 'Number', },
|
|
|
+ ],
|
|
|
+ emptyRows: 0,
|
|
|
+ headRows: 1,
|
|
|
+ headRowHeight: [38],
|
|
|
+ headColWidth: [30],
|
|
|
+ defaultRowHeight: 21,
|
|
|
+ headerFont: '12px 微软雅黑',
|
|
|
+ font: '12px 微软雅黑',
|
|
|
+ readOnly: true,
|
|
|
+};
|
|
|
+
|
|
|
function initSpreadSettingWithRoles(compareRoles) {
|
|
|
function setSpreadSettingCols(setting, fieldSufs, Roles) {
|
|
|
function addExtraCols(fieldSuf, Role) {
|
|
@@ -227,6 +250,7 @@ function initSpreadSettingWithRoles(compareRoles) {
|
|
|
setSpreadSettingCols(gclSpreadSetting, fieldSufs, roles);
|
|
|
setSpreadSettingCols(leafXmjSpreadSetting, fieldSufs, roles);
|
|
|
setSpreadSettingCols(exportGclSpreadSetting, fieldSufs, roles);
|
|
|
+ setSpreadSettingCols(chapterSpreadSetting, fieldSufs, roles);
|
|
|
}
|
|
|
function calculateStageLedgerData(datas) {
|
|
|
for (const d of datas) {
|
|
@@ -266,6 +290,12 @@ $(document).ready(() => {
|
|
|
if (thousandth) sjsSettingObj.setTpThousandthFormat(leafXmjSpreadSetting);
|
|
|
SpreadJsObj.initSheet(leafXmjSheet, leafXmjSpreadSetting);
|
|
|
|
|
|
+ const chapterSpread = SpreadJsObj.createNewSpread($('#chapter-spread')[0]);
|
|
|
+ const chapterSheet = chapterSpread.getActiveSheet();
|
|
|
+ sjsSettingObj.setGridSelectStyle(gclSpreadSetting, sjsSettingObj.FxTreeStyle.jz);
|
|
|
+ if (thousandth) sjsSettingObj.setTpThousandthFormat(chapterSpreadSetting);
|
|
|
+ SpreadJsObj.initSheet(chapterSheet, chapterSpreadSetting);
|
|
|
+
|
|
|
$.subMenu({
|
|
|
menu: '#sub-menu', miniMenu: '#sub-mini-menu', miniMenuList: '#mini-menu-list',
|
|
|
toMenu: '#to-menu', toMiniMenu: '#to-mini-menu',
|
|
@@ -345,6 +375,8 @@ $(document).ready(() => {
|
|
|
gclGatherData = gclGatherModel.gatherGclData();
|
|
|
SpreadJsObj.loadSheetData(gclSheet, SpreadJsObj.DataType.Data, gclGatherData);
|
|
|
loadLeafXmjData(0);
|
|
|
+ const chapterData = gclGatherModel.gatherChapterData(chapter, result.spec, ['deal_tp', 'total_price', 'sum_contract_tp', 'sum_qc_tp', 'sum_gather_tp']);
|
|
|
+ SpreadJsObj.loadSheetData(chapterSheet, SpreadJsObj.DataType.Data, chapterData);
|
|
|
}, null, true);
|
|
|
function loadPosData(iRow) {
|
|
|
const node = iRow ? billsSheet.zh_tree.nodes[iRow] : SpreadJsObj.getSelectObject(billsSheet);
|
|
@@ -394,12 +426,14 @@ $(document).ready(() => {
|
|
|
});
|
|
|
const compareStages = [];
|
|
|
$('#select-qi-ok').click(function () {
|
|
|
- function refreshView () {
|
|
|
+ function refreshView (data) {
|
|
|
+ const gatherField = ['deal_tp', 'total_price', 'sum_contract_tp', 'sum_qc_tp', 'sum_gather_tp'];
|
|
|
compareStages.length = 0;
|
|
|
for (let order = 0, iLength = trs.length; order < iLength; order++) {
|
|
|
const tr = trs[order];
|
|
|
if ($('input', tr)[0].checked) {
|
|
|
compareStages.push(order + 1);
|
|
|
+ gatherField.push(`contract_tp${order}`, `qc_tp${order}`, `gather_tp${order}`);
|
|
|
}
|
|
|
}
|
|
|
// setLocalCache(cCacheKey, compareStages.join(','));
|
|
@@ -418,6 +452,10 @@ $(document).ready(() => {
|
|
|
gclGatherData = gclGatherModel.gatherGclData();
|
|
|
SpreadJsObj.loadSheetData(gclSheet, SpreadJsObj.DataType.Data, gclGatherData);
|
|
|
loadLeafXmjData(0);
|
|
|
+
|
|
|
+ const chapterData = gclGatherModel.gatherChapterData(chapter, data.spec, gatherField);
|
|
|
+ SpreadJsObj.reLoadSheetHeader(chapterSheet);
|
|
|
+ SpreadJsObj.loadSheetData(chapterSheet, SpreadJsObj.DataType.Data, chapterData);
|
|
|
}
|
|
|
let loadData = [], showData = [], trs = $('tr[stage-id]');
|
|
|
for (let order = 0, iLength = trs.length; order < iLength; order++) {
|
|
@@ -440,7 +478,7 @@ $(document).ready(() => {
|
|
|
cTree.reCalcSumData(['contract_qty', 'contract_tp', 'qc_qty', 'qc_tp', 'gather_qty', 'gather_tp'], showData);
|
|
|
treeCalc.calculateAll(cTree);
|
|
|
cPos.reCalcSumData(['contract_qty', 'qc_qty', 'gather_qty'], showData);
|
|
|
- refreshView();
|
|
|
+ refreshView(result);
|
|
|
$('#select-qi').modal('hide');
|
|
|
}, null, true);
|
|
|
} else {
|
|
@@ -505,9 +543,14 @@ $(document).ready(() => {
|
|
|
|
|
|
SpreadExcelObj.exportSimpleXlsxSheet(exportGclSpreadSetting, data, $('.sidebar-title').attr('data-original-title') + "-多期比较.xlsx");
|
|
|
};
|
|
|
+ const exportChapter = function () {
|
|
|
+ SpreadExcelObj.exportSimpleXlsxSheet(chapterSpreadSetting, chapterSheet.zh_data, $('.sidebar-title').attr('data-original-title') + "-多期比较.xlsx");
|
|
|
+ };
|
|
|
const cur = $('.active[name=compareType]').attr('href');
|
|
|
if (cur.indexOf('gcl') >= 0) {
|
|
|
exportGcl();
|
|
|
+ } else if (cur.indexOf('chapter') >= 0) {
|
|
|
+ exportChapter();
|
|
|
} else {
|
|
|
exportLedger();
|
|
|
}
|
|
@@ -518,12 +561,15 @@ $(document).ready(() => {
|
|
|
SpreadJsObj.reLoadSheetHeader(billsSheet);
|
|
|
SpreadJsObj.reloadColData(billsSheet, billsSpreadSetting.baseCols.length, compareStages.length * billsSpreadSetting.extraCols.length + billsSpreadSetting.specExtraCols.length);
|
|
|
SpreadJsObj.reLoadSheetHeader(posSheet);
|
|
|
- SpreadJsObj.reloadColData(posSheet, posSpreadSetting.baseCols.length, compareStages.length * posSpreadSetting.extraCols.length + billsSpreadSetting.specExtraCols.length);
|
|
|
+ SpreadJsObj.reloadColData(posSheet, posSpreadSetting.baseCols.length, compareStages.length * posSpreadSetting.extraCols.length + posSpreadSetting.specExtraCols.length);
|
|
|
|
|
|
SpreadJsObj.reLoadSheetHeader(gclSheet);
|
|
|
- SpreadJsObj.reloadColData(gclSheet, gclSpreadSetting.baseCols.length, compareStages.length * gclSpreadSetting.extraCols.length + billsSpreadSetting.specExtraCols.length);
|
|
|
+ SpreadJsObj.reloadColData(gclSheet, gclSpreadSetting.baseCols.length, compareStages.length * gclSpreadSetting.extraCols.length + gclSpreadSetting.specExtraCols.length);
|
|
|
SpreadJsObj.reLoadSheetHeader(leafXmjSheet);
|
|
|
- SpreadJsObj.reloadColData(leafXmjSheet, leafXmjSpreadSetting.baseCols.length, compareStages.length * leafXmjSpreadSetting.extraCols.length + billsSpreadSetting.specExtraCols.length);
|
|
|
+ SpreadJsObj.reloadColData(leafXmjSheet, leafXmjSpreadSetting.baseCols.length, compareStages.length * leafXmjSpreadSetting.extraCols.length + leafXmjSpreadSetting.specExtraCols.length);
|
|
|
+
|
|
|
+ SpreadJsObj.reLoadSheetHeader(chapterSheet);
|
|
|
+ SpreadJsObj.reloadColData(chapterSheet, chapterSpreadSetting.baseCols.length, compareStages.length * chapterSpreadSetting.extraCols.length + chapterSpreadSetting.specExtraCols.length);
|
|
|
});
|
|
|
$('[name=compareType]').click(function () {
|
|
|
$('[name=compareType]').removeClass('active');
|
|
@@ -534,6 +580,7 @@ $(document).ready(() => {
|
|
|
posSpread.refresh();
|
|
|
gclSpread.refresh();
|
|
|
leafXmjSpread.refresh();
|
|
|
+ chapterSpread.refresh();
|
|
|
});
|
|
|
$('#select-qi-all').click(function() {
|
|
|
const check = this.checked;
|