Kaynağa Gözat

山海鲸决策大屏8

ellisran 1 ay önce
ebeveyn
işleme
a5236e9609

+ 5 - 0
app/controller/datacollect_controller.js

@@ -78,6 +78,8 @@ module.exports = app => {
                 const is_cost = ctx.subProject.data_collect_pages.includes('7') && ctx.subProject.data_collect === 7;
                 const is_dz2 = ['P0505', 'P0506', 'P1201', 'P1202', 'GY18Y', 'GYJJ1', 'P1103', 'KLG25', 'I2U5B', 'SEN48'].indexOf(ctx.session.sessionProject.code) !== -1
                     && ctx.subProject.data_collect_pages.includes('6') && ctx.subProject.data_collect === 6;
+                const is_dz3 = ctx.subProject.data_collect_pages.includes('8') && ctx.subProject.data_collect === 8;
+                const shj_url = 'http://112.74.42.187:3300/#/project/viewer?projectId=b03i54j0j8ai';
                 const renderData = {
                     projectData,
                     noticeList,
@@ -91,6 +93,7 @@ module.exports = app => {
                     acAdvance: auditConst.advance,
                     pushType: auditConst.pushType,
                     jsFiles: this.app.jsFiles.common.concat(this.app.jsFiles.datacollect.index),
+                    shj_url,
                 };
                 if (is_cost) {
                     await this.layout('datacollect/index_cost.ejs', renderData);
@@ -108,6 +111,8 @@ module.exports = app => {
                     }
                     renderData.dpCategory = dpCategory;
                     await this.layout('datacollect/index4GY18Y.ejs', renderData);
+                } else if (is_dz3) {
+                    ctx.redirect(shj_url);
                 } else {
                     await this.layout('datacollect/index.ejs', renderData);
                 }

+ 1 - 0
app/controller/sub_proj_setting_controller.js

@@ -453,6 +453,7 @@ module.exports = app => {
                     dcTenders,
                     is_dz1: ['P0505', 'MI22U'].indexOf(ctx.session.sessionProject.code) !== -1 ? 5 : false,
                     is_dz2,
+                    is_dz3: 8,
                     selfCategoryLevel: await ctx.service.projectAccount.getSelfCategoryLevel(this.ctx.session.sessionUser.accountId),
                 };
                 if (is_dz2) {

+ 3 - 1
app/service/shenpi_audit.js

@@ -413,7 +413,9 @@ module.exports = app => {
                     return;
                 }
                 // 更新固定审批流
-                await transaction.delete(this.tableName, { tid: tenderId, sp_type, sp_status });
+                const delCondition = { sp_type, sp_status };
+                this._.assign(delCondition, tidCondition);
+                await transaction.delete(this.tableName, delCondition);
                 const insertDatas = [];
                 for (const [i, id] of ids.entries()) {
                     const oneInsertData = {

+ 2 - 0
app/view/datacollect/index.ejs

@@ -45,6 +45,8 @@
                         <% for (const i of ctx.subProject.data_collect_pages) { %>
                         <% if (['6', '7'].includes(i)) { %>
                             <a class="dropdown-item" href="/sp/<%- ctx.subProject.id %>/datacollect/index/<%- i %>">决策大屏<%- i %></a>
+                        <% } else if (['8'].includes(i)) { %>
+                            <a class="dropdown-item" target="_blank" href="<%- shj_url %>">决策大屏<%- i %></a>
                         <% } else { %>
                             <a class="dropdown-item change-collect" href="javascript:void(0)" data-collect="<%- i %>">决策大屏<%- i %></a>
                         <% } %>

+ 5 - 1
app/view/datacollect/index4GY18Y.ejs

@@ -61,7 +61,11 @@
                     <button type="button" class="btn btn-sm btn-outline-dark text-white dropdown-toggle" data-toggle="dropdown" id="zhankai">决策大屏<span>6</span></button>
                     <div class="dropdown-menu" aria-labelledby="zhankai">
                         <% for (const i of ctx.subProject.data_collect_pages) { %>
-                            <a class="dropdown-item" href="/sp/<%- ctx.subProject.id %>/datacollect/index/<%- i %>">决策大屏<%- i %></a>
+                            <% if (['8'].includes(i)) { %>
+                                <a class="dropdown-item" target="_blank" href="<%- shj_url %>">决策大屏<%- i %></a>
+                            <% } else { %>
+                                <a class="dropdown-item" href="/sp/<%- ctx.subProject.id %>/datacollect/index/<%- i %>">决策大屏<%- i %></a>
+                            <% } %>
                         <% } %>
                     </div>
                 </div>

+ 5 - 1
app/view/datacollect/index_cost.ejs

@@ -43,7 +43,11 @@
                     <button type="button" class="btn btn-sm btn-outline-dark text-white dropdown-toggle" data-toggle="dropdown" id="zhankai">决策大屏<span>7</span></button>
                     <div class="dropdown-menu" aria-labelledby="zhankai">
                         <% for (const i of ctx.subProject.data_collect_pages) { %>
-                            <a class="dropdown-item" href="/sp/<%- ctx.subProject.id %>/datacollect/index/<%- i %>">决策大屏<%- i %></a>
+                            <% if (['8'].includes(i)) { %>
+                                <a class="dropdown-item" target="_blank" href="<%- shj_url %>">决策大屏<%- i %></a>
+                            <% } else { %>
+                                <a class="dropdown-item" href="/sp/<%- ctx.subProject.id %>/datacollect/index/<%- i %>">决策大屏<%- i %></a>
+                            <% } %>
                         <% } %>
                     </div>
                 </div>

+ 7 - 0
app/view/layout/menu.ejs

@@ -37,10 +37,17 @@
             <% } %>
             <% } else { %>
             <li <% if((ctx.controllerName === menu.controller && (!menu.notIncludedUrl || !menu.notIncludedUrl.some(item => ctx.url.includes(item)))) || (!!menu.controllers && menu.controllers.indexOf(ctx.controllerName) >= 0 && (!menu.includedUrl || !menu.includedUrl[ctx.controllerName] || menu.includedUrl[ctx.controllerName].some(item => ctx.url.includes(item)))) || (menu.url && menu.url === ctx.url)) { %>class="active"<% } %>>
+                <% if (menu.controller === 'datacollect' && ctx.subProject.data_collect_pages.includes('8') && ctx.subProject.data_collect === 8) { %>
+                <a href="<%- menu.url %>" target="_blank" id="<%- 'nav_' + index%>" data-toggle="tooltip" data-placement="right" title="" data-original-title="<%- menu.name %>">
+                    <i class="fa <%- menu.icon %>"></i>
+                    <% if (menu.caption) { %><span class="d-inline-block" style="vertical-align: text-bottom;"><%- menu.caption %></span><% } %>
+                </a>
+                <% } else { %>
                 <a href="<%- menu.url %>" id="<%- 'nav_' + index%>" data-toggle="tooltip" data-placement="right" title="" data-original-title="<%- menu.name %>">
                     <i class="fa <%- menu.icon %>"></i>
                     <% if (menu.caption) { %><span class="d-inline-block" style="vertical-align: text-bottom;"><%- menu.caption %></span><% } %>
                 </a>
+                <% } %>
             </li>
             <% } %>
             <% } %>

+ 15 - 0
app/view/sp_setting/datacollect.ejs

@@ -26,6 +26,8 @@
                     <% } %>
                     <a class="nav-item nav-link<% if (ctx.subProject.data_collect === 7) { %> active<% } %>" data-datacollect="7" data-toggle="tab" href="#shujudaping-7" role="tab">
                         决策大屏<%- ctx.helper.transFormToChinese(7) %><% if (ctx.helper._.indexOf(ctx.subProject.data_collect_pages, '7') !== -1) { %>(已开启<% if (ctx.subProject.data_collect === 7) { %>、默认<% } %>)<% } %></a>
+                    <a class="nav-item nav-link<% if (ctx.subProject.data_collect === is_dz3) { %> active<% } %>" data-datacollect="<%- is_dz3 %>" data-toggle="tab" href="#shujudaping-<%- is_dz3 %>" role="tab">
+                        决策大屏<%- ctx.helper.transFormToChinese(is_dz3) %><% if (ctx.helper._.indexOf(ctx.subProject.data_collect_pages, is_dz3.toString()) !== -1) { %>(已开启<% if (ctx.subProject.data_collect === is_dz3) { %>、默认<% } %>)<% } %></a>
                     <div class="ml-auto">
                         <!--<div class="form-check form-check-inline">-->
                             <!--<input class="form-check-input" type="checkbox" id="show-datacollect" value="option1" <% if (ctx.subProject.data_collect) { %>checked<% } %>>-->
@@ -62,6 +64,11 @@
                     <div id="shujudaping-7" class="tab-pane<% if (ctx.subProject.data_collect === 7) { %> active<% } %>">
                         成本管理决策大屏数据汇总<img src="/public/images/juecedaping07.png" width="100%">
                     </div>
+                    <% if (is_dz3) { %>
+                    <div id="shujudaping-<%- is_dz3 %>" class="tab-pane<% if (ctx.subProject.data_collect === is_dz3) { %> active<% } %>">
+                        山海鲸数据大屏平台定制(会打开新标签页跳转)<img src="/public/images/juecedaping0<%- is_dz3 %>.png" width="100%">
+                    </div>
+                    <% } %>
                 </div>
             </div>
         </div>
@@ -84,6 +91,7 @@
     let addDataCollect = JSON.parse(unescape('<%- escape(JSON.stringify(ctx.subProject.page_show.addDataCollect)) %>'));
     let is_dz1 = <% if (is_dz1) { %>parseInt('<%- is_dz1 %>');<% } else { %>false;<% } %>
     let is_dz2 = <% if (is_dz2) { %>parseInt('<%- is_dz2 %>');<% } else { %>false;<% } %>
+    let is_dz3 = <% if (is_dz3) { %>parseInt('<%- is_dz3 %>');<% } else { %>false;<% } %>
     $(function () {
         autoFlashHeight();
         // 开启及关闭展示
@@ -165,6 +173,13 @@
                 msg = '(已开启' + (7 === dataCollect ? '、默认' : '') + ')' ;
             }
             $('#tablist a').eq(7-3).text('决策大屏' + transFormToChinese(7) + msg);
+            if (is_dz3) {
+                let msg = '';
+                if (_.indexOf(dataCollectPages, is_dz3.toString()) !== -1) {
+                    msg = '(已开启' + (is_dz3=== dataCollect ? '、默认' : '') + ')' ;
+                }
+                $('#tablist a').eq(is_dz3-3).text('决策大屏' + transFormToChinese(is_dz3) + msg);
+            }
         }
         $('#tablist a').click(function () {
             const page = parseInt($(this).data('datacollect'));