Browse Source

施工日志功能迁移

ellisran 3 months ago
parent
commit
18028f8642

+ 1 - 1
app/base/base_controller.js

@@ -35,7 +35,7 @@ class BaseController extends Controller {
             }
             menuList.datacollect.display = ctx.session && ctx.session.sessionProject ? ctx.session.sessionProject.showDataCollect : false;
             menuList.file.display = ctx.session && ctx.session.sessionProject ? ctx.session.sessionProject.page_show.openFile : false;
-            menuList.construction.display = ctx.session && ctx.session.sessionProject ? ctx.session.sessionProject.page_show.openConstruction : false;
+            // menuList.construction.display = ctx.session && ctx.session.sessionProject ? ctx.session.sessionProject.page_show.openConstruction : false;
             menuList.contract.display = ctx.session && ctx.session.sessionProject ? ctx.session.sessionProject.page_show.openContract : false;
             menuList.financial.display = ctx.session && ctx.session.sessionProject ? ctx.session.sessionProject.page_show.openFinancial : false;
             menuList.budget.display = ctx.session && ctx.session.sessionProject ? ctx.session.sessionProject.showBudget : false;

+ 4 - 4
app/controller/construction_controller.js

@@ -26,7 +26,7 @@ module.exports = app => {
          */
         async index(ctx) {
             try {
-                if (!ctx.session.sessionProject.page_show.openConstruction) {
+                if (!ctx.subProject.page_show.openConstruction) {
                     throw '该功能已关闭或无法查看';
                 }
                 // 获取用户新建标段权利
@@ -188,7 +188,7 @@ module.exports = app => {
                 console.log(err);
                 this.log(err);
                 ctx.session.postError = err.toString();
-                ctx.redirect(this.request && this.request.headers && this.request.headers.referer ? this.request.headers.referer : '/construction');
+                ctx.redirect(this.request && this.request.headers && this.request.headers.referer ? this.request.headers.referer : `/sp/${ctx.subProject.id}/construction`);
             }
         }
 
@@ -292,7 +292,7 @@ module.exports = app => {
                 console.log(err);
                 this.log(err);
                 ctx.session.postError = err.toString();
-                ctx.redirect(ctx.constructionTender ? '/constrution/' + ctx.constructionTender.id + '/list' : '/construction');
+                ctx.redirect(`/sp/${ctx.subProject.id}` + (ctx.constructionTender ? '/constrution/' + ctx.constructionTender.id + '/list' : '/construction'));
             }
         }
 
@@ -411,7 +411,7 @@ module.exports = app => {
                     fileData.orginpath = ctx.app.config.fujianOssPath + filepath;
                     delete fileData.filepath;
                     if (!ctx.helper.canPreview(fileData.fileext)) {
-                        fileData.filepath = `/construction/${original_data.tid}/log/${original_data.log_id}/file/${fileData.id}/download`;
+                        fileData.filepath = `/sp/${ctx.subProject.id}/construction/${original_data.tid}/log/${original_data.log_id}/file/${fileData.id}/download`;
                     } else {
                         fileData.filepath = ctx.app.config.fujianOssPath + filepath;
                         fileData.viewpath = ctx.app.config.fujianOssPath + filepath;

+ 1 - 1
app/middleware/construction_check.js

@@ -66,7 +66,7 @@ module.exports = options => {
                     this.redirect('/wap/list');
                 } else {
                     this.postError(err, '未知错误');
-                    err === '该功能已关闭或无法查看' ? this.redirect('/dashboard') : (err === '您无权查看该内容' ? this.redirect(this.request.headers.referer) : this.redirect('/construction'));
+                    err === '该功能已关闭或无法查看' ? this.redirect('/dashboard') : (err === '您无权查看该内容' ? this.redirect(this.request.headers.referer) : this.redirect(`/sp/${this.subProject.id}/construction`));
                 }
             }
         }

+ 4 - 3
app/public/js/construction_index.js

@@ -20,7 +20,7 @@ const tenderListSpec = (function(){
             html.push(arr.indexOf(node) === arr.length - 1 ? '└' : '├');
             html.push('</span>');
             //html.push('<a href="/tender/' + node.id + '">', node[c.field], '</a>');
-            html.push('<a href="/construction/'+ node.id +'/list" name="name" style="min-width: 300px;word-break:break-all;" id="' + node.id + '">', node.name, '</a>');
+            html.push('<a href="/sp/'+ spid +'/construction/'+ node.id +'/list" name="name" style="min-width: 300px;word-break:break-all;" id="' + node.id + '">', node.name, '</a>');
         }
         html.push('</td>');
 
@@ -42,8 +42,9 @@ const tenderListSpec = (function(){
     }
     function getTenderTreeHeaderHtml() {
         const html = [];
-        html.push('<table class="table table-hover table-bordered">');
-        html.push('<thead style="position: fixed;left:56px;top: 34px;">', '<tr>');
+        const left = $('#sub-menu').css('display') === 'none' ? 56 : 176;
+        html.push('<table class="table table-hover table-bordered">')
+        html.push('<thead style="position: fixed;left:'+ left +'px;top: 34px;" class="text-center">', '<tr>');
         html.push('<th class="text-center" style="min-width: 300px;">', '标段名称', tenderListOrder.getOrderButton('name'), '</th>');
         html.push('<th class="text-center" style="width: 300px;">', '创建时间', tenderListOrder.getOrderButton('create_time'), '</th>');
         if (is_admin) {

+ 9 - 9
app/public/js/construction_info.js

@@ -23,7 +23,7 @@ $(function () {
     });
 
     function updateJsonData(newVal, id) {
-        postData('/construction/' + tender_id + '/log/' + log_id + '/save', { type: 'update_json', updateData: { key: id, value: newVal } }, function (result) {
+        postData(`/sp/${spid}/construction/${tender_id}/log/${log_id}/save`, { type: 'update_json', updateData: { key: id, value: newVal } }, function (result) {
         });
     }
 
@@ -94,7 +94,7 @@ $(function () {
     $('dl').on('click', 'dd', function () {
         const id = parseInt($(this).data('id'));
         if (id) {
-            postData('/construction/' + tender_id + '/log/' + log_id + '/save', { type: 'set_shenpi', uid: id }, function (result) {
+            postData(`/sp/${spid}/construction/${tender_id}/log/${log_id}/save`, { type: 'set_shenpi', uid: id }, function (result) {
                 $('#show-shenpi-btn').hide();
                 $('#show-shenpi span').text(result.shenpi_username);
                 $('#show-shenpi').show();
@@ -103,7 +103,7 @@ $(function () {
     });
 
     $('.remove-shenpi-btn').on('click', function () {
-        postData('/construction/' + tender_id + '/log/' + log_id + '/save', { type: 'remove_shenpi' }, function (result) {
+        postData(`/sp/${spid}/construction/${tender_id}/log/${log_id}/save`, { type: 'remove_shenpi' }, function (result) {
             $('#show-shenpi-btn').show();
             $('#show-shenpi span').text('');
             $('#show-shenpi').hide();
@@ -117,7 +117,7 @@ $(function () {
             toastr.error('请选择审签人再提交');
             return false;
         }
-        postData('/construction/' + tender_id + '/log/' + log_id + '/save', { type: 'start' }, function (result) {
+        postData(`/sp/${spid}/construction/${tender_id}/log/${log_id}/save`, { type: 'start' }, function (result) {
             window.location.reload();
         });
     });
@@ -129,7 +129,7 @@ $(function () {
         $('.edit-textarea').removeAttr('readonly');
         $(this).siblings('span').hide();
         $(this).parents('.title-main').append('<a href="javascript:void(0);" id="start-btn" class="btn btn-sm btn-primary pull-right mr-2">提交审签</a>');
-        postData('/construction/' + tender_id + '/log/' + log_id + '/save', { type: 'checkNo' }, function (result) {
+        postData(`/sp/${spid}/construction/${tender_id}/log/${log_id}/save`, { type: 'checkNo' }, function (result) {
             // window.location.reload();
         });
     });
@@ -142,7 +142,7 @@ $(function () {
     // });
 
     $('#check-btn').click(function () {
-        postData('/construction/' + tender_id + '/log/' + log_id + '/save', { type: 'checked' }, function (result) {
+        postData(`/sp/${spid}/construction/${tender_id}/log/${log_id}/save`, { type: 'checked' }, function (result) {
             window.location.reload();
         });
     });
@@ -173,7 +173,7 @@ $(function () {
             toastr.error('无权限上传!');
             return false;
         }
-        postDataWithFile('/construction/' + tender_id + '/log/' + log_id + '/file/upload', formData, function (data) {
+        postDataWithFile(`/sp/${spid}/construction/${tender_id}/log/${log_id}/file/upload`, formData, function (data) {
             attData = data.concat(attData);
             // 重新生成List
             getAllList();
@@ -188,7 +188,7 @@ $(function () {
     $('body').on('click', '.delete-file', function () {
         let attid = $(this).data('attid');
         const data = {id: attid};
-        postData('/construction/' + tender_id + '/log/' + log_id + '/file/delete', data, function (result) {
+        postData(`/sp/${spid}/construction/${tender_id}/log/${log_id}/file/delete`, data, function (result) {
             // 删除到attData中
             const att_index = attData.findIndex(function (item) {
                 return item.id === parseInt(attid);
@@ -215,7 +215,7 @@ $(function () {
         <td class="text-left"><a href="${att.filepath}" target="_blank">${att.filename}${att.fileext}</a></td>
         <td width="15%">${moment(att.upload_time).format("YYYY-MM-DD HH:mm:ss")}</td>
         <td width="10%">
-            <a href="/construction/${tender_id}/log/${log_id}/file/${att.id}/download" class="mr-2" title="下载"><span class="fa fa-download text-primary"></span></a>`
+            <a href="/sp/${spid}/construction/${tender_id}/log/${log_id}/file/${att.id}/download" class="mr-2" title="下载"><span class="fa fa-download text-primary"></span></a>`
             html += (att.uid === accountId && (logStatus === constructionStatusConst.checked ? Boolean(att.extra_upload) : true)) ?
                 `<a href="javascript:void(0)" class="mr-2 delete-file" data-attid="${att.id}" title="删除附件"><span class="fa fa-trash text-danger"></span></a>` : '';
             html += `</td>`;

+ 6 - 6
app/public/js/construction_list.js

@@ -12,7 +12,7 @@ $(function () {
             queryArr.push('uid=' + uid);
         }
         const queryStr = queryArr.length > 0 ? '?' + queryArr.join('&') : '';
-        const link = '/construction/' + tender_id + '/list' + queryStr;
+        const link = `/sp/${spid}/construction/${tender_id }/list` + queryStr;
         window.location.href = link;
     });
 
@@ -27,7 +27,7 @@ $(function () {
             queryArr.push('uid=' + uid);
         }
         const queryStr = queryArr.length > 0 ? '?' + queryArr.join('&') : '';
-        const link = '/construction/' + tender_id + '/list' + queryStr;
+        const link = `/sp/${spid}/construction/${tender_id }/list` + queryStr;
         window.location.href = link;
     });
     if (reportFlag) {
@@ -70,9 +70,9 @@ $(function () {
                 code: $('#show-code').val(),
                 period: _.trim($('#code-date').val()),
             };
-            postData('/construction/' + tender_id + '/list/add', newData, function (result) {
+            postData(`/sp/${spid}/construction/${tender_id}/list/add`, newData, function (result) {
                 console.log(result);
-                window.location.href = '/construction/' + tender_id + '/log/' + result;
+                window.location.href = `/sp/${spid}/construction/${tender_id}/log/` + result;
             })
         });
 
@@ -87,7 +87,7 @@ $(function () {
                 toastr.error('请勾选日志再批量提交');
                 return false;
             }
-            postData('/construction/' + tender_id + '/list/startmulti', { ids: checkedIds }, function (result) {
+            postData(`/sp/${spid}/construction/${tender_id}/list/startmulti`, { ids: checkedIds }, function (result) {
                 window.location.reload();
             });
         });
@@ -103,7 +103,7 @@ $(function () {
                 toastr.error('删除的日志id为空');
                 return false;
             }
-            postData('/construction/' + tender_id + '/log/' + log_id + '/delete', {}, function (result) {
+            postData(`/sp/${spid}/construction/${tender_id}/log/${log_id}/delete`, {}, function (result) {
                 window.location.reload();
             })
         });

+ 11 - 11
app/router.js

@@ -344,17 +344,17 @@ module.exports = app => {
     app.post('/sp/:id/fm/update', sessionAuth, projectManagerCheck, subProjectCheck, 'fileController.manageUpdate');
 
     // **施工日志 todo 接入项目内部
-    app.get('/construction', sessionAuth, 'constructionController.index');
-    app.post('/construction/:tid/audit/save', sessionAuth, 'constructionController.auditSave');
-    app.get('/construction/:tid/list', sessionAuth, constructionCheck, 'constructionController.list');
-    app.post('/construction/:tid/list/add', sessionAuth, constructionCheck, 'constructionController.addLog');
-    app.post('/construction/:tid/list/startmulti', sessionAuth, constructionCheck, 'constructionController.startMulti');
-    app.get('/construction/:tid/log/:id', sessionAuth, constructionCheck, 'constructionController.logInfo');
-    app.post('/construction/:tid/log/:id/delete', sessionAuth, constructionCheck, 'constructionController.deleteLog');
-    app.post('/construction/:tid/log/:id/save', sessionAuth, constructionCheck, 'constructionController.logSave');
-    app.post('/construction/:tid/log/:id/file/upload', sessionAuth, constructionCheck, 'constructionController.uploadFile');
-    app.post('/construction/:tid/log/:id/file/delete', sessionAuth, constructionCheck, 'constructionController.deleteFile');
-    app.get('/construction/:tid/log/:id/file/:fid/download', sessionAuth, constructionCheck, 'constructionController.downloadFile');
+    app.get('/sp/:id/construction', sessionAuth, subProjectCheck, 'constructionController.index');
+    app.post('/sp/:id/construction/:tid/audit/save', sessionAuth, subProjectCheck, 'constructionController.auditSave');
+    app.get('/sp/:id/construction/:tid/list', sessionAuth, subProjectCheck, constructionCheck, 'constructionController.list');
+    app.post('/sp/:id/construction/:tid/list/add', sessionAuth, subProjectCheck, constructionCheck, 'constructionController.addLog');
+    app.post('/sp/:id/construction/:tid/list/startmulti', sessionAuth, subProjectCheck, constructionCheck, 'constructionController.startMulti');
+    app.get('/sp/:id/construction/:tid/log/:id', sessionAuth, subProjectCheck, constructionCheck, 'constructionController.logInfo');
+    app.post('/sp/:id/construction/:tid/log/:id/delete', sessionAuth, subProjectCheck, constructionCheck, 'constructionController.deleteLog');
+    app.post('/sp/:id/construction/:tid/log/:id/save', sessionAuth, subProjectCheck, constructionCheck, 'constructionController.logSave');
+    app.post('/sp/:id/construction/:tid/log/:id/file/upload', sessionAuth, subProjectCheck, constructionCheck, 'constructionController.uploadFile');
+    app.post('/sp/:id/construction/:tid/log/:id/file/delete', sessionAuth, subProjectCheck, constructionCheck, 'constructionController.deleteFile');
+    app.get('/sp/:id/construction/:tid/log/:id/file/:fid/download', sessionAuth, subProjectCheck, constructionCheck, 'constructionController.downloadFile');
 
     // **概算投资/动态投资
     // app.get('/budget', sessionAuth, 'budgetController.list');

+ 1 - 1
app/service/construction_att.js

@@ -55,7 +55,7 @@ module.exports = app => {
             return result.map(item => {
                 item.orginpath = this.ctx.app.config.fujianOssPath + item.filepath;
                 if (!this.ctx.helper.canPreview(item.fileext)) {
-                    item.filepath = `/construction/${item.tid}/log/${item.log_id}/file/${item.id}/download`;
+                    item.filepath = `/sp/${this.ctx.subProject.id}/construction/${item.tid}/log/${item.log_id}/file/${item.id}/download`;
                 } else {
                     item.filepath = this.ctx.app.config.fujianOssPath + item.filepath;
                     item.viewpath = item.filepath;

+ 4 - 4
app/service/tender.js

@@ -588,8 +588,8 @@ module.exports = app => {
                     '  FROM ?? As t ' +
                     '  Left Join ?? As pa ' +
                     '  ON t.`user_id` = pa.`id` ' +
-                    '  WHERE t.`project_id` = ? ORDER BY CONVERT(t.`name` USING GBK) ASC';
-                sqlParam = [this.tableName, this.ctx.service.projectAccount.tableName, session.sessionProject.id];
+                    '  WHERE t.`project_id` = ? AND t.`spid` = ? ORDER BY CONVERT(t.`name` USING GBK) ASC';
+                sqlParam = [this.tableName, this.ctx.service.projectAccount.tableName, session.sessionProject.id, this.ctx.subProject.id];
             } else {
                 // 根据用户权限查阅标段
                 sql = 'SELECT t.`id`, t.`project_id`, t.`name`, t.`status`, t.`category`, t.`user_id`, t.`create_time`,' +
@@ -599,11 +599,11 @@ module.exports = app => {
                     '  FROM ?? As t ' +
                     '  Left Join ?? As pa ' +
                     '  ON t.`user_id` = pa.`id` ' +
-                    '  WHERE t.`project_id` = ? AND ' +
+                    '  WHERE t.`project_id` = ? AND t.`spid` = ? AND ' +
                     // 参与施工 的标段
                     ' t.id IN ( SELECT ca.`tid` FROM ?? As ca WHERE ca.`uid` = ?)' +
                     ' ORDER BY CONVERT(t.`name` USING GBK) ASC';
-                sqlParam = [this.tableName, this.ctx.service.projectAccount.tableName, session.sessionProject.id,
+                sqlParam = [this.tableName, this.ctx.service.projectAccount.tableName, session.sessionProject.id, this.ctx.subProject.id,
                     this.ctx.service.constructionAudit.tableName, session.sessionUser.accountId,
                 ];
             }

+ 22 - 1
app/view/construction/index.ejs

@@ -1,6 +1,8 @@
+<% include ../tender/list_sub_menu.ejs %>
 <div class="panel-content">
     <div class="panel-title fluid">
-        <div class="title-main  d-flex justify-content-between">
+        <div class="title-main  d-flex">
+            <% include ../tender/list_sub_mini_menu.ejs %>
             <div class="d-inline-block" id="show-level"></div>
         </div>
     </div>
@@ -20,4 +22,23 @@
     const is_admin = <%- ctx.session.sessionUser.is_admin %>;
 
     const uphlname = 'user_' + uid + '_pro_' + pid + '_category_hide_construction_list';
+
+    $.subMenu({
+        menu: '#sub-menu', miniMenu: '#sub-mini-menu', miniMenuList: '#mini-menu-list',
+        toMenu: '#to-menu', toMiniMenu: '#to-mini-menu',
+        key: 'list.menu.1.0.0',
+        miniHint: '#sub-mini-hint', hintKey: 'menu.hint.1.0.1',
+        callback: function (info) {
+            if (info.mini) {
+                $('.panel-title').addClass('fluid');
+                $('#sub-menu').removeClass('panel-sidebar');
+                $('.c-body table thead').css('left', '56px');
+            } else {
+                $('.panel-title').removeClass('fluid');
+                $('#sub-menu').addClass('panel-sidebar');
+                $('.c-body table thead').css('left', '176px');
+            }
+            autoFlashHeight();
+        }
+    });
 </script>

+ 2 - 2
app/view/construction/info.ejs

@@ -2,7 +2,7 @@
     <div class="panel-title fluid">
         <div class="title-main  d-flex justify-content-between">
             <div class="d-inline-block">
-                <a href="/construction/<%- ctx.constructionTender.id %>/list" class="mr-2"><i class="fa fa-chevron-left mr-2"></i>
+                <a href="/sp/<%- ctx.subProject.id %>/construction/<%- ctx.constructionTender.id %>/list" class="mr-2"><i class="fa fa-chevron-left mr-2"></i>
                     <span>返回</span></a><%- (ctx.constructionTender.name.length > 20 ? ctx.constructionTender.name.substring(0,20) + '...' : ctx.constructionTender.name) %> / <%- logInfo.code %></div>
             <div>
                 <% if (ctx.session.sessionUser.accountId === logInfo.shenpi_uid && logInfo.status === constructionConst.status.checking) { %>
@@ -154,7 +154,7 @@
                                     <td width="5%"><%- index+1 %></td>
                                     <td class="text-left"><a href="<%- att.filepath %>" target="_blank"><%- att.filename %><%- att.fileext %></a></td>
                                     <td width="15%"><%- moment(att.upload_time).format("YYYY-MM-DD HH:mm:ss") %></td>
-                                    <td width="10%"><a href="/construction/<%- ctx.constructionTender.id %>/log/<%- logInfo.id %>/file/<%- att.id %>/download" class="mr-2" title="下载"><i class="fa fa-download"></i></a>
+                                    <td width="10%"><a href="/sp/<%- ctx.subProject.id %>/construction/<%- ctx.constructionTender.id %>/log/<%- logInfo.id %>/file/<%- att.id %>/download" class="mr-2" title="下载"><i class="fa fa-download"></i></a>
                                     <% if (att.uid === ctx.session.sessionUser.accountId && (logInfo.status === constructionConst.status.checked ? Boolean(att.extra_upload) : true )) { %>
                                         <a href="javascript:void(0)" class="mr-2 delete-file" data-attid="<%- att.id %>" title="删除附件"><span class="fa fa-trash text-danger"></span></a>
                                     <% } %>

+ 4 - 4
app/view/construction/list.ejs

@@ -2,7 +2,7 @@
     <div class="panel-title fluid">
         <div class="title-main d-flex justify-content-between">
             <div class="col-4 pl-0">
-                <div class="d-inline-block"><a href="/construction" class="mr-2"><i class="fa fa-chevron-left mr-2"></i><span>返回</span></a><%- (ctx.constructionTender.name.length > 20 ? ctx.constructionTender.name.substring(0,20) + '...' : ctx.constructionTender.name) %></div>
+                <div class="d-inline-block"><a href="/sp/<%- ctx.subProject.id %>/construction" class="mr-2"><i class="fa fa-chevron-left mr-2"></i><span>返回</span></a><%- (ctx.constructionTender.name.length > 20 ? ctx.constructionTender.name.substring(0,20) + '...' : ctx.constructionTender.name) %></div>
             </div>
             <div class="col-3">
                 <div class="d-inline-block mr-2">
@@ -67,7 +67,7 @@
                     <tbody class="text-center">
                     <% for (const log of logList) { %>
                     <tr>
-                        <td><a href="/construction/<%- ctx.constructionTender.id %>/log/<%- log.id %>"><%- log.code %></a></td>
+                        <td><a href="/sp/<%- ctx.subProject.id %>/construction/<%- ctx.constructionTender.id %>/log/<%- log.id %>"><%- log.code %></a></td>
                         <td><%- moment(log.create_time).format('YYYY-MM-DD') %></td>
                         <td><%- log.period %></td>
                         <td><%- constructionConst.type[log.type] %></td>
@@ -76,10 +76,10 @@
                         <td><span class="<%- constructionConst.statusClass[log.status] %>"><%- constructionConst.statusString[log.status] %></span></td>
                         <td>
                             <% if (ctx.session.sessionUser.accountId === log.shenpi_uid && log.status === constructionConst.status.checking) { %>
-                                <a href="/construction/<%- ctx.constructionTender.id %>/log/<%- log.id %>" class="btn btn-success btn-sm">审签</a>
+                                <a href="/sp/<%- ctx.subProject.id %>/construction/<%- ctx.constructionTender.id %>/log/<%- log.id %>" class="btn btn-success btn-sm">审签</a>
                             <% } %>
                             <% if (ctx.session.sessionUser.accountId === log.report_uid && log.status === constructionConst.status.uncheck) { %>
-                                    <a href="/construction/<%- ctx.constructionTender.id %>/log/<%- log.id %>" class="btn btn-primary btn-sm">提交</a>
+                                    <a href="/sp/<%- ctx.subProject.id %>/construction/<%- ctx.constructionTender.id %>/log/<%- log.id %>" class="btn btn-primary btn-sm">提交</a>
                             <a href="#del-bg" data-toggle="modal" data-target="#del-bg" data-id="<%- log.id %>" class="btn btn-outline-danger btn-sm delete-log-a">删除</a>
                             <% } %>
                         </td>

+ 4 - 4
app/view/construction/modal.ejs

@@ -156,7 +156,7 @@
             const id = parseInt($(this).data('id'));
             console.log(id);
             if (!isNaN(id) && id !== 0) {
-                postData('/construction/'+ $('#tender_id').val() + '/audit/save', {type: 'add-audit', id: id}, function (result) {
+                postData(`/sp/${spid}/construction/${$('#tender_id').val()}/audit/save`, {type: 'add-audit', id: id}, function (result) {
                     setList(result);
                 })
             }
@@ -173,7 +173,7 @@
             }
             const tid = $('#tender_id').val();
             if (tid) {
-                postData('/construction/'+ $('#tender_id').val() + '/audit/save', { type: 'list' }, function (result) {
+                postData(`/sp/${spid}/construction/${$('#tender_id').val()}/audit/save`, { type: 'list' }, function (result) {
                     setList(result);
                 });
             }
@@ -209,7 +209,7 @@
 
         $('#del-audit-btn').click(function () {
             let uids = $('#del-audit-ids').val();
-            postData('/construction/'+ $('#tender_id').val() + '/audit/save', { type: 'del-audit', id: uids.split(',') }, function (result) {
+            postData(`/sp/${spid}/construction/${$('#tender_id').val()}/audit/save`, { type: 'del-audit', id: uids.split(',') }, function (result) {
                 // toastr.success(`成功添加 位用户`);
                 $('#del-construction-audit').modal('hide');
                 setList(result);
@@ -225,7 +225,7 @@
                 id,
                 is_report: $(this).is(':checked'),
             }
-            postData('/construction/'+ $('#tender_id').val() + '/audit/save', { type: 'save-report', updateData: updateInfo }, function (result) {
+            postData(`/sp/${spid}/construction/${$('#tender_id').val()}/audit/save`, { type: 'save-report', updateData: updateInfo }, function (result) {
             })
         });
     });

+ 1 - 1
app/view/layout/menu.ejs

@@ -17,7 +17,7 @@
             <% for (const index in ctx.menuList) { %>
             <% const menu = ctx.menuList[index]; %>
             <% if (!menu.display) { continue } %>
-            <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.some(item => ctx.url.includes(item)))) || (menu.url && menu.url === ctx.url)) { %>class="active"<% } %>>
+            <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"<% } %>>
                 <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><%- menu.caption %></span><% } %>

+ 9 - 0
app/view/tender/list_sub_menu_list.ejs

@@ -12,3 +12,12 @@
         </li>
     </ul>
 </div>
+<% if (ctx.subProject.page_show.openConstruction) { %>
+<div class="nav-box">
+    <ul class="nav-list list-unstyled">
+        <li class="<% if (ctx.url === '/sp/' + ctx.subProject.id + '/construction') { %>active<% } %>">
+            <a href="/sp/<%- ctx.subProject.id %>/construction"><span class="ml-3">施工日志</span></a>
+        </li>
+    </ul>
+</div>
+<% } %>

+ 11 - 11
config/menu.js

@@ -105,8 +105,8 @@ const menu = {
         children: null,
         caption: '标段管理',
         controller: 'list',
-        controllers: ['list', 'tender', 'contract'],
-        includedUrl: ['/contract/tender'],
+        controllers: ['list', 'tender', 'contract', 'construction'],
+        includedUrl: { contract: ['/contract/tender'] },
     },
     contract: {
         name: '合同管理',
@@ -134,15 +134,15 @@ const menu = {
         caption: '动态投资',
         controller: 'budget',
     },
-    construction: {
-        name: '施工日志',
-        icon: 'fa-pencil-square-o',
-        display: true,
-        url: '/construction',
-        caption: '施工日志',
-        children: null,
-        controller: 'construction',
-    },
+    // construction: {
+    //     name: '施工日志',
+    //     icon: 'fa-pencil-square-o',
+    //     display: true,
+    //     // url: '/construction',
+    //     caption: '施工日志',
+    //     children: null,
+    //     controller: 'construction',
+    // },
     financial: {
         name: '资金监管',
         icon: 'fa-money',

+ 1 - 0
config/web.js

@@ -1518,6 +1518,7 @@ const JsFiles = {
                     '/public/js/moment/moment.min.js',
                 ],
                 mergeFiles: [
+                    '/public/js/sub_menu.js',
                     '/public/js/zh_calc.js',
                     '/public/js/PinYinOrder.bundle.js',
                     '/public/js/shares/tender_list_order.js',