|
@@ -32,20 +32,20 @@ $(function () {
|
|
|
{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: '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: '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: '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: '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: '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: '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: '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: '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: '2|1', rowSpan: '1|1', field: 'contract_qty', hAlign: 2, width: 70, type: 'Number', readOnly: true},
|
|
|
{title: '|金额(万元)', colSpan: '|1', rowSpan: '|1', field: 'gather_tp', hAlign: 2, width: 70, 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: '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},
|
|
|
];
|
|
|
|
|
|
const ledgerSpreadSetting = {
|
|
@@ -70,9 +70,10 @@ $(function () {
|
|
|
|
|
|
if (curScheduleStage && curScheduleStage.order) {
|
|
|
postData('/tender/' + getTenderId() + '/measure/stage/' + curScheduleStage.order + '/load', { filter: 'ledger' }, function (data) {
|
|
|
- const calcList = ['contract_qty', 'contract_tp', 'qc_qty', 'qc_tp', 'total_price', 'contract_tp', 'qc_tp', 'gather_tp',
|
|
|
+ const calcList = ['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 = ['contract_qty', 'contract_tp', 'qc_qty', 'qc_tp', 'ledger_id', 'ledger_pid', 'order', 'level', 'tender_id', 'full_path',
|
|
|
+ const showList = ['plan_gcl', 'plan_tp', 'next_plan_gcl', 'next_plan_tp', 'end_plan_gcl', 'end_plan_tp', 'year_plan_gcl', 'year_plan_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 = {
|
|
@@ -84,7 +85,7 @@ $(function () {
|
|
|
fullPath: 'full_path',
|
|
|
calcFields: calcList,
|
|
|
};
|
|
|
- baseLedgerTreeSetting.updateFields = ['contract_qty', 'contract_tp', 'qc_qty', 'qc_tp', 'postil', 'used', 'contract_expr'];
|
|
|
+ baseLedgerTreeSetting.updateFields = ['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);
|
|
@@ -112,8 +113,9 @@ $(function () {
|
|
|
node.dgn_price = ZhCalc.round(ZhCalc.div(node.total_price, node.dgn_qty1), 2);
|
|
|
};
|
|
|
const baseLedgerTree = createNewPathTree('base', baseLedgerTreeSetting);
|
|
|
- // const newLedgerList = setMonthToLedger(data.bills, data.slm);
|
|
|
- baseLedgerTree.loadDatas(data.ledgerData);
|
|
|
+ const newLedgerList = setMonthToLedger(data.ledgerData, slmList, nextSlmList, endSlmList, yearSlmList);
|
|
|
+ console.log(newLedgerList);
|
|
|
+ baseLedgerTree.loadDatas(newLedgerList);
|
|
|
treeCalc.calculateAll(baseLedgerTree);
|
|
|
console.log(baseLedgerTree);
|
|
|
for (const d of baseLedgerTree.nodes) {
|
|
@@ -197,7 +199,7 @@ $(function () {
|
|
|
return;
|
|
|
}
|
|
|
const _self = $(this);
|
|
|
- postData(window.location.pathname + '/save', {type: 'add_stage', postData: { yearmonth, order }}, function (result) {
|
|
|
+ postData('/tender/'+ getTenderId() + '/schedule/stage/save', {type: 'add_stage', postData: { yearmonth, order }}, function (result) {
|
|
|
_self.addClass('disabled').attr('disabled', true);
|
|
|
toastr.success('新增成功');
|
|
|
setTimeout(function () {
|
|
@@ -265,16 +267,40 @@ function setLeafData(tree) {
|
|
|
return newtree;
|
|
|
}
|
|
|
|
|
|
-function setMonthToLedger(ledgerList, slm) {
|
|
|
+function setMonthToLedger(ledgerList, slm, nextSlm, endSlm, yearSlm) {
|
|
|
if (slm.length > 0) {
|
|
|
for(const s of slm) {
|
|
|
const index = _.findIndex(ledgerList, { 'ledger_id': s.lid });
|
|
|
- const canCalc = _.find(scheduleMonth, { 'yearmonth': s.yearmonth, 'stage_used': 1});
|
|
|
- if (index && index !== -1 && canCalc) {
|
|
|
- ledgerList[index][s.yearmonth + '_plan_tp'] = s.plan_tp;
|
|
|
- ledgerList[index][s.yearmonth + '_plan_gcl'] = s.plan_gcl;
|
|
|
- ledgerList[index][s.yearmonth + '_sj_tp'] = s.sj_tp;
|
|
|
- ledgerList[index][s.yearmonth + '_sj_gcl'] = s.sj_gcl;
|
|
|
+ if (index && index !== -1) {
|
|
|
+ ledgerList[index].plan_tp = s.plan_tp;
|
|
|
+ ledgerList[index].plan_gcl = s.plan_gcl;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (nextSlm.length > 0) {
|
|
|
+ for (const ns of nextSlm) {
|
|
|
+ const index = _.findIndex(ledgerList, {'ledger_id': ns.lid});
|
|
|
+ if (index && index !== -1) {
|
|
|
+ ledgerList[index].next_plan_tp = ns.plan_tp;
|
|
|
+ ledgerList[index].next_plan_gcl = ns.plan_gcl;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (endSlm.length > 0) {
|
|
|
+ for (const es of endSlm) {
|
|
|
+ const index = _.findIndex(ledgerList, {'ledger_id': es.lid});
|
|
|
+ if (index && index !== -1) {
|
|
|
+ ledgerList[index].end_plan_tp = es.plan_tp;
|
|
|
+ ledgerList[index].end_plan_gcl = es.plan_gcl;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (yearSlm.length > 0) {
|
|
|
+ for (const ys of yearSlm) {
|
|
|
+ const index = _.findIndex(ledgerList, {'ledger_id': ys.lid});
|
|
|
+ if (index && index !== -1) {
|
|
|
+ ledgerList[index].year_plan_tp = ys.plan_tp;
|
|
|
+ ledgerList[index].year_plan_gcl = ys.plan_gcl;
|
|
|
}
|
|
|
}
|
|
|
}
|