|
@@ -68,11 +68,11 @@ $(document).ready(() => {
|
|
|
},
|
|
|
bonus: {
|
|
|
cols: [
|
|
|
- {title: '名称', colSpan: '1', rowSpan: '1', field: 'name', hAlign: 0, width: 320, formatter: '@'},
|
|
|
- {title: '汇总', colSpan: '1', rowSpan: '1', field: 'filter', hAlign: 1, width: 100, formatter: '@'},
|
|
|
+ {title: '名称', colSpan: '1', rowSpan: '1', field: 'name', hAlign: 0, width: 320, formatter: '@', cellType: 'tree'},
|
|
|
+ {title: '汇总', colSpan: '1', rowSpan: '1', field: 'filter_str', hAlign: 1, width: 100, formatter: '@'},
|
|
|
{title: '类型', colSpan: '1', rowSpan: '1', field: 'b_type', hAlign: 1, width: 80, formatter: '@'},
|
|
|
- {title: '金额', colSpan: '1', rowSpan: '1', field: 'tp', hAlign: 1, width: 80, formatter: '@'},
|
|
|
- {title: '时间', colSpan: '1', rowSpan: '1', field: 'real_time', hAlign: 1, width: 80, formatter: '@'},
|
|
|
+ {title: '金额', colSpan: '1', rowSpan: '1', field: 'tp', hAlign: 2, width: 80},
|
|
|
+ {title: '时间', colSpan: '1', rowSpan: '1', field: 'real_time', hAlign: 1, width: 100, formatter: 'yyyy-MM-dd'},
|
|
|
],
|
|
|
emptyRows: 0,
|
|
|
headRows: 1,
|
|
@@ -113,14 +113,14 @@ $(document).ready(() => {
|
|
|
},
|
|
|
tempLand: {
|
|
|
cols: [
|
|
|
- {title: '名称', colSpan: '1', rowSpan: '2', field: 'name', hAlign: 0, width: 320, formatter: '@'},
|
|
|
- {title: '汇总', colSpan: '1', rowSpan: '2', field: 'filter', hAlign: 1, width: 100, formatter: '@'},
|
|
|
+ {title: '名称', colSpan: '1', rowSpan: '2', field: 'name', hAlign: 0, width: 320, formatter: '@', cellType: 'tree'},
|
|
|
+ {title: '汇总', colSpan: '1', rowSpan: '2', field: 'filter_str', hAlign: 1, width: 100, formatter: '@'},
|
|
|
{title: '单位', colSpan: '1', rowSpan: '2', field: 'unit', hAlign: 1, width: 80, formatter: '@'},
|
|
|
{title: '单价', colSpan: '1', rowSpan: '2', field: 'unit_price', hAlign: 2, width: 60, type: 'Number'},
|
|
|
- {title: '本期|数量', colSpan: '2|1', rowSpan: '1|1', field: 'qty', hAlign: 1, width: 80, formatter: '@'},
|
|
|
- {title: '|数量', colSpan: '|1', rowSpan: '|1', field: 'tp', hAlign: 1, width: 80, formatter: '@'},
|
|
|
- {title: '截止本期|数量', colSpan: '2|1', rowSpan: '1|1', field: 'end_qty', hAlign: 1, width: 80, formatter: '@'},
|
|
|
- {title: '|数量', colSpan: '|1', rowSpan: '|1', field: 'end_tp', hAlign: 1, width: 80, formatter: '@'},
|
|
|
+ {title: '本期|数量', colSpan: '2|1', rowSpan: '1|1', field: 'qty', hAlign: 2, width: 80, formatter: '@'},
|
|
|
+ {title: '|金额', colSpan: '|1', rowSpan: '|1', field: 'tp', hAlign: 2, width: 80, formatter: '@'},
|
|
|
+ {title: '截止本期|数量', colSpan: '2|1', rowSpan: '1|1', field: 'end_qty', hAlign: 2, width: 80, formatter: '@'},
|
|
|
+ {title: '|金额', colSpan: '|1', rowSpan: '|1', field: 'end_tp', hAlign: 2, width: 80, formatter: '@'},
|
|
|
],
|
|
|
emptyRows: 0,
|
|
|
headRows: 2,
|
|
@@ -132,13 +132,13 @@ $(document).ready(() => {
|
|
|
},
|
|
|
other: {
|
|
|
cols: [
|
|
|
- {title: '名称', colSpan: '1', rowSpan: '1', field: 'name', hAlign: 0, width: 320, formatter: '@'},
|
|
|
- {title: '汇总', colSpan: '1', rowSpan: '1', field: 'filter', hAlign: 1, width: 100, formatter: '@'},
|
|
|
+ {title: '名称', colSpan: '1', rowSpan: '1', field: 'name', hAlign: 0, width: 320, formatter: '@', cellType: 'tree'},
|
|
|
+ {title: '汇总', colSpan: '1', rowSpan: '1', field: 'filter_str', hAlign: 1, width: 100, formatter: '@'},
|
|
|
{title: '类型', colSpan: '1', rowSpan: '1', field: 'o_type', hAlign: 1, width: 80, formatter: '@'},
|
|
|
- {title: '金额', colSpan: '1', rowSpan: '1', field: 'total_price', hAlign: 1, width: 80, formatter: '@'},
|
|
|
- {title: '本期', colSpan: '1', rowSpan: '1', field: 'tp', hAlign: 1, width: 80, formatter: '@'},
|
|
|
- {title: '截止本期', colSpan: '1', rowSpan: '1', field: 'end_tp', hAlign: 1, width: 80, formatter: '@'},
|
|
|
- {title: '时间', colSpan: '1', rowSpan: '1', field: 'real_time', hAlign: 1, width: 80, formatter: '@'},
|
|
|
+ {title: '金额', colSpan: '1', rowSpan: '1', field: 'total_price', hAlign: 2, width: 80},
|
|
|
+ {title: '本期', colSpan: '1', rowSpan: '1', field: 'tp', hAlign: 2, width: 80},
|
|
|
+ {title: '截止本期', colSpan: '1', rowSpan: '1', field: 'end_tp', hAlign: 2, width: 80},
|
|
|
+ {title: '时间', colSpan: '1', rowSpan: '1', field: 'real_time', hAlign: 1, width: 100, formatter: 'yyyy-MM-dd'},
|
|
|
],
|
|
|
emptyRows: 0,
|
|
|
headRows: 1,
|
|
@@ -157,10 +157,10 @@ $(document).ready(() => {
|
|
|
seData: 'cur',
|
|
|
jgcl: [],
|
|
|
yjcl: [],
|
|
|
- bonus: [],
|
|
|
- other: [],
|
|
|
+ bonus: createNewPathTree('gather', {id: 'tree_id', pid: 'tree_pid', order: 'order', level: 'level', rootId: -1, fullPath: 'full_path'}),
|
|
|
+ other: createNewPathTree('gather', {id: 'tree_id', pid: 'tree_pid', order: 'order', level: 'level', rootId: -1, fullPath: 'full_path'}),
|
|
|
safeProd: [],
|
|
|
- tempLand: [],
|
|
|
+ tempLand: createNewPathTree('gather', {id: 'tree_id', pid: 'tree_pid', order: 'order', level: 'level', rootId: -1, fullPath: 'full_path'}),
|
|
|
gatherJgcl(tenders) {
|
|
|
this.jgcl = [];
|
|
|
for (const [i, t] of tenders.entries()) {
|
|
@@ -223,18 +223,24 @@ $(document).ready(() => {
|
|
|
}
|
|
|
},
|
|
|
gatherBonus(tenders) {
|
|
|
- this.bonus = [];
|
|
|
+ this.bonus.clearDatas();
|
|
|
for (const [i, t] of tenders.entries()) {
|
|
|
- this.bonus.push({ tid: t.id, name: t.name, filter: t.filter });
|
|
|
- this.bonus.push(...t.bonus);
|
|
|
+ const tenderNode = this.bonus.addNode({ tid: t.id, name: t.name, filter_str: t.filter });
|
|
|
+ for (const b of t.bonus) {
|
|
|
+ this.bonus.addNode(b, tenderNode);
|
|
|
+ }
|
|
|
}
|
|
|
+ this.bonus.sortTreeNode(true);
|
|
|
},
|
|
|
gatherOther(tenders) {
|
|
|
- this.other = [];
|
|
|
+ this.other.clearDatas();
|
|
|
for (const [i, t] of tenders.entries()) {
|
|
|
- this.other.push({ tid: t.id, name: t.name, filter: t.filter });
|
|
|
- this.other.push(...t.other);
|
|
|
+ const tenderNode = this.other.addNode({ tid: t.id, name: t.name, filter_str: t.stage_filter });
|
|
|
+ for (const o of t.other) {
|
|
|
+ this.other.addNode(o, tenderNode);
|
|
|
+ }
|
|
|
}
|
|
|
+ this.other.sortTreeNode(true);
|
|
|
},
|
|
|
gatherSafeProd(tenders) {
|
|
|
this.safeProd = [];
|
|
@@ -265,10 +271,12 @@ $(document).ready(() => {
|
|
|
}
|
|
|
},
|
|
|
gatherTempLand(tenders) {
|
|
|
- this.tempLand = [];
|
|
|
+ this.tempLand.clearDatas();
|
|
|
for (const [i, t] of tenders.entries()) {
|
|
|
- this.tempLand.push({ tid: t.id, name: t.name, filter: t.filter });
|
|
|
- this.tempLand.push(...t.tempLand);
|
|
|
+ const tenderNode = this.tempLand.addNode({ tid: t.id, name: t.name, filter_str: t.filter });
|
|
|
+ for (const tl of t.tempLand) {
|
|
|
+ this.tempLand.addNode(tl, tenderNode);
|
|
|
+ }
|
|
|
// const endfix = '_' + (i + 1);
|
|
|
// for (const data of t.tempLand) {
|
|
|
// if (!data.unit) data.unit = '';
|
|
@@ -293,6 +301,7 @@ $(document).ready(() => {
|
|
|
// tl['sum_end_tp'] = ZhCalc.add(tl['sum_end_tp'], data.end_tp);
|
|
|
// }
|
|
|
}
|
|
|
+ this.tempLand.sortTreeNode(true);
|
|
|
},
|
|
|
gatherStageExtraData(tenders) {
|
|
|
this.tenderCount = tenders.length;
|
|
@@ -311,7 +320,7 @@ $(document).ready(() => {
|
|
|
for (const [i, tender] of tenders.entries()) {
|
|
|
for (const col of spreadSetting.extraCols) {
|
|
|
const newCol = JSON.parse(JSON.stringify(col));
|
|
|
- if (newCol.formatTitle) newCol.title = newCol.formatTitle.replace('%s', tender.name).replace('%f', tender.filter);
|
|
|
+ if (newCol.formatTitle) newCol.title = newCol.formatTitle.replace('%s', tender.name).replace('%f', tender.stage_filter);
|
|
|
if (newCol.formatField) newCol.field = newCol.formatField.replace('%d', i + 1);
|
|
|
spreadSetting.cols.push(newCol);
|
|
|
}
|
|
@@ -380,7 +389,8 @@ $(document).ready(() => {
|
|
|
},
|
|
|
loadSheetData() {
|
|
|
SpreadJsObj.initSheet(dataSheet, spreadSetting[this.seType]);
|
|
|
- SpreadJsObj.loadSheetData(dataSheet, SpreadJsObj.DataType.Data, this[this.seType]);
|
|
|
+ const isTree = spreadSetting[this.seType].cols.find(x => { return x.cellType === 'tree'; });
|
|
|
+ SpreadJsObj.loadSheetData(dataSheet, isTree ? SpreadJsObj.DataType.Tree : SpreadJsObj.DataType.Data, this[this.seType]);
|
|
|
SpreadJsObj.locateRow(dataSheet, 0);
|
|
|
},
|
|
|
refreshStageExtraData(type) {
|
|
@@ -423,10 +433,10 @@ $(document).ready(() => {
|
|
|
const sheets = [];
|
|
|
sheets.push({ name: '甲供材料', setting: spreadSetting.jgcl, data: stageExtra.jgcl });
|
|
|
sheets.push({ name: '永久材料', setting: spreadSetting.yjcl, data: stageExtra.yjcl });
|
|
|
- sheets.push({ name: '奖罚金', setting: spreadSetting.bonus, data: stageExtra.bonus });
|
|
|
+ sheets.push({ name: '奖罚金', setting: spreadSetting.bonus, data: stageExtra.bonus.nodes });
|
|
|
sheets.push({ name: '安全生产', setting: spreadSetting.safeProd, data: stageExtra.safeProd });
|
|
|
- sheets.push({ name: '临时占地', setting: spreadSetting.tempLand, data: stageExtra.tempLand });
|
|
|
- sheets.push({ name: '其他', setting: spreadSetting.other, data: stageExtra.other });
|
|
|
+ sheets.push({ name: '临时占地', setting: spreadSetting.tempLand, data: stageExtra.tempLand.nodes });
|
|
|
+ sheets.push({ name: '其他', setting: spreadSetting.other, data: stageExtra.other.nodes });
|
|
|
SpreadExcelObj.exportSimpleXlsxSheets(sheets, "计量汇总-其他台账.xlsx");
|
|
|
});
|
|
|
$.subMenu({
|