Pārlūkot izejas kodu

关联台账,计算问题

MaiXinRong 1 gadu atpakaļ
vecāks
revīzija
57e818cc10
2 mainītis faili ar 5 papildinājumiem un 5 dzēšanām
  1. 0 3
      app/public/js/sr_detail.js
  2. 5 2
      app/service/shenpi_audit.js

+ 0 - 3
app/public/js/sr_detail.js

@@ -179,9 +179,6 @@ $(document).ready(() => {
             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);

+ 5 - 2
app/service/shenpi_audit.js

@@ -102,9 +102,12 @@ module.exports = app => {
             };
             const audit = await this.getDataByCondition(delData);
             const allAudit = await this.getAllDataByCondition({ where: { tid: this.ctx.tender.id, sp_type: data.code, sp_status: data.status } });
+            const sameOrder = allAudit.filter(x => { return x.audit_order === audit.audit_order });
             const updateData = [];
-            for (const aa of allAudit) {
-                if (aa.audit_order > audit.audit_order) updateData.push({ id: aa.id, audit_order: aa.audit_order - 1});
+            if (sameOrder.length === 1) {
+                for (const aa of allAudit) {
+                    if (aa.audit_order > audit.audit_order) updateData.push({ id: aa.id, audit_order: aa.audit_order - 1});
+                }
             }
             const transaction = await this.db.beginTransaction();
             try {