Tony Kang пре 2 недеља
родитељ
комит
8ec6861d2e
2 измењених фајлова са 10 додато и 7 уклоњено
  1. 9 6
      app/controller/report_controller.js
  2. 1 1
      app/view/report/index.ejs

+ 9 - 6
app/controller/report_controller.js

@@ -1136,8 +1136,9 @@ module.exports = app => {
                 const sorder = -1;
                 const sorder = -1;
                 const stage_times = -1;
                 const stage_times = -1;
                 const stage_status = -1;
                 const stage_status = -1;
-                const project_id = ctx.params.id;
-                const { treeNodes, custCfg, commonArrs } = await this._createNodes(ctx, sourceTypeConst.sourceType.contract_management, project_id);
+                const project_id = ctx.contract.project_id;
+                // const { treeNodes, custCfg, commonArrs } = await this._createNodes(ctx, sourceTypeConst.sourceType.contract, project_id);
+                const { treeNodes, custCfg, commonArrs, allTreeItems, allIndivTreeItems } = await this._createNodes(ctx, sourceTypeConst.sourceType.contract, project_id);
                 if (stage_id === -600) {
                 if (stage_id === -600) {
                     // 统一为合同管理
                     // 统一为合同管理
                 }
                 }
@@ -1192,8 +1193,10 @@ module.exports = app => {
                     tenderInfo: null,
                     tenderInfo: null,
                     rpt_tpl_data: JSON.stringify(treeNodes),
                     rpt_tpl_data: JSON.stringify(treeNodes),
                     cust_tpl_data: JSON.stringify(rpt_tpl_items),
                     cust_tpl_data: JSON.stringify(rpt_tpl_items),
-                    all_common_tpl_data: JSON.stringify([]),
-                    all_indivi_tpl_data: JSON.stringify([]),
+                    all_common_tpl_data: JSON.stringify(allTreeItems),
+                    all_indivi_tpl_data: JSON.stringify(allIndivTreeItems),
+                    // all_common_tpl_data: JSON.stringify([]),
+                    // all_indivi_tpl_data: JSON.stringify([]),
                     cust_select_keys,
                     cust_select_keys,
                     cust_cfg: JSON.stringify(custCfg),
                     cust_cfg: JSON.stringify(custCfg),
                     project_id,
                     project_id,
@@ -1255,13 +1258,13 @@ module.exports = app => {
 
 
         async indexForProjectContract(ctx) {
         async indexForProjectContract(ctx) {
             const preUrl = `/sp/${ctx.params.prjid}/contract/panel`;
             const preUrl = `/sp/${ctx.params.prjid}/contract/panel`;
-            await this._indexForContract(ctx, sourceTypeConst.sourceType.contract_management, -600, preUrl);
+            await this._indexForContract(ctx, sourceTypeConst.sourceType.contract, -600, preUrl);
         }
         }
 
 
         async indexForTenderContract(ctx) {
         async indexForTenderContract(ctx) {
             // const preUrl = `/sp/${ctx.params.prjid}/contract/panel`;
             // const preUrl = `/sp/${ctx.params.prjid}/contract/panel`;
             const preUrl = '';
             const preUrl = '';
-            await this._indexForContract(ctx, sourceTypeConst.sourceType.contract_management, -600, preUrl);
+            await this._indexForContract(ctx, sourceTypeConst.sourceType.contract, -600, preUrl);
         }
         }
 
 
         /**
         /**

+ 1 - 1
app/view/report/index.ejs

@@ -128,7 +128,7 @@
                 </div>
                 </div>
                 <% } %>
                 <% } %>
                 <% } %>
                 <% } %>
-                <% if (isAdmin && stg_id !== -150) { %>
+                <% if (isAdmin && ![-150, -600].includes(stg_id)) { %>
                 <div class="d-inline-block">
                 <div class="d-inline-block">
                     <a href="/tender/<%- tender_id %>/report/format/setup" class=" btn btn-light btn-sm  text-primary">设置</a>
                     <a href="/tender/<%- tender_id %>/report/format/setup" class=" btn btn-light btn-sm  text-primary">设置</a>
                 </div>
                 </div>