Explorar o código

变更方案会签或签及审批组功能测试修复

ellisran hai 1 ano
pai
achega
3ff313949a

+ 2 - 2
app/controller/change_controller.js

@@ -3595,8 +3595,8 @@ module.exports = app => {
                             if (ctx.change.userGroups[au][0].audit_order !== 0) {
                             if (ctx.change.userGroups[au][0].audit_order !== 0) {
                                 cl['audit_amount_' + ctx.change.userGroups[au][0].audit_order] =
                                 cl['audit_amount_' + ctx.change.userGroups[au][0].audit_order] =
                                     (ctx.change.userGroups[au][0].audit_type === auditType.key.and &&
                                     (ctx.change.userGroups[au][0].audit_type === auditType.key.and &&
-                                        ctx.helper._.findIndex(ctx.change.userGroups[au], { uid: ctx.session.sessionUser.accountId, status: audit.changePlan.status.checked }) !== -1) ||
-                                    (ctx.change.shenpiPower && ctx.helper._.findIndex(ctx.change.userGroups[au], { uid: ctx.session.sessionUser.accountId }) !== -1) ?
+                                        ctx.helper._.findIndex(ctx.change.userGroups[au], { aid: ctx.session.sessionUser.accountId, status: audit.changePlan.status.checked }) !== -1) ||
+                                    (ctx.change.shenpiPower && ctx.helper._.findIndex(ctx.change.userGroups[au], { aid: ctx.session.sessionUser.accountId }) !== -1) ?
                                         cl.spamount : (audit_amount[au - 1] !== undefined ? parseFloat(audit_amount[au - 1]) : null);
                                         cl.spamount : (audit_amount[au - 1] !== undefined ? parseFloat(audit_amount[au - 1]) : null);
                             }
                             }
                         }
                         }

+ 10 - 8
app/public/js/change_plan_information.js

@@ -215,7 +215,7 @@ $(document).ready(() => {
                     colSpan: '2|1', rowSpan: '1|1',
                     colSpan: '2|1', rowSpan: '1|1',
                     field: 'audit_amount_' + audit[0].audit_order,
                     field: 'audit_amount_' + audit[0].audit_order,
                     hAlign: 2, width: 60, type: 'Number',
                     hAlign: 2, width: 60, type: 'Number',
-                    readOnly: !(change.shenpiPower && audit.aid === parseInt(cur_uid))
+                    readOnly: !(change.shenpiPower && _.findIndex(audit, { aid: parseInt(cur_uid) }) !== -1),
                 };
                 };
                 const newColTp = {
                 const newColTp = {
                     title: '|金额',
                     title: '|金额',
@@ -319,14 +319,16 @@ $(document).ready(() => {
             changeSpreadSheet.setValue(changeSpreadSheet.getRowCount() - 1, 6, oSum !== 0 ? oSum : null);
             changeSpreadSheet.setValue(changeSpreadSheet.getRowCount() - 1, 6, oSum !== 0 ? oSum : null);
             changeSpreadSheet.setValue(changeSpreadSheet.getRowCount() - 1, 8, cSum !== 0 ? cSum : null);
             changeSpreadSheet.setValue(changeSpreadSheet.getRowCount() - 1, 8, cSum !== 0 ? cSum : null);
             changeSpreadSheet.setValue(changeSpreadSheet.getRowCount() - 1, 10, sSum !== 0 ? sSum : null);
             changeSpreadSheet.setValue(changeSpreadSheet.getRowCount() - 1, 10, sSum !== 0 ? sSum : null);
-            // 用户的数据合计
-            for (const j in change.userGroups) {
-                if (change.userGroups[j][0].audit_order !== 0) {
-                    let audit_sum = 0;
-                    for (let i = 0; i < rowCount - 1; i++) {
-                        audit_sum = ZhCalc.add(audit_sum, changeSpreadSheet.getValue(i, 12 + (j - 1) * 2));
+            if (readOnly) {
+                // 用户的数据合计
+                for (const j in change.userGroups) {
+                    if (change.userGroups[j][0].audit_order !== 0) {
+                        let audit_sum = 0;
+                        for (let i = 0; i < rowCount - 1; i++) {
+                            audit_sum = ZhCalc.add(audit_sum, changeSpreadSheet.getValue(i, 12 + (j - 1) * 2));
+                        }
+                        changeSpreadSheet.setValue(changeSpreadSheet.getRowCount() - 1, 12 + (j - 1) * 2, audit_sum !== 0 ? audit_sum : null);
                     }
                     }
-                    changeSpreadSheet.setValue(changeSpreadSheet.getRowCount() - 1, 12 + (j - 1) * 2, audit_sum !== 0 ? audit_sum : null);
                 }
                 }
             }
             }
         },
         },

+ 1 - 1
app/service/change_plan.js

@@ -488,7 +488,7 @@ module.exports = app => {
             if (change.status !== status.checked && change.status !== status.uncheck && change.status !== status.revise) {
             if (change.status !== status.checked && change.status !== status.uncheck && change.status !== status.revise) {
                 if (change.status === status.checkNo) {
                 if (change.status === status.checkNo) {
                     const lastAuditors = await this.service.changePlanAudit.getAuditors(change.id, change.times - 1);
                     const lastAuditors = await this.service.changePlanAudit.getAuditors(change.id, change.times - 1);
-                    const onAuditor = this._.findLast(lastAuditors, { status: status.back });
+                    const onAuditor = this._.findLast(lastAuditors, { status: status.checkNo });
                     if (onAuditor && onAuditor.aid === accountId) {
                     if (onAuditor && onAuditor.aid === accountId) {
                         change.cancancel = 4;// 审批人撤回退回原报
                         change.cancancel = 4;// 审批人撤回退回原报
                         change.preAuditors = lastAuditors.filter(x => { return x.order === onAuditor.order; });
                         change.preAuditors = lastAuditors.filter(x => { return x.order === onAuditor.order; });

+ 1 - 1
app/service/change_plan_audit.js

@@ -903,7 +903,7 @@ module.exports = app => {
          */
          */
         async _auditCheckCancelNo(change) {
         async _auditCheckCancelNo(change) {
             const accountId = this.ctx.session.sessionUser.accountId;
             const accountId = this.ctx.session.sessionUser.accountId;
-            const selfAuditor = change.preAuditors.find(x => { return x.aid === accountId && x.status === auditConst.status.back; });
+            const selfAuditor = change.preAuditors.find(x => { return x.aid === accountId && x.status === auditConst.status.checkNo; });
             if (!selfAuditor) throw '该标段由他人审批退回,您不可撤回';
             if (!selfAuditor) throw '该标段由他人审批退回,您不可撤回';
             const time = new Date();
             const time = new Date();