|
@@ -22,6 +22,9 @@ $(function () {
|
|
|
level: 'level',
|
|
|
rootId: -1,
|
|
|
fullPath: 'full_path',
|
|
|
+ calcFun: function (node) {
|
|
|
+ node.dgn_price = ZhCalc.round(ZhCalc.div(node.total_price, node.dgn_qty1), 2);
|
|
|
+ }
|
|
|
//treeCacheKey: 'ledger_bills_fold' + '_' + getTenderId(),
|
|
|
// markFoldKey: 'bills-fold',
|
|
|
// markFoldSubKey: window.location.pathname.split('/')[2],
|
|
@@ -34,7 +37,7 @@ $(function () {
|
|
|
{title: '单位', colSpan: '1', rowSpan: '2', field: 'unit', hAlign: 1, width: 50, formatter: '@', readOnly: true},
|
|
|
{title: '经济指标', colSpan: '1', rowSpan: '2', field: 'dgn_price', hAlign: 2, width: 60, type: 'Number', readOnly: true},
|
|
|
{title: '总设计|工程量', colSpan: '2|1', rowSpan: '1|1', field: 'dgn_qty1', hAlign: 2, width: 70, type: 'Number', readOnly: true},
|
|
|
- {title: '|金额(万元)', colSpan: '|1', rowSpan: '|1', field: 'total_price', hAlign: 2, width: 70, type: 'Number', readOnly: true},
|
|
|
+ {title: '|金额(元)', colSpan: '|1', rowSpan: '|1', field: 'total_price', hAlign: 2, width: 70, type: 'Number', readOnly: true},
|
|
|
];
|
|
|
|
|
|
const ledgerSpreadSetting = {
|
|
@@ -51,22 +54,22 @@ $(function () {
|
|
|
}
|
|
|
};
|
|
|
const monthsCols = [];
|
|
|
- const calcCols = [];
|
|
|
+ const calcCols = ['total_price'];
|
|
|
if(scheduleMonth.length > 0) {
|
|
|
for (const sm of scheduleMonth) {
|
|
|
if (sm.stage_gcl_used === 1) {
|
|
|
const yearmonth = sm.yearmonth.split('-')[0] + '年' + parseInt(sm.yearmonth.split('-')[1]) + '月';
|
|
|
const cols = {title: yearmonth + '|计划工程量', colSpan: '4|1', rowSpan: '1|1', field: sm.yearmonth+'_plan_gcl', hAlign: 2, width: 90, type: 'Number', readOnly: true};
|
|
|
- const cols2 = {title: '|计划金额(万元)', colSpan: '|1', rowSpan: '|1', field: sm.yearmonth+'_plan_tp', hAlign: 2, width: 90, type: 'Number', readOnly: true};
|
|
|
+ const cols2 = {title: '|计划金额(元)', colSpan: '|1', rowSpan: '|1', field: sm.yearmonth+'_plan_tp', hAlign: 2, width: 90, type: 'Number', readOnly: true};
|
|
|
const cols3 = {title: '|计量工程量', colSpan: '|1', rowSpan: '|1', field: sm.yearmonth+'_sj_gcl', hAlign: 2, width: 90, type: 'Number', readOnly: 'readOnly.gcl'};
|
|
|
- const cols4 = {title: '|计量金额(万元)', colSpan: '|1', rowSpan: '|1', field: sm.yearmonth+'_sj_tp', hAlign: 2, width: 90, type: 'Number', readOnly : true};
|
|
|
+ const cols4 = {title: '|计量金额(元)', colSpan: '|1', rowSpan: '|1', field: sm.yearmonth+'_sj_tp', hAlign: 2, width: 90, type: 'Number', readOnly : true};
|
|
|
monthsCols.push(cols);
|
|
|
monthsCols.push(cols2);
|
|
|
monthsCols.push(cols3);
|
|
|
monthsCols.push(cols4);
|
|
|
- calcCols.push(sm.yearmonth + '_plan_gcl');
|
|
|
+ // calcCols.push(sm.yearmonth + '_plan_gcl');
|
|
|
calcCols.push(sm.yearmonth + '_plan_tp');
|
|
|
- calcCols.push(sm.yearmonth + '_sj_gcl');
|
|
|
+ // calcCols.push(sm.yearmonth + '_sj_gcl');
|
|
|
calcCols.push(sm.yearmonth + '_sj_tp');
|
|
|
}
|
|
|
}
|
|
@@ -79,7 +82,7 @@ $(function () {
|
|
|
const ledgerCol = {
|
|
|
readOnly: {
|
|
|
gcl: function (data) {
|
|
|
- return !data.is_leaf;
|
|
|
+ return !(data.is_leaf && !revising);
|
|
|
},
|
|
|
},
|
|
|
};
|
|
@@ -199,7 +202,7 @@ $(function () {
|
|
|
if (info.sheet.zh_setting) {
|
|
|
const select = SpreadJsObj.getSelectObject(info.sheet);
|
|
|
const col = info.sheet.zh_setting.cols[info.col];
|
|
|
- const validText = is_numeric(info.editingText) ? parseFloat(info.editingText) : (info.editingText ? trimInvalidChar(info.editingText) : null);
|
|
|
+ let validText = is_numeric(info.editingText) ? parseFloat(info.editingText) : (info.editingText ? trimInvalidChar(info.editingText) : null);
|
|
|
const orgValue = select[col.field];
|
|
|
if (orgValue == validText || ((!orgValue || orgValue === '') && (validText === ''))) {
|
|
|
SpreadJsObj.reLoadRowData(info.sheet, info.row);
|
|
@@ -212,14 +215,15 @@ $(function () {
|
|
|
}
|
|
|
const yearmonth = col.field.split('_')[0];
|
|
|
// 判断输入位数,提示
|
|
|
- const reg = new RegExp('^([-]?)\\d+(\\.\\d{0,'+ parseInt(tenderInfo.decimal.up) +'})?$');
|
|
|
+ const reg = new RegExp('^([-]?)\\d+$');
|
|
|
if (validText !== null && (!reg.test(validText))) {
|
|
|
- toastr.error('输入工程量小数位数不能大于' + tenderInfo.decimal.up + '位');
|
|
|
- SpreadJsObj.reLoadRowData(info.sheet, info.row);
|
|
|
- return;
|
|
|
+ // toastr.error('输入工程量小数位数不能大于3位');
|
|
|
+ // SpreadJsObj.reLoadRowData(info.sheet, info.row);
|
|
|
+ // return;
|
|
|
+ validText = ZhCalc.round(validText, 3);
|
|
|
}
|
|
|
const sj_gcl = validText;
|
|
|
- const sj_tp = select.dgn_price && select.dgn_price !== 0 ? ZhCalc.round(ZhCalc.mul(validText, select.dgn_price), tenderInfo.decimal.tp) : 0;
|
|
|
+ const sj_tp = select.dgn_price && select.dgn_price !== 0 ? ZhCalc.round(ZhCalc.mul(validText, select.dgn_price), 0) : 0;
|
|
|
select[col.field] = validText;
|
|
|
const updateData = {
|
|
|
lid: select.ledger_id,
|
|
@@ -231,13 +235,13 @@ $(function () {
|
|
|
postData(window.location.pathname + '/save', {type: 'ledger_edit', postData: updateData}, function (result) {
|
|
|
select[yearmonth + '_sj_tp'] = sj_tp;
|
|
|
const nodes = treeCalc.calculateParent(info.sheet.zh_tree, select);
|
|
|
- SpreadJsObj.reLoadNodesData(info.sheet, nodes);
|
|
|
- SpreadJsObj.reLoadRowData(info.sheet, info.row);
|
|
|
+ const refreshNode = ledgerTree.loadPostData({update: nodes});
|
|
|
+ ledgerSpreadObj.refreshTree(info.sheet, refreshNode);
|
|
|
},function () {
|
|
|
select[col.field] = orgValue;
|
|
|
const nodes = treeCalc.calculateParent(info.sheet.zh_tree, select);
|
|
|
- SpreadJsObj.reLoadNodesData(info.sheet, nodes);
|
|
|
- SpreadJsObj.reLoadRowData(info.sheet, info.row);
|
|
|
+ const refreshNode = ledgerTree.loadPostData({update: nodes});
|
|
|
+ ledgerSpreadObj.refreshTree(info.sheet, refreshNode);
|
|
|
})
|
|
|
}
|
|
|
},
|
|
@@ -258,7 +262,7 @@ $(function () {
|
|
|
}
|
|
|
const select = SpreadJsObj.getSelectObject(info.sheet);
|
|
|
const col = info.sheet.zh_setting.cols[range.col];
|
|
|
- const validText = is_numeric(info.pasteData.text) ? parseFloat(info.pasteData.text) : (info.pasteData.text ? trimInvalidChar(info.pasteData.text) : null);
|
|
|
+ let validText = is_numeric(info.pasteData.text) ? parseFloat(info.pasteData.text) : (info.pasteData.text ? trimInvalidChar(info.pasteData.text) : null);
|
|
|
const orgValue = select[col.field];
|
|
|
if (orgValue == validText || ((!orgValue || orgValue === '') && (validText === ''))) {
|
|
|
SpreadJsObj.reLoadRowData(info.sheet, info.row);
|
|
@@ -271,14 +275,15 @@ $(function () {
|
|
|
}
|
|
|
const yearmonth = col.field.split('_')[0];
|
|
|
// 判断输入位数,提示
|
|
|
- const reg = new RegExp('^([-]?)\\d+(\\.\\d{0,'+ parseInt(tenderInfo.decimal.up) +'})?$');
|
|
|
+ const reg = new RegExp('^([-]?)\\d+$');
|
|
|
if (validText !== null && (!reg.test(validText))) {
|
|
|
- toastr.error('粘贴的工程量小数位数不能大于' + tenderInfo.decimal.up + '位');
|
|
|
- SpreadJsObj.reLoadRowData(info.sheet, info.cellRange.row, info.cellRange.rowCount);
|
|
|
- return;
|
|
|
+ // toastr.error('粘贴的工程量小数位数不能大于3位');
|
|
|
+ // SpreadJsObj.reLoadRowData(info.sheet, info.cellRange.row, info.cellRange.rowCount);
|
|
|
+ // return;
|
|
|
+ validText = ZhCalc.round(validText, 3);
|
|
|
}
|
|
|
const sj_gcl = validText;
|
|
|
- const sj_tp = select.dgn_price && select.dgn_price !== 0 ? ZhCalc.round(ZhCalc.mul(validText, select.dgn_price), tenderInfo.decimal.tp) : 0;
|
|
|
+ const sj_tp = select.dgn_price && select.dgn_price !== 0 ? ZhCalc.round(ZhCalc.mul(validText, select.dgn_price), 0) : 0;
|
|
|
select[col.field] = validText;
|
|
|
const updateData = {
|
|
|
lid: select.ledger_id,
|
|
@@ -290,13 +295,13 @@ $(function () {
|
|
|
postData(window.location.pathname + '/save', {type: 'ledger_edit', postData: updateData}, function (result) {
|
|
|
select[yearmonth + '_sj_tp'] = sj_tp;
|
|
|
const nodes = treeCalc.calculateParent(info.sheet.zh_tree, select);
|
|
|
- SpreadJsObj.reLoadNodesData(info.sheet, nodes);
|
|
|
- SpreadJsObj.reLoadRowData(info.sheet, info.cellRange.row, info.cellRange.rowCount);
|
|
|
+ const refreshNode = ledgerTree.loadPostData({update: nodes});
|
|
|
+ ledgerSpreadObj.refreshTree(info.sheet, refreshNode);
|
|
|
},function () {
|
|
|
select[col.field] = orgValue;
|
|
|
const nodes = treeCalc.calculateParent(info.sheet.zh_tree, select);
|
|
|
- SpreadJsObj.reLoadNodesData(info.sheet, nodes);
|
|
|
- SpreadJsObj.reLoadRowData(info.sheet, info.cellRange.row, info.cellRange.rowCount);
|
|
|
+ const refreshNode = ledgerTree.loadPostData({update: nodes});
|
|
|
+ ledgerSpreadObj.refreshTree(info.sheet, refreshNode);
|
|
|
})
|
|
|
},
|
|
|
};
|
|
@@ -315,7 +320,10 @@ $(function () {
|
|
|
level: 'level',
|
|
|
rootId: -1,
|
|
|
fullPath: 'full_path',
|
|
|
- calcFields: ['plan_gcl', 'plan_tp', 'next_plan_gcl', 'next_plan_tp', 'end_plan_gcl', 'end_plan_tp', 'year_plan_gcl', 'year_plan_tp'],
|
|
|
+ calcFun: function (node) {
|
|
|
+ node.dgn_price = ZhCalc.round(ZhCalc.div(node.total_price, node.dgn_qty1), 2);
|
|
|
+ },
|
|
|
+ calcFields: ['plan_tp', 'next_plan_tp', 'end_plan_tp', 'year_plan_tp', 'total_price', 'end_gather_tp', 'year_gather_tp', 'gather_tp'],
|
|
|
};
|
|
|
|
|
|
const huizong_static_cols = [
|
|
@@ -324,19 +332,19 @@ $(function () {
|
|
|
{title: '单位', colSpan: '1', rowSpan: '2', field: 'unit', hAlign: 1, width: 50, formatter: '@', readOnly: true},
|
|
|
{title: '经济指标', colSpan: '1', rowSpan: '2', field: 'dgn_price', hAlign: 2, width: 60, type: 'Number', readOnly: true},
|
|
|
{title: '总设计|工程量', colSpan: '2|1', rowSpan: '1|1', field: 'dgn_qty1', hAlign: 2, width: 70, type: 'Number', readOnly: true},
|
|
|
- {title: '|金额(万元)', colSpan: '|1', rowSpan: '|1', field: 'total_price', hAlign: 2, width: 70, type: 'Number', readOnly: true},
|
|
|
+ {title: '|金额(元)', colSpan: '|1', rowSpan: '|1', field: 'total_price', hAlign: 2, width: 70, type: 'Number', readOnly: true},
|
|
|
{title: '自开工至本月计划完成|工程量', colSpan: '2|1', rowSpan: '1|1', field: 'end_plan_gcl', hAlign: 2, width: 70, type: 'Number', readOnly: true},
|
|
|
- {title: '|金额(万元)', colSpan: '|1', rowSpan: '|1', field: 'end_plan_tp', hAlign: 2, width: 70, type: 'Number', readOnly: true},
|
|
|
+ {title: '|金额(元)', colSpan: '|1', rowSpan: '|1', field: 'end_plan_tp', hAlign: 2, width: 70, type: 'Number', readOnly: true},
|
|
|
{title: '截止本月完成计量|工程量', colSpan: '2|1', rowSpan: '1|1', field: 'end_gather_qty', hAlign: 2, width: 70, type: 'Number', readOnly: true},
|
|
|
- {title: '|金额(万元)', colSpan: '|1', rowSpan: '|1', field: 'end_gather_tp', hAlign: 2, width: 70, type: 'Number', readOnly: true},
|
|
|
+ {title: '|金额(元)', colSpan: '|1', rowSpan: '|1', field: 'end_gather_tp', hAlign: 2, width: 70, type: 'Number', readOnly: true},
|
|
|
{title: '本年计划完成|工程量', colSpan: '2|1', rowSpan: '1|1', field: 'year_plan_gcl', hAlign: 2, width: 70, type: 'Number', readOnly: true},
|
|
|
- {title: '|金额(万元)', colSpan: '|1', rowSpan: '|1', field: 'year_plan_tp', hAlign: 2, width: 70, type: 'Number', readOnly: true},
|
|
|
+ {title: '|金额(元)', colSpan: '|1', rowSpan: '|1', field: 'year_plan_tp', hAlign: 2, width: 70, type: 'Number', readOnly: true},
|
|
|
{title: '本年累计完成|工程量', colSpan: '2|1', rowSpan: '1|1', field: 'year_contract_qty', hAlign: 2, width: 70, type: 'Number', readOnly: true},
|
|
|
- {title: '|金额(万元)', colSpan: '|1', rowSpan: '|1', field: 'year_gather_tp', hAlign: 2, width: 70, type: 'Number', readOnly: true},
|
|
|
+ {title: '|金额(元)', colSpan: '|1', rowSpan: '|1', field: 'year_gather_tp', hAlign: 2, width: 70, type: 'Number', readOnly: true},
|
|
|
{title: '本月计划完成|工程量', colSpan: '2|1', rowSpan: '1|1', field: 'plan_gcl', hAlign: 2, width: 70, type: 'Number', readOnly: true},
|
|
|
- {title: '|金额(万元)', colSpan: '|1', rowSpan: '|1', field: 'plan_tp', hAlign: 2, width: 70, type: 'Number', readOnly: true},
|
|
|
+ {title: '|金额(元)', colSpan: '|1', rowSpan: '|1', field: 'plan_tp', hAlign: 2, width: 70, type: 'Number', readOnly: true},
|
|
|
{title: '下月计划|工程量', colSpan: '2|1', rowSpan: '1|1', field: 'next_plan_gcl', hAlign: 2, width: 70, type: 'Number', readOnly: true},
|
|
|
- {title: '|金额(万元)', colSpan: '|1', rowSpan: '|1', field: 'next_plan_tp', hAlign: 2, width: 70, type: 'Number', readOnly: true},
|
|
|
+ {title: '|金额(元)', colSpan: '|1', rowSpan: '|1', field: 'next_plan_tp', hAlign: 2, width: 70, type: 'Number', readOnly: true},
|
|
|
];
|
|
|
|
|
|
const huizongSpreadSetting = {
|
|
@@ -361,72 +369,70 @@ $(function () {
|
|
|
|
|
|
const huizongObj = {
|
|
|
setSjs: function (order) {
|
|
|
- postData('/tender/' + getTenderId() + '/measure/stage/' + order + '/load', { filter: 'ledger' }, function (data) {
|
|
|
- postData('/tender/' + getTenderId() + '/schedule/stage/' + order + '/load', {}, function (data2) {
|
|
|
- const calcList = ['year_contract_qty', 'year_gather_tp',
|
|
|
- 'contract_qty', 'end_gather_qty', 'contract_tp', 'qc_qty', 'qc_tp', 'total_price', 'contract_tp', 'qc_tp', 'gather_tp',
|
|
|
- 'pre_contract_tp', 'pre_qc_tp', 'pre_gather_tp', 'end_contract_tp', 'end_qc_tp', 'end_gather_tp', 'end_correct_tp'];
|
|
|
- const showList = ['plan_gcl', 'plan_tp', 'next_plan_gcl', 'next_plan_tp', 'end_plan_gcl', 'end_plan_tp', 'year_plan_gcl', 'year_plan_tp',
|
|
|
- 'year_contract_qty', 'year_gather_tp',
|
|
|
- 'contract_qty', 'end_gather_qty', 'contract_tp', 'qc_qty', 'qc_tp', 'ledger_id', 'ledger_pid', 'order', 'level', 'tender_id', 'full_path',
|
|
|
- 'code', 'name', 'unit', 'dgn_qty1', 'dgn_qty2', 'dgn_price', 'quantity', 'total_price', 'contract_tp', 'qc_tp', 'gather_tp',
|
|
|
- 'pre_contract_tp', 'pre_qc_tp', 'pre_gather_tp', 'end_contract_tp', 'end_qc_tp', 'end_gather_tp', 'end_correct_tp'];
|
|
|
- const baseLedgerTreeSetting = {
|
|
|
- id: 'ledger_id',
|
|
|
- pid: 'ledger_pid',
|
|
|
- order: 'order',
|
|
|
- level: 'level',
|
|
|
- rootId: -1,
|
|
|
- fullPath: 'full_path',
|
|
|
- calcFields: calcList,
|
|
|
- };
|
|
|
- baseLedgerTreeSetting.updateFields = ['year_contract_qty', 'year_gather_tp', 'contract_qty', 'end_gather_qty', 'contract_tp', 'qc_qty', 'qc_tp', 'postil', 'used', 'contract_expr'];
|
|
|
- baseLedgerTreeSetting.calcFun = function (node) {
|
|
|
- if (!node.children || node.children.length === 0) {
|
|
|
- node.pre_gather_qty = ZhCalc.add(node.pre_contract_qty, node.pre_qc_qty);
|
|
|
- node.gather_qty = ZhCalc.add(node.contract_qty, node.qc_qty);
|
|
|
- node.end_contract_qty = ZhCalc.add(node.pre_contract_qty, node.contract_qty);
|
|
|
- node.end_qc_qty = ZhCalc.add(node.pre_qc_qty, node.qc_qty);
|
|
|
- node.end_gather_qty = ZhCalc.add(node.pre_gather_qty, node.gather_qty);
|
|
|
- }
|
|
|
- node.pre_gather_tp = ZhCalc.add(node.pre_contract_tp, node.pre_qc_tp);
|
|
|
- node.gather_tp = ZhCalc.add(node.contract_tp, node.qc_tp);
|
|
|
- node.end_contract_tp = ZhCalc.add(node.pre_contract_tp, node.contract_tp);
|
|
|
- node.end_qc_tp = ZhCalc.add(node.pre_qc_tp, node.qc_tp);
|
|
|
- node.end_gather_tp = ZhCalc.add(node.pre_gather_tp, node.gather_tp);
|
|
|
- node.end_final_tp = ZhCalc.add(node.end_qc_tp, node.total_price);
|
|
|
- if (!node.children || node.children.length === 0) {
|
|
|
- if (node.end_contract_qty) {
|
|
|
- node.end_correct_tp = ZhCalc.add(node.end_qc_tp, ZhCalc.mul(node.end_contract_qty, node.unit_price, tenderInfo.decimal.tp));
|
|
|
- } else {
|
|
|
- node.end_correct_tp = node.end_gather_tp;
|
|
|
- }
|
|
|
+ postData('/tender/' + getTenderId() + '/schedule/stage/' + order + '/load', {filter: 'gcl' }, function (data) {
|
|
|
+ const calcList = ['year_gather_tp',
|
|
|
+ 'contract_tp', 'qc_qty', 'qc_tp', 'total_price', 'contract_tp', 'qc_tp', 'gather_tp',
|
|
|
+ 'pre_contract_tp', 'pre_qc_tp', 'pre_gather_tp', 'end_contract_tp', 'end_qc_tp', 'end_gather_tp', 'end_correct_tp'];
|
|
|
+ const showList = ['plan_gcl', 'plan_tp', 'next_plan_gcl', 'next_plan_tp', 'end_plan_gcl', 'end_plan_tp', 'year_plan_gcl', 'year_plan_tp',
|
|
|
+ 'year_contract_qty', 'year_gather_tp',
|
|
|
+ 'contract_qty', 'end_gather_qty', 'contract_tp', 'qc_qty', 'qc_tp', 'ledger_id', 'ledger_pid', 'order', 'level', 'tender_id', 'full_path',
|
|
|
+ 'code', 'name', 'unit', 'dgn_qty1', 'dgn_qty2', 'dgn_price', 'quantity', 'total_price', 'contract_tp', 'qc_tp', 'gather_tp',
|
|
|
+ 'pre_contract_tp', 'pre_qc_tp', 'pre_gather_tp', 'end_contract_tp', 'end_qc_tp', 'end_gather_tp', 'end_correct_tp'];
|
|
|
+ const baseLedgerTreeSetting = {
|
|
|
+ id: 'ledger_id',
|
|
|
+ pid: 'ledger_pid',
|
|
|
+ order: 'order',
|
|
|
+ level: 'level',
|
|
|
+ rootId: -1,
|
|
|
+ fullPath: 'full_path',
|
|
|
+ calcFields: calcList,
|
|
|
+ };
|
|
|
+ baseLedgerTreeSetting.updateFields = ['year_contract_qty', 'year_gather_tp', 'contract_qty', 'end_gather_qty', 'contract_tp', 'qc_qty', 'qc_tp', 'postil', 'used', 'contract_expr'];
|
|
|
+ baseLedgerTreeSetting.calcFun = function (node) {
|
|
|
+ if (!node.children || node.children.length === 0) {
|
|
|
+ node.pre_gather_qty = ZhCalc.add(node.pre_contract_qty, node.pre_qc_qty);
|
|
|
+ node.gather_qty = ZhCalc.add(node.contract_qty, node.qc_qty);
|
|
|
+ node.end_contract_qty = ZhCalc.add(node.pre_contract_qty, node.contract_qty);
|
|
|
+ node.end_qc_qty = ZhCalc.add(node.pre_qc_qty, node.qc_qty);
|
|
|
+ node.end_gather_qty = ZhCalc.add(node.pre_gather_qty, node.gather_qty);
|
|
|
+ }
|
|
|
+ node.pre_gather_tp = ZhCalc.add(node.pre_contract_tp, node.pre_qc_tp);
|
|
|
+ node.gather_tp = ZhCalc.add(node.contract_tp, node.qc_tp);
|
|
|
+ node.end_contract_tp = ZhCalc.add(node.pre_contract_tp, node.contract_tp);
|
|
|
+ node.end_qc_tp = ZhCalc.add(node.pre_qc_tp, node.qc_tp);
|
|
|
+ node.end_gather_tp = ZhCalc.add(node.pre_gather_tp, node.gather_tp);
|
|
|
+ node.end_final_tp = ZhCalc.add(node.end_qc_tp, node.total_price);
|
|
|
+ if (!node.children || node.children.length === 0) {
|
|
|
+ if (node.end_contract_qty) {
|
|
|
+ node.end_correct_tp = ZhCalc.add(node.end_qc_tp, ZhCalc.mul(node.end_contract_qty, node.unit_price, tenderInfo.decimal.tp));
|
|
|
+ } else {
|
|
|
+ node.end_correct_tp = node.end_gather_tp;
|
|
|
}
|
|
|
- node.end_gather_percent = ZhCalc.mul(ZhCalc.div(node.end_gather_tp, node.end_final_tp), 100, 2);
|
|
|
- node.end_correct_percent = ZhCalc.mul(ZhCalc.div(node.end_correct_tp, node.end_final_tp), 100, 2);
|
|
|
- node.final_dgn_price = ZhCalc.round(ZhCalc.div(node.end_gather_tp, ZhCalc.add(node.deal_dgn_qty1, node.c_dgn_qty1)), tenderInfo.decimal.up);
|
|
|
- node.dgn_price = ZhCalc.round(ZhCalc.div(node.total_price, node.dgn_qty1), 2);
|
|
|
- };
|
|
|
- const baseLedgerTree = createNewPathTree('base', baseLedgerTreeSetting);
|
|
|
- const newLedgerList = setTpMonthToLedger(data.ledgerData, data2.slmList, data2.nextSlmList, data2.endSlmList, data2.yearSlmList, data2.curYearStageData);
|
|
|
- baseLedgerTree.loadDatas(newLedgerList);
|
|
|
- treeCalc.calculateAll(baseLedgerTree);
|
|
|
- const huizongTree = createNewPathTree('filter', huizongTreeSetting);
|
|
|
- for (const d of baseLedgerTree.nodes) {
|
|
|
- if (!d.b_code) {
|
|
|
- const one = _.find(selectedLedgerList, function (item) {
|
|
|
- return item === d.ledger_id;
|
|
|
- });
|
|
|
- if (one) {
|
|
|
- huizongTree.addData(d, showList);
|
|
|
- }
|
|
|
+ }
|
|
|
+ node.end_gather_percent = ZhCalc.mul(ZhCalc.div(node.end_gather_tp, node.end_final_tp), 100, 2);
|
|
|
+ node.end_correct_percent = ZhCalc.mul(ZhCalc.div(node.end_correct_tp, node.end_final_tp), 100, 2);
|
|
|
+ node.final_dgn_price = ZhCalc.round(ZhCalc.div(node.end_gather_tp, ZhCalc.add(node.deal_dgn_qty1, node.c_dgn_qty1)), tenderInfo.decimal.up);
|
|
|
+ node.dgn_price = ZhCalc.round(ZhCalc.div(node.total_price, node.dgn_qty1), 2);
|
|
|
+ };
|
|
|
+ const baseLedgerTree = createNewPathTree('base', baseLedgerTreeSetting);
|
|
|
+ const newLedgerList = setTpMonthToLedger(data.ledgerData, data.slmList, data.nextSlmList, data.endSlmList, data.yearSlmList, data.curYearStageData);
|
|
|
+ baseLedgerTree.loadDatas(newLedgerList);
|
|
|
+ treeCalc.calculateAll(baseLedgerTree);
|
|
|
+ const huizongTree = createNewPathTree('filter', huizongTreeSetting);
|
|
|
+ for (const d of baseLedgerTree.nodes) {
|
|
|
+ if (!d.b_code) {
|
|
|
+ const one = _.find(selectedLedgerList, function (item) {
|
|
|
+ return item === d.ledger_id;
|
|
|
+ });
|
|
|
+ if (one) {
|
|
|
+ huizongTree.addData(d, showList);
|
|
|
}
|
|
|
}
|
|
|
- huizongTree.sortTreeNode(true);
|
|
|
- treeCalc.calculateAll(huizongTree);
|
|
|
- console.log(huizongTree);
|
|
|
- SpreadJsObj.loadSheetData(huizongSpread.getActiveSheet(), SpreadJsObj.DataType.Tree, huizongTree);
|
|
|
- }, null, true);
|
|
|
+ }
|
|
|
+ huizongTree.sortTreeNode(true);
|
|
|
+ treeCalc.calculateAll(huizongTree);
|
|
|
+ console.log(huizongTree);
|
|
|
+ SpreadJsObj.loadSheetData(huizongSpread.getActiveSheet(), SpreadJsObj.DataType.Tree, huizongTree);
|
|
|
}, null, true);
|
|
|
},
|
|
|
dropDownHtml: function (order) {
|
|
@@ -435,10 +441,10 @@ $(function () {
|
|
|
if (ss.order !== order) {
|
|
|
html += '<a class="dropdown-item change-tp" data-order="'+ ss.order +'" href="javascript:void(0);">'+ ss.yearmonth.split('-')[0] + '年' + parseInt(ss.yearmonth.split('-')[1]) +'月(第'+ ss.order +'期)</a>';
|
|
|
} else {
|
|
|
- $('#dropdownMenuButton').text(ss.yearmonth.split('-')[0] + '年' + parseInt(ss.yearmonth.split('-')[1]) +'月(第'+ ss.order +'期)');
|
|
|
+ $('#stageDropdownMenuButton').text(ss.yearmonth.split('-')[0] + '年' + parseInt(ss.yearmonth.split('-')[1]) +'月(第'+ ss.order +'期)');
|
|
|
}
|
|
|
}
|
|
|
- $('.dropdown-menu').html(html);
|
|
|
+ $('#stageDropdownMenu').html(html);
|
|
|
}
|
|
|
};
|
|
|
|