浏览代码

编号重复判断

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

+ 4 - 0
app/service/payment_detail.js

@@ -52,6 +52,10 @@ module.exports = app => {
                     throw '上一期未审批通过,请等待上一期审批通过后,再新增';
                 }
 
+                if (this._.findIndex(details, { code }) !== -1) {
+                    throw '编号不能重复';
+                }
+
                 trInfo.rpt_audit = JSON.parse(trInfo.rpt_audit);
                 if (this._.findIndex(trInfo.rpt_audit, { uid: null }) !== -1) {
                     throw '未配置好表单角色,无法新建';