Bläddra i källkod

修复新增变更继承审批流程问题

ellisran 1 år sedan
förälder
incheckning
6714274608
3 ändrade filer med 18 tillägg och 29 borttagningar
  1. 3 1
      app/public/js/change_audit.js
  2. 14 27
      app/service/change.js
  3. 1 1
      app/service/change_audit.js

+ 3 - 1
app/public/js/change_audit.js

@@ -100,7 +100,9 @@ $(document).ready(function () {
                         html.push('</div>');
                         html.push('<div class="col-auto">');
                         // todo 添加会签或签时
-                        // html.push('<span class="badge badge-pill badge-primary badge-bg-small"><small></small></span>');
+                        if (data[0].audit_type !== auditType.key.common) {
+                            html.push(`<span class="badge badge-pill badge-${auditType.info[data[0].audit_type].class} badge-bg-small"><small>${auditType.info[data[0].audit_type].long}</small></span>`);
+                        }
                         if (shenpi_status === shenpiConst.sp_status.sqspr || (shenpi_status === shenpiConst.sp_status.gdzs && index+1 !== datas.length)) {
                             html.push('<a href="javascript: void(0)" class="text-danger pull-right">移除</a>');
                         }

+ 14 - 27
app/service/change.js

@@ -191,17 +191,12 @@ module.exports = app => {
                 const userInfo = await this.ctx.service.projectAccount.getDataById(userId);
                 const changeaudit = [
                     {
-                        tid: tenderId,
-                        cid,
-                        uid: userId,
-                        name: userInfo.name,
-                        jobs: userInfo.role,
-                        company: userInfo.company,
-                        times: 1,
-                        usite: 0,
-                        usort: 0,
+                        tid: tenderId, cid, uid: userId,
+                        name: userInfo.name, jobs: userInfo.role, company: userInfo.company,
+                        times: 1, usite: 0, usort: 0,
                         begin_time: new Date(),
-                        status: 2,
+                        status: audit.change.status.checking,
+                        audit_type: auditType.key.common, audit_order: 0,
                     },
                 ];
                 // 并把之前存在的变更令审批人添加到zh_change_audit
@@ -209,23 +204,15 @@ module.exports = app => {
                 const changeInfo = await this.ctx.service.change.getHaveAuditLastInfo(tenderId);
                 if (changeInfo) {
                     // 再获取非原报审批人
-                    const auditList = await this.ctx.service.changeAudit.getListGroupByTimes(changeInfo.cid, changeInfo.times);
-                    let sort = 1;
-                    for (const audit of auditList) {
-                        if (audit.usite !== 0) {
-                            const oneaudit = {
-                                tid: tenderId,
-                                cid,
-                                uid: audit.uid,
-                                name: audit.name,
-                                jobs: audit.jobs,
-                                company: audit.company,
-                                times: 1,
-                                usite: audit.usite,
-                                usort: sort++,
-                                status: 1,
-                            };
-                            changeaudit.push(oneaudit);
+                    const auditList = await this.ctx.service.changeAudit.getUniqAuditor(changeInfo.cid, changeInfo.times); // 全部参与的审批人
+                    for (const x of auditList) {
+                        if (x.audit_order !== 0) {
+                            changeaudit.push({
+                                tid: tenderId, cid, uid: x.uid,
+                                name: x.name, jobs: x.jobs, company: x.company,
+                                times: 1, usite: x.usite, usort: x.audit_order, status: audit.change.status.uncheck,
+                                audit_type: x.audit_type, audit_order: x.audit_order,
+                            });
                         }
                     }
                 }

+ 1 - 1
app/service/change_audit.js

@@ -563,7 +563,7 @@ module.exports = app => {
             const auditors = await this.getAuditorsNew(cid, times); // 全部参与的审批人
             const result = [];
             auditors.forEach(x => {
-                if (result.findIndex(r => { return x.uid === r.uid && x.audit_order === x.audit_order; }) < 0) {
+                if (result.findIndex(r => { return x.uid === r.uid && x.audit_order === r.audit_order; }) < 0) {
                     result.push(x);
                 }
             });