Explorar o código

台账修订,上下移问题

MaiXinRong %!s(int64=5) %!d(string=hai) anos
pai
achega
ee76e9a2dd
Modificáronse 2 ficheiros con 3 adicións e 2 borrados
  1. 2 1
      app/service/revise_pos.js
  2. 1 1
      app/service/stage_audit.js

+ 2 - 1
app/service/revise_pos.js

@@ -181,6 +181,7 @@ module.exports = app => {
         }
 
         async updatePosArr(tid, data) {
+            console.log(data);
             if (data.length === 0) return;
             const op = await this.getDataById(data[0].id);
             const bills = await this.ctx.service.reviseBills.getDataById(op.lid);
@@ -235,7 +236,7 @@ module.exports = app => {
             const transaction = await this.db.beginTransaction();
             try {
                 for (const d of data) {
-                    if (needUpdateBills) await transaction.update(this.tableName, d);
+                    await transaction.update(this.tableName, d);
                 }
                 if (needUpdateBills) await transaction.update(this.ctx.service.reviseBills.tableName, updateBills);
                 await transaction.commit();

+ 1 - 1
app/service/stage_audit.js

@@ -407,7 +407,7 @@ module.exports = app => {
                 // 计算并合同支付最终数据
                 const [yfPay, sfPay] = await this.ctx.service.stagePay.calcAllStagePays(this.ctx.stage, transaction);
                 this.ctx.stage.tp_history.push({
-                    times: times + 1, order: 0,
+                    times: times, order: audit.order,
                     contract_tp: tpData.contract_tp,
                     qc_tp: tpData.qc_tp,
                     yf_tp: yfPay.tp,