Browse Source

计量台账,工程量清单模式,数据检查调整

MaiXinRong 4 years ago
parent
commit
53fbd38152
2 changed files with 13 additions and 62 deletions
  1. 1 60
      app/controller/tender_controller.js
  2. 12 2
      app/public/js/stage.js

+ 1 - 60
app/controller/tender_controller.js

@@ -116,40 +116,6 @@ module.exports = app => {
 
                 const tenderList = await this.ctx.service.tender.getList('', userPermission);
 
-                // for (const t of tenderList) {
-                //     if (t.user_id === this.ctx.session.sessionUser.accountId && (
-                //         t.ledger_status === auditConst.ledger.status.checkNo || t.ledger_status === auditConst.ledger.status.uncheck)) {
-                //         const sum = await this.ctx.service.ledger.addUp({ tender_id: t.id/* , is_leaf: true*/ });
-                //         t.total_price = sum.total_price;
-                //         t.deal_tp = sum.deal_tp;
-                //     }
-                //     if (t.ledger_status === auditConst.ledger.status.checked) {
-                //         t.lastStage = await this.ctx.service.stage.getLastestStage(t.id, true);
-
-                //         if (!t.lastStage) continue;
-                //         if (t.lastStage.status === auditConst.stage.status.uncheck &&
-                //             t.lastStage.user_id !== this.ctx.session.sessionUser.accountId) {
-                //             t.lastStage = await this.ctx.service.stage.getLastestStage(t.id);
-                //         }
-
-                //         if (!t.lastStage) continue;
-                //         await this.ctx.service.stage.checkStageGatherData(t.lastStage);
-                //     }
-                //     if (t.lastStage) {
-                //         if (t.lastStage.status === auditConst.stage.status.uncheck) {
-                //             const status_name = await this.ctx.service.projectAccount.getAccountInfoById(t.lastStage.user_id);
-                //             t.status_users = status_name ? status_name.name : '';
-                //         } else {
-                //             const status_name = await this.ctx.service.stageAudit.getAuditorByStatus(t.lastStage.id, t.lastStage.status, t.lastStage.times);
-                //             t.status_users = status_name ? status_name.name : '';
-                //         }
-                //     } else {
-                //         if (t.ledger_status !== auditConst.ledger.status.uncheck) {
-                //             const status_name = await this.ctx.service.ledgerAudit.getStatusName(t.id, t.ledger_times);
-                //             t.status_users = status_name ? status_name.name : '';
-                //         }
-                //     }
-                // }
                 for (const t of tenderList) {
                     if (t.user_id === this.ctx.session.sessionUser.accountId && (
                             t.ledger_status === auditConst.ledger.status.checkNo || t.ledger_status === auditConst.ledger.status.uncheck)) {
@@ -162,7 +128,7 @@ module.exports = app => {
                     if (t.ledger_status === auditConst.ledger.status.checked) {
                         t.lastStage = await this.ctx.service.stage.getLastestStage(t.id, true);
                         if (t.lastStage && t.lastStage.status === auditConst.stage.status.uncheck &&
-                            t.lastStage.user_id !== this.ctx.session.sessionUser.accountId) {
+                            t.lastStage.user_id !== this.ctx.session.sessionUser.accountId) {c
                             t.lastStage = await this.ctx.service.stage.getLastestStage(t.id);
                         }
                         if (t.lastStage) await this.ctx.service.stage.checkStageGatherData(t.lastStage);
@@ -175,31 +141,6 @@ module.exports = app => {
                         await this._getLedgerAuditInfo(t);
                     }
                 }
-                // tenderList.forEach(async t => {
-                //     if (t.user_id === this.ctx.session.sessionUser.accountId && (
-                //             t.ledger_status === auditConst.ledger.status.checkNo || t.ledger_status === auditConst.ledger.status.uncheck)) {
-                //         const sum = await this.ctx.service.ledger.addUp({ tender_id: t.id/* , is_leaf: true*/ });
-                //         t.total_price = sum.total_price;
-                //         t.deal_tp = sum.deal_tp;
-                //     }
-                //     t.advance_tp = await this.ctx.service.advance.getSumAdvance(t.id);
-                //
-                //     if (t.ledger_status === auditConst.ledger.status.checked) {
-                //         t.lastStage = await this.ctx.service.stage.getLastestStage(t.id, true);
-                //         if (t.lastStage && t.lastStage.status === auditConst.stage.status.uncheck &&
-                //             t.lastStage.user_id !== this.ctx.session.sessionUser.accountId) {
-                //             t.lastStage = await this.ctx.service.stage.getLastestStage(t.id);
-                //         }
-                //         if (t.lastStage) await this.ctx.service.stage.checkStageGatherData(t.lastStage);
-                //         t.completeStage = await this.ctx.service.stage.getLastestCompleteStage(t.id);
-                //     }
-                //
-                //     if (t.lastStage) {
-                //         await this._getStageAuditInfo(t, t.lastStage);
-                //     } else {
-                //         await this._getLedgerAuditInfo(t);
-                //     }
-                // });
                 const categoryData = await this.ctx.service.category.getAllCategory(this.ctx.session.sessionProject.id);
                 const valuations = await this.ctx.service.valuation.getProjectValidValuation(this.ctx.session.sessionProject.id);
                 const renderData = {

+ 12 - 2
app/public/js/stage.js

@@ -3359,7 +3359,7 @@ $(document).ready(() => {
         });
     })('a[name=showLevel]', slSpread.getActiveSheet());
 
-    LedgerChecker({
+    const stageCheckerSetting = {
         ledgerTree: stageTree,
         ledgerPos: stagePos,
         checkList: checkList,
@@ -3383,7 +3383,17 @@ $(document).ready(() => {
                 }
             },
         }
-    });
+    };
+    if (!checkTzMeasureType()) {
+        stageCheckerSetting.checkOption.calc.field.push('sgfh_qty', 'sjcl_qty', 'qtcl_qty', 'quantity');
+        stageCheckerSetting.checkOption.tp.field.push(
+            {qty: 'sgfh_qty', tp: 'sgfh_tp'},
+            {qty: 'sjcl_qty', tp: 'sjcl_tp'},
+            {qty: 'qtcl_qty', tp: 'qtcl_tp'},
+            {qty: 'quantity', tp: 'total_price'},
+        );
+    }
+    LedgerChecker(stageCheckerSetting);
 
     const dataChecker = DataChecker({
         checkUrl: window.location.pathname + '/check',