Browse Source

会签数据相关

MaiXinRong 1 month ago
parent
commit
f8beb3c553

+ 6 - 6
app/controller/cost_controller.js

@@ -305,7 +305,7 @@ module.exports = app => {
                 for (const f of filter) {
                 for (const f of filter) {
                     switch (f) {
                     switch (f) {
                         case 'bills':
                         case 'bills':
-                            responseData.data.bills = ctx.costStage.readOnly
+                            responseData.data.bills = ctx.costStage.readOnly && !ctx.costStage.canCheck
                                 ? await ctx.service.costStageLedger.getReadData(ctx.costStage)
                                 ? await ctx.service.costStageLedger.getReadData(ctx.costStage)
                                 : await ctx.service.costStageLedger.getEditData(ctx.costStage);
                                 : await ctx.service.costStageLedger.getEditData(ctx.costStage);
                             break;
                             break;
@@ -313,7 +313,7 @@ module.exports = app => {
                             responseData.data[f] = await ctx.service.costStageLedger.getCompareData(ctx.costStage);
                             responseData.data[f] = await ctx.service.costStageLedger.getCompareData(ctx.costStage);
                             break;
                             break;
                         case 'detail':
                         case 'detail':
-                            responseData.data.detail =  ctx.costStage.readOnly
+                            responseData.data.detail =  ctx.costStage.readOnly && !ctx.costStage.canCheck
                                 ? await ctx.service.costStageDetail.getReadData(ctx.costStage)
                                 ? await ctx.service.costStageDetail.getReadData(ctx.costStage)
                                 : await ctx.service.costStageDetail.getEditData(ctx.costStage);
                                 : await ctx.service.costStageDetail.getEditData(ctx.costStage);
                             break;
                             break;
@@ -363,7 +363,7 @@ module.exports = app => {
                         case 'bills':
                         case 'bills':
                             const ledger = await ctx.service.costStageLedger.getReadData(ctx.costStage.relaStage);
                             const ledger = await ctx.service.costStageLedger.getReadData(ctx.costStage.relaStage);
                             ledger.forEach(l => { delete l.postil; delete l.memo; });
                             ledger.forEach(l => { delete l.postil; delete l.memo; });
-                            const book = ctx.costStage.readOnly
+                            const book = ctx.costStage.readOnly && !ctx.costStage.canCheck
                                 ? await ctx.service.costStageBook.getReadData(ctx.costStage)
                                 ? await ctx.service.costStageBook.getReadData(ctx.costStage)
                                 : await ctx.service.costStageBook.getEditData(ctx.costStage);
                                 : await ctx.service.costStageBook.getEditData(ctx.costStage);
                             ctx.helper.assignRelaData(ledger, [
                             ctx.helper.assignRelaData(ledger, [
@@ -384,7 +384,7 @@ module.exports = app => {
                         case 'detail':
                         case 'detail':
                             const detail = await ctx.service.costStageDetail.getReadData(ctx.costStage.relaStage);
                             const detail = await ctx.service.costStageDetail.getReadData(ctx.costStage.relaStage);
                             detail.forEach(l => { delete l.postil; delete l.memo; });
                             detail.forEach(l => { delete l.postil; delete l.memo; });
-                            const bookDetail = ctx.costStage.readOnly
+                            const bookDetail = ctx.costStage.readOnly && !ctx.costStage.canCheck
                                 ? await ctx.service.costStageBookDetail.getReadData(ctx.costStage)
                                 ? await ctx.service.costStageBookDetail.getReadData(ctx.costStage)
                                 : await ctx.service.costStageBookDetail.getEditData(ctx.costStage);
                                 : await ctx.service.costStageBookDetail.getEditData(ctx.costStage);
                             ctx.helper.assignRelaData(detail, [
                             ctx.helper.assignRelaData(detail, [
@@ -428,7 +428,7 @@ module.exports = app => {
                 for (const f of filter) {
                 for (const f of filter) {
                     switch (f) {
                     switch (f) {
                         case 'bills':
                         case 'bills':
-                            responseData.data.bills = ctx.costStage.readOnly
+                            responseData.data.bills = ctx.costStage.readOnly && !ctx.costStage.canCheck
                                 ? await ctx.service.costStageAnalysis.getReadData(ctx.costStage)
                                 ? await ctx.service.costStageAnalysis.getReadData(ctx.costStage)
                                 : await ctx.service.costStageAnalysis.getEditData(ctx.costStage);
                                 : await ctx.service.costStageAnalysis.getEditData(ctx.costStage);
                             break;
                             break;
@@ -436,7 +436,7 @@ module.exports = app => {
                             responseData.data[f] = await ctx.service.costStageAnalysis.getCompareData(ctx.costStage);
                             responseData.data[f] = await ctx.service.costStageAnalysis.getCompareData(ctx.costStage);
                             break;
                             break;
                         case 'detail':
                         case 'detail':
-                            responseData.data.detail =  ctx.costStage.readOnly
+                            responseData.data.detail =  ctx.costStage.readOnly && !ctx.costStage.canCheck
                                 ? await ctx.service.costStageAnalysisDetail.getReadData(ctx.costStage)
                                 ? await ctx.service.costStageAnalysisDetail.getReadData(ctx.costStage)
                                 : await ctx.service.costStageAnalysisDetail.getEditData(ctx.costStage);
                                 : await ctx.service.costStageAnalysisDetail.getEditData(ctx.costStage);
                             break;
                             break;

+ 1 - 1
app/service/cost_stage.js

@@ -280,7 +280,7 @@ module.exports = app => {
                 // 会签,会签人部分审批通过时,只读,但是curSort需按原来的取值
                 // 会签,会签人部分审批通过时,只读,但是curSort需按原来的取值
                 stage.curSort = stage.flowAuditorIds.indexOf(accountId) >= 0 ? stage.curAuditors[0].active_order : stage.curAuditors[0].active_order - 1;
                 stage.curSort = stage.flowAuditorIds.indexOf(accountId) >= 0 ? stage.curAuditors[0].active_order : stage.curAuditors[0].active_order - 1;
                 if (stage.curAuditors[0].audit_type === auditType.key.and) {
                 if (stage.curAuditors[0].audit_type === auditType.key.and) {
-                    stage.readOnly = !_.isEqual(stage.flowAuditorIds, stage.curAuditorIds);
+                    stage.readOnly = !this.ctx.helper._.isEqual(stage.flowAuditorIds, stage.curAuditorIds);
                     stage.canCheck = true;
                     stage.canCheck = true;
                 } else {
                 } else {
                     stage.readOnly = stage.curAuditorIds.indexOf(accountId) < 0;
                     stage.readOnly = stage.curAuditorIds.indexOf(accountId) < 0;

+ 1 - 1
app/service/phase_pay.js

@@ -487,7 +487,7 @@ module.exports = app => {
                 // 会签,会签人部分审批通过时,只读,但是curSort需按原来的取值
                 // 会签,会签人部分审批通过时,只读,但是curSort需按原来的取值
                 phasePay.curSort = phasePay.flowAuditorIds.indexOf(accountId) >= 0 ? phasePay.curAuditors[0].active_order : phasePay.curAuditors[0].active_order - 1;
                 phasePay.curSort = phasePay.flowAuditorIds.indexOf(accountId) >= 0 ? phasePay.curAuditors[0].active_order : phasePay.curAuditors[0].active_order - 1;
                 if (phasePay.curAuditors[0].audit_type === auditType.key.and) {
                 if (phasePay.curAuditors[0].audit_type === auditType.key.and) {
-                    phasePay.readOnly = !_.isEqual(phasePay.flowAuditorIds, phasePay.curAuditorIds);
+                    phasePay.readOnly = !this.ctx.helper._.isEqual(phasePay.flowAuditorIds, phasePay.curAuditorIds);
                     phasePay.canCheck = true;
                     phasePay.canCheck = true;
                 } else {
                 } else {
                     phasePay.readOnly = phasePay.curAuditorIds.indexOf(accountId) < 0;
                     phasePay.readOnly = phasePay.curAuditorIds.indexOf(accountId) < 0;

+ 1 - 1
app/service/safe_stage.js

@@ -246,7 +246,7 @@ module.exports = app => {
                 // 会签,会签人部分审批通过时,只读,但是curSort需按原来的取值
                 // 会签,会签人部分审批通过时,只读,但是curSort需按原来的取值
                 safeStage.curSort = safeStage.flowAuditorIds.indexOf(accountId) >= 0 ? safeStage.curAuditors[0].active_order : safeStage.curAuditors[0].active_order - 1;
                 safeStage.curSort = safeStage.flowAuditorIds.indexOf(accountId) >= 0 ? safeStage.curAuditors[0].active_order : safeStage.curAuditors[0].active_order - 1;
                 if (safeStage.curAuditors[0].audit_type === auditType.key.and) {
                 if (safeStage.curAuditors[0].audit_type === auditType.key.and) {
-                    safeStage.readOnly = !_.isEqual(safeStage.flowAuditorIds, safeStage.curAuditorIds);
+                    safeStage.readOnly = !this.ctx.helper._.isEqual(safeStage.flowAuditorIds, safeStage.curAuditorIds);
                     safeStage.canCheck = true;
                     safeStage.canCheck = true;
                 } else {
                 } else {
                     safeStage.readOnly = safeStage.curAuditorIds.indexOf(accountId) < 0;
                     safeStage.readOnly = safeStage.curAuditorIds.indexOf(accountId) < 0;