|
@@ -64,9 +64,13 @@ $(function () {
|
|
|
|
|
|
postData(window.location.pathname + '/load', {}, function (data) {
|
|
|
const showList = ['is_select', 'can_select', 'ledger_id', 'ledger_pid', 'order', 'level', 'tender_id', 'full_path',
|
|
|
- 'code', 'name', 'unit', 'dgn_qty1', 'dgn_qty2', 'dgn_price', 'quantity', 'total_price'];
|
|
|
- const calcList = ['total_price'];
|
|
|
- const fileds = [];
|
|
|
+ 'code', 'name', 'unit', 'dgn_qty1', 'dgn_qty2', 'dgn_price', 'quantity', 'total_price',
|
|
|
+ 'final_contract_tp', 'final_qc_tp', 'pre_final_contract_tp', 'pre_final_qc_tp', 'pre_final_gather_tp', 'final_gather_tp', 'end_final_gather_tp'
|
|
|
+ ];
|
|
|
+ const calcList = ['total_price',
|
|
|
+ 'final_contract_tp', 'final_qc_tp', 'pre_final_contract_tp', 'pre_final_qc_tp', 'pre_final_gather_tp', 'final_gather_tp', 'end_final_gather_tp'
|
|
|
+ ];
|
|
|
+ const fileds = ['final_contract_tp', 'final_qc_tp'];
|
|
|
if (scheduleStage.length > 0) {
|
|
|
for (const ss of scheduleStage) {
|
|
|
// const pushTp = [ss.order + '_gather_tp', ss.order + '_contract_tp', ss.order + '_qc_tp'];
|
|
@@ -96,6 +100,9 @@ $(function () {
|
|
|
node[ss.order + '_gather_tp'] = ZhCalc.add(node[ss.order + '_contract_tp'], node[ss.order + '_qc_tp']);
|
|
|
}
|
|
|
}
|
|
|
+ node.pre_final_gather_tp = ZhCalc.add(node.pre_final_contract_tp, node.pre_final_qc_tp);
|
|
|
+ node.final_gather_tp = ZhCalc.add(node.final_contract_tp, node.final_qc_tp);
|
|
|
+ node.end_final_gather_tp = ZhCalc.add(node.pre_final_gather_tp, node.final_gather_tp);
|
|
|
}
|
|
|
});
|
|
|
slh = data.slh;
|
|
@@ -222,7 +229,9 @@ $(function () {
|
|
|
const [under_ledger, parent_ledger] = getPAndULedger(select_ledger);
|
|
|
// 重新计算每一期计量进度金额并提交
|
|
|
const stageTpList = calcStageTp(under_ledger);
|
|
|
- postData(window.location.pathname + '/save', { select_ledger: _.map(select_ledger, 'ledger_id'), under_ledger, parent_ledger, stageTpList, type: 'sz' } , function (result) {
|
|
|
+ const stageSjTp = calcStageSjTp(under_ledger);
|
|
|
+ console.log(under_ledger, stageSjTp);
|
|
|
+ postData(window.location.pathname + '/save', { select_ledger: _.map(select_ledger, 'ledger_id'), under_ledger, parent_ledger, stageTpList, stageSjTp, type: 'sz' } , function (result) {
|
|
|
toastr.success('设置成功');
|
|
|
setTimeout(function () {
|
|
|
window.location.reload();
|
|
@@ -254,7 +263,9 @@ $(function () {
|
|
|
const [under_ledger, parent_ledger] = getPAndULedger(select_ledger);
|
|
|
// 重新计算每一期计量进度金额并提交
|
|
|
const stageTpList = calcStageTp(under_ledger);
|
|
|
- postData(window.location.pathname + '/save', { select_ledger: _.map(select_ledger, 'ledger_id'), under_ledger, parent_ledger, stageTpList, type: 'xz' } , function (result) {
|
|
|
+ const stageSjTp = calcStageSjTp(under_ledger);
|
|
|
+ console.log(stageSjTp);
|
|
|
+ postData(window.location.pathname + '/save', { select_ledger: _.map(select_ledger, 'ledger_id'), under_ledger, parent_ledger, stageTpList, stageSjTp, type: 'xz' } , function (result) {
|
|
|
toastr.success('进度台账数据修正成功');
|
|
|
setTimeout(function () {
|
|
|
window.location.reload();
|
|
@@ -268,7 +279,7 @@ $(function () {
|
|
|
for (const sl of select_ledger) {
|
|
|
const hadChild = _.find(select_ledger, { ledger_pid: sl.ledger_id });
|
|
|
if (!hadChild) {
|
|
|
- const pushArray = { ledger_id: sl.ledger_id, ledger_pid: sl.ledger_pid, gcl: sl.dgn_qty1, tp: sl.total_price };
|
|
|
+ const pushArray = { ledger_id: sl.ledger_id, ledger_pid: sl.ledger_pid, gcl: sl.dgn_qty1, tp: sl.total_price, end_final_gather_tp: sl.end_final_gather_tp };
|
|
|
if (scheduleStage.length > 0) {
|
|
|
for (const ss of scheduleStage) {
|
|
|
pushArray[ss.order + '_gather_tp'] = sl[ss.order + '_gather_tp'];
|
|
@@ -357,6 +368,15 @@ function calcStageTp(list) {
|
|
|
}
|
|
|
return false;
|
|
|
}
|
|
|
+
|
|
|
+function calcStageSjTp(list) {
|
|
|
+ let stageSjTp = 0;
|
|
|
+ for (const l of list) {
|
|
|
+ stageSjTp = ZhCalc.add(stageSjTp, l.end_final_gather_tp);
|
|
|
+ }
|
|
|
+ return stageSjTp;
|
|
|
+}
|
|
|
+
|
|
|
function addIsSelect(datas) {
|
|
|
// const newDatas = [];
|
|
|
for (const d of datas) {
|