|
@@ -40,7 +40,6 @@ $(document).ready(function () {
|
|
|
function calculateStagePosData(datas) {
|
|
|
for (const d of datas) {
|
|
|
d.gather_qty = ZhCalc.add(d.contract_qty, d.qc_qty);
|
|
|
- d.gather_tp = ZhCalc.add(d.contract_tp, d.qc_tp);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -70,20 +69,18 @@ $(document).ready(function () {
|
|
|
keys: ['id', 'tender_id', 'ledger_id'],
|
|
|
masterId: 'id',
|
|
|
minorId: 'lid',
|
|
|
- }
|
|
|
- //scTreeSetting.updateFields = ['contract_qty', 'contract_tp', 'qc_qty', 'qc_tp'];
|
|
|
- scTreeSetting.calcFields = ['gather_tp0'];
|
|
|
+ calcFields: [],
|
|
|
+ };
|
|
|
const scTree = createNewPathTree('master', scTreeSetting);
|
|
|
scTree.loadDatas(ledger);
|
|
|
calculateStageLedgerData(orgStageLedger);
|
|
|
- scTree.loadMinorData(orgStageLedger, '0', ['gather_qty', 'gather_tp']);
|
|
|
+ scTree.loadMinorData(orgStageLedger, '0', ['gather_qty', 'gather_tp'], ['gather_tp']);
|
|
|
treeCalc.calculateAll(scTree);
|
|
|
scTree.expandByCalcFields();
|
|
|
SpreadJsObj.loadSheetData(ledgerSpread.getActiveSheet(), SpreadJsObj.DataType.Tree, scTree);
|
|
|
// 加载 部位 数据
|
|
|
const scPosSetting = {
|
|
|
id: 'id', ledgerId: 'lid', masterId: 'id', minorId: 'pid',
|
|
|
- updateFields: ['contract_qty', 'qc_qty'],
|
|
|
};
|
|
|
scPosSetting.calcFun = function (pos) {
|
|
|
pos.gather_qty = ZhCalc.add(pos.contract_qty, pos.qc_qty);
|
|
@@ -126,9 +123,9 @@ $(document).ready(function () {
|
|
|
scTreeSetting.calcFields = [];
|
|
|
const fieldSufs = ['0'], roles = ['原报'], trs = $('tr[auditorId]');
|
|
|
for (let order = 0, iLength = trs.length; order < iLength; order++) {
|
|
|
- fieldSufs.push(order + '');
|
|
|
- roles.push(tr.children()[0].text);
|
|
|
- scTreeSetting.calcFields.push('gather_tp' + order);
|
|
|
+ const tr = trs[order];
|
|
|
+ fieldSufs.push((order + 1) + '');
|
|
|
+ roles.push(tr.children[0].textContent);
|
|
|
}
|
|
|
setSpreadSettingCols(ledgerSpreadSetting, fieldSufs, roles);
|
|
|
SpreadJsObj.initSheet(ledgerSpread.getActiveSheet(), ledgerSpreadSetting);
|
|
@@ -142,8 +139,8 @@ $(document).ready(function () {
|
|
|
let loadData = [], showData = [], trs = $('tr[auditorId]');
|
|
|
for (let order = 0, iLength = trs.length; order < iLength; order++) {
|
|
|
const tr = trs[order];
|
|
|
- if ($('input[type=check]', tr)[0].checked) {
|
|
|
- if (!scTree.minorData[tr]) {
|
|
|
+ if ($('input[type=checkbox]', tr)[0].checked) {
|
|
|
+ if (!scTree.minorData[order + 1]) {
|
|
|
loadData.push(order + 1);
|
|
|
}
|
|
|
showData.push(order + 1);
|
|
@@ -153,7 +150,7 @@ $(document).ready(function () {
|
|
|
postData(window.location.pathname + '/load', {auditors: loadData}, function (result) {
|
|
|
for (const aData of result) {
|
|
|
calculateStageLedgerData(aData.bills);
|
|
|
- scTree.loadMinorData(aData.bills, aData.order + '', ['gather_qty', 'gather_tp']);
|
|
|
+ scTree.loadMinorData(aData.bills, aData.order + '', ['gather_qty', 'gather_tp'], ['gather_tp']);
|
|
|
treeCalc.calculateAll(scTree);
|
|
|
calculateStagePosData(aData.pos);
|
|
|
scPos.loadMinorData(aData.pos, aData.order + '', ['gather_qty']);
|