|
@@ -42,6 +42,7 @@ function generateChapterHtml(data) {
|
|
}
|
|
}
|
|
|
|
|
|
$(document).ready(function () {
|
|
$(document).ready(function () {
|
|
|
|
+ const preUrl = window.location.pathname.split('/').slice(0, 6).join('/');
|
|
let per = _.toNumber(getLocalCache('StageGatherOverPercent'));
|
|
let per = _.toNumber(getLocalCache('StageGatherOverPercent'));
|
|
if (per && !_.isNaN(per)) {
|
|
if (per && !_.isNaN(per)) {
|
|
$('#over-percent').val(per >= 50 ? (per <= 100 ? per : 100) : 50);
|
|
$('#over-percent').val(per >= 50 ? (per <= 100 ? per : 100) : 50);
|
|
@@ -62,31 +63,7 @@ $(document).ready(function () {
|
|
const leafXmjSpread = SpreadJsObj.createNewSpread($('#leaf-xmj-spread')[0]);
|
|
const leafXmjSpread = SpreadJsObj.createNewSpread($('#leaf-xmj-spread')[0]);
|
|
SpreadJsObj.initSheet(leafXmjSpread.getActiveSheet(), leafXmjSpreadSetting);
|
|
SpreadJsObj.initSheet(leafXmjSpread.getActiveSheet(), leafXmjSpreadSetting);
|
|
|
|
|
|
- $.subMenu({
|
|
|
|
- menu: '#sub-menu', miniMenu: '#sub-mini-menu', miniMenuList: '#mini-menu-list',
|
|
|
|
- toMenu: '#to-menu', toMiniMenu: '#to-mini-menu',
|
|
|
|
- key: 'menu.1.0.0',
|
|
|
|
- miniHint: '#sub-mini-hint', hintKey: 'menu.hint.1.0.1',
|
|
|
|
- callback: function (info) {
|
|
|
|
- if (info.mini) {
|
|
|
|
- $('.panel-title').addClass('fluid');
|
|
|
|
- $('#sub-menu').removeClass('panel-sidebar');
|
|
|
|
- } else {
|
|
|
|
- $('.panel-title').removeClass('fluid');
|
|
|
|
- $('#sub-menu').addClass('panel-sidebar');
|
|
|
|
- }
|
|
|
|
- autoFlashHeight();
|
|
|
|
- gclSpread.refresh();
|
|
|
|
- leafXmjSpread.refresh();
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
-
|
|
|
|
- // 解析清单汇总数据
|
|
|
|
- gclGatherModel.loadLedgerData(ledger, curLedgerData, preLedgerData);
|
|
|
|
- gclGatherModel.loadPosData(pos, curPosData, prePosData);
|
|
|
|
- gclGatherModel.loadDealBillsData(dealBills);
|
|
|
|
- const gclGatherData = gclGatherModel.gatherGclData();
|
|
|
|
- gclGatherModel.checkDiffer(gclGatherData);
|
|
|
|
|
|
+ let gclGatherData;
|
|
// 获取项目节数据
|
|
// 获取项目节数据
|
|
function loadLeafXmjData(iGclRow) {
|
|
function loadLeafXmjData(iGclRow) {
|
|
const gcl = gclGatherData[iGclRow];
|
|
const gcl = gclGatherData[iGclRow];
|
|
@@ -112,10 +89,6 @@ $(document).ready(function () {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- // 加载清单数据
|
|
|
|
- checkOverRange(gclGatherData);
|
|
|
|
- SpreadJsObj.loadSheetData(gclSpread.getActiveSheet(), SpreadJsObj.DataType.Data, gclGatherData);
|
|
|
|
- loadLeafXmjData(0);
|
|
|
|
// 切换清单行,读取所属项目节数据
|
|
// 切换清单行,读取所属项目节数据
|
|
gclSpread.getActiveSheet().bind(spreadNS.Events.SelectionChanged, function (e, info) {
|
|
gclSpread.getActiveSheet().bind(spreadNS.Events.SelectionChanged, function (e, info) {
|
|
const iOldRow = info.oldSelections[0].row, iNewRow = info.newSelections[0].row;
|
|
const iOldRow = info.oldSelections[0].row, iNewRow = info.newSelections[0].row;
|
|
@@ -136,16 +109,30 @@ $(document).ready(function () {
|
|
checkOverRange(gclGatherData);
|
|
checkOverRange(gclGatherData);
|
|
SpreadJsObj.reLoadSheetData(gclSpread.getActiveSheet());
|
|
SpreadJsObj.reLoadSheetData(gclSpread.getActiveSheet());
|
|
});
|
|
});
|
|
- const chapterData = gclGatherModel.gatherChapterData(chapter, ['total_price', 'contract_tp', 'qc_tp', 'pre_contract_tp', 'pre_qc_tp']);
|
|
|
|
- for (const c of chapterData) {
|
|
|
|
- c.gather_tp = ZhCalc.add(c.contract_tp, c.qc_tp);
|
|
|
|
- c.end_contract_tp = ZhCalc.add(c.contract_tp, c.pre_contract_tp);
|
|
|
|
- c.end_qc_tp = ZhCalc.add(c.qc_tp, c.pre_qc_tp);
|
|
|
|
- c.end_gather_tp = ZhCalc.add(c.end_contract_tp, c.end_qc_tp);
|
|
|
|
- c.end_final_tp = ZhCalc.add(c.end_qc_tp, c.total_price);
|
|
|
|
- c.end_final_ratio = ZhCalc.mul(ZhCalc.div(c.end_gather_tp, c.end_final_tp), 100, 2);
|
|
|
|
- }
|
|
|
|
- generateChapterHtml(chapterData);
|
|
|
|
|
|
+
|
|
|
|
+ postData(preUrl + '/load', { filter: 'ledger;pos;dealBills' }, function (result) {
|
|
|
|
+ // 解析清单汇总数据
|
|
|
|
+ gclGatherModel.loadLedgerData(result.ledgerData);
|
|
|
|
+ gclGatherModel.loadPosData(result.posData);
|
|
|
|
+ gclGatherModel.loadDealBillsData(result.dealBills);
|
|
|
|
+ gclGatherData = gclGatherModel.gatherGclData();
|
|
|
|
+ gclGatherModel.checkDiffer(gclGatherData);
|
|
|
|
+ checkOverRange(gclGatherData);
|
|
|
|
+ // 加载清单数据
|
|
|
|
+ SpreadJsObj.loadSheetData(gclSpread.getActiveSheet(), SpreadJsObj.DataType.Data, gclGatherData);
|
|
|
|
+ loadLeafXmjData(0);
|
|
|
|
+ // 章节合计
|
|
|
|
+ const chapterData = gclGatherModel.gatherChapterData(chapter, ['total_price', 'contract_tp', 'qc_tp', 'pre_contract_tp', 'pre_qc_tp']);
|
|
|
|
+ for (const c of chapterData) {
|
|
|
|
+ c.gather_tp = ZhCalc.add(c.contract_tp, c.qc_tp);
|
|
|
|
+ c.end_contract_tp = ZhCalc.add(c.contract_tp, c.pre_contract_tp);
|
|
|
|
+ c.end_qc_tp = ZhCalc.add(c.qc_tp, c.pre_qc_tp);
|
|
|
|
+ c.end_gather_tp = ZhCalc.add(c.end_contract_tp, c.end_qc_tp);
|
|
|
|
+ c.end_final_tp = ZhCalc.add(c.end_qc_tp, c.total_price);
|
|
|
|
+ c.end_final_ratio = ZhCalc.mul(ZhCalc.div(c.end_gather_tp, c.end_final_tp), 100, 2);
|
|
|
|
+ }
|
|
|
|
+ generateChapterHtml(chapterData);
|
|
|
|
+ });
|
|
|
|
|
|
// 展开收起附件
|
|
// 展开收起附件
|
|
$('a', '.right-nav').bind('click', function () {
|
|
$('a', '.right-nav').bind('click', function () {
|
|
@@ -205,4 +192,23 @@ $(document).ready(function () {
|
|
leafXmjSpread.refresh();
|
|
leafXmjSpread.refresh();
|
|
}
|
|
}
|
|
});
|
|
});
|
|
|
|
+ // 导航栏
|
|
|
|
+ $.subMenu({
|
|
|
|
+ menu: '#sub-menu', miniMenu: '#sub-mini-menu', miniMenuList: '#mini-menu-list',
|
|
|
|
+ toMenu: '#to-menu', toMiniMenu: '#to-mini-menu',
|
|
|
|
+ key: 'menu.1.0.0',
|
|
|
|
+ miniHint: '#sub-mini-hint', hintKey: 'menu.hint.1.0.1',
|
|
|
|
+ callback: function (info) {
|
|
|
|
+ if (info.mini) {
|
|
|
|
+ $('.panel-title').addClass('fluid');
|
|
|
|
+ $('#sub-menu').removeClass('panel-sidebar');
|
|
|
|
+ } else {
|
|
|
|
+ $('.panel-title').removeClass('fluid');
|
|
|
|
+ $('#sub-menu').addClass('panel-sidebar');
|
|
|
|
+ }
|
|
|
|
+ autoFlashHeight();
|
|
|
|
+ gclSpread.refresh();
|
|
|
|
+ leafXmjSpread.refresh();
|
|
|
|
+ }
|
|
|
|
+ });
|
|
});
|
|
});
|