浏览代码

修复修订bug

laiguoran 4 年之前
父节点
当前提交
63d3ec242a
共有 1 个文件被更改,包括 2 次插入4 次删除
  1. 2 4
      app/service/change.js

+ 2 - 4
app/service/change.js

@@ -1252,12 +1252,10 @@ module.exports = app => {
                 const changeList = await this.ctx.service.changeAuditList.getAllDataByCondition({
                     where: { cid: changeData.cid },
                 });
-                // 申请变更金额更新为上一次审批审批变更后数量
+                // 申请变更金额更新为上一次审批审批变更后数量,清空audit_amount值
                 const updateTpList = [];
                 for (const cl of changeList) {
-                    if (cl.camount !== cl.spamount) {
-                        updateTpList.push({ id: cl.id, camount: cl.spamount });
-                    }
+                    updateTpList.push({ id: cl.id, camount: cl.spamount, audit_amount: null });
                 }
                 if (updateTpList.length > 0) {
                     await this.transaction.updateRows(this.ctx.service.changeAuditList.tableName, updateTpList);