|
@@ -267,6 +267,7 @@ function calculateStagePosData(datas) {
|
|
|
}
|
|
|
|
|
|
$(document).ready(() => {
|
|
|
+ let spec;
|
|
|
autoFlashHeight();
|
|
|
initSpreadSettingWithRoles([]);
|
|
|
const billsSpread = SpreadJsObj.createNewSpread($('#bills-spread')[0]);
|
|
@@ -375,7 +376,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']);
|
|
|
+ spec = result.spec;
|
|
|
+ const chapterData = gclGatherModel.gatherChapterData(chapter, 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) {
|
|
@@ -394,7 +396,6 @@ $(document).ready(() => {
|
|
|
SpreadJsObj.resetTopAndSelect(leafXmjSheet);
|
|
|
}
|
|
|
billsSheet.bind(spreadNS.Events.SelectionChanged, function (e, info) {
|
|
|
- console.log(SpreadJsObj.getSelectObject(info.sheet));
|
|
|
if (info.newSelections) {
|
|
|
const iNewRow = info.newSelections[0].row;
|
|
|
if (info.oldSelections) {
|
|
@@ -426,14 +427,14 @@ $(document).ready(() => {
|
|
|
});
|
|
|
const compareStages = [];
|
|
|
$('#select-qi-ok').click(function () {
|
|
|
- function refreshView (data) {
|
|
|
+ function refreshView () {
|
|
|
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}`);
|
|
|
+ gatherField.push(`contract_tp${order + 1}`, `qc_tp${order + 1}`, `gather_tp${order + 1}`);
|
|
|
}
|
|
|
}
|
|
|
// setLocalCache(cCacheKey, compareStages.join(','));
|
|
@@ -453,7 +454,7 @@ $(document).ready(() => {
|
|
|
SpreadJsObj.loadSheetData(gclSheet, SpreadJsObj.DataType.Data, gclGatherData);
|
|
|
loadLeafXmjData(0);
|
|
|
|
|
|
- const chapterData = gclGatherModel.gatherChapterData(chapter, data.spec, gatherField);
|
|
|
+ const chapterData = gclGatherModel.gatherChapterData(chapter, spec, gatherField);
|
|
|
SpreadJsObj.reLoadSheetHeader(chapterSheet);
|
|
|
SpreadJsObj.loadSheetData(chapterSheet, SpreadJsObj.DataType.Data, chapterData);
|
|
|
}
|
|
@@ -469,6 +470,7 @@ $(document).ready(() => {
|
|
|
}
|
|
|
if (loadData.length > 0) {
|
|
|
postData(window.location.pathname + '/load', {stages: loadData}, function (result) {
|
|
|
+ spec = result.spec;
|
|
|
for (const aData of result.stages) {
|
|
|
calculateStageLedgerData(aData.bills);
|
|
|
cTree.loadMinorData(aData.bills, aData.order + '', ['contract_qty', 'contract_tp', 'qc_qty', 'qc_tp', 'gather_qty', 'gather_tp'], ['contract_tp', 'qc_tp', 'gather_tp']);
|
|
@@ -478,7 +480,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(result);
|
|
|
+ refreshView();
|
|
|
$('#select-qi').modal('hide');
|
|
|
}, null, true);
|
|
|
} else {
|