فهرست منبع

合同管理成员问题,施工日志进入bug

ellisran 4 ماه پیش
والد
کامیت
79742dcb39

+ 5 - 5
app/controller/construction_controller.js

@@ -234,7 +234,7 @@ module.exports = app => {
                 const responseData = {
                 const responseData = {
                     err: 0, msg: '', data: null,
                     err: 0, msg: '', data: null,
                 };
                 };
-                const id = parseInt(ctx.params.id);
+                const id = parseInt(ctx.params.lid);
                 if (!id) throw '参数有误';
                 if (!id) throw '参数有误';
                 const logInfo = await ctx.service.constructionLog.getDataById(id);
                 const logInfo = await ctx.service.constructionLog.getDataById(id);
                 if (!logInfo) throw '该日志不存在';
                 if (!logInfo) throw '该日志不存在';
@@ -251,7 +251,7 @@ module.exports = app => {
 
 
         async logInfo(ctx) {
         async logInfo(ctx) {
             try {
             try {
-                const id = parseInt(ctx.params.id);
+                const id = parseInt(ctx.params.lid);
                 if (!id) throw '参数有误';
                 if (!id) throw '参数有误';
                 const logInfo = await ctx.service.constructionLog.getDataById(id);
                 const logInfo = await ctx.service.constructionLog.getDataById(id);
                 if (!logInfo) throw '该日志不存在';
                 if (!logInfo) throw '该日志不存在';
@@ -298,7 +298,7 @@ module.exports = app => {
 
 
         async logSave(ctx) {
         async logSave(ctx) {
             try {
             try {
-                const id = parseInt(ctx.params.id);
+                const id = parseInt(ctx.params.lid);
                 if (!id) throw '参数有误';
                 if (!id) throw '参数有误';
                 const logInfo = await ctx.service.constructionLog.getDataById(id);
                 const logInfo = await ctx.service.constructionLog.getDataById(id);
                 if (!logInfo) throw '该日志不存在';
                 if (!logInfo) throw '该日志不存在';
@@ -370,7 +370,7 @@ module.exports = app => {
             };
             };
             let stream;
             let stream;
             try {
             try {
-                const id = parseInt(ctx.params.id);
+                const id = parseInt(ctx.params.lid);
                 if (!id) throw '参数有误';
                 if (!id) throw '参数有误';
                 const logInfo = await ctx.service.constructionLog.getDataById(id);
                 const logInfo = await ctx.service.constructionLog.getDataById(id);
                 if (!logInfo) throw '该日志不存在';
                 if (!logInfo) throw '该日志不存在';
@@ -482,7 +482,7 @@ module.exports = app => {
                 data: '',
                 data: '',
             };
             };
             try {
             try {
-                const id = parseInt(ctx.params.id);
+                const id = parseInt(ctx.params.lid);
                 if (!id) throw '参数有误';
                 if (!id) throw '参数有误';
                 const logInfo = await ctx.service.constructionLog.getDataById(id);
                 const logInfo = await ctx.service.constructionLog.getDataById(id);
                 if (!logInfo) throw '该日志不存在';
                 if (!logInfo) throw '该日志不存在';

+ 1 - 1
app/public/js/contract_index.js

@@ -34,7 +34,7 @@ $(document).ready(function() {
                     }
                     }
                 } else {
                 } else {
                     html.push(`<span class="text-muted mr-2">${tree.isLastSibling(node) ? '└' : '├'}</span>`);
                     html.push(`<span class="text-muted mr-2">${tree.isLastSibling(node) ? '└' : '├'}</span>`);
-                    html.push('<a href="/sp/' + spid +'/contract/'+ node.id +'/detail" name="name" id="' + node.id + '">', node.name, '</a>');
+                    html.push('<a href="/sp/' + spid +'/contract/tender/'+ node.id +'/detail" name="name" id="' + node.id + '">', node.name, '</a>');
                 }
                 }
                 html.push('</td>');
                 html.push('</td>');
                 // 创建时间
                 // 创建时间

+ 1 - 1
app/public/js/contract_tender.js

@@ -56,7 +56,7 @@ const tenderListSpec = (function(){
         if (is_admin) {
         if (is_admin) {
             html.push('<td style="width: 10%" class="text-center">');
             html.push('<td style="width: 10%" class="text-center">');
             if (!node.cid) {
             if (!node.cid) {
-                html.push(`<a href="javascript:void(0);" data-toggle="modal" data-stid="${node.id}" class="btn btn-sm btn-primary get-audits"> 成员管理</a>`);
+                html.push(`<a href="javascript:void(0);" data-toggle="modal" data-stid="${node.id}" class="btn btn-sm btn-outline-primary get-audits"> 成员管理</a>`);
                 // html.push('<a href="#empower" data-toggle="modal" data-target="#empower" class="btn btn-sm btn-primary ">成员管理</a>');
                 // html.push('<a href="#empower" data-toggle="modal" data-target="#empower" class="btn btn-sm btn-primary ">成员管理</a>');
             }
             }
             html.push('</td>');
             html.push('</td>');

+ 6 - 6
app/router.js

@@ -349,12 +349,12 @@ module.exports = app => {
     app.get('/sp/:id/construction/:tid/list', sessionAuth, subProjectCheck, constructionCheck, 'constructionController.list');
     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/add', sessionAuth, subProjectCheck, constructionCheck, 'constructionController.addLog');
     app.post('/sp/:id/construction/:tid/list/startmulti', sessionAuth, subProjectCheck, constructionCheck, 'constructionController.startMulti');
     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('/sp/:id/construction/:tid/log/:lid', sessionAuth, subProjectCheck, constructionCheck, 'constructionController.logInfo');
+    app.post('/sp/:id/construction/:tid/log/:lid/delete', sessionAuth, subProjectCheck, constructionCheck, 'constructionController.deleteLog');
+    app.post('/sp/:id/construction/:tid/log/:lid/save', sessionAuth, subProjectCheck, constructionCheck, 'constructionController.logSave');
+    app.post('/sp/:id/construction/:tid/log/:lid/file/upload', sessionAuth, subProjectCheck, constructionCheck, 'constructionController.uploadFile');
+    app.post('/sp/:id/construction/:tid/log/:lid/file/delete', sessionAuth, subProjectCheck, constructionCheck, 'constructionController.deleteFile');
+    app.get('/sp/:id/construction/:tid/log/:lid/file/:fid/download', sessionAuth, subProjectCheck, constructionCheck, 'constructionController.downloadFile');
 
 
     // **概算投资/动态投资
     // **概算投资/动态投资
     // app.get('/budget', sessionAuth, 'budgetController.list');
     // app.get('/budget', sessionAuth, 'budgetController.list');

+ 1 - 1
app/service/contract_att.js

@@ -30,7 +30,7 @@ module.exports = app => {
             return result.map(item => {
             return result.map(item => {
                 item.orginpath = this.ctx.app.config.fujianOssPath + item.filepath;
                 item.orginpath = this.ctx.app.config.fujianOssPath + item.filepath;
                 if (!this.ctx.helper.canPreview(item.fileext)) {
                 if (!this.ctx.helper.canPreview(item.fileext)) {
-                    item.filepath = `/contract/${item.spid || item.tid}/detail/${contractConst.typeMap[item.contract_type]}/${item.cid}/file/${item.id}/download`;
+                    item.filepath = `/sp/${this.ctx.subProject.id}/contract${item.tid ? '/tender/' + item.tid : ''}/detail/${contractConst.typeMap[item.contract_type]}/${item.cid}/file/${item.id}/download`;
                 } else {
                 } else {
                     item.filepath = this.ctx.app.config.fujianOssPath + item.filepath;
                     item.filepath = this.ctx.app.config.fujianOssPath + item.filepath;
                     item.viewpath = item.filepath;
                     item.viewpath = item.filepath;

+ 1 - 1
app/service/contract_pay_att.js

@@ -30,7 +30,7 @@ module.exports = app => {
             return result.map(item => {
             return result.map(item => {
                 item.orginpath = this.ctx.app.config.fujianOssPath + item.filepath;
                 item.orginpath = this.ctx.app.config.fujianOssPath + item.filepath;
                 if (!this.ctx.helper.canPreview(item.fileext)) {
                 if (!this.ctx.helper.canPreview(item.fileext)) {
-                    item.filepath = `/contract/${item.spid || item.tid}/detail/${contractConst.typeMap[item.contract_type]}/${item.cid}/pay/${item.cpid}/file/${item.id}/download`;
+                    item.filepath = `/sp/${this.ctx.subProject.id}/contract${item.tid ? '/tender/' + item.tid : ''}/detail/${contractConst.typeMap[item.contract_type]}/${item.cid}/pay/${item.cpid}/file/${item.id}/download`;
                 } else {
                 } else {
                     item.filepath = this.ctx.app.config.fujianOssPath + item.filepath;
                     item.filepath = this.ctx.app.config.fujianOssPath + item.filepath;
                     item.viewpath = item.filepath;
                     item.viewpath = item.filepath;

+ 5 - 6
app/view/contract/modal.ejs

@@ -174,9 +174,8 @@
         // 添加到成员中
         // 添加到成员中
         $('body').on('click', '#authority-list dl dd', function () {
         $('body').on('click', '#authority-list dl dd', function () {
             const id = parseInt($(this).data('id'));
             const id = parseInt($(this).data('id'));
-            console.log(id);
             if (!isNaN(id) && id !== 0) {
             if (!isNaN(id) && id !== 0) {
-                postData(`/sp/${spid}/contract/${$('#stid').val()}/audit/save`, {type: 'add-audit', id: id}, function (result) {
+                postData(`/sp/${spid}/contract/tender/${$('#stid').val()}/audit/save`, {type: 'add-audit', id: id}, function (result) {
                     setList(result);
                     setList(result);
                 })
                 })
             }
             }
@@ -193,7 +192,7 @@
             }
             }
             const stid = $('#stid').val();
             const stid = $('#stid').val();
             if (stid) {
             if (stid) {
-                postData(`/sp/${spid}/contract/${$('#stid').val()}/audit/save`, { type: 'list' }, function (result) {
+                postData(`/sp/${spid}/contract/tender/${$('#stid').val()}/audit/save`, { type: 'list' }, function (result) {
                     setList(result);
                     setList(result);
                 });
                 });
             }
             }
@@ -202,7 +201,7 @@
             const stid = $(this).data('stid');
             const stid = $(this).data('stid');
             $('#stid').val(stid);
             $('#stid').val(stid);
             $('#contract-audit-list').html('');
             $('#contract-audit-list').html('');
-            postData(`/sp/${spid}/contract/${$('#stid').val()}/audit/save`, { type: 'check' }, function (result) {
+            postData(`/sp/${spid}/contract/tender/${$('#stid').val()}/audit/save`, { type: 'check' }, function (result) {
                 $('#authority-list').modal('show');
                 $('#authority-list').modal('show');
             });
             });
         });
         });
@@ -241,7 +240,7 @@
 
 
         $('#del-audit-btn').click(function () {
         $('#del-audit-btn').click(function () {
             let uids = $('#del-audit-ids').val();
             let uids = $('#del-audit-ids').val();
-            postData(`/sp/${spid}/contract/${$('#stid').val()}/audit/save`, { type: 'del-audit', id: uids.split(',') }, function (result) {
+            postData(`/sp/${spid}/contract/tender/${$('#stid').val()}/audit/save`, { type: 'del-audit', id: uids.split(',') }, function (result) {
                 // toastr.success(`成功添加 位用户`);
                 // toastr.success(`成功添加 位用户`);
                 $('#del-contract-audit').modal('hide');
                 $('#del-contract-audit').modal('hide');
                 setList(result);
                 setList(result);
@@ -255,7 +254,7 @@
             const id = parseInt($(this).val());
             const id = parseInt($(this).val());
             const updateInfo = { id };
             const updateInfo = { id };
             updateInfo[type] = value;
             updateInfo[type] = value;
-            postData(`/sp/${spid}/contract/${$('#stid').val()}/audit/save`, { type: 'save-permission', updateData: updateInfo }, function (result) {
+            postData(`/sp/${spid}/contract/tender/${$('#stid').val()}/audit/save`, { type: 'save-permission', updateData: updateInfo }, function (result) {
             })
             })
         });
         });
     });
     });