|
@@ -36,7 +36,7 @@ function customColDisplay () {
|
|
|
{ title: '本期完成计量', fields: ['gather_qty', 'gather_tp'], visible: true },
|
|
|
{ title: '截止本期计量合同', fields: ['end_contract_qty', 'end_contract_tp'], visible: true },
|
|
|
{ title: '截止本期数量变更', fields: ['end_qc_qty', 'end_qc_tp', 'end_qc_bgl'], visible: true },
|
|
|
- { title: '截止本期完成计量', fields: ['end_gather_qty', 'end_gather_tp', 'end_gather_percent'], visible: true },
|
|
|
+ { title: '截止本期完成计量', fields: ['end_gather_qty', 'end_gather_tp', 'end_gather_percent', 'end_final_1_percent'], visible: true },
|
|
|
{ title: '本期批注', fields: ['postil'], visible: true },
|
|
|
{ title: '图册号', fields: ['drawing_code'], visible: true },
|
|
|
{ title: '备注', fields: ['memo'], visible: true },
|
|
@@ -165,16 +165,26 @@ $(document).ready(() => {
|
|
|
markExpandSubKey: window.location.pathname.split('/')[2],
|
|
|
};
|
|
|
// 台账树结构计算相关设置
|
|
|
- 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', 'end_contract_tp', 'end_qc_tp', 'end_gather_tp', 'end_correct_tp'];
|
|
|
+ stageTreeSetting.updateFields = ['contract_qty', 'contract_tp', 'qc_qty', 'qc_tp', 'qc_minus_qty', 'postil', 'used', 'contract_expr'];
|
|
|
+ stageTreeSetting.calcFields = ['deal_tp', 'total_price', 'contract_tp', 'qc_tp', 'gather_tp',
|
|
|
+ 'end_contract_tp', 'end_qc_tp', 'end_gather_tp', 'end_correct_tp', 'final_1_tp', 'end_final_1_tp'];
|
|
|
stageTreeSetting.calcFun = function (node) {
|
|
|
if (!node.children || node.children.length === 0) {
|
|
|
node.gather_qty = ZhCalc.add(node.contract_qty, node.qc_qty);
|
|
|
node.end_gather_qty = ZhCalc.add(node.end_contract_qty, node.end_qc_qty);
|
|
|
+ node.end_qc_minus_qty = ZhCalc.add(node.pre_qc_minus_qty, node.qc_minus_qty);
|
|
|
+ node.final_1_qty = ZhCalc.add(node.end_qc_minus_qty, node.quantity);
|
|
|
+ node.final_1_tp = ZhCalc.mul(node.final_1_qty, node.unit_price, tenderInfo.decimal.tp);
|
|
|
+ node.deal_final_1_qty = ZhCalc.add(node.end_qc_minus_qty, node.deal_qty);
|
|
|
+ node.end_final_1_qty = ZhCalc.add(node.end_qc_qty, node.final_1_qty);
|
|
|
}
|
|
|
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_gather_tp = ZhCalc.add(node.end_contract_tp, node.end_qc_tp);
|
|
|
node.end_final_tp = ZhCalc.add(node.end_qc_tp, node.total_price);
|
|
|
+ node.end_final_1_tp = ZhCalc.add(node.end_qc_tp, node.final_1_tp);
|
|
|
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));
|
|
@@ -185,6 +195,8 @@ $(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.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.end_final_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);
|
|
|
};
|
|
|
const stageTree = createNewPathTree('stage', stageTreeSetting);
|
|
|
// 初始化 计量单元 数据结构
|
|
@@ -192,19 +204,23 @@ $(document).ready(() => {
|
|
|
stagePosSetting.calcFun = function (pos) {
|
|
|
pos.gather_qty = ZhCalc.add(pos.contract_qty, pos.qc_qty);
|
|
|
pos.end_gather_qty = ZhCalc.add(pos.end_contract_qty, pos.end_qc_qty);
|
|
|
+ pos.end_qc_minus_qty = ZhCalc.add(pos.pre_qc_minus_qty, pos.qc_minus_qty);
|
|
|
pos.sum = ZhCalc.add(pos.end_qc_qty, pos.quantity);
|
|
|
pos.end_gather_percent = ZhCalc.mul(ZhCalc.div(pos.end_gather_qty, pos.sum), 100, 2);
|
|
|
pos.estimate_qty = !checkZero(pos.real_qty)
|
|
|
? ZhCalc.sub(ZhCalc.sub(pos.real_qty, pos.quantity), pos.end_qc_qty)
|
|
|
: null;
|
|
|
+ pos.final_1_qty = ZhCalc.add(pos.end_qc_minus_qty, pos.quantity);
|
|
|
+ pos.deal_final_1_qty = ZhCalc.add(pos.end_qc_minus_qty, pos.deal_qty);
|
|
|
+ pos.end_final_1_qty = ZhCalc.add(pos.end_qc_qty, pos.final_1_qty);
|
|
|
};
|
|
|
const stagePos = new StagePosData(stagePosSetting);
|
|
|
|
|
|
// 初始化 台账 spread
|
|
|
const slSpread = SpreadJsObj.createNewSpread($('#stage-ledger')[0]);
|
|
|
customizeStageTreeSetting(ledgerSpreadSetting, customColDisplay());
|
|
|
- const ratioCol = ledgerSpreadSetting.cols.find(x => {return x.field === 'end_gather_percent' || x.field === 'end_correct_percent'});
|
|
|
- ratioCol.field = tenderInfo.display.stage.correct ? 'end_correct_percent' : 'end_gather_percent';
|
|
|
+ const ratioCol = ledgerSpreadSetting.cols.find(x => {return x.field === 'end_final_1_percent' || x.field === 'end_correct_1_percent'});
|
|
|
+ if (ratioCol) ratioCol.field = tenderInfo.display.stage.correct ? 'end_correct_1_percent' : 'end_final_1_percent';
|
|
|
ledgerSpreadSetting.imageClick = function (data, hitinfo) {
|
|
|
const col = hitinfo.sheet.zh_setting.cols[hitinfo.col];
|
|
|
if (col.field === 'dagl') data.dagl_url && window.open(data.dagl_url);
|