Browse Source

1. 计量台账,未计量勾选问题
2. 台账修订,截止本期计算问题

MaiXinRong 3 months ago
parent
commit
d1a6a5049e

+ 2 - 2
app/controller/revise_controller.js

@@ -433,8 +433,8 @@ module.exports = app => {
                 ]);
                 const settleStatusPos = ctx.revise.readySettle ? await ctx.service.settlePos.getAllDataByCondition({ where: { settle_id: ctx.revise.readySettle.id }}) : [];
                 this.ctx.helper.assignRelaData(revisePos, [
-                    { data: curPos, fields: ['contract_qty'], prefix: '', relaId: 'lid' },
-                    { data: prePos, fields: ['contract_qty'], prefix: 'pre_', relaId: 'lid' },
+                    { data: curPos, fields: ['contract_qty'], prefix: '', relaId: 'pid' },
+                    { data: prePos, fields: ['contract_qty'], prefix: 'pre_', relaId: 'pid' },
                     { data: settleStatusPos, fields: ['settle_status'], prefix: '', relaId: 'pid' },
                 ]);
                 const ledgerTags = await this.ctx.service.ledgerTag.getDatas(ctx.tender.id);

+ 3 - 2
app/public/js/revise.js

@@ -173,7 +173,7 @@ $(document).ready(() => {
     treeSetting.calcFun = function (node) {
         node.dgn_price = ZhCalc.round(ZhCalc.div(node.total_price, node.dgn_qty1), 2);
         node.end_contract_qty = ZhCalc.add(node.contract_qty, node.pre_contract_qty);
-        node.end_percent = node.quantity ? ZhCalc.mul(ZhCalc.div(node.contract_qty, node.quantity, 4), 100, 2) : 0;
+        node.end_percent = node.quantity ? ZhCalc.mul(ZhCalc.div(node.end_contract_qty, node.quantity, 4), 100, 2) : 0;
     };
     const billsTree = createNewPathTree('revise', treeSetting);
     // 初始化 计量单元
@@ -181,7 +181,7 @@ $(document).ready(() => {
         id: 'id', ledgerId: 'lid',
         calcFun: function(node) {
             node.end_contract_qty = ZhCalc.add(node.contract_qty, node.pre_contract_qty);
-            node.end_percent = node.quantity ? ZhCalc.mul(ZhCalc.div(node.contract_qty, node.quantity, 4), 100, 2) : 0;
+            node.end_percent = node.quantity ? ZhCalc.mul(ZhCalc.div(node.end_contract_qty, node.quantity, 4), 100, 2) : 0;
         }
     });
 
@@ -2169,6 +2169,7 @@ $(document).ready(() => {
         checkShowLast(result.bills.length);
 
         pos.loadDatas(result.pos);
+        pos.calculateAll();
         posSpreadObj.loadCurPosData();
         SpreadJsObj.resetTopAndSelect(posSheet);
 

+ 3 - 2
app/public/js/revise_history.js

@@ -68,7 +68,7 @@ $(document).ready(() => {
     treeSetting.calcFun = function (node) {
         node.dgn_price = ZhCalc.round(ZhCalc.div(node.total_price, node.dgn_qty1), 2);
         node.end_contract_qty = ZhCalc.add(node.contract_qty, node.pre_contract_qty);
-        node.end_percent = node.quantity ? ZhCalc.mul(ZhCalc.div(node.contract_qty, node.quantity, 4), 100, 2) : 0;
+        node.end_percent = node.quantity ? ZhCalc.mul(ZhCalc.div(node.end_contract_qty, node.quantity, 4), 100, 2) : 0;
     };
     const billsTree = createNewPathTree('revise', treeSetting);
     // 初始化 部位明细
@@ -76,7 +76,7 @@ $(document).ready(() => {
         id: 'id', ledgerId: 'lid',
         calcFun: function(node) {
             node.end_contract_qty = ZhCalc.add(node.contract_qty, node.pre_contract_qty);
-            node.end_percent = node.quantity ? ZhCalc.mul(ZhCalc.div(node.contract_qty, node.quantity, 4), 100, 2) : 0;
+            node.end_percent = node.quantity ? ZhCalc.mul(ZhCalc.div(node.end_contract_qty, node.quantity, 4), 100, 2) : 0;
         }
     });
 
@@ -219,6 +219,7 @@ $(document).ready(() => {
         checkShowLast(result.reviseBills.length);
 
         pos.loadDatas(result.revisePos);
+        pos.calculateAll();
         posSpreadObj.loadCurPosData();
         SpreadJsObj.resetTopAndSelect(posSheet);
 

+ 1 - 1
app/view/stage/index.ejs

@@ -97,7 +97,7 @@
                                             <div class="input-group-text">
                                                 <div class="form-group form-check mb-0">
                                                     <input type="checkbox" class="form-check-input group-checkbox" id="pos-un-measure">
-                                                    <label class="form-check-label" for="pos-measure">未计量</label><!--勾选状态增加颜色text-danger-->
+                                                    <label class="form-check-label" for="pos-un-measure">未计量</label><!--勾选状态增加颜色text-danger-->
                                                 </div>
                                             </div>
                                         </div>