Pārlūkot izejas kodu

Merge branch 'dev' of http://192.168.1.41:3000/maixinrong/Calculation into dev

MaiXinRong 2 mēneši atpakaļ
vecāks
revīzija
9f52beea59

+ 2 - 2
app/controller/advance_controller.js

@@ -297,7 +297,7 @@ module.exports = app => {
                 }
                 const shenpiInfo = await ctx.service.shenpiAudit.getDataByCondition({ tid: ctx.tender.id, sp_type: shenpiConst.sp_type.advance, sp_status: shenpiConst.sp_status.gdzs });
                 const is_gdzs = shenpiInfo && ctx.tender.info.shenpi.advance === shenpiConst.sp_status.gdzs ? 1 : 0;
-                const result = await ctx.service.advanceAudit.addAuditor(ctx.tender.id, ctx.advance.id, audit_id, ctx.advance.times, is_gdzs);
+                const result = await ctx.service.advanceAudit.addAuditor(ctx.tender.id, ctx.advance.id, audit_id, ctx.advance.times, ctx.advance.type, is_gdzs);
                 if (!result) {
                     throw '添加审核人失败';
                 }
@@ -388,7 +388,7 @@ module.exports = app => {
                     }
                 }
 
-                await ctx.service.advanceAudit.check(ctx.advance.id, data, ctx.advance.times);
+                await ctx.service.advanceAudit.check(ctx.advance.id, data, ctx.advance.times, ctx.advance.type);
 
                 ctx.redirect(ctx.request.header.referer);
             } catch (err) {

+ 1 - 1
app/controller/datacollect_controller.js

@@ -67,7 +67,7 @@ module.exports = app => {
                 if (ctx.params.index) {
                     ctx.subProject.data_collect = parseInt(ctx.params.index);
                 }
-                const is_dz2 = ['P0505', 'P0506', 'P1201', 'P1202', 'GY18Y', 'GYJJ1', 'P1103'].indexOf(ctx.session.sessionProject.code) !== -1
+                const is_dz2 = ['P0505', 'P0506', 'P1201', 'P1202', 'GY18Y', 'GYJJ1', 'P1103', 'KLG25'].indexOf(ctx.session.sessionProject.code) !== -1
                     && ctx.subProject.data_collect_pages.includes('6') && ctx.subProject.data_collect === 6;
                 const renderData = {
                     projectData,

+ 1 - 1
app/controller/sub_proj_setting_controller.js

@@ -430,7 +430,7 @@ module.exports = app => {
                 const categoryData = await ctx.service.category.getAllCategory(ctx.subProject);
                 const tenders = await ctx.service.tender.getList('', null, 1);
                 const dcTenders = await ctx.service.datacollectTender.getList(ctx.subProject.project_id, ctx.subProject.id);
-                const is_dz2 = ['P0505', 'P0506', 'P1201', 'P1202', 'GY18Y', 'GYJJ1', 'P1103'].indexOf(ctx.session.sessionProject.code) !== -1 ? 6 : false;
+                const is_dz2 = ['P0505', 'P0506', 'P1201', 'P1202', 'GY18Y', 'GYJJ1', 'P1103', 'KLG25'].indexOf(ctx.session.sessionProject.code) !== -1 ? 6 : false;
                 const renderData = {
                     dataCollectAudits,
                     accountList,

+ 1 - 0
app/public/js/stage.js

@@ -5572,6 +5572,7 @@ function makeReportData(sfid) {
         project_id: tender.project_id,
         tender_id: tender.id,
         stage_id: stage.id,
+        sp_id: spid,
     };
     const rpt_name = tender.name + '-第' + stage.order + '期-' + ledger_code + (pos_name ? '/' + pos_name : '-' + lData.name);
     const qrCodePath = sfInfo.qrcode;

+ 11 - 8
app/service/advance_audit.js

@@ -70,7 +70,7 @@ module.exports = app => {
          * @param {Number} times - 第几次审批
          * @return {Boolean} 是否插入成功
          */
-        async addAuditor(tid, vid, audit_id, times = 1, is_gdzs = 0) {
+        async addAuditor(tid, vid, audit_id, times = 1, type, is_gdzs = 0) {
             const transaction = await this.db.beginTransaction();
             try {
                 let newOrder = await this.getNewOrder(vid, times);
@@ -80,6 +80,7 @@ module.exports = app => {
                 const record = {
                     tid,
                     vid,
+                    type,
                     audit_id,
                     times,
                     order: newOrder,
@@ -419,7 +420,7 @@ module.exports = app => {
             }
         }
 
-        async _checkNoPre(pid, advanceId, checkData, times) {
+        async _checkNoPre(pid, advanceId, checkData, times, type) {
             const time = new Date();
             // 整理当前流程审核人状态更新
             const audit = await this.getDataByCondition({ vid: advanceId, times, status: auditConst.status.checking });
@@ -453,6 +454,7 @@ module.exports = app => {
                 const newAuditors = {
                     tid: audit.tid,
                     vid: audit.vid,
+                    type,
                     audit_id: preAuditor.audit_id,
                     times: audit.times,
                     order: audit.order + 1,
@@ -463,6 +465,7 @@ module.exports = app => {
                 const uncheckNewAuditors = {
                     tid: audit.tid,
                     vid: audit.vid,
+                    type,
                     audit_id: audit.audit_id,
                     times: audit.times,
                     order: audit.order + 2,
@@ -509,7 +512,7 @@ module.exports = app => {
          * @param {Number} times - 第几次审批
          * @return {Promise<void>}
          */
-        async check(advanceId, checkData, times = 1) {
+        async check(advanceId, checkData, times = 1, type) {
             if (checkData.checkType !== auditConst.status.checked && checkData.checkType !== auditConst.status.checkNo && checkData.checkType !== auditConst.status.checkNoPre) {
                 throw '提交数据错误';
             }
@@ -522,7 +525,7 @@ module.exports = app => {
                     await this._checkNo(pid, advanceId, checkData, times);
                     break;
                 case auditConst.status.checkNoPre:
-                    await this._checkNoPre(pid, advanceId, checkData, times);
+                    await this._checkNoPre(pid, advanceId, checkData, times, type);
                     break;
                 default:
                     throw '无效审批操作';
@@ -550,7 +553,7 @@ module.exports = app => {
                 const checkAgainAuditors = [];
                 audits.forEach(x => {
                     checkAgainAuditors.push({
-                        tid: advance.tid, vid: advance.id, audit_id: x.audit_id, type: x.type,
+                        tid: advance.tid, vid: advance.id, audit_id: x.audit_id, type: advance.type,
                         times: x.times, order: maxOrder + 1,
                         status: auditConst.status.checkAgain,
                         create_time: time, end_time: time, opinion: '',
@@ -559,7 +562,7 @@ module.exports = app => {
                 const checkingAuditors = [];
                 audits.forEach(x => {
                     checkingAuditors.push({
-                        tid: advance.tid, vid: advance.id, audit_id: x.audit_id, type: x.type,
+                        tid: advance.tid, vid: advance.id, audit_id: x.audit_id, type: advance.type,
                         times: x.times, order: maxOrder + 2,
                         status: auditConst.status.checking,
                         create_time: time,
@@ -742,7 +745,7 @@ module.exports = app => {
                 let order = 1;
                 for (const aid of newIdList) {
                     newAuditors.push({
-                        tid: advance.tid, vid: advance.id, audit_id: aid,
+                        tid: advance.tid, vid: advance.id, type: advance.type, audit_id: aid,
                         times: advance.times, order, status: auditConst.status.uncheck,
                     });
                     order++;
@@ -771,7 +774,7 @@ module.exports = app => {
 
                 // 添加终审
                 const newAuditor = {
-                    tid: advance.tid, vid: advance.id, audit_id: lastId,
+                    tid: advance.tid, vid: advance.id, type: advance.type, audit_id: lastId,
                     times: advance.times, order, status: auditConst.status.uncheck,
                 };
                 await transaction.insert(this.tableName, newAuditor);

+ 1 - 0
app/view/report/rpt_individual.ejs

@@ -125,6 +125,7 @@
         params.project_id = req_params.project_id;
         params.tender_id = req_params.tender_id;
         params.stage_id = req_params.stage_id;
+        params.sp_id = req_params.sp_id || -1;
         params.stage_status = 3;
         params.closeWatermark = 1;
         params.custCfg = CUST_CFG;