|
@@ -267,9 +267,9 @@ $(document).ready(() => {
|
|
|
markExpandSubKey: window.location.pathname.split('/')[2],
|
|
|
};
|
|
|
// 台账树结构计算相关设置
|
|
|
- stageTreeSetting.updateFields = ['contract_qty', 'contract_tp', 'qc_qty', 'qc_tp', 'postil', 'used', 'contract_expr', 'minus_qc_qty'];
|
|
|
+ stageTreeSetting.updateFields = ['contract_qty', 'contract_tp', 'qc_qty', 'qc_tp', 'postil', 'used', 'contract_expr'];
|
|
|
stageTreeSetting.calcFields = ['deal_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', 'final_1_tp'];
|
|
|
+ 'pre_contract_tp', 'pre_qc_tp', 'pre_gather_tp', 'end_contract_tp', 'end_qc_tp', 'end_gather_tp', 'end_correct_tp'];
|
|
|
stageTreeSetting.calcFun = function (node) {
|
|
|
if (!node.children || node.children.length === 0) {
|
|
|
node.pre_gather_qty = ZhCalc.add(node.pre_contract_qty, node.pre_qc_qty);
|
|
@@ -277,10 +277,6 @@ $(document).ready(() => {
|
|
|
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.end_minus_qc_qty = ZhCalc.add(node.pre_minus_qc_qty, node.minus_qc_qty);
|
|
|
- node.final_1_qty = ZhCalc.add(node.end_minus_qc_qty, node.quantity); // 1#台账 台账+负变更
|
|
|
- node.final_1_tp = ZhCalc.mul(node.unit_price, node.final_1_qty, tenderInfo.decimal.tp);
|
|
|
- node.final_deal_1_qty = ZhCalc.add(node.end_minus_qc_qty, node.deal_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);
|
|
@@ -298,15 +294,13 @@ $(document).ready(() => {
|
|
|
}
|
|
|
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.end_gather_1_percent = ZhCalc.mul(ZhCalc.div(node.end_gather_tp, node.end_final_1_tp), 100, 2);
|
|
|
- node.end_correct_1_percent = ZhCalc.mul(ZhCalc.div(node.end_correct_tp, node.end_final_1_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);
|
|
|
};
|
|
|
const stageTree = createNewPathTree('stage', stageTreeSetting);
|
|
|
// 初始化 计量单元 数据结构
|
|
|
const stagePosSetting = {
|
|
|
id: 'id', ledgerId: 'lid',
|
|
|
- updateFields: ['contract_qty', 'qc_qty', 'postil', 'contract_expr', 'minus_qc_qty'],
|
|
|
+ updateFields: ['contract_qty', 'qc_qty', 'postil', 'contract_expr'],
|
|
|
};
|
|
|
stagePosSetting.calcFun = function (pos) {
|
|
|
pos.pre_gather_qty = ZhCalc.add(pos.pre_contract_qty, pos.pre_qc_qty);
|
|
@@ -319,8 +313,6 @@ $(document).ready(() => {
|
|
|
pos.estimate_qty = !checkZero(pos.real_qty)
|
|
|
? ZhCalc.sub(ZhCalc.sub(pos.real_qty, pos.quantity), pos.end_qc_qty)
|
|
|
: null;
|
|
|
- pos.end_minus_qc_qty = ZhCalc.add(pos.minus_qc_qty, pos.pre_minus_qc_qty);
|
|
|
- pos.final_1_qty = ZhCalc.add(pos.end_minus_qc_qty, pos.quantity);
|
|
|
};
|
|
|
const stagePos = new StagePosData(stagePosSetting);
|
|
|
|
|
@@ -421,6 +413,7 @@ $(document).ready(() => {
|
|
|
// 切换变更令,加载右侧明细数据
|
|
|
this.spread.bind(spreadNS.Events.SelectionChanged, function (e, info) {
|
|
|
const change = SpreadJsObj.getSelectObject(info.sheet);
|
|
|
+ console.log(change);
|
|
|
if(change) {
|
|
|
self._loadChangeDetail(change);
|
|
|
}
|
|
@@ -661,8 +654,6 @@ $(document).ready(() => {
|
|
|
};
|
|
|
const ratioCol = ledgerSpreadSetting.cols.find(x => {return x.field === 'end_gather_percent' || x.field === 'end_correct_percent'});
|
|
|
if (ratioCol) ratioCol.field = tenderInfo.display.stage.correct ? 'end_correct_percent' : 'end_gather_percent';
|
|
|
- const ratioCol1 = ledgerSpreadSetting.cols.find(x => {return x.field === 'end_gather_1_percent' || x.field === 'end_correct_1_percent'});
|
|
|
- if (ratioCol) ratioCol1.field = tenderInfo.display.stage.correct ? 'end_correct_1_percent' : 'end_gather_1_percent';
|
|
|
ledgerSpreadSetting.imageClick = function (data, hitinfo) {
|
|
|
const col = hitinfo.sheet.zh_setting.cols[hitinfo.col];
|
|
|
switch (col.field) {
|
|
@@ -2045,38 +2036,11 @@ $(document).ready(() => {
|
|
|
});
|
|
|
|
|
|
// 加载计量单元数据 - 暂时统一加载,如有需要,切换成动态加载并缓存
|
|
|
- postData(window.location.pathname + '/load', { filter: 'ledger;pos;detail;change;import_change;tag;cooperation;minus_change' }, function (result) {
|
|
|
+ postData(window.location.pathname + '/load', { filter: 'ledger;pos;detail;change;import_change;tag;cooperation' }, function (result) {
|
|
|
// 加载树结构
|
|
|
stageTree.loadDatas(result.ledgerData);
|
|
|
// 加载部位明细
|
|
|
stagePos.loadDatas(result.posData);
|
|
|
- let mcIndex = {};
|
|
|
- if (result.minus_change && result.minus_change.length > 0) {
|
|
|
- for (const mc of result.minus_change) {
|
|
|
- if (!mcIndex[mc.lid]) mcIndex[mc.lid] = stageTree.nodes.find(x => { return x.id === mc.lid; });
|
|
|
- if (mcIndex[mc.lid]) {
|
|
|
- mcIndex[mc.lid].pre_minus_qc_qty = ZhCalc.add(mcIndex[mc.lid].pre_minus_qc_qty, mc.qty);
|
|
|
- }
|
|
|
- const mcP = stagePos.getPos(mc.pid);
|
|
|
- if (mcP) {
|
|
|
- mcP.pre_minus_qc_qty = ZhCalc.add(mcP.pre_minus_qc_qty, mc.qty);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- if (result.changeData && result.changeData.length > 0) {
|
|
|
- for (const mc of result.changeData) {
|
|
|
- if (!mc.minus || !mc.qty) continue;
|
|
|
- if (!mcIndex[mc.lid]) mcIndex[mc.lid] = stageTree.nodes.find(x => { return x.id === mc.lid; });
|
|
|
- if (mcIndex[mc.lid]) {
|
|
|
- mcIndex[mc.lid].minus_qc_qty = ZhCalc.add(mcIndex[mc.lid].minus_qc_qty, mc.qty);
|
|
|
- }
|
|
|
- const mcP = stagePos.getPos(mc.pid);
|
|
|
- if (mcP) {
|
|
|
- mcP.minus_qc_qty = ZhCalc.add(mcP.minus_qc_qty, mc.qty);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- mcIndex = null;
|
|
|
checkShowLast(result.ledgerData.length);
|
|
|
treeCalc.calculateAll(stageTree);
|
|
|
// 加载解锁相关
|
|
@@ -3914,7 +3878,6 @@ $(document).ready(() => {
|
|
|
{title: '单价', field: 'unit_price', hAlign: 2, width: 50},
|
|
|
{title: '数量', field: 'quantity', hAlign: 2, width: 50},
|
|
|
{title: '完成率(%)', field: 'end_gather_percent', hAlign: 2, width: 70},
|
|
|
- {title: '本期负变更', field: 'minus_qc_qty', hAlign: 2, width: 50},
|
|
|
],
|
|
|
emptyRows: 0,
|
|
|
headRows: 1,
|
|
@@ -3953,11 +3916,6 @@ $(document).ready(() => {
|
|
|
}
|
|
|
}
|
|
|
}, {
|
|
|
- key: 'minus_qc_qty', title: '负变更', valid: true,
|
|
|
- check: function (node) {
|
|
|
- return node.end_minus_qc_qty;
|
|
|
- }
|
|
|
- }, {
|
|
|
key: 'estimate', title: '预计变更', valid: true,
|
|
|
check: function (node) {
|
|
|
const posRange = stagePos.ledgerPos[itemsPre + node.id] || [];
|