소스 검색

Merge branch 'dev' of http://192.168.1.41:3000/maixinrong/Calculation into dev

Tony Kang 1 개월 전
부모
커밋
8570c021e0
64개의 변경된 파일1103개의 추가작업 그리고 233개의 파일을 삭제
  1. 3 0
      app/base/base_controller.js
  2. 2 2
      app/const/audit.js
  3. 1 0
      app/const/sp_page_show.js
  4. 56 17
      app/controller/quality_controller.js
  5. 12 6
      app/controller/sub_proj_setting_controller.js
  6. 1 1
      app/middleware/inspection_check.js
  7. 6 1
      app/public/js/change.js
  8. 7 2
      app/public/js/change_apply.js
  9. 132 50
      app/public/js/change_information.js
  10. 7 2
      app/public/js/change_plan.js
  11. 6 1
      app/public/js/change_project.js
  12. 28 1
      app/public/js/ledger.js
  13. 1 1
      app/public/js/material_audit.js
  14. 1 1
      app/public/js/measure_material.js
  15. 1 1
      app/public/js/measure_stage.js
  16. 3 0
      app/public/js/phase_pay_detail.js
  17. 7 1
      app/public/js/phase_pay_list.js
  18. 1 1
      app/public/js/quality_tender.js
  19. 65 21
      app/public/js/setting_manage.js
  20. 1 1
      app/public/js/sp_setting_permission.js
  21. 40 0
      app/public/js/spss_gather_stage_info.js
  22. 6 1
      app/public/js/stage_bwtz.js
  23. 1 0
      app/router.js
  24. 32 9
      app/service/deal_bills.js
  25. 7 1
      app/service/phase_pay_detail.js
  26. 6 6
      app/service/quality_inspection_audit.js
  27. 1 1
      app/service/stage_bonus.js
  28. 1 1
      app/service/stage_jgcl.js
  29. 1 1
      app/service/stage_other.js
  30. 6 0
      app/service/stage_pos.js
  31. 1 1
      app/service/stage_safe_prod.js
  32. 1 1
      app/service/stage_temp_land.js
  33. 1 1
      app/service/stage_yjcl.js
  34. 128 0
      app/service/sub_project.js
  35. 6 1
      app/service/tender_permission.js
  36. 2 2
      app/view/change/addlist.ejs
  37. 39 6
      app/view/change/apply_information_modal.ejs
  38. 5 4
      app/view/change/information.ejs
  39. 40 7
      app/view/change/information_modal.ejs
  40. 40 7
      app/view/change/plan_information_modal.ejs
  41. 40 7
      app/view/change/project_information_modal.ejs
  42. 1 1
      app/view/change/revise.ejs
  43. 39 6
      app/view/financial/pay_detail_modal.ejs
  44. 13 5
      app/view/ledger/audit_modal.ejs
  45. 6 2
      app/view/ledger/explode_modal.ejs
  46. 18 6
      app/view/material/audit_modal.ejs
  47. 39 6
      app/view/phase_pay/audit_modal.ejs
  48. 1 1
      app/view/quality/inspection.ejs
  49. 1 1
      app/view/quality/inspection_modal.ejs
  50. 4 1
      app/view/quality/sub_memu_list.ejs
  51. 1 0
      app/view/quality/tender.ejs
  52. 6 2
      app/view/revise/history_modal.ejs
  53. 18 6
      app/view/revise/info_modal.ejs
  54. 5 5
      app/view/setting/user_unit.ejs
  55. 79 0
      app/view/shares/col_set_modal.ejs
  56. 35 9
      app/view/sp_setting/manage.ejs
  57. 50 1
      app/view/sp_setting/user_modal.ejs
  58. 1 0
      app/view/spss/gather_info.ejs
  59. 1 0
      app/view/spss/gather_info_modal.ejs
  60. 18 6
      app/view/stage/audit_modal.ejs
  61. 3 3
      app/view/tender/modal.ejs
  62. 5 4
      app/view/wap/inspection.ejs
  63. 11 1
      config/menu.js
  64. 3 0
      sql/update.sql

+ 3 - 0
app/base/base_controller.js

@@ -41,6 +41,7 @@ class BaseController extends Controller {
             menuList.budget.display = ctx.subProject.page_show.openBudget || false;
             menuList.payment.display = ctx.subProject.page_show.openPayment || false;
             menuList.quality.display = ctx.subProject.page_show.quality || false;
+            menuList.inspection.display = ctx.subProject.page_show.quality || false;
             for (const index in menuList) {
                 const im = menuList[index];
                 if (!im.url) {
@@ -56,6 +57,8 @@ class BaseController extends Controller {
                         }
                     } else if (index === 'financial') {
                         im.url = `/sp/${ctx.subProject.id}/${im.controller}/${ctx.subProject.financialToUrl}`;
+                    } else if (index === 'inspection') {
+                        im.url = `/sp/${ctx.subProject.id}/quality/inspection`;
                     } else {
                         im.url = `/sp/${ctx.subProject.id}/${im.controller}`;
                     }

+ 2 - 2
app/const/audit.js

@@ -40,9 +40,9 @@ const common = (function() {
         { key: 'checked', value: 3, title: '审批通过', class: 'text-success', btnTitle: '', btnClass: 'btn-primary' },
         { key: 'checkNo', value: 4, title: '审批退回', class: 'text-warning', btnTitle: '重新上报', btnClass: 'btn-primary' },
         { key: 'checkNoPre', value: 5, title: '审批退回', class: 'text-warning', btnTitle: '重新审批', btnClass: 'btn-primary' },
-        { key: 'checkSkip', value: 6, title: '', class: '', btnTitle: '', btnClass: '' },
+        { key: 'checkAgain', value: 6, title: '重新审批', class: 'text-warning', btnTitle: '', btnClass: '' },
         { key: 'checkCancel', value: 7, title: '撤回', class: 'text-warning', btnTitle: '', btnClass: '' },
-        { key: 'checkAgain', value: 8, title: '重新审批', class: 'text-warning', btnTitle: '', btnClass: '' },
+        { key: 'checkSkip', value: 8, title: '', class: '', btnTitle: '', btnClass: '' },
     ];
     return (function(){
         const status = {}, info = [];

+ 1 - 0
app/const/sp_page_show.js

@@ -110,6 +110,7 @@ const defaultSetting = {
     openInfo: 1,
     correctCalcContractTp: 0,
     quality: 1,
+    qualityInspection: 1,
 };
 
 module.exports = {

+ 56 - 17
app/controller/quality_controller.js

@@ -43,6 +43,7 @@ module.exports = app => {
                 if (!ctx.subProject.page_show.quality) throw '该功能已关闭';
 
                 const renderData = {
+                    is_inspection: ctx.url.includes('inspection') ? 1 : 0,
                     jsFiles: this.app.jsFiles.common.concat(this.app.jsFiles.quality.tender),
                 };
 
@@ -73,6 +74,42 @@ module.exports = app => {
             }
         }
 
+        async inspectionTender(ctx) {
+            try {
+                if (!ctx.subProject.page_show.qualityInspection) throw '该功能已关闭';
+
+                const renderData = {
+                    is_inspection: ctx.url.includes('inspection') ? 1 : 0,
+                    jsFiles: this.app.jsFiles.common.concat(this.app.jsFiles.quality.tender),
+                };
+
+                const accountList = await ctx.service.projectAccount.getAllSubProjectAccount(ctx.subProject);
+                renderData.accountList = accountList;
+                const unitList = await ctx.service.constructionUnit.getAllDataByCondition({ where: { pid: ctx.session.sessionProject.id } });
+                const accountGroupList = unitList.map(item => {
+                    const groupList = accountList.filter(item1 => item1.company === item.name);
+                    return { groupName: item.name, groupList };
+                }).filter(x => { return x.groupList.length > 0; });
+                // const unitList = await ctx.service.constructionUnit.getAllDataByCondition({ where: { pid: ctx.session.sessionProject.id } });
+                // renderData.accountGroup = unitList.map(item => {
+                //     const groupList = accountList.filter(item1 => item1.company === item.name);
+                //     return { groupName: item.name, groupList };
+                // });
+                renderData.accountGroup = accountGroupList;
+                renderData.accountInfo = await ctx.service.projectAccount.getDataById(ctx.session.sessionUser.accountId);
+                renderData.tenderList = await ctx.service.tender.getSpecList(ctx.service.tenderPermission, 'inspection', ctx.session.sessionUser.is_admin ? 'all' : '');
+                renderData.categoryData = await this.ctx.service.category.getAllCategory(this.ctx.subProject);
+                renderData.selfCategoryLevel = this.ctx.subProject.permission.self_category_level;
+                renderData.permissionConst = ctx.service.tenderPermission.partPermissionConst('inspection');
+                renderData.permissionBlock = ctx.service.tenderPermission.partPermissionBlock('inspection');
+                await this.layout('quality/tender.ejs', renderData, 'quality/tender_modal.ejs');
+            } catch (err) {
+                ctx.log(err);
+                ctx.postError(err, '无法查看质量巡检数据');
+                ctx.redirect('/dashboard');
+            }
+        }
+
         async member(ctx) {
             try {
                 const data = JSON.parse(ctx.request.body.data);
@@ -113,10 +150,11 @@ module.exports = app => {
                 let auditList = [];
                 switch (data.type) {
                     case 'add-audit':
+                        if (!data.key || !['quality', 'inspection'].includes(data.key)) throw '参数有误';
                         // // 判断用户是单个还是数组
                         uids = data.id instanceof Array ? data.id : [data.id];
                         // // 判断该用户的组是否已加入到表中,已加入则提示无需添加
-                        auditList = await ctx.service.tenderPermission.getPartsPermission(tenderInfo.id, ['quality']);
+                        auditList = await ctx.service.tenderPermission.getPartsPermission(tenderInfo.id, [data.key]);
                         const addAidList = ctx.helper._.difference(uids, ctx.helper._.map(auditList, 'uid'));
                         if (addAidList.length === 0) {
                             throw '用户已存在成员管理中,无需重复添加';
@@ -124,18 +162,18 @@ module.exports = app => {
                         const accountList = await ctx.service.projectAccount.getAllDataByCondition({ where: { id: addAidList } });
                         const insert_members = [];
                         for (const account of accountList) {
-                            insert_members.push({
-                                uid: account.id,
-                                quality: ['1'],
-                            });
+                            const insert_member = { uid: account.id };
+                            insert_member[data.key] = ['1'];
+                            insert_members.push(insert_member);
                         }
-                        await ctx.service.tenderPermission.saveOnePermission(tenderInfo.id, ctx.helper._.map(accountList, 'id'), insert_members, ['quality']);
-                        responseData.data = await ctx.service.tenderPermission.getPartsPermission(tenderInfo.id, ['quality']);
+                        await ctx.service.tenderPermission.saveOnePermission(tenderInfo.id, ctx.helper._.map(accountList, 'id'), insert_members, [data.key]);
+                        responseData.data = await ctx.service.tenderPermission.getPartsPermission(tenderInfo.id, [data.key]);
                         break;
                     case 'del-audit':
+                        if (!data.key || !['quality', 'inspection'].includes(data.key)) throw '参数有误';
                         uids = data.id instanceof Array ? data.id : [data.id];
                         if (uids.length === 0) throw '没有选择要移除的用户';
-                        auditList = await ctx.service.tenderPermission.getPartsPermission(tenderInfo.id, ['quality']);
+                        auditList = await ctx.service.tenderPermission.getPartsPermission(tenderInfo.id, [data.key]);
                         // 判断uids和auditList中是否有相同的uid
                         const commonUids = ctx.helper._.intersection(uids, ctx.helper._.map(auditList, 'uid'));
                         if (commonUids.length === 0) {
@@ -143,20 +181,21 @@ module.exports = app => {
                         }
                         const del_members = [];
                         for (const uid of uids) {
-                            del_members.push({
-                                uid,
-                                quality: [],
-                            });
+                            const del_member = { uid };
+                            del_member[data.key] = [];
+                            del_members.push(del_member);
                         }
-                        await ctx.service.tenderPermission.saveOnePermission(tenderInfo.id, uids, del_members, ['quality']);
-                        responseData.data = await ctx.service.tenderPermission.getPartsPermission(tenderInfo.id, ['quality']);
+                        await ctx.service.tenderPermission.saveOnePermission(tenderInfo.id, uids, del_members, [data.key]);
+                        responseData.data = await ctx.service.tenderPermission.getPartsPermission(tenderInfo.id, [data.key]);
                         break;
                     case 'save-permission':
+                        if (!data.key || !['quality', 'inspection'].includes(data.key)) throw '参数有误';
                         uids = data.uid instanceof Array ? data.uid : [data.uid];
-                        await ctx.service.tenderPermission.saveOnePermission(tenderInfo.id, uids, data.members, ['quality']);
+                        await ctx.service.tenderPermission.saveOnePermission(tenderInfo.id, uids, data.members, [data.key]);
                         break;
                     case 'list':
-                        responseData.data = await ctx.service.tenderPermission.getPartsPermission(tenderInfo.id, ['quality']);
+                        if (!data.key || !['quality', 'inspection'].includes(data.key)) throw '参数有误';
+                        responseData.data = await ctx.service.tenderPermission.getPartsPermission(tenderInfo.id, [data.key]);
                         break;
                     default: throw '参数有误';
                 }
@@ -499,7 +538,7 @@ module.exports = app => {
          */
         async inspection(ctx) {
             try {
-                if (!ctx.subProject.page_show.quality) throw '该功能已关闭';
+                if (!ctx.subProject.page_show.qualityInspection) throw '该功能已关闭';
                 const status = parseInt(ctx.query.status) || 0;
                 await this._filterInspection(ctx, status);
             } catch (err) {

+ 12 - 6
app/controller/sub_proj_setting_controller.js

@@ -250,7 +250,9 @@ module.exports = app => {
                     return { id: item.id, name: item.name, groupList };
                 }).filter(x => { return x.groupList.length > 0; });
 
-                const subProjects = await this.ctx.service.subProject.getAllDataByCondition({ where: { project_id: this.ctx.session.sessionProject.id, is_folder: 0, is_delete: 0 }});
+                // const subProjects = await this.ctx.service.subProject.getAllDataByCondition({ where: { project_id: this.ctx.session.sessionProject.id, is_delete: 0 }});
+                const subProjects = await this.ctx.service.subProject.getSubProjectTreeNodes(this.ctx.session.sessionProject.id,
+                    this.ctx.session.sessionUser.accountId, this.ctx.session.sessionUser.is_admin);
                 const renderData = {
                     pageInfo,
                     accountGroup,
@@ -542,7 +544,10 @@ module.exports = app => {
                 const projectData = await ctx.service.project.getDataById(projectId);
                 if (projectData === null) throw '没有对应的项目数据';
                 if (ctx.session.sessionUser.is_admin === 0) throw '没有访问权限';
-                const tenderList = await ctx.service.tender.getList('', null, 1);
+                // 默认查询已完工的标段
+                const { done = '1' } = ctx.query || {};
+                const buildStatusFilter = ctx.service.tender.db.format(' AND build_status = ?', [tenderConst.buildStatus.status.finish]);
+                const tenderList = await ctx.service.tender.getList('', null, 1, done === '1' ? buildStatusFilter : '');
                 const removeTenders = await ctx.service.shenpiAudit.getRemoveTenders(tenderList);
                 if (removeTenders.length > 0) {
                     ctx.helper._.remove(tenderList, function(n) {
@@ -587,8 +592,8 @@ module.exports = app => {
                     subProjects,
                 };
                 renderData.selfCategoryLevel = await this.ctx.service.projectAccount.getSelfCategoryLevel(this.ctx.session.sessionUser.accountId);
-                renderData.permissionConst = ctx.service.tenderPermission.partPermissionConst('quality');
-                renderData.permissionBlock = ctx.service.tenderPermission.partPermissionBlock('quality');
+                renderData.permissionConst = ctx.service.tenderPermission.partPermissionConst(['quality', 'inspection']);
+                renderData.permissionBlock = ctx.service.tenderPermission.partPermissionBlock(['quality', 'inspection']);
                 await this.layout('sp_setting/manage.ejs', renderData, 'sp_setting/manage_modal.ejs');
             } catch (error) {
                 ctx.log(error);
@@ -642,6 +647,7 @@ module.exports = app => {
                         responseData.data.contractAuditList = await ctx.service.contractAudit.getList({ tid: tender.id });
                         responseData.data.constructionAuditList = await ctx.service.constructionAudit.getList(tender.id);
                         responseData.data.qualityAuditList = await ctx.service.tenderPermission.getPartsPermission(tender.id, ['quality']);
+                        responseData.data.inspectionAuditList = await ctx.service.tenderPermission.getPartsPermission(tender.id, ['inspection']);
                         break;
                     case 'copy2otu':
                         if (data.userType === 'tourist') {
@@ -652,8 +658,8 @@ module.exports = app => {
                             await ctx.service.contractAudit.setOtherTender(data.tidList, data.auditList);
                         } else if (data.userType === 'construction') {
                             await ctx.service.constructionAudit.setOtherTender(data.tidList, data.auditList);
-                        } else if (data.userType === 'quality') {
-                            await ctx.service.tenderPermission.setOtherTender(data.tidList, data.auditList, ['quality']);
+                        } else if (data.userType === 'quality' || data.userType === 'inspection') {
+                            await ctx.service.tenderPermission.setOtherTender(data.tidList, data.auditList, [data.userType]);
                         } else {
                             throw '参数有误';
                         }

+ 1 - 1
app/middleware/inspection_check.js

@@ -24,7 +24,7 @@ module.exports = options => {
     return function* InspectionCheck(next) {
         try {
             // 获取revise
-            if (!this.subProject.page_show.quality) {
+            if (!this.subProject.page_show.qualityInspection) {
                 throw '该功能已关闭';
             }
             const qiid = this.params.qiid || this.request.body.qiid;

+ 6 - 1
app/public/js/change.js

@@ -239,7 +239,12 @@ $(document).ready(() => {
                     historyHTML.push('<div class="card"><div class="card-body px-3 py-0">');
                     for (const [i, auditor] of group.auditors.entries()) {
                         historyHTML.push(`<div class="card-text p-2 py-3 row ${ ( i > 0 ? 'border-top' : '') }">`);
-                        historyHTML.push(`<div class="col"><span class="h6">${auditor.name}</span><span class="text-muted ml-1">${auditor.role}</span></div>`);
+                        let companyRolePart = '';
+                        if (group.audit_order !== 0) {
+                            const rolePart = auditor.role ? ' - ' + auditor.role : '';
+                            companyRolePart = `<span class="text-muted ml-1">${auditor.company}${rolePart}</span>`;
+                        }
+                        historyHTML.push(`<div class="col-10"><span class="h6">${auditor.name}</span>${companyRolePart}</div>`);
                         historyHTML.push('<div class="col">');
                         if (auditor.status === auditConst.status.checked || group.status === auditConst.status.cancelRevise) {
                             historyHTML.push('<span class="pull-right text-success"><i class="fa fa-check-circle"></i></span>');

+ 7 - 2
app/public/js/change_apply.js

@@ -279,8 +279,13 @@ $(document).ready(() => {
                     historyHTML.push('</div>');
                     historyHTML.push('<div class="card"><div class="card-body px-3 py-0">');
                     for (const [i, auditor] of group.auditors.entries()) {
-                        historyHTML.push(`<div class="card-text p-2 py-3 row ${ ( i > 0 ? 'border-top' : '') }">`);
-                        historyHTML.push(`<div class="col"><span class="h6">${auditor.name}</span><span class="text-muted ml-1">${auditor.role}</span></div>`);
+                        historyHTML.push(`<div class="card-text p-2 py-3 row ${(i > 0 ? 'border-top' : '')}">`);
+                        let companyRolePart = '';
+                        if (group.audit_order !== 0) {
+                            const rolePart = auditor.role ? ' - ' + auditor.role : '';
+                            companyRolePart = `<span class="text-muted ml-1">${auditor.company}${rolePart}</span>`;
+                        }
+                        historyHTML.push(`<div class="col-10"><span class="h6">${auditor.name}</span>${companyRolePart}</div>`);
                         historyHTML.push('<div class="col">');
                         if (auditor.status === auditConst.status.checked || group.status === auditConst.status.cancelRevise) {
                             historyHTML.push('<span class="pull-right text-success"><i class="fa fa-check-circle"></i></span>');

+ 132 - 50
app/public/js/change_information.js

@@ -5791,35 +5791,96 @@ $(document).ready(() => {
         $('.reduction-code').click(function () {
             const code = $(this).attr('data-code');
             $('input[name="code"]').val(code);
-            changeInfo.code = $('input[name="code"]').val();
-            judgeChange();
+            updateInfo('code', code);
         });
-        // 记录变更信息操作
-        $('body').on('valuechange', '#change_form input[type="text"]', function (e, previous) {
-            changeInfo[$(this).attr('name')] = $(this).val();
-            judgeChange();
+
+        // 回车提交
+        $('#change_form input[type="text"]').on('keypress', function () {
+            if(window.event.keyCode === 13) {
+                $(this).blur();
+            }
+        });
+        $('#change_form textarea').on('keypress', function () {
+            if(window.event.keyCode === 13) {
+                $(this).blur();
+            }
         });
-        $('body').on('valuechange', '#change_form textarea', function (e, previous) {
-            changeInfo[$(this).attr('name')] = $(this).val().replace(/[\r\n]/g, '<br><br>');
-            judgeChange();
+        $('#change_form input[type="text"]').blur(function () {
+            let val_name = $(this).attr('name');
+            let val = _.trim($(this).val()) !== '' ? _.trim($(this).val()) : '';
+            switch(val_name) {
+                case 'code':
+                    if(!val) {
+                        toastr.error('申请编号不能为空!');
+                        $(this).val(change[val_name]);
+                        return false;
+                    }
+                    break;
+                default:
+                    if(val && val.length > 255) {
+                        toastr.error('超出字段范围,请缩减');
+                        $(this).val(change[val_name]);
+                        return false;
+                    }
+                    break;
+            }
+            updateInfo(val_name, val);
         });
-        $('body').on('change', '#change_form select', function (e, previous) {
-            changeInfo[$(this).attr('name')] = $(this).val();
-            judgeChange();
+
+        $('#change_form textarea').blur(function () {
+            const val_name = $(this).attr('name');
+            let val = _.trim($(this).val()) !== '' ? _.trim($(this).val()) : '';
+            updateInfo(val_name, val);
         });
-        $('body').on('click', '#change_form input[type="radio"]', function (e, previous) {
-            changeInfo[$(this).attr('name')] = $(this).val();
-            judgeChange();
+
+        $('#change_form select').change(function () {
+            const val_name = $(this).attr('name');
+            let val = _.trim($(this).val()) !== '' ? _.trim($(this).val()) : '';
+            updateInfo(val_name, val);
         });
-        $('body').on('click', '#change_form input[type="checkbox"]', function (e, previous) {
+
+        $('#change_form input[type="radio"]').change(function () {
+            const val_name = $(this).attr('name');
+            let val = _.trim($(this).val()) !== '' ? _.trim($(this).val()) : '';
+            updateInfo(val_name, val);
+        });
+
+        $('#change_form input[type="checkbox"]').click(function () {
             const typecheck = [];
             $.each($('#change_form input[name="type[]"]:checked'), function () {
                 typecheck.push($(this).val());
             });
-            changeInfo.type = typecheck.join(',');
-            judgeChange();
+            const val_name = 'type';
+            const val = typecheck.join(',');
+            updateInfo(val_name, val);
         });
 
+        // 记录变更信息操作
+        // $('body').on('valuechange', '#change_form input[type="text"]', function (e, previous) {
+        //     changeInfo[$(this).attr('name')] = $(this).val();
+        //     judgeChange();
+        // });
+        // $('body').on('valuechange', '#change_form textarea', function (e, previous) {
+        //     changeInfo[$(this).attr('name')] = $(this).val().replace(/[\r\n]/g, '<br><br>');
+        //     judgeChange();
+        // });
+        // $('body').on('change', '#change_form select', function (e, previous) {
+        //     changeInfo[$(this).attr('name')] = $(this).val();
+        //     judgeChange();
+        // });
+        // $('body').on('click', '#change_form input[type="radio"]', function (e, previous) {
+        //     changeInfo[$(this).attr('name')] = $(this).val();
+        //     judgeChange();
+        // });
+        // $('body').on('click', '#change_form input[type="checkbox"]', function (e, previous) {
+        //     const typecheck = [];
+        //     $.each($('#change_form input[name="type[]"]:checked'), function () {
+        //         typecheck.push($(this).val());
+        //     });
+        //     changeInfo.type = typecheck.join(',');
+        //     judgeChange();
+        // });
+
         // 保存修改ajax提交(不刷新页面)
         $('.save_change_btn').on('click', function () {
             // 保存修改modal
@@ -6117,42 +6178,51 @@ $(document).ready(() => {
     });
 
     if (readOnly && !shenpiPower) {
-        // 记录变更信息操作
-        $('body').on('valuechange', '#w_code', function (e, previous) {
-            const new_w_code = $(this).val();
-            if (new_w_code !== w_code) {
-                $('#show-save-btn').show();
-                $('#sp-btn').hide();
-                $('.title-main').addClass('bg-warning');
-            } else {
-                $('#show-save-btn').hide();
-                $('#sp-btn').show();
-                $('.title-main').removeClass('bg-warning');
+        $('input[id="w_code"]').on('keypress', function () {
+            if(window.event.keyCode === 13) {
+                $(this).blur();
             }
         });
-
-        // 保存修改ajax提交(不刷新页面)
-        $('.save_change_btn').on('click', function () {
-            const new_w_code = $('#w_code').val();
-            // 后改为br
-            // 更新至服务器
-            postData(window.location.pathname + '/save', { type:'info', updateData: { w_code: new_w_code } }, function (result) {
-                toastr.success(result ? result.msg : '');
-                $('#show-save-btn').hide();
-                $('#sp-btn').show();
-                $('.title-main').removeClass('bg-warning');
-                w_code = new_w_code;
-            });
-            return false;
+        $('input[id="w_code"]').blur(function () {
+            updateInfo('w_code', $('#w_code').val());
         });
 
-        $('#cancel_change').on('click', function () {
-            $('#show-save-btn').hide();
-            $('#sp-btn').show();
-            $('.title-main').removeClass('bg-warning');
-            $('#w_code').val(w_code);
-            // toastr.success('已还原到上次保存状态');
-        });
+        // 记录变更信息操作
+        // $('body').on('valuechange', '#w_code', function (e, previous) {
+        //     const new_w_code = $(this).val();
+        //     if (new_w_code !== w_code) {
+        //         $('#show-save-btn').show();
+        //         $('#sp-btn').hide();
+        //         $('.title-main').addClass('bg-warning');
+        //     } else {
+        //         $('#show-save-btn').hide();
+        //         $('#sp-btn').show();
+        //         $('.title-main').removeClass('bg-warning');
+        //     }
+        // });
+        //
+        // // 保存修改ajax提交(不刷新页面)
+        // $('.save_change_btn').on('click', function () {
+        //     const new_w_code = $('#w_code').val();
+        //     // 后改为br
+        //     // 更新至服务器
+        //     postData(window.location.pathname + '/save', { type:'info', updateData: { w_code: new_w_code } }, function (result) {
+        //         toastr.success(result ? result.msg : '');
+        //         $('#show-save-btn').hide();
+        //         $('#sp-btn').show();
+        //         $('.title-main').removeClass('bg-warning');
+        //         w_code = new_w_code;
+        //     });
+        //     return false;
+        // });
+        //
+        // $('#cancel_change').on('click', function () {
+        //     $('#show-save-btn').hide();
+        //     $('#sp-btn').show();
+        //     $('.title-main').removeClass('bg-warning');
+        //     $('#w_code').val(w_code);
+        //     // toastr.success('已还原到上次保存状态');
+        // });
     }
 });
 /**
@@ -6456,6 +6526,18 @@ function makePushBwmx(clinfo, listinfo, removeList, updateList, showTips = false
     }
     return info;
 }
+
+function updateInfo(val_name, val) {
+    if(change[val_name] !== val) {
+        // 更新至服务器
+        const updateData = {};
+        updateData[val_name] = val;
+        postData(window.location.pathname + '/save', { type:'info', updateData }, function (result) {
+            change[val_name] = val;
+        });
+    }
+}
+
 function makeWhiteList(clinfo) {
     clinfo.lid = 0;
     clinfo.xmj_code = null;

+ 7 - 2
app/public/js/change_plan.js

@@ -278,8 +278,13 @@ $(document).ready(() => {
                     historyHTML.push('</div>');
                     historyHTML.push('<div class="card"><div class="card-body px-3 py-0">');
                     for (const [i, auditor] of group.auditors.entries()) {
-                        historyHTML.push(`<div class="card-text p-2 py-3 row ${ ( i > 0 ? 'border-top' : '') }">`);
-                        historyHTML.push(`<div class="col"><span class="h6">${auditor.name}</span><span class="text-muted ml-1">${auditor.role}</span></div>`);
+                        historyHTML.push(`<div class="card-text p-2 py-3 row ${(i > 0 ? 'border-top' : '')}">`);
+                        let companyRolePart = '';
+                        if (group.audit_order !== 0) {
+                            const rolePart = auditor.role ? ' - ' + auditor.role : '';
+                            companyRolePart = `<span class="text-muted ml-1">${auditor.company}${rolePart}</span>`;
+                        }
+                        historyHTML.push(`<div class="col-10"><span class="h6">${auditor.name}</span>${companyRolePart}</div>`);
                         historyHTML.push('<div class="col">');
                         if (auditor.status === auditConst.status.checked || group.status === auditConst.status.cancelRevise) {
                             historyHTML.push('<span class="pull-right text-success"><i class="fa fa-check-circle"></i></span>');

+ 6 - 1
app/public/js/change_project.js

@@ -287,7 +287,12 @@ $(document).ready(() => {
                     historyHTML.push('<div class="card"><div class="card-body px-3 py-0">');
                     for (const [i, auditor] of group.auditors.entries()) {
                         historyHTML.push(`<div class="card-text p-2 py-3 row ${ ( i > 0 ? 'border-top' : '') }">`);
-                        historyHTML.push(`<div class="col"><span class="h6">${auditor.name}</span><span class="text-muted ml-1">${auditor.role}</span></div>`);
+                        let companyRolePart = '';
+                        if (group.audit_order !== 0) {
+                            const rolePart = auditor.role ? ' - ' + auditor.role : '';
+                            companyRolePart = `<span class="text-muted ml-1">${auditor.company}${rolePart}</span>`;
+                        }
+                        historyHTML.push(`<div class="col-10"><span class="h6">${auditor.name}</span>${companyRolePart}</div>`);
                         historyHTML.push('<div class="col">');
                         if (auditor.status === auditConst.status.checked || group.status === auditConst.status.cancelRevise) {
                             historyHTML.push('<span class="pull-right text-success"><i class="fa fa-check-circle"></i></span>');

+ 28 - 1
app/public/js/ledger.js

@@ -3158,7 +3158,6 @@ $(document).ready(function() {
             this.sheet = this.spread.getActiveSheet();
             SpreadJsObj.initSheet(this.spread.getActiveSheet(), this.spreadSetting);
 
-
             this.OprObj = {
                 /**
                  * 删除按钮响应事件
@@ -3225,6 +3224,19 @@ $(document).ready(function() {
                         });
                     }
                 },
+                insert: function (sheet) {
+                    if (!sheet.zh_setting || sheet.zh_setting.readOnly) return;
+
+                    const select = SpreadJsObj.getSelectObject(sheet);
+                    const data = { insert: { select_id: select ? select.id: null, count: 1 } };
+
+                    postData(self.url + '/update', data, function (result) {
+                        self.loadUpdateData(result);
+                        SpreadJsObj.reLoadSheetData(sheet);
+                    }, function () {
+                        SpreadJsObj.reLoadSheetData(sheet);
+                    });
+                },
                 editEnded: function (e, info) {
                     if (!info.sheet.zh_setting || !info.sheet.zh_data || info.sheet.zh_setting.readOnly) return;
 
@@ -3406,6 +3418,20 @@ $(document).ready(function() {
                                 SpreadJsObj.refreshSheetReadOnly(self.sheet);
                             },
                         },
+                        add: {
+                            name: '插入',
+                            icon: 'fa-plus',
+                            visible: function (key, opt) {
+                                return !self.sheet.zh_setting.readOnly;
+                            },
+                            disabled: function (key, opt) {
+                                const select = SpreadJsObj.getSelectObject(self.sheet);
+                                return !select;
+                            },
+                            callback: function (key, opt) {
+                                self.OprObj.insert(self.sheet);
+                            },
+                        },
                         del: {
                             name: '删除',
                             icon: 'fa-times',
@@ -3554,6 +3580,7 @@ $(document).ready(function() {
                     return updateData.del.indexOf(d.id) >= 0;
                 });
             }
+            this.data.sort((x, y) => { return x.order - y.order; });
         }
     }
     class BatchInsertBillsPosObj {

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

@@ -383,7 +383,7 @@ $(document).ready(function () {
                 lastAuditorHtml.push('<div class="card"><div class="card-body px-3 py-0">');
                 for (const [i, auditor] of data.entries()) {
                     lastAuditorHtml.push(`<div class="card-text p-2 py-3 row ${ ( i > 0 ? 'border-top' : '') }">`);
-                    lastAuditorHtml.push(`<div class="col"><span class="h6">${auditor.name}</span><span class="text-muted ml-1">${auditor.role}</span></div>`);
+                    lastAuditorHtml.push(`<div class="col-10"><span class="h6">${auditor.name}</span><span class="text-muted ml-1">${auditor.company}${auditor.role ? ' - ' + auditor.role : ''}</span></div>`);
                     lastAuditorHtml.push('<div class="col">');
                     lastAuditorHtml.push('</div>');
                     lastAuditorHtml.push('</div>');

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

@@ -127,7 +127,7 @@ $(function () {
                     historyHTML.push('<div class="card"><div class="card-body px-3 py-0">');
                     for (const [i, auditor] of group.auditors.entries()) {
                         historyHTML.push(`<div class="card-text p-2 py-3 row ${ ( i > 0 ? 'border-top' : '') }">`);
-                        historyHTML.push(`<div class="col"><span class="h6">${auditor.name}</span><span class="text-muted ml-1">${auditor.role}</span></div>`);
+                        historyHTML.push(`<div class="col-10"><span class="h6">${auditor.name}</span><span class="text-muted ml-1">${auditor.company}${auditor.role ? ' - ' + auditor.role : ''}</span></div>`);
                         historyHTML.push('<div class="col">');
                         if (auditor.status === auditConst.status.checked) {
                             historyHTML.push('<span class="pull-right text-success"><i class="fa fa-check-circle"></i></span>');

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

@@ -127,7 +127,7 @@ $('a[data-target="#sp-list" ]').on('click', function () {
                 historyHTML.push('<div class="card"><div class="card-body px-3 py-0">');
                 for (const [i, auditor] of group.auditors.entries()) {
                     historyHTML.push(`<div class="card-text p-2 py-3 row ${ ( i > 0 ? 'border-top' : '') }">`);
-                    historyHTML.push(`<div class="col"><span class="h6">${auditor.name}</span><span class="text-muted ml-1">${auditor.role}</span></div>`);
+                    historyHTML.push(`<div class="col-10"><span class="h6">${auditor.name}</span><span class="text-muted ml-1">${user.company}${user.role ? ' - ' + user.role : ''}</span></div>`);
                     historyHTML.push('<div class="col">');
                     if (auditor.status === auditConst.status.checked) {
                         historyHTML.push('<span class="pull-right text-success"><i class="fa fa-check-circle"></i></span>');

+ 3 - 0
app/public/js/phase_pay_detail.js

@@ -89,6 +89,7 @@ $(document).ready(() => {
                 return payUtils.check.isYf(data) || (data.children && data.children.length > 0) || payUtils.check.isLock(data);
             },
             startTpReadOnly: function(data) {
+                if (data.children && data.children.length > 0) return true;
                 if (payUtils.check.isOld(data)) {
                     return payUtils.check.isStarted(data) || !payUtils.check.isYB(data) || payUtils.check.isLock(data);
                 } else {
@@ -96,6 +97,7 @@ $(document).ready(() => {
                 }
             },
             rangeTpReadOnly: function(data) {
+                if (data.children && data.children.length > 0) return true;
                 if (payUtils.check.isOld(data)) {
                     return !payUtils.check.isYB(data) || payUtils.check.isLock(data);
                 } else {
@@ -790,6 +792,7 @@ $(document).ready(() => {
                         data.postData.push(updateData);
                     }
                 }
+                if (data.postData.length === 0) return;
                 postData('update', data, function (result) {
                     if (result.reload) {
                         payEvent.reloadPays(result.reload);

+ 7 - 1
app/public/js/phase_pay_list.js

@@ -107,7 +107,13 @@ $(document).ready(() => {
                 historyHTML.push('<div class="card"><div class="card-body px-3 py-0">');
                 for (const [i, auditor] of group.auditors.entries()) {
                     historyHTML.push(`<div class="card-text p-2 py-3 row ${ ( i > 0 ? 'border-top' : '') }">`);
-                    historyHTML.push(`<div class="col"><span class="h6">${auditor.name}</span><span class="text-muted ml-1">${auditor.role}</span></div>`);
+                    let companyRolePart = '';
+                        if (group.audit_order !== 0) {
+                            const rolePart = auditor.role ? ' - ' + auditor.role : '';
+                            companyRolePart = `<span class="text-muted ml-1">${auditor.company}${rolePart}</span>`;
+                        }
+                    
+                    historyHTML.push(`<div class="col-10"><span class="h6">${auditor.name}</span>${companyRolePart}</div>`);
                     historyHTML.push('<div class="col">');
                     if (auditor.audit_status === auditConst.status.checked) {
                         historyHTML.push('<span class="pull-right text-success"><i class="fa fa-check-circle"></i></span>');

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

@@ -13,7 +13,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="/sp/${spid}/quality/tender/${node.id}/info" name="name" style="min-width: 200px;word-break:break-all;" id="${node.id}">${node.name}</a>`);
+            html.push(`<a href="/sp/${spid}/quality/tender/${node.id}/${isInspection ? 'inspection' : 'info'}" name="name" style="min-width: 200px;word-break:break-all;" id="${node.id}">${node.name}</a>`);
         }
         html.push('</td>');
 

+ 65 - 21
app/public/js/setting_manage.js

@@ -176,9 +176,24 @@ $(document).ready(() => {
         contract: '合同管理',
         construction: '施工日志',
         quality: '质量管理',
+        inspection: '质量巡检',
     };
-    const tabTypeKeys = ['tourist', 'schedule', 'contract', 'construction', 'quality'];
+    const tabTypeKeys = ['tourist', 'schedule', 'contract', 'construction', 'quality', 'inspection'];
 
+    const $filterTenderDone = $('body #filter-tender-done')
+    if (window.location.search && window.location.search.split('done=')[1]) {
+      $filterTenderDone.prop('checked', window.location.search.split('done=')[1] === '1' ? true : false);
+    } else {
+      $filterTenderDone.prop('checked', true);
+    }
+    $filterTenderDone.on('change', function() {
+      const isChecked = $(this).is(':checked');
+      if (isChecked) {
+        window.location.href = `/sp/${spid}/setting/manage?done=1`;
+      } else {
+        window.location.href = `/sp/${spid}/setting/manage?done=0`;
+      }
+    });
     $('body').on('click', '.c-body .tender-info', function () {
         $('.c-body .tender-info').removeClass('table-warning');
         $(this).addClass('table-warning');
@@ -200,7 +215,8 @@ $(document).ready(() => {
             setScheduleHtml(result.scheduleAuditList);
             setContractHtml(result.contractAuditList);
             setConstructionHtml(result.constructionAuditList);
-            setQualityHtml(result.qualityAuditList);
+            setTenderPermissionHtml(result.qualityAuditList, 'quality');
+            setTenderPermissionHtml(result.inspectionAuditList, 'inspection');
             resetAddUserHtml();
         });
     });
@@ -227,6 +243,8 @@ $(document).ready(() => {
                 $('#add_user_dropdownMenuButton').attr('data-type', 'construction');
             } else if ($(this).attr('href') === '#zlgl') {
                 $('#add_user_dropdownMenuButton').attr('data-type', 'quality');
+            } else if ($(this).attr('href') === '#zlxj') {
+                $('#add_user_dropdownMenuButton').attr('data-type', 'inspection');
             }
         }
     });
@@ -324,6 +342,30 @@ $(document).ready(() => {
             type: 'save-permission',
             uid,
             members: [member],
+            key: 'quality',
+        };
+        const _self = $(this);
+        postData('/sp/' + spid + '/quality/' + cur_tenderid + '/audit/save', prop, function (data) {
+        });
+    });
+
+    // 权限更改
+    $('body').on('click', '#inspection-users input[type="checkbox"]', function () {
+        const uid = parseInt($(this).parents('tr').data('uid'));
+        const member = {
+            uid,
+            inspection: [1],
+        };
+        $(this).parents('tr').find('input[type="checkbox"]').each(function () {
+            if ($(this).is(':checked')) {
+                member.inspection.push($(this).data('value'));
+            }
+        });
+        const prop = {
+            type: 'save-permission',
+            uid,
+            members: [member],
+            key: 'inspection',
         };
         const _self = $(this);
         postData('/sp/' + spid + '/quality/' + cur_tenderid + '/audit/save', prop, function (data) {
@@ -355,8 +397,8 @@ $(document).ready(() => {
                 $('#'+ type + '-users').find('tr[data-id="'+ id +'"]').remove();
                 $('#remove-user').modal('hide');
             });
-        } else if (type === 'quality') {
-            postData('/sp/' + spid + '/' + type + '/' + cur_tenderid + '/audit/save', { type: 'del-audit', id }, function (data) {
+        } else if (type === 'quality' || type === 'inspection') {
+            postData('/sp/' + spid + '/quality/' + cur_tenderid + '/audit/save', { type: 'del-audit', id, key: type }, function (data) {
                 $('#'+ type + '-users').find('tr[data-uid="'+ id +'"]').remove();
                 $('#remove-user').modal('hide');
             });
@@ -564,13 +606,13 @@ $(document).ready(() => {
                 postData('/sp/' + spid + '/construction/' + cur_tenderid + '/audit/save', prop, function (datas) {
                     setConstructionHtml(datas);
                 });
-            } else if (type === 'quality') {
+            } else if (type === 'quality' || type === 'inspection') {
                 const user = _.find(accountList, function (item) {
                     return item.id === id;
                 });
                 const saIdList = [];
-                for (let i = 0; i < $('#quality-users tr').length; i++) {
-                    saIdList.push(parseInt($('#quality-users tr').eq(i).data('uid')));
+                for (let i = 0; i < $('#' + type + '-users tr').length; i++) {
+                    saIdList.push(parseInt($('#' + type + '-users tr').eq(i).data('uid')));
                 }
                 if (_.includes(saIdList, id)) {
                     toastr.error('该用户已存在列表中,无需重复添加');
@@ -580,9 +622,10 @@ $(document).ready(() => {
                 const prop = {
                     id: id,
                     type: 'add-audit',
+                    key: type,
                 };
                 postData('/sp/' + spid + '/quality/' + cur_tenderid + '/audit/save', prop, function (datas) {
-                    setQualityHtml(datas);
+                    setTenderPermissionHtml(datas, type);
                 });
             }
         }
@@ -736,7 +779,9 @@ $(document).ready(() => {
                 userData.member = [1];
                 if ($('#quality-users tr').eq(i).find('input[data-block="upload"]').eq(0).is(':checked')) userData.member.push(2);
                 if ($('#quality-users tr').eq(i).find('input[data-block="add"]').eq(0).is(':checked')) userData.member.push(3);
-                if ($('#quality-users tr').eq(i).find('input[data-block="add_inspection"]').eq(0).is(':checked')) userData.member.push(4);
+            } else if (userType === 'inspection') {
+                userData.member = [1];
+                if ($('#inspection-users tr').eq(i).find('input[data-block="add"]').eq(0).is(':checked')) userData.member.push(2);
             }
             saIdList.push(userData);
         }
@@ -1074,26 +1119,25 @@ function setConstructionHtml(constructionAuditList) {
     $('#construction-users').html(html);
 }
 
-function setQualityHtml(qualityAuditList) {
+function setTenderPermissionHtml(auditList, key) {
     const html = [];
-    for (const m of qualityAuditList) {
-        html.push(getUserPermissionHtml(m));
+    for (const m of auditList) {
+        html.push(getUserPermissionHtml(m, key));
     }
-    $('#quality-users').html(html.join(''));
+    $('#' + key + '-users').html(html.join(''));
 }
 
-const getUserPermissionHtml = function(user) {
+const getUserPermissionHtml = function(user, key) {
     const html = [];
     html.push(`<tr data-uid="${user.uid}" data-id="${user.id}">`);
     html.push(`<td>${user.name}</td>`, `<td>${user.role}</td>`);
-    for (const block of permissionBlock) {
-        for (const p of block.permission) {
-            if (p.isDefault) continue;
-            const checked = user[block.key] ? (user[block.key].indexOf(p.value) >= 0 ? 'checked' : '') : '';
-            html.push(`<td class="text-center"><input type="checkbox" data-block="${p.key}" data-value="${p.value}" ${checked}></td>`);
-        }
+    const block = _.find(permissionBlock, { key: key });
+    for (const p of block.permission) {
+        if (p.isDefault) continue;
+        const checked = user[block.key] ? (user[block.key].indexOf(p.value) >= 0 ? 'checked' : '') : '';
+        html.push(`<td class="text-center"><input type="checkbox" data-block="${p.key}" data-value="${p.value}" ${checked}></td>`);
     }
-    html.push(`<td class="text-center"><a href="#remove-user1" data-id="${user.uid}" data-toggle="modal" data-target="#remove-user" class="btn btn-sm btn-outline-danger remove-quality-user">移除</a></td>`);
+    html.push(`<td class="text-center"><a href="#remove-user1" data-id="${user.uid}" data-toggle="modal" data-target="#remove-user" class="btn btn-sm btn-outline-danger remove-${key}-user">移除</a></td>`);
     html.push('</tr>');
     return html.join('');
 };

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

@@ -271,7 +271,7 @@ $(document).ready(() => {
         }
     });
     $('#copy-user-batch-ok').click(function() {
-        const spCheck = $('[name=cub-sp-check]:checked');
+        const spCheck = $('[name=cub-sp-check][tree_is_folder="0"]:checked');
         if (spCheck.length === 0) {
             toastr.warning('未选择项目');
             return;

+ 40 - 0
app/public/js/spss_gather_stage_info.js

@@ -18,6 +18,7 @@ $(document).ready(() => {
             {title: '截止本期应付', colSpan: '1', rowSpan: '1', field: 'end_yf_tp', hAlign: 2, width: 80, type: 'Number'},
             {title: '本期实付', colSpan: '1', rowSpan: '1', field: 'sf_tp', hAlign: 2, width: 80, type: 'Number'},
             {title: '截止本期实付', colSpan: '1', rowSpan: '1', field: 'end_sf_tp', hAlign: 2, width: 80, type: 'Number'},
+            {title: '待应付', colSpan: '1', rowSpan: '1', field: 'df_tp', hAlign: 2, width: 80, type: 'Number'},
         ],
         emptyRows: 0,
         headRows: 1,
@@ -30,6 +31,41 @@ $(document).ready(() => {
 
     const infoSpread = SpreadJsObj.createNewSpread($('#info-spread')[0]);
     const infoSheet = infoSpread.getActiveSheet();
+    const colSetSetting = {
+        key: 'zh.spss.info',
+        colSet: [
+            { name: '名称', field: 'name', fixed: ['show'], },
+            { name: '计量模式', field: 'measure_type_str', fixed: ['show'], },
+            { name: '标段状态',  field: 'progress_str', fixed: ['show'], },
+            { name: '汇总', field: 'stage_filter', fixed: ['show'],},
+            { name: '签约合同价', field: 'contract_price', },
+            { name: '0号台账', field: 'total_price', },
+            { name: '本期合同',field: 'contract_tp', },
+            { name: '本期变更', field: 'qc_tp', },
+            { name: '本期完成', field: 'gather_tp',},
+            { name: '截止本期合同', field: 'end_contract_tp', },
+            { name: '截止本期变更', field: 'end_qc_tp',},
+            { name: '截止本期完成',field: 'end_gather_tp', },
+            { name: '本期应付', field: 'yf_tp',},
+            { name: '截止本期应付', field: 'end_yf_tp', },
+            { name: '本期实付', field: 'sf_tp', },
+            { name: '截止本期实付',  field: 'end_sf_tp', },
+            { name: '待应付', field: 'df_tp', },
+        ],
+        refreshColSetSetting: function(colSettings) {
+            if (!colSettings) colSettings = customColSet.loadLocalColSet(colSetSetting);
+            for (const col of infoSpreadSetting.cols) {
+                const colCache = colSettings.find(x => { return x.field === col.field; });
+                if (colCache) col.visible = colCache.show;
+            }
+        },
+        afterSet: function(colSetting) {
+            colSetSetting.refreshColSetSetting(colSetting);
+            SpreadJsObj.refreshColumnVisible(infoSheet);
+        }
+    };
+    colSetSetting.refreshColSetSetting();
+
     SpreadJsObj.initSheet(infoSheet, infoSpreadSetting);
     let infoTree;
 
@@ -53,6 +89,7 @@ $(document).ready(() => {
                 node.end_yf_tp = tender.info.end_yf_tp;
                 node.sf_tp = tender.info.sf_tp;
                 node.end_sf_tp = tender.info.end_sf_tp;
+                node.df_tp = ZhCalc.sub(node.end_yf_tp, node.end_sf_tp);
             }, categoryLevel, true);
             infoTree.setting.calcFields = ['total_price', 'contract_price', 'contract_tp', 'qc_tp', 'gather_tp', 'end_contract_tp', 'end_qc_tp', 'end_gather_tp', 'yf_tp', 'end_yf_tp', 'sf_tp', 'end_sf_tp'];
             treeCalc.calculateAll(infoTree);
@@ -310,4 +347,7 @@ $(document).ready(() => {
         },
         defaultCategoryLevel: selfCategoryLevel,
     });
+    $('#spss-info-col-set').click(() => {
+        customColSet.show(colSetSetting);
+    })
 });

+ 6 - 1
app/public/js/stage_bwtz.js

@@ -66,7 +66,12 @@ $(document).ready(() => {
                 for (const fp of filterPath) {
                     if (checkFullPath(fp, node.full_path)) {
                         filterUnitTree.addData(node, ['id', 'ledger_id', 'ledger_pid', 'order', 'level', 'full_path', 'pos_name',
-                            'code', 'b_code', 'name', 'unit', 'unit_price', 'quantity', 'total_price', 'drawing_code_merge', 'memo_merge']);
+                            'code', 'b_code', 'name', 'unit', 'unit_price', 'quantity', 'total_price', 'drawing_code_merge', 'memo_merge',
+                            'contract_qty', 'contract_tp', 'qc_qty', 'qc_tp', 'qc_minus_qty', 'gather_qty', 'gather_tp',
+                            'end_contract_qty', 'end_contract_tp', 'end_qc_qty', 'end_qc_tp', 'end_qc_minus_qty', 'end_gather_qty', 'end_gather_tp', 'end_final_1_percent',
+                            'org_price', 'pc_tp', 'gxby_status', 'gxby_url', 'dagl_status', 'dagl_url',
+                            'postil_merge', 'ex_memo1_merge', 'ex_memo2_merge', 'ex_memo3_merge',
+                        ]);
                         break;
                     }
                 }

+ 1 - 0
app/router.js

@@ -468,6 +468,7 @@ module.exports = app => {
 
     // 质量管理
     app.get('/sp/:id/quality', sessionAuth, subProjectCheck, 'qualityController.tender');
+    app.get('/sp/:id/quality/inspection', sessionAuth, subProjectCheck, 'qualityController.inspectionTender');
     app.get('/sp/:id/quality/tender', sessionAuth, subProjectCheck, 'qualityController.tender');
     app.post('/sp/:id/quality/member', sessionAuth, subProjectCheck, projectManagerCheck, 'qualityController.member');
     app.post('/sp/:id/quality/memberSave', sessionAuth, subProjectCheck, projectManagerCheck, 'qualityController.memberSave');

+ 32 - 9
app/service/deal_bills.js

@@ -234,6 +234,34 @@ module.exports = app => {
             return insertData;
         }
 
+        async _insertDatas(data, result) {
+            const select = await this.getDataById(data.select_id);
+            if (!select) throw '选择的签约清单不存在,请刷新页面后重试';
+
+            const insertData = [];
+            for (let i = 0; i < data.count; i++) {
+                insertData.push({
+                    id: this.uuid.v4(),
+                    tender_id: this.ctx.tender.id,
+                    order: select.order + i,
+                });
+            }
+
+            const transaction = await this.db.beginTransaction();
+            try {
+                await transaction.query('Update ?? SET `order` = `order` + ? WHERE tender_id = ? and `order` >= ?', [this.tableName, data.count, this.ctx.tender.id, select.order]);
+                await transaction.insert(this.tableName, insertData);
+                await transaction.commit();
+            } catch(err) {
+                this.ctx.log(err);
+                await transaction.rollback();
+                throw '插入数据错误';
+            }
+
+            result.add = insertData;
+            result.update = await this.db.query('SELECT * FROM ?? where tender_id = ? and `order` >= ?', [this.tableName, this.ctx.tender.id, select.order + data.count]);
+        }
+
         async _delDatas (data) {
             await this.db.delete(this.tableName, {id: data});
             return data;
@@ -278,15 +306,10 @@ module.exports = app => {
         async updateDatas(data) {
             const result = {add: [], del: [], update: []};
             try {
-                if (data.add) {
-                    result.add = await this._addDatas(data.add);
-                }
-                if (data.update) {
-                    result.update = await this._updateDatas(data.update);
-                }
-                if (data.del) {
-                    result.del = await this._delDatas(data.del);
-                }
+                if (data.add) result.add = await this._addDatas(data.add);
+                if (data.update) result.update = await this._updateDatas(data.update);
+                if (data.del) result.del = await this._delDatas(data.del);
+                if (data.insert) await this._insertDatas(data.insert, result);
                 return result;
             } catch (err) {
                 if (err) result.err = err;

+ 7 - 1
app/service/phase_pay_detail.js

@@ -618,13 +618,19 @@ class PhasePayDetail extends TreeService {
                 ud.update_user_id = this.ctx.session.sessionUser.accountId;
                 updateDatas.push(ud);
             }
-            if (updateDatas.length > 0) await this.db.updateRows(this.tableName, updateDatas);
+            if (updateDatas.length > 0) {
+                await this.db.updateRows(this.tableName, updateDatas);
+                return await this.getAllDataByCondition({ where: { id: data.map(d => { return d.id; }) } });
+            } else {
+                return [];
+            }
         } else {
             const node = await this.getDataById(data.id);
             if (!node || masterId !== node[this.setting.mid]) throw '提交数据错误';
             const updateData = this._filterValidField(node.id, data);
             updateData.update_user_id = this.ctx.session.sessionUser.accountId;
             await this.db.update(this.tableName, updateData);
+            return this.getDataById(data.id);
         }
     }
 }

+ 6 - 6
app/service/quality_inspection_audit.js

@@ -97,14 +97,14 @@ module.exports = app => {
                     audit_order: newAuditOrder,
                 };
                 const result = await transaction.insert(this.tableName, data);
-                const auditList = await this.ctx.service.tenderPermission.getPartsPermission(this.ctx.tender.id, ['quality']);
+                const auditList = await this.ctx.service.tenderPermission.getPartsPermission(this.ctx.tender.id, ['inspection']);
                 const addAid = this._.includes(this._.map(auditList, 'uid'), auditorId);
                 if (!addAid) {
                     const insert_members = [{
                         uid: auditorId,
-                        quality: ['1'],
+                        inspection: ['1'],
                     }];
-                    await this.ctx.service.tenderPermission.saveOnePermission(this.ctx.tender.id, [auditorId], insert_members, ['quality'], transaction);
+                    await this.ctx.service.tenderPermission.saveOnePermission(this.ctx.tender.id, [auditorId], insert_members, ['inspection'], transaction);
                 }
                 await transaction.commit();
                 return (result.effectRows = 1);
@@ -679,14 +679,14 @@ module.exports = app => {
                             times: inspection.times, order: selfAudit.order + 1, status: auditConst.status.rectification,
                             is_rectification: 1, begin_time: time, audit_order: selfAudit.audit_order + 1,
                         });
-                        const auditList = await this.ctx.service.tenderPermission.getPartsPermission(inspection.tid, ['quality']);
+                        const auditList = await this.ctx.service.tenderPermission.getPartsPermission(inspection.tid, ['inspection']);
                         const addAid = this._.includes(this._.map(auditList, 'uid'), checkData.rectification_uid);
                         if (!addAid) {
                             const insert_members = [{
                                 uid: checkData.rectification_uid,
-                                quality: ['1'],
+                                inspection: ['1'],
                             }];
-                            await this.ctx.service.tenderPermission.saveOnePermission(inspection.tid, [checkData.rectification_uid], insert_members, ['quality'], transaction);
+                            await this.ctx.service.tenderPermission.saveOnePermission(inspection.tid, [checkData.rectification_uid], insert_members, ['inspection'], transaction);
                         }
                         await transaction.update(this.ctx.service.qualityInspection.tableName, {
                             id: inspection.id, status: auditConst.status.rectification, rectification_uid: checkData.rectification_uid,

+ 1 - 1
app/service/stage_bonus.js

@@ -44,7 +44,7 @@ module.exports = app => {
             const data = await this.getAllDataByCondition({where: { sid: stage.id }});
             this._parseData(data);
             if (!stage || cancel || !stage.readOnly || this.ctx.tender.isTourist || stage.status === auditConst.status.checked
-                || (stage.flowAuditorIds && stage.flowAuditorIds.indexOf(this.ctx.session.sessionUser.accountId) > 0)) return data;
+                || (stage.flowAuditorIds && stage.flowAuditorIds.indexOf(this.ctx.session.sessionUser.accountId) >= 0)) return data;
 
             for (const d of data) {
                 const his = d.shistory ? JSON.parse(d.shistory) : [];

+ 1 - 1
app/service/stage_jgcl.js

@@ -25,7 +25,7 @@ module.exports = app => {
         async getStageData(stage, cancel = false) {
             const data = await this.getAllDataByCondition({where: { sid: stage.id }});
             if (!stage || cancel || !stage.readOnly || this.ctx.tender.isTourist || stage.status === auditConst.status.checked
-                || (stage.flowAuditorIds && stage.flowAuditorIds.indexOf(this.ctx.session.sessionUser.accountId) > 0)) return data;
+                || (stage.flowAuditorIds && stage.flowAuditorIds.indexOf(this.ctx.session.sessionUser.accountId) >= 0)) return data;
 
             for (const d of data) {
                 const his = d.shistory ? JSON.parse(d.shistory) : [];

+ 1 - 1
app/service/stage_other.js

@@ -25,7 +25,7 @@ module.exports = app => {
         async getStageData(stage, cancel = false) {
             const data = await this.getAllDataByCondition({where: { sid: stage.id }});
             if (!stage || cancel || !stage.readOnly || this.ctx.tender.isTourist || stage.status === auditConst.status.checked
-                || (stage.flowAuditorIds && stage.flowAuditorIds.indexOf(this.ctx.session.sessionUser.accountId) > 0)) return data;
+                || (stage.flowAuditorIds && stage.flowAuditorIds.indexOf(this.ctx.session.sessionUser.accountId) >= 0)) return data;
 
             for (const d of data) {
                 const his = d.shistory ? JSON.parse(d.shistory) : [];

+ 6 - 0
app/service/stage_pos.js

@@ -394,6 +394,12 @@ module.exports = app => {
                             sp.positive_qc_qty = osp.positive_qc_qty || 0;
                             sp.negative_qc_qty = osp.positive_qc_qty || 0;
                             sp.ex_stage_qty1 = osp.ex_stage_qty1 || 0;
+                        } else {
+                            sp.qc_qty = 0;
+                            sp.qc_minus_qty = 0;
+                            sp.positive_qc_qty = 0;
+                            sp.negative_qc_qty = 0;
+                            sp.ex_stage_qty1 = 0;
                         }
                     }
                     insertPosStage.push(sp);

+ 1 - 1
app/service/stage_safe_prod.js

@@ -26,7 +26,7 @@ module.exports = app => {
         async getStageData(stage, cancel) {
             const data = await this.getAllDataByCondition({where: { sid: stage.id }});
             if (!stage || cancel || !stage.readOnly || this.ctx.tender.isTourist || stage.status === auditConst.status.checked
-                || (stage.flowAuditorIds && stage.flowAuditorIds.indexOf(this.ctx.session.sessionUser.accountId) > 0)) return data;
+                || (stage.flowAuditorIds && stage.flowAuditorIds.indexOf(this.ctx.session.sessionUser.accountId) >= 0)) return data;
 
             for (const d of data) {
                 const his = d.shistory ? JSON.parse(d.shistory) : [];

+ 1 - 1
app/service/stage_temp_land.js

@@ -26,7 +26,7 @@ module.exports = app => {
         async getStageData(stage, cancel = false) {
             const data = await this.getAllDataByCondition({where: { sid: stage.id }});
             if (!stage || cancel || !stage.readOnly || this.ctx.tender.isTourist || stage.status === auditConst.status.checked
-                || (stage.flowAuditorIds && stage.flowAuditorIds.indexOf(this.ctx.session.sessionUser.accountId) > 0)) return data;
+                || (stage.flowAuditorIds && stage.flowAuditorIds.indexOf(this.ctx.session.sessionUser.accountId) >= 0)) return data;
 
             for (const d of data) {
                 const his = d.shistory ? JSON.parse(d.shistory) : [];

+ 1 - 1
app/service/stage_yjcl.js

@@ -27,7 +27,7 @@ module.exports = app => {
         async getStageData(stage) {
             const data = await this.getAllDataByCondition({ where: { sid: stage.id } });
             if (!stage.readOnly  || stage.status === auditConst.status.checked
-                || (stage.flowAuditorIds && stage.flowAuditorIds.indexOf(this.ctx.session.sessionUser.accountId) > 0)) return data;
+                || (stage.flowAuditorIds && stage.flowAuditorIds.indexOf(this.ctx.session.sessionUser.accountId) >= 0)) return data;
 
             for (const d of data) {
                 const his = d.shistory ? JSON.parse(d.shistory) : [];

+ 128 - 0
app/service/sub_project.js

@@ -23,6 +23,121 @@ const funSet = require('../const/fun_set');
 const defaultFunSet = funSet.defaultInfo;
 const pageShowConst = require('../const/sp_page_show').defaultSetting;
 
+class DragTree {
+    /**
+     * 构造函数
+     */
+    constructor(setting) {
+        // 无索引
+        this.datas = [];
+        // 以key为索引indexedDB
+        this.items = {};
+        // 以排序为索引
+        this.nodes = [];
+        // 根节点
+        this.children = [];
+        // 树设置
+        this.setting = setting;
+        if (!this.setting.itemsPre) this.setting.itemsPre = 'id_';
+    }
+    /**
+     * 树结构根据显示排序
+     */
+    sortTreeNode(isResort) {
+        const self = this;
+        const addSortNodes = function (nodes) {
+            if (!nodes) { return }
+            for (let i = 0; i < nodes.length; i++) {
+                self.nodes.push(nodes[i]);
+                nodes[i].index = self.nodes.length - 1;
+                if (!isResort) {
+                    nodes[i].children = self.getChildren(nodes[i]);
+                } else {
+                    nodes[i].children.sort((a, b) => { return a[self.setting.order] - b[self.setting.order]; })
+                }
+                addSortNodes(nodes[i].children);
+            }
+        };
+        this.nodes = [];
+        if (!isResort) {
+            this.children = this.getChildren();
+        } else {
+            this.children.sort((a, b) => { return a[self.setting.order] - b[self.setting.order]; });
+        }
+        addSortNodes(this.children);
+    }
+    /**
+     * 加载数据(初始化), 并给数据添加部分树结构必须数据
+     * @param datas
+     */
+    loadDatas(datas) {
+        const self = this;
+        // 清空旧数据
+        this.items = {};
+        this.nodes = [];
+        this.datas = [];
+        this.children = [];
+        // 加载全部数据
+        datas.sort(function (a, b) {
+            return a[self.setting.level] - b[self.setting.level];
+        });
+        for (const data of datas) {
+            const keyName = this.setting.itemsPre + data[this.setting.id];
+            if (this.items[keyName]) continue;
+
+            const item = JSON.parse(JSON.stringify(data));
+            item.children = [];
+            item.expanded = true;
+            item.visible = true;
+            if (item[this.setting.pid] === this.setting.rootId) {
+                this.children.push(item);
+            } else {
+                const parent = this.getParent(item);
+                if (!parent) continue;
+                parent.children.push(item);
+            }
+            this.items[keyName] = item;
+            this.datas.push(item);
+        }
+        this.children.sort((a, b) => { return a[self.setting.order] - b[self.setting.order]; });
+        this.sortTreeNode(true);
+    }
+
+    getItemsByIndex(index) {
+        return this.nodes[index];
+    }
+    getItems(id) {
+        return this.items[this.setting.itemsPre + id];
+    };
+
+    getParent(node) {
+        return this.getItems(node[this.setting.pid]);
+    };
+    getChildren(node) {
+        const setting = this.setting;
+        const pid = node ? node[setting.id] : setting.rootId;
+        const children = this.datas.filter(function (x) {
+            return x[setting.pid] === pid;
+        });
+        children.sort((a, b) => { return a[setting.order] - b[setting.order]; });
+        return children;
+    };
+    isLastSibling(node) {
+        const siblings = this.getChildren(this.getParent(node));
+        return (siblings && siblings.length > 0) ? node[this.setting.order] === siblings[siblings.length - 1][this.setting.order] : false;
+    };
+
+    recursiveFun(children, fun) {
+        if (!fun) return;
+        if (!children || children.length === 0) return;
+
+        for (const c of children) {
+            this.recursiveFun(c.children, fun);
+            fun(c);
+        }
+    }
+}
+
 module.exports = app => {
     class SubProject extends app.BaseService {
 
@@ -97,6 +212,19 @@ module.exports = app => {
             return admin ? result : this._filterEmptyFolder(result);
         }
 
+        async getSubProjectTreeNodes(pid, uid, admin, filterFolder = false) {
+            const subProjects = await this.getSubProject(pid, uid, admin, filterFolder);
+            const subProjectsTree = new DragTree({ id: 'id', pid: 'tree_pid', level: 'tree_level', order: 'tree_order', rootId: '-1' });
+            subProjectsTree.loadDatas(subProjects);
+            const result = subProjectsTree.nodes.map(x => {
+                return {
+                    id: x.id, tree_pid: x.tree_pid, tree_level: x.tree_level, is_folder: x.is_folder, name: x.name,
+                    is_last_sibling: subProjectsTree.isLastSibling(x), has_children: x.children && x.children.length > 0,
+                };
+            });
+            return result;
+        }
+
         async getBudgetProject(pid, uid, admin) {
             let result = await this.getAllDataByCondition({ where: { project_id: pid, is_delete: 0 } });
 

+ 6 - 1
app/service/tender_permission.js

@@ -26,11 +26,16 @@ module.exports = app => {
                     view: { title: '查看', value: 1, isDefault: 1 },
                     upload: { title: '上传文件', value: 2 },
                     add: { title: '新增功能', value: 3 },
-                    add_inspection: { title: '添加质量巡检', value: 4 },
+                    // add_inspection: { title: '添加质量巡检', value: 4 },
                 },
+                inspection: {
+                    view: { title: '查看', value: 1, isDefault: 1 },
+                    add: { title: '新增巡检', value: 2 },
+                }
             };
             this.PermissionBlock = [
                 { key: 'quality', name: '质量管理', field: 'quality' },
+                { key: 'inspection', name: '质量巡检', field: 'inspection' },
             ];
             for (const p of this.PermissionBlock) {
                 if (p.children) {

+ 2 - 2
app/view/change/addlist.ejs

@@ -16,9 +16,9 @@
                     </div>
                 </div>
             </div>
-            <div class="ml-auto">
+            <!-- <div class="ml-auto">
                 <a class="btn btn-sm btn-primary mr-1" id="add-all-revise" href="javascript: void(0);">勾选当前新增部位/清单</a>
-            </div>
+            </div> -->
         </div>
     </div>
     <div class="content-wrap row pr-46">

+ 39 - 6
app/view/change/apply_information_modal.ejs

@@ -339,9 +339,20 @@
                                                         <div class="card-body px-3 py-0">
                                                             <% for (const [i, auditor] of group.auditors.entries()) { %>
                                                                 <div class="card-text p-2 py-3 row <%- ( i > 0 ? 'border-top' : '') %>">
-                                                                    <div class="col">
+                                                                    <div class="col-10">
                                                                         <span class="h6"><%- auditor.name %></span>
-                                                                        <span class="text-muted ml-1"><%- auditor.role %></span>
+                                                                        <% if (group.audit_order === 0) { %>
+                                                                                <% if (auditor.role && auditor.role.trim()) { %>
+                                                                                    <span class="text-muted ml-1"><%- auditor.role %></span>
+                                                                                <% } %>
+                                                                            <% } else { %>
+                                                                                <span class="text-muted ml-1">
+                                                                                    <%- auditor.company %>
+                                                                                    <% if (auditor.role && auditor.role.trim()) { %>
+                                                                                        - <%- auditor.role %>
+                                                                                    <% } %>
+                                                                                </span>
+                                                                            <% } %>
                                                                     </div>
                                                                     <div class="col">
                                                                         <% if (auditor.status === auditConst.status.checked || auditor.status === auditConst.status.cancelRevise) { %>
@@ -523,9 +534,20 @@
                                                             <div class="card-body px-3 py-0">
                                                                 <% for (const [i, auditor] of group.auditors.entries()) { %>
                                                                     <div class="card-text p-2 py-3 row <%- ( i > 0 ? 'border-top' : '') %>">
-                                                                        <div class="col">
+                                                                        <div class="col-10">
                                                                             <span class="h6"><%- auditor.name %></span>
-                                                                            <span class="text-muted ml-1"><%- auditor.role %></span>
+                                                                            <% if (group.audit_order === 0) { %>
+                                                                                <% if (auditor.role && auditor.role.trim()) { %>
+                                                                                    <span class="text-muted ml-1"><%- auditor.role %></span>
+                                                                                <% } %>
+                                                                            <% } else { %>
+                                                                                <span class="text-muted ml-1">
+                                                                                    <%- auditor.company %>
+                                                                                    <% if (auditor.role && auditor.role.trim()) { %>
+                                                                                        - <%- auditor.role %>
+                                                                                    <% } %>
+                                                                                </span>
+                                                                            <% } %>
                                                                         </div>
                                                                         <div class="col">
                                                                             <% if (auditor.status === auditConst.status.checked || auditor.status === auditConst.status.cancelRevise) { %>
@@ -718,7 +740,18 @@
                                                                     <div class="card-text p-2 py-3 row <%- ( i > 0 ? 'border-top' : '') %>">
                                                                         <div class="col">
                                                                             <span class="h6"><%- auditor.name %></span>
-                                                                            <span class="text-muted ml-1"><%- auditor.role %></span>
+                                                                            <% if (group.audit_order === 0) { %>
+                                                                                <% if (auditor.role && auditor.role.trim()) { %>
+                                                                                    <span class="text-muted ml-1"><%- auditor.role %></span>
+                                                                                <% } %>
+                                                                            <% } else { %>
+                                                                                <span class="text-muted ml-1">
+                                                                                    <%- auditor.company %>
+                                                                                    <% if (auditor.role && auditor.role.trim()) { %>
+                                                                                        - <%- auditor.role %>
+                                                                                    <% } %>
+                                                                                </span>
+                                                                            <% } %>
                                                                         </div>
                                                                         <div class="col">
                                                                             <% if (auditor.status === auditConst.status.checked || auditor.status === auditConst.status.cancelRevise) { %>
@@ -1505,7 +1538,7 @@
                         lastAuditorHtml.push('<div class="card"><div class="card-body px-3 py-0">');
                         for (const [i, auditor] of data.entries()) {
                             lastAuditorHtml.push(`<div class="card-text p-2 py-3 row ${ ( i > 0 ? 'border-top' : '') }">`);
-                            lastAuditorHtml.push(`<div class="col"><span class="h6">${auditor.name}</span><span class="text-muted ml-1">${auditor.role}</span></div>`);
+                            lastAuditorHtml.push(`<div class="col"><span class="h6">${auditor.name}</span><span class="text-muted ml-1">${auditor.company}${auditor.role ? ' - ' + auditor.role : ''}</span></div>`);
                             lastAuditorHtml.push('<div class="col">');
                             lastAuditorHtml.push('</div>');
                             lastAuditorHtml.push('</div>');

+ 5 - 4
app/view/change/information.ejs

@@ -109,7 +109,7 @@
                     <div class="tab-pane active" id="bgxinxi">
                         <div class="sjs-sh-1" style="overflow-y: auto;">
                             <% if (!change.readOnly || change.shenpiPower) { %>
-                            <form class="p-2" action="/tender/<%- change.tid %>/change/<%- change.cid %>/information/save?_csrf_j=<%= ctx.csrf %>" method="post" id="change_form">
+                            <div class="p-2" id="change_form">
                                 <% if (ctx.subProject.page_show.openChangeState) { %>
                                 <div class="form-group">
                                     <label>变更状态</label>
@@ -235,9 +235,9 @@
                                     <label>批复文号</label>
                                     <input class="form-control form-control-sm" id="w_code" name="w_code"  placeholder="" type="text" value="<%- change.w_code %>">
                                 </div>
-                            </form>
+                            </div>
                             <% } else { %>
-                            <form class="p-2">
+                            <div class="p-2">
                                 <% if (ctx.subProject.page_show.openChangeState) { %>
                                 <div class="form-group">
                                     <label>变更状态</label>
@@ -358,7 +358,7 @@
                                     <label>批复文号</label>
                                     <input class="form-control form-control-sm" id="w_code" placeholder="" type="text" value="<%- change.w_code %>" <% if (!(change.shenpiPower || (change.status === auditConst.status.checked && (ctx.session.sessionUser.is_admin || ctx.helper._.findIndex(change.auditors, { uid: ctx.session.sessionUser.accountId }) !== -1)))) { %>readonly<% } %>>
                                 </div>
-                            </form>
+                            </div>
                             <% } %>
                         </div>
                     </div>
@@ -619,6 +619,7 @@
     changeUnits = _.map(changeUnits, 'unit');
     changeUnits.push('');
     let changeUsedData = JSON.parse(unescape('<%- escape(JSON.stringify(changeUsedData)) %>'));
+    const change = JSON.parse(unescape('<%- escape(JSON.stringify(change)) %>'));
 </script>
 <% if (!change.readOnly || change.shenpiPower) { %>
 <script>

+ 40 - 7
app/view/change/information_modal.ejs

@@ -355,9 +355,20 @@
                                                         <div class="card-body px-3 py-0">
                                                             <% for (const [i, auditor] of group.auditors.entries()) { %>
                                                                 <div class="card-text p-2 py-3 row <%- ( i > 0 ? 'border-top' : '') %>">
-                                                                    <div class="col">
+                                                                    <div class="col-10">
                                                                         <span class="h6"><%- auditor.name %></span>
-                                                                        <span class="text-muted ml-1"><%- auditor.role %></span>
+                                                                        <% if (group.audit_order === 0) { %>
+                                                                                <% if (auditor.role && auditor.role.trim()) { %>
+                                                                                    <span class="text-muted ml-1"><%- auditor.role %></span>
+                                                                                <% } %>
+                                                                            <% } else { %>
+                                                                                <span class="text-muted ml-1">
+                                                                                    <%- auditor.company %>
+                                                                                    <% if (auditor.role && auditor.role.trim()) { %>
+                                                                                        - <%- auditor.role %>
+                                                                                    <% } %>
+                                                                                </span>
+                                                                            <% } %>
                                                                     </div>
                                                                     <div class="col">
                                                                         <% if (auditor.status === auditConst.status.checked || group.status === auditConst.status.cancelRevise) { %>
@@ -512,9 +523,20 @@
                                                         <div class="card-body px-3 py-0">
                                                             <% for (const [i, auditor] of group.auditors.entries()) { %>
                                                                 <div class="card-text p-2 py-3 row <%- ( i > 0 ? 'border-top' : '') %>">
-                                                                    <div class="col">
+                                                                    <div class="col-10">
                                                                         <span class="h6"><%- auditor.name %></span>
-                                                                        <span class="text-muted ml-1"><%- auditor.role %></span>
+                                                                        <% if (group.audit_order === 0) { %>
+                                                                                <% if (auditor.role && auditor.role.trim()) { %>
+                                                                                    <span class="text-muted ml-1"><%- auditor.role %></span>
+                                                                                <% } %>
+                                                                            <% } else { %>
+                                                                                <span class="text-muted ml-1">
+                                                                                    <%- auditor.company %>
+                                                                                    <% if (auditor.role && auditor.role.trim()) { %>
+                                                                                        - <%- auditor.role %>
+                                                                                    <% } %>
+                                                                                </span>
+                                                                            <% } %>
                                                                     </div>
                                                                     <div class="col">
                                                                         <% if (auditor.status === auditConst.status.checked || group.status === auditConst.status.cancelRevise) { %>
@@ -681,9 +703,20 @@
                                                         <div class="card-body px-3 py-0">
                                                             <% for (const [i, auditor] of group.auditors.entries()) { %>
                                                                 <div class="card-text p-2 py-3 row <%- ( i > 0 ? 'border-top' : '') %>">
-                                                                    <div class="col">
+                                                                    <div class="col-10">
                                                                         <span class="h6"><%- auditor.name %></span>
-                                                                        <span class="text-muted ml-1"><%- auditor.role %></span>
+                                                                        <% if (group.audit_order === 0) { %>
+                                                                                <% if (auditor.role && auditor.role.trim()) { %>
+                                                                                    <span class="text-muted ml-1"><%- auditor.role %></span>
+                                                                                <% } %>
+                                                                            <% } else { %>
+                                                                                <span class="text-muted ml-1">
+                                                                                    <%- auditor.company %>
+                                                                                    <% if (auditor.role && auditor.role.trim()) { %>
+                                                                                        - <%- auditor.role %>
+                                                                                    <% } %>
+                                                                                </span>
+                                                                            <% } %>
                                                                     </div>
                                                                     <div class="col">
                                                                         <% if (auditor.status === auditConst.status.checked || group.status === auditConst.status.cancelRevise) { %>
@@ -1570,7 +1603,7 @@
                         lastAuditorHtml.push('<div class="card"><div class="card-body px-3 py-0">');
                         for (const [i, auditor] of data.entries()) {
                             lastAuditorHtml.push(`<div class="card-text p-2 py-3 row ${ ( i > 0 ? 'border-top' : '') }">`);
-                            lastAuditorHtml.push(`<div class="col"><span class="h6">${auditor.name}</span><span class="text-muted ml-1">${auditor.role}</span></div>`);
+                            lastAuditorHtml.push(`<div class="col-10"><span class="h6">${auditor.name}</span><span class="text-muted ml-1">${auditor.company}${auditor.role ? ' - ' + auditor.role : ''}</span></div>`);
                             lastAuditorHtml.push('<div class="col">');
                             lastAuditorHtml.push('</div>');
                             lastAuditorHtml.push('</div>');

+ 40 - 7
app/view/change/plan_information_modal.ejs

@@ -331,9 +331,20 @@
                                                         <div class="card-body px-3 py-0">
                                                             <% for (const [i, auditor] of group.auditors.entries()) { %>
                                                                 <div class="card-text p-2 py-3 row <%- ( i > 0 ? 'border-top' : '') %>">
-                                                                    <div class="col">
+                                                                    <div class="col-10">
                                                                         <span class="h6"><%- auditor.name %></span>
-                                                                        <span class="text-muted ml-1"><%- auditor.role %></span>
+                                                                        <% if (group.audit_order === 0) { %>
+                                                                                <% if (auditor.role && auditor.role.trim()) { %>
+                                                                                    <span class="text-muted ml-1"><%- auditor.role %></span>
+                                                                                <% } %>
+                                                                            <% } else { %>
+                                                                                <span class="text-muted ml-1">
+                                                                                    <%- auditor.company %>
+                                                                                    <% if (auditor.role && auditor.role.trim()) { %>
+                                                                                        - <%- auditor.role %>
+                                                                                    <% } %>
+                                                                                </span>
+                                                                            <% } %>
                                                                     </div>
                                                                     <div class="col">
                                                                         <% if (auditor.status === auditConst.status.checked || auditor.status === auditConst.status.cancelRevise) { %>
@@ -515,9 +526,20 @@
                                                             <div class="card-body px-3 py-0">
                                                                 <% for (const [i, auditor] of group.auditors.entries()) { %>
                                                                     <div class="card-text p-2 py-3 row <%- ( i > 0 ? 'border-top' : '') %>">
-                                                                        <div class="col">
+                                                                        <div class="col-10">
                                                                             <span class="h6"><%- auditor.name %></span>
-                                                                            <span class="text-muted ml-1"><%- auditor.role %></span>
+                                                                            <% if (group.audit_order === 0) { %>
+                                                                                <% if (auditor.role && auditor.role.trim()) { %>
+                                                                                    <span class="text-muted ml-1"><%- auditor.role %></span>
+                                                                                <% } %>
+                                                                            <% } else { %>
+                                                                                <span class="text-muted ml-1">
+                                                                                    <%- auditor.company %>
+                                                                                    <% if (auditor.role && auditor.role.trim()) { %>
+                                                                                        - <%- auditor.role %>
+                                                                                    <% } %>
+                                                                                </span>
+                                                                            <% } %>
                                                                         </div>
                                                                         <div class="col">
                                                                             <% if (auditor.status === auditConst.status.checked || auditor.status === auditConst.status.cancelRevise) { %>
@@ -700,9 +722,20 @@
                                                             <div class="card-body px-3 py-0">
                                                                 <% for (const [i, auditor] of group.auditors.entries()) { %>
                                                                     <div class="card-text p-2 py-3 row <%- ( i > 0 ? 'border-top' : '') %>">
-                                                                        <div class="col">
+                                                                        <div class="col-10">
                                                                             <span class="h6"><%- auditor.name %></span>
-                                                                            <span class="text-muted ml-1"><%- auditor.role %></span>
+                                                                            <% if (group.audit_order === 0) { %>
+                                                                                <% if (auditor.role && auditor.role.trim()) { %>
+                                                                                    <span class="text-muted ml-1"><%- auditor.role %></span>
+                                                                                <% } %>
+                                                                            <% } else { %>
+                                                                                <span class="text-muted ml-1">
+                                                                                    <%- auditor.company %>
+                                                                                    <% if (auditor.role && auditor.role.trim()) { %>
+                                                                                        - <%- auditor.role %>
+                                                                                    <% } %>
+                                                                                </span>
+                                                                            <% } %>
                                                                         </div>
                                                                         <div class="col">
                                                                             <% if (auditor.status === auditConst.status.checked || auditor.status === auditConst.status.cancelRevise) { %>
@@ -1489,7 +1522,7 @@
                         lastAuditorHtml.push('<div class="card"><div class="card-body px-3 py-0">');
                         for (const [i, auditor] of data.entries()) {
                             lastAuditorHtml.push(`<div class="card-text p-2 py-3 row ${ ( i > 0 ? 'border-top' : '') }">`);
-                            lastAuditorHtml.push(`<div class="col"><span class="h6">${auditor.name}</span><span class="text-muted ml-1">${auditor.role}</span></div>`);
+                            lastAuditorHtml.push(`<div class="col-10"><span class="h6">${auditor.name}</span><span class="text-muted ml-1">${auditor.company}${auditor.role ? ' - ' + auditor.role : ''}</span></div>`);
                             lastAuditorHtml.push('<div class="col">');
                             lastAuditorHtml.push('</div>');
                             lastAuditorHtml.push('</div>');

+ 40 - 7
app/view/change/project_information_modal.ejs

@@ -281,9 +281,20 @@
                                                         <div class="card-body px-3 py-0">
                                                             <% for (const [i, auditor] of group.auditors.entries()) { %>
                                                                 <div class="card-text p-2 py-3 row <%- ( i > 0 ? 'border-top' : '') %>">
-                                                                    <div class="col">
+                                                                    <div class="col-10">
                                                                         <span class="h6"><%- auditor.name %></span>
-                                                                        <span class="text-muted ml-1"><%- auditor.role %></span>
+                                                                        <% if (group.audit_order === 0) { %>
+                                                                                <% if (auditor.role && auditor.role.trim()) { %>
+                                                                                    <span class="text-muted ml-1"><%- auditor.role %></span>
+                                                                                <% } %>
+                                                                            <% } else { %>
+                                                                                <span class="text-muted ml-1">
+                                                                                    <%- auditor.company %>
+                                                                                    <% if (auditor.role && auditor.role.trim()) { %>
+                                                                                        - <%- auditor.role %>
+                                                                                    <% } %>
+                                                                                </span>
+                                                                            <% } %>
                                                                     </div>
                                                                     <div class="col">
                                                                         <% if (auditor.status === auditConst.status.checked || auditor.status === auditConst.status.cancelRevise) { %>
@@ -469,9 +480,20 @@
                                                             <div class="card-body px-3 py-0">
                                                                 <% for (const [i, auditor] of group.auditors.entries()) { %>
                                                                     <div class="card-text p-2 py-3 row <%- ( i > 0 ? 'border-top' : '') %>">
-                                                                        <div class="col">
+                                                                        <div class="col-10">
                                                                             <span class="h6"><%- auditor.name %></span>
-                                                                            <span class="text-muted ml-1"><%- auditor.role %></span>
+                                                                            <% if (group.audit_order === 0) { %>
+                                                                                <% if (auditor.role && auditor.role.trim()) { %>
+                                                                                    <span class="text-muted ml-1"><%- auditor.role %></span>
+                                                                                <% } %>
+                                                                            <% } else { %>
+                                                                                <span class="text-muted ml-1">
+                                                                                    <%- auditor.company %>
+                                                                                    <% if (auditor.role && auditor.role.trim()) { %>
+                                                                                        - <%- auditor.role %>
+                                                                                    <% } %>
+                                                                                </span>
+                                                                            <% } %>
                                                                         </div>
                                                                         <div class="col">
                                                                             <% if (auditor.status === auditConst.status.checked || auditor.status === auditConst.status.cancelRevise) { %>
@@ -658,9 +680,20 @@
                                                             <div class="card-body px-3 py-0">
                                                                 <% for (const [i, auditor] of group.auditors.entries()) { %>
                                                                     <div class="card-text p-2 py-3 row <%- ( i > 0 ? 'border-top' : '') %>">
-                                                                        <div class="col">
+                                                                        <div class="col-10">
                                                                             <span class="h6"><%- auditor.name %></span>
-                                                                            <span class="text-muted ml-1"><%- auditor.role %></span>
+                                                                            <% if (group.audit_order === 0) { %>
+                                                                                <% if (auditor.role && auditor.role.trim()) { %>
+                                                                                    <span class="text-muted ml-1"><%- auditor.role %></span>
+                                                                                <% } %>
+                                                                            <% } else { %>
+                                                                                <span class="text-muted ml-1">
+                                                                                    <%- auditor.company %>
+                                                                                    <% if (auditor.role && auditor.role.trim()) { %>
+                                                                                        - <%- auditor.role %>
+                                                                                    <% } %>
+                                                                                </span>
+                                                                            <% } %>
                                                                         </div>
                                                                         <div class="col">
                                                                             <% if (auditor.status === auditConst.status.checked || auditor.status === auditConst.status.cancelRevise) { %>
@@ -1537,7 +1570,7 @@
                         lastAuditorHtml.push('<div class="card"><div class="card-body px-3 py-0">');
                         for (const [i, auditor] of data.entries()) {
                             lastAuditorHtml.push(`<div class="card-text p-2 py-3 row ${ ( i > 0 ? 'border-top' : '') }">`);
-                            lastAuditorHtml.push(`<div class="col"><span class="h6">${auditor.name}</span><span class="text-muted ml-1">${auditor.role}</span></div>`);
+                            lastAuditorHtml.push(`<div class="col-10"><span class="h6">${auditor.name}</span><span class="text-muted ml-1">${auditor.company}${auditor.role ? ' - ' + auditor.role : ''}</span></div>`);
                             lastAuditorHtml.push('<div class="col">');
                             lastAuditorHtml.push('</div>');
                             lastAuditorHtml.push('</div>');

+ 1 - 1
app/view/change/revise.ejs

@@ -47,7 +47,7 @@
                 </div>
             </div>
             <div class="ml-auto">
-                <a class="btn btn-sm btn-primary mr-1" id="add-all-revise" href="javascript: void(0);">勾选当前新增部位/清单</a>
+                <!-- <a class="btn btn-sm btn-primary mr-1" id="add-all-revise" href="javascript: void(0);">勾选当前新增部位/清单</a> -->
                 <a class="btn btn-sm btn-primary mr-1" id="ledger-check2" href="javascript: void(0);">数据检查</a>
             </div>
         </div>

+ 39 - 6
app/view/financial/pay_detail_modal.ejs

@@ -304,9 +304,20 @@
                                                         <div class="card-body px-3 py-0">
                                                             <% for (const [i, auditor] of group.auditors.entries()) { %>
                                                                 <div class="card-text p-2 py-3 row <%- ( i > 0 ? 'border-top' : '') %>">
-                                                                    <div class="col">
+                                                                    <div class="col-10">
                                                                         <span class="h6"><%- auditor.name %></span>
-                                                                        <span class="text-muted ml-1"><%- auditor.role %></span>
+                                                                        <% if (group.audit_order === 0) { %>
+                                                                                <% if (auditor.role && auditor.role.trim()) { %>
+                                                                                    <span class="text-muted ml-1"><%- auditor.role %></span>
+                                                                                <% } %>
+                                                                            <% } else { %>
+                                                                                <span class="text-muted ml-1">
+                                                                                    <%- auditor.company %>
+                                                                                    <% if (auditor.role && auditor.role.trim()) { %>
+                                                                                        - <%- auditor.role %>
+                                                                                    <% } %>
+                                                                                </span>
+                                                                            <% } %>
                                                                     </div>
                                                                     <div class="col">
                                                                         <% if (auditor.status === auditConst.status.checked) { %>
@@ -485,9 +496,20 @@
                                                             <div class="card-body px-3 py-0">
                                                                 <% for (const [i, auditor] of group.auditors.entries()) { %>
                                                                     <div class="card-text p-2 py-3 row <%- ( i > 0 ? 'border-top' : '') %>">
-                                                                        <div class="col">
+                                                                        <div class="col-10">
                                                                             <span class="h6"><%- auditor.name %></span>
-                                                                            <span class="text-muted ml-1"><%- auditor.role %></span>
+                                                                            <% if (group.audit_order === 0) { %>
+                                                                                <% if (auditor.role && auditor.role.trim()) { %>
+                                                                                    <span class="text-muted ml-1"><%- auditor.role %></span>
+                                                                                <% } %>
+                                                                            <% } else { %>
+                                                                                <span class="text-muted ml-1">
+                                                                                    <%- auditor.company %>
+                                                                                    <% if (auditor.role && auditor.role.trim()) { %>
+                                                                                        - <%- auditor.role %>
+                                                                                    <% } %>
+                                                                                </span>
+                                                                            <% } %>
                                                                         </div>
                                                                         <div class="col">
                                                                             <% if (auditor.status === auditConst.status.checked) { %>
@@ -667,9 +689,20 @@
                                                             <div class="card-body px-3 py-0">
                                                                 <% for (const [i, auditor] of group.auditors.entries()) { %>
                                                                     <div class="card-text p-2 py-3 row <%- ( i > 0 ? 'border-top' : '') %>">
-                                                                        <div class="col">
+                                                                        <div class="col-10">
                                                                             <span class="h6"><%- auditor.name %></span>
-                                                                            <span class="text-muted ml-1"><%- auditor.role %></span>
+                                                                            <% if (group.audit_order === 0) { %>
+                                                                                <% if (auditor.role && auditor.role.trim()) { %>
+                                                                                    <span class="text-muted ml-1"><%- auditor.role %></span>
+                                                                                <% } %>
+                                                                            <% } else { %>
+                                                                                <span class="text-muted ml-1">
+                                                                                    <%- auditor.company %>
+                                                                                    <% if (auditor.role && auditor.role.trim()) { %>
+                                                                                        - <%- auditor.role %>
+                                                                                    <% } %>
+                                                                                </span>
+                                                                            <% } %>
                                                                         </div>
                                                                         <div class="col">
                                                                             <% if (auditor.status === auditConst.status.checked) { %>

+ 13 - 5
app/view/ledger/audit_modal.ejs

@@ -136,9 +136,13 @@
                                             <div class="card-body px-3 py-0">
                                                 <% for (const [i, auditor] of group.auditors.entries()) { %>
                                                 <div class="card-text p-2 py-3 row <%- ( i > 0 ? 'border-top' : '') %>">
-                                                    <div class="col">
+                                                    <div class="col-10">
                                                         <span class="h6"><%- auditor.name %></span>
-                                                        <span class="text-muted ml-1"><%- auditor.role %></span>
+                                                        <span class="text-muted ml-1"><%- auditor.company %>
+                                                        <% if (auditor.role) { %>
+                                                            - <%= auditor.role %>
+                                                        <% } %>
+                                                        </span>
                                                     </div>
                                                     <div class="col">
                                                         <% if (auditor.status === auditConst.status.checked) { %>
@@ -270,7 +274,7 @@
                                         <div class="card">
                                             <div class="card-body px-3 py-0">
                                                 <div class="card-text p-2 py-3 row">
-                                                    <div class="col">
+                                                    <div class="col-10">
                                                         <span class="h6"><%- tender.user.name %></span>
                                                         <span class="text-muted ml-1"><%- tender.user.role %></span>
                                                     </div>
@@ -317,9 +321,13 @@
                                             <div class="card-body px-3 py-0">
                                                 <% for (const [i, auditor] of group.auditors.entries()) { %>
                                                 <div class="card-text p-2 py-3 row <%- ( i > 0 ? 'border-top' : '') %>">
-                                                    <div class="col">
+                                                    <div class="col-10">
                                                         <span class="h6"><%- auditor.name %></span>
-                                                        <span class="text-muted ml-1"><%- auditor.role %></span>
+                                                        <span class="text-muted ml-1"><%- auditor.company %>
+                                                        <% if (auditor.role) { %>
+                                                            - <%= auditor.role %>
+                                                        <% } %>
+                                                        </span>
                                                     </div>
                                                     <div class="col">
                                                         <% if (auditor.status === auditConst.status.checked) { %>

+ 6 - 2
app/view/ledger/explode_modal.ejs

@@ -417,9 +417,13 @@
                                             <div class="card-body px-3 py-0">
                                                 <% for (const [i, auditor] of group.auditors.entries()) { %>
                                                 <div class="card-text p-2 py-3 row <%- ( i > 0 ? 'border-top' : '') %>">
-                                                    <div class="col">
+                                                    <div class="col-10">
                                                         <span class="h6"><%- auditor.name %></span>
-                                                        <span class="text-muted ml-1"><%- auditor.role %></span>
+                                                        <span class="text-muted ml-1"><%- auditor.company %>
+                                                        <% if (auditor.role) { %>
+                                                            - <%= auditor.role %>
+                                                        <% } %>
+                                                        </span>
                                                     </div>
                                                     <div class="col">
                                                         <% if (auditor.status === auditConst.status.checked) { %>

+ 18 - 6
app/view/material/audit_modal.ejs

@@ -220,9 +220,13 @@
                                                     <div class="card-body px-3 py-0">
                                                         <% for (const [i, auditor] of group.auditors.entries()) { %>
                                                             <div class="card-text p-2 py-3 row <%- ( i > 0 ? 'border-top' : '') %>">
-                                                                <div class="col">
+                                                                <div class="col-10">
                                                                     <span class="h6"><%- auditor.name %></span>
-                                                                    <span class="text-muted ml-1"><%- auditor.role %></span>
+                                                                    <span class="text-muted ml-1"><%- auditor.company %>
+                                                                        <% if (auditor.role) { %>
+                                                                            - <%= auditor.role %>
+                                                                        <% } %>    
+                                                                    </span>
                                                                 </div>
                                                                 <div class="col">
                                                                     <% if (auditor.status === auditConst.status.checked) { %>
@@ -399,9 +403,13 @@
                                                             <div class="card-body px-3 py-0">
                                                                 <% for (const [i, auditor] of group.auditors.entries()) { %>
                                                                     <div class="card-text p-2 py-3 row <%- ( i > 0 ? 'border-top' : '') %>">
-                                                                        <div class="col">
+                                                                        <div class="col-10">
                                                                             <span class="h6"><%- auditor.name %></span>
-                                                                            <span class="text-muted ml-1"><%- auditor.role %></span>
+                                                                            <span class="text-muted ml-1"><%- auditor.company %>
+                                                                                <% if (auditor.role) { %>
+                                                                                    - <%= auditor.role %>
+                                                                                <% } %>    
+                                                                            </span>
                                                                         </div>
                                                                         <div class="col">
                                                                             <% if (auditor.status === auditConst.status.checked) { %>
@@ -580,9 +588,13 @@
                                                             <div class="card-body px-3 py-0">
                                                                 <% for (const [i, auditor] of group.auditors.entries()) { %>
                                                                     <div class="card-text p-2 py-3 row <%- ( i > 0 ? 'border-top' : '') %>">
-                                                                        <div class="col">
+                                                                        <div class="col-10">
                                                                             <span class="h6"><%- auditor.name %></span>
-                                                                            <span class="text-muted ml-1"><%- auditor.role %></span>
+                                                                            <span class="text-muted ml-1"><%- auditor.company %>
+                                                                                <% if (auditor.role) { %>
+                                                                                    - <%= auditor.role %>
+                                                                                <% } %>    
+                                                                            </span>
                                                                         </div>
                                                                         <div class="col">
                                                                             <% if (auditor.status === auditConst.status.checked) { %>

+ 39 - 6
app/view/phase_pay/audit_modal.ejs

@@ -195,9 +195,20 @@
                                             <div class="card-body px-3 py-0">
                                                 <% for (const [i, auditor] of group.auditors.entries()) { %>
                                                 <div class="card-text p-2 py-3 row <%- ( i > 0 ? 'border-top' : '') %>">
-                                                    <div class="col">
+                                                    <div class="col-10">
                                                         <span class="h6"><%- auditor.name %></span>
-                                                        <span class="text-muted ml-1"><%- auditor.role %></span>
+                                                        <% if (group.audit_order === 0) { %>
+                                                            <% if (auditor.role && auditor.role.trim()) { %>
+                                                                <span class="text-muted ml-1"><%- auditor.role %></span>
+                                                            <% } %>
+                                                        <% } else { %>
+                                                            <span class="text-muted ml-1">
+                                                                <%- auditor.company %>
+                                                                <% if (auditor.role && auditor.role.trim()) { %>
+                                                                    - <%- auditor.role %>
+                                                                <% } %>
+                                                            </span>
+                                                        <% } %>
                                                     </div>
                                                     <div class="col">
                                                         <% if (auditor.audit_status === auditConst.status.checked) { %>
@@ -322,9 +333,20 @@
                                             <div class="card-body px-3 py-0">
                                                 <% for (const [i, auditor] of group.auditors.entries()) { %>
                                                 <div class="card-text p-2 py-3 row <%- ( i > 0 ? 'border-top' : '') %>">
-                                                    <div class="col">
+                                                    <div class="col-10">
                                                         <span class="h6"><%- auditor.name %></span>
-                                                        <span class="text-muted ml-1"><%- auditor.role %></span>
+                                                        <% if (group.audit_order === 0) { %>
+                                                            <% if (auditor.role && auditor.role.trim()) { %>
+                                                                <span class="text-muted ml-1"><%- auditor.role %></span>
+                                                            <% } %>
+                                                        <% } else { %>
+                                                            <span class="text-muted ml-1">
+                                                                <%- auditor.company %>
+                                                                <% if (auditor.role && auditor.role.trim()) { %>
+                                                                    - <%- auditor.role %>
+                                                                <% } %>
+                                                            </span>
+                                                        <% } %>
                                                     </div>
                                                     <div class="col">
                                                         <% if (auditor.audit_status === auditConst.status.checked) { %>
@@ -453,9 +475,20 @@
                                             <div class="card-body px-3 py-0">
                                                 <% for (const [i, auditor] of group.auditors.entries()) { %>
                                                 <div class="card-text p-2 py-3 row <%- ( i > 0 ? 'border-top' : '') %>">
-                                                    <div class="col">
+                                                    <div class="col-10">
                                                         <span class="h6"><%- auditor.name %></span>
-                                                        <span class="text-muted ml-1"><%- auditor.role %></span>
+                                                        <% if (group.audit_order === 0) { %>
+                                                            <% if (auditor.role && auditor.role.trim()) { %>
+                                                                <span class="text-muted ml-1"><%- auditor.role %></span>
+                                                            <% } %>
+                                                        <% } else { %>
+                                                            <span class="text-muted ml-1">
+                                                                <%- auditor.company %>
+                                                                <% if (auditor.role && auditor.role.trim()) { %>
+                                                                    - <%- auditor.role %>
+                                                                <% } %>
+                                                            </span>
+                                                        <% } %>
                                                     </div>
                                                     <div class="col">
                                                         <% if (auditor.audit_status === auditConst.status.checked) { %>

+ 1 - 1
app/view/quality/inspection.ejs

@@ -53,7 +53,7 @@
                 </div>
             </div>
             <div class="ml-auto">
-                <% if (permission.add_inspection) { %>
+                <% if (permission.add) { %>
                 <a href="#add-bj" data-toggle="modal" data-target="#add-bj" class="btn btn-sm btn-primary pull-right ml-1">新建巡检</a>
                 <a href="#setting" data-toggle="modal" data-target="#setting" class="btn btn-sm btn-outline-primary pull-right ml-1"><i class="fa fa-cog"></i></a>
                 <% } %>

+ 1 - 1
app/view/quality/inspection_modal.ejs

@@ -47,7 +47,7 @@
         </div>
     </div>
 </div>
-<% if (permission.add_inspection) { %>
+<% if (permission.add) { %>
     <!--弹出添加变更令-->
     <div class="modal fade" id="add-bj-modal" data-backdrop="static">
         <div class="modal-dialog" role="document">

+ 4 - 1
app/view/quality/sub_memu_list.ejs

@@ -1,5 +1,8 @@
-<nav-menu title="返回" url="/sp/<%- ctx.subProject.id %>/quality/tender" tclass="text-primary" ml="1" icon="fa-chevron-left"></nav-menu>
+<nav-menu title="返回" url="/sp/<%- ctx.subProject.id %>/quality<%- ctx.url.includes('/inspection') ? '/inspection' : '' %>" tclass="text-primary" ml="1" icon="fa-chevron-left"></nav-menu>
+<% if (!ctx.url.includes('/inspection')) { %>
 <nav-menu title="工程资料" url="/sp/<%- ctx.subProject.id %>/quality/tender/<%= ctx.tender.id %>/info%>" ml="3" active="<%- (ctx.url.indexOf('/info') !== -1 && ctx.url.indexOf('/information') === -1 ? 1 : -1) %>"></nav-menu>
 <!--<nav-menu title="缺陷管理" url="/sp/<%- ctx.subProject.id %>/quality/tender/<%= ctx.tender.id %>/flaw%>" ml="3" active="<%= ctx.url.indexOf('/flaw') %>"></nav-menu>-->
 <!--<nav-menu title="试验报告" url="/sp/<%- ctx.subProject.id %>/quality/tender/<%= ctx.tender.id %>/lab%>" ml="3" active="<%= ctx.url.indexOf('/lab') %>"></nav-menu>-->
+<% } else { %>
 <nav-menu title="质量巡检" url="/sp/<%- ctx.subProject.id %>/quality/tender/<%= ctx.tender.id %>/inspection %>" ml="3" active="<%= ctx.url.indexOf('/inspection') %>"></nav-menu>
+<% } %>

+ 1 - 0
app/view/quality/tender.ejs

@@ -24,4 +24,5 @@
 
     const pid = '<%- ctx.session.sessionProject.id %>';
     const uphlname = 'user_<%- ctx.session.sessionUser.accountId %>_pro_<% ctx.session.sessionProject.id %>_category_hide_list';
+    const isInspection = parseInt('<%- is_inspection %>');
 </script>

+ 6 - 2
app/view/revise/history_modal.ejs

@@ -132,9 +132,13 @@
                                             <div class="card-body px-3 py-0">
                                                 <% for (const [i, auditor] of group.auditors.entries()) { %>
                                                 <div class="card-text p-2 py-3 row <%- ( i > 0 ? 'border-top' : '') %>">
-                                                    <div class="col">
+                                                    <div class="col-10">
                                                         <span class="h6"><%- auditor.name %></span>
-                                                        <span class="text-muted ml-1"><%- auditor.role %></span>
+                                                        <span class="text-muted ml-1"><%- auditor.company %>
+                                                            <% if (auditor.role) { %>
+                                                                - <%= auditor.role %>
+                                                            <% } %>
+                                                        </span>
                                                     </div>
                                                     <div class="col">
                                                         <% if (auditor.status === auditConst.status.checked) { %>

+ 18 - 6
app/view/revise/info_modal.ejs

@@ -273,9 +273,13 @@
                                                 <div class="card-body px-3 py-0">
                                                     <% for (const [i, auditor] of group.auditors.entries()) { %>
                                                     <div class="card-text p-2 py-3 row <%- ( i > 0 ? 'border-top' : '') %>">
-                                                        <div class="col">
+                                                        <div class="col-10">
                                                             <span class="h6"><%- auditor.name %></span>
-                                                            <span class="text-muted ml-1"><%- auditor.role %></span>
+                                                            <span class="text-muted ml-1"><%- auditor.company %>
+                                                            <% if (auditor.role) { %>
+                                                                - <%= auditor.role %>
+                                                            <% } %>    
+                                                            </span>
                                                         </div>
                                                         <div class="col">
                                                             <% if (auditor.status === auditConst.status.checked) { %>
@@ -449,9 +453,13 @@
                                                 <div class="card-body px-3 py-0">
                                                     <% for (const [i, auditor] of group.auditors.entries()) { %>
                                                     <div class="card-text p-2 py-3 row <%- ( i > 0 ? 'border-top' : '') %>">
-                                                        <div class="col">
+                                                        <div class="col-10">
                                                             <span class="h6"><%- auditor.name %></span>
-                                                            <span class="text-muted ml-1"><%- auditor.role %></span>
+                                                            <span class="text-muted ml-1"><%- auditor.company %>
+                                                            <% if (auditor.role) { %>
+                                                                - <%= auditor.role %>
+                                                            <% } %>
+                                                            </span>
                                                         </div>
                                                         <div class="col">
                                                             <% if (auditor.status === auditConst.status.checked) { %>
@@ -632,9 +640,13 @@
                                             <div class="card-body px-3 py-0">
                                                 <% for (const [i, auditor] of group.auditors.entries()) { %>
                                                 <div class="card-text p-2 py-3 row <%- ( i > 0 ? 'border-top' : '') %>">
-                                                    <div class="col">
+                                                    <div class="col-10">
                                                         <span class="h6"><%- auditor.name %></span>
-                                                        <span class="text-muted ml-1"><%- auditor.role %></span>
+                                                        <span class="text-muted ml-1"><%- auditor.company %>
+                                                        <% if (auditor.role) { %>
+                                                            - <%= auditor.role %>
+                                                        <% } %>
+                                                        </span>
                                                     </div>
                                                     <div class="col">
                                                         <% if (auditor.status === auditConst.status.checked) { %>

+ 5 - 5
app/view/setting/user_unit.ejs

@@ -16,16 +16,16 @@
     </div>
     <div class="content-wrap">
         <div class="c-body">
-            <div class="sjs-height-0">
+            <div class="sjs-height-0 d-flex flex-column" style="overflow: unset;">
                 <nav class="nav nav-tabs m-3" role="tablist">
                     <a class="nav-item nav-link" href="/setting/user">账号列表</a>
                     <a class="nav-item nav-link" href="/setting/user/permission/set">账号权限</a>
                     <a class="nav-item nav-link active" href="/setting/user/unit">参建单位</a>
                 </nav>
-                <div class="tab-content m-3">
-                    <div class="tab-pane active">
-                        <div class="row">
-                            <div class="col-5">
+                <div class="tab-content p-3 flex-fill" style="overflow-x: auto; overflow-y: hidden;">
+                    <div class="tab-pane active h-100" >
+                        <div class="row h-100">
+                            <div class="col-5 h-100 overflow-auto" style="padding-right: 0;" >
                                 <table class="table table-hover table-bordered table-sm">
                                     <thead id="unit_header">
                                     <tr>

+ 79 - 0
app/view/shares/col_set_modal.ejs

@@ -0,0 +1,79 @@
+
+<!--弹出列设置-->
+<div class="modal fade" id="custom-col-set" data-backdrop="static">
+    <div class="modal-dialog" role="document">
+        <div class="modal-content">
+            <div class="modal-header">
+                <h5 class="modal-title">列设置</h5>
+            </div>
+            <div class="modal-body">
+                <table class="table table-hover table-bordered" id="custom-col-set-table">
+                </table>
+            </div>
+            <form class="modal-footer" >
+                <button type="button" class="btn btn-secondary btn-sm" data-dismiss="modal">关闭</button>
+                <button type="button" class="btn btn-primary btn-sm" id="custom-col-set-ok">确定修改</button>
+            </form>
+        </div>
+    </div>
+</div>
+<script>
+    const customColSet = (function () {
+        const loadLocalColSet = function(setting, cache) {
+            if (!cache) {
+                const cacheStr = setting.key ? getLocalCache(setting.key) : '';
+                cache = cacheStr ? JSON.parse(cacheStr) : [];
+            }
+            for (const col of setting.colSet) {
+                if (col.fixed && col.fixed.indexOf(col.field) > 0) {
+                    col.show = 1;
+                } else {
+                    const selfSet = cache.find(x => { return x.field === col.field; });
+                    col.show = selfSet ? selfSet.show : 1;
+                }
+            }
+            return setting.colSet;
+        }
+        const getColSetTableHtml = function(setting) {
+            const html  = [];
+            html.push('<tr class="text-center"><th>列名</th><th width="50px">显示</th></tr>');
+            for (const col of setting.colSet) {
+                html.push(`<tr class="text-center" code="${col.field}">`);
+                html.push(`<td>${col.name}</td>`);
+                if (col.fixed && col.fixed.indexOf('show') >= 0) {
+                    html.push(`                        <td>
+                            <div class="form-check form-check-inline">
+                                <input class="form-check-input" type="checkbox" id="inlineCheckbox-${col.field}" checked="" disabled="">
+                                <label class="form-check-label" for="inlineCheckbox-${col.field}"></label>
+                            </div>
+                        </td>`);
+                } else {
+                    html.push(`                        <td>
+                            <div class="form-check form-check-inline">
+                                <input class="form-check-input" type="checkbox" id="inlineCheckbox-${col.field}" ${ (col.show ? 'checked' : '') } >
+                                <label class="form-check-label" for="inlineCheckbox-${col.field}"></label>
+                            </div>
+                        </td>`)
+                }
+                html.push('</tr>');
+            }
+            $('#custom-col-set-table').html(html.join(''));
+        }
+        const show = function(setting) {
+            loadLocalColSet(setting);
+            getColSetTableHtml(setting);
+            $('#custom-col-set-ok').bind('click', function() {
+                const trs = $('tr[code]', '#custom-col-set');
+                const colSet = [];
+                for (const tr of trs) {
+                    colSet.push({ field: $(tr).attr('code'), show: $('input[type=checkbox]', tr)[0].checked});
+                }
+                setLocalCache(setting.key, JSON.stringify(colSet));
+                if (setting.afterSet) setting.afterSet(loadLocalColSet(setting, colSet));
+                $('#custom-col-set').modal('hide');
+            });
+            $('#custom-col-set').modal('show');
+        }
+        return { show, loadLocalColSet }
+    })();
+</script>

+ 35 - 9
app/view/sp_setting/manage.ejs

@@ -9,6 +9,10 @@
                 <div class="d-inline-block" id="show-level"></div>
                 <div class="d-inline-block"><button class="btn btn-sm btn-primary" data-toggle="modal" data-target="#select-tender">关联标段</button></div>
                 <div class="d-inline-block"><button class="btn btn-sm btn-primary" data-toggle="modal" data-target="#filter-tender">过滤标段</button></div>
+                <div class="d-inline-block custom-control custom-checkbox ml-2">
+                    <input type="checkbox" id="filter-tender-done" name="customCheckbox" class="custom-control-input" >
+                    <label class="custom-control-label" for="filter-tender-done">过滤完工标段</label>
+                </div>
             </div>
         </div>
     </div>
@@ -25,6 +29,7 @@
                     <a class="nav-item nav-link" data-toggle="tab" href="#htgl" role="tab">合同管理</a>
                     <a class="nav-item nav-link" data-toggle="tab" href="#sgrz" role="tab">施工日志</a>
                     <a class="nav-item nav-link" data-toggle="tab" href="#zlgl" role="tab">质量管理</a>
+                    <a class="nav-item nav-link" data-toggle="tab" href="#zlxj" role="tab">质量巡检</a>
 <!--                    <a class="nav-item nav-link" data-toggle="tab" href="#subadmin" role="tab">标段管理员</a>-->
                     <div class="ml-auto" id="user-set" style="display: none">
                         <div class="row">
@@ -222,7 +227,7 @@
                             </table>
                         </div>
                     </div>
-                    <!--质量巡检 -->
+                    <!--质量管理 -->
                     <div id="zlgl" class="tab-pane">
                         <div class="col-8" style="max-width: 800px">
                             <table class="table table-hover table-bordered table-sm">
@@ -230,17 +235,14 @@
                                 <tr>
                                     <th class="align-middle" rowspan="2">成员名称</th>
                                     <th class="align-middle" rowspan="2">角色/职位</th>
-                                    <% for (const pb of permissionBlock) { %>
-                                        <th colspan="<%- pb.permission.filter(x => { return !x.isDefault; }).length %>"><%- pb.name %></th>
-                                    <% } %>
+                                    <% const pb = permissionBlock.find(item => item.key === 'quality'); %>
+                                    <th colspan="<%- pb.permission.filter(x => { return !x.isDefault; }).length %>"><%- pb.name %></th>
                                     <th class="align-middle" rowspan="2">操作</th>
                                 </tr>
                                 <tr>
-                                    <% for (const pb of permissionBlock) { %>
-                                        <% for (const p of pb.permission) { %>
-                                            <% if (p.isDefault) continue; %>
-                                            <th><%- p.title %></th>
-                                        <% } %>
+                                    <% for (const p of pb.permission) { %>
+                                        <% if (p.isDefault) continue; %>
+                                        <th><%- p.title %></th>
                                     <% } %>
                                 </tr>
                                 </thead>
@@ -249,6 +251,30 @@
                             </table>
                         </div>
                     </div>
+                    <!--质量巡检 -->
+                    <div id="zlxj" class="tab-pane">
+                        <div class="col-8" style="max-width: 800px">
+                            <table class="table table-hover table-bordered table-sm">
+                                <thead class="text-center">
+                                <tr>
+                                    <th class="align-middle" rowspan="2">成员名称</th>
+                                    <th class="align-middle" rowspan="2">角色/职位</th>
+                                    <% const inspectionPb = permissionBlock.find(item => item.key === 'inspection'); %>
+                                    <th colspan="<%- inspectionPb.permission.filter(x => { return !x.isDefault; }).length %>"><%- inspectionPb.name %></th>
+                                    <th class="align-middle" rowspan="2">操作</th>
+                                </tr>
+                                <tr>
+                                    <% for (const p of inspectionPb.permission) { %>
+                                        <% if (p.isDefault) continue; %>
+                                        <th><%- p.title %></th>
+                                    <% } %>
+                                </tr>
+                                </thead>
+                                <tbody id="inspection-users">
+                                </tbody>
+                            </table>
+                        </div>
+                    </div>
                     <!--标段管理员 -->
                     <div id="subadmin" class="tab-pane">
                         <div class="col-6">

+ 50 - 1
app/view/sp_setting/user_modal.ejs

@@ -151,7 +151,17 @@
                                 <tbody>
                                 <% for (const sp of subProjects) { %>
                                 <% if (sp.id === ctx.subProject.id) continue; %>
-                                <tr><td class="text-center"><input type="checkbox" name="cub-sp-check" spid="<%- sp.id %>"></td><td><%- sp.name %></td></tr>
+                                <tr tree_id="<%- sp.id %>" tree_pid="<%- sp.tree_pid %>" tree_expand="1" tree_leaf="<%- (sp.has_children ? 0 : 1) %>">
+                                    <td class="text-center"><input type="checkbox" name="cub-sp-check" tree_is_folder="<%- (sp.is_folder ? 1 : 0) %>" spid="<%- sp.id %>"></td>
+                                    <td class="in-<%- sp.tree_level%> d-flex">
+                                        <% if (sp.has_children) { %>
+                                        <div onselectstart="return false" style="{-moz-user-select:none}" class="fold-switch mr-1 d-inline-block" title="收起" id="<%- sp.id %>"><i class="fa fa-minus-square-o"></i></div>
+                                        <% } else { %>
+                                        <div class="text-muted mr-1 d-inline-block" style="heigth: 100%"><%- (sp.is_last_sibling ? '└' : '├') %></div>
+                                        <% } %>
+                                        <div class="d-inline-block"><%- sp.name %></div>
+                                    </td>
+                                </tr>
                                 <% } %>
                                 </tbody>
                             </table>
@@ -179,3 +189,42 @@
         </div>
     </div>
 </div>
+<script>
+    const setPosterityShow = function(id, show) {
+        const children = $(`tr[tree_pid=${id}]`);
+        for (const c of children) {
+            if (show) {
+                $(c).show();
+            } else {
+                $(c).hide();
+            }
+            if (c.getAttribute('tree_leaf') !== '1') {
+                setPosterityShow(c.getAttribute('tree_id'), c.getAttribute('tree_expand') === '1' && show);
+            }
+        }
+    }
+    $('body').on('click', '.fold-switch', function() {
+        const id = this.getAttribute('id');
+        const nodeTr = $(`tr[tree_id=${id}]`);
+        const expand = nodeTr.attr('tree_expand') === '1';
+        nodeTr.attr('tree_expand', expand ? 0 : 1);
+        if (!expand) {
+            $(this).html(`<i class="fa fa-minus-square-o"></i>`);
+        } else {
+            $(this).html(`<i class="fa fa-plus-square-o"></i>`);
+        }
+        setPosterityShow(id, !expand);
+    });
+    const setChildrenCheck = function(id, check) {
+        const children = $(`tr[tree_pid=${id}]`);
+        for (const c of children) {
+            $('input', c)[0].checked = check;
+            if (c.getAttribute('tree_leaf') !== '1') {
+                setChildrenCheck(c.getAttribute('tree_id'), check);
+            }
+        }
+    }
+    $('body').on('change', 'input[name=cub-sp-check][tree_is_folder="1"]', function() {
+        setChildrenCheck(this.getAttribute('spid'), this.checked);
+    })
+</script>

+ 1 - 0
app/view/spss/gather_info.ejs

@@ -22,6 +22,7 @@
                     <div class="d-inline-block">
                         <button class="btn btn-primary btn-sm mr-2" id="export-excel">导出Excel</button>
                         <button class="btn btn-sm btn-primary" id="gather-select">汇总标段</button>
+                        <button class="btn btn-sm btn-primary" id="spss-info-col-set">列设置</button>
                     </div>
                 </div>
             </div>

+ 1 - 0
app/view/spss/gather_info_modal.ejs

@@ -1,4 +1,5 @@
 <% include ./spss_select_modal.ejs %>
+<% include ../shares/col_set_modal.ejs %>
 <div class="modal fade" id="info-cate" data-backdrop="static">
     <div class="modal-dialog" role="document">
         <div class="modal-content">

+ 18 - 6
app/view/stage/audit_modal.ejs

@@ -222,9 +222,13 @@
                                                     <div class="card-body px-3 py-0">
                                                         <% for (const [i, auditor] of group.auditors.entries()) { %>
                                                         <div class="card-text p-2 py-3 row <%- ( i > 0 ? 'border-top' : '') %>">
-                                                            <div class="col">
+                                                            <div class="col-10">
                                                                 <span class="h6"><%- auditor.name %></span>
-                                                                <span class="text-muted ml-1"><%- auditor.role %></span>
+                                                                <span class="text-muted ml-1"><%- auditor.company %>
+                                                                <% if (auditor.role) { %>
+                                                                    - <%= auditor.role %>
+                                                                <% } %>    
+                                                                </span>
                                                             </div>
                                                             <div class="col">
                                                                 <% if (auditor.status === auditConst.status.checked) { %>
@@ -401,9 +405,13 @@
                                                 <div class="card-body px-3 py-0">
                                                     <% for (const [i, auditor] of group.auditors.entries()) { %>
                                                     <div class="card-text p-2 py-3 row <%- ( i > 0 ? 'border-top' : '') %>">
-                                                        <div class="col">
+                                                        <div class="col-10">
                                                             <span class="h6"><%- auditor.name %></span>
-                                                            <span class="text-muted ml-1"><%- auditor.role %></span>
+                                                            <span class="text-muted ml-1"><%- auditor.company %>
+                                                            <% if (auditor.role) { %>
+                                                                - <%= auditor.role %>
+                                                            <% } %> 
+                                                            </span>
                                                         </div>
                                                         <div class="col">
                                                             <% if (auditor.status === auditConst.status.checked) { %>
@@ -582,9 +590,13 @@
                                                 <div class="card-body px-3 py-0">
                                                     <% for (const [i, auditor] of group.auditors.entries()) { %>
                                                     <div class="card-text p-2 py-3 row <%- ( i > 0 ? 'border-top' : '') %>">
-                                                        <div class="col">
+                                                        <div class="col-10">
                                                             <span class="h6"><%- auditor.name %></span>
-                                                            <span class="text-muted ml-1"><%- auditor.role %></span>
+                                                            <span class="text-muted ml-1"><%- auditor.company %>
+                                                            <% if (auditor.role) { %>
+                                                                - <%= auditor.role %>
+                                                            <% } %>    
+                                                            </span>
                                                         </div>
                                                         <div class="col">
                                                             <% if (auditor.status === auditConst.status.checked) { %>

+ 3 - 3
app/view/tender/modal.ejs

@@ -154,9 +154,9 @@
                                                 <div class="card">
                                                     <div class="card-body px-3 py-0">
                                                         <div class="card-text p-2 py-3 row">
-                                                            <div class="col">
+                                                            <div class="col-10">
                                                                 <span class="h6">${user.name}</span>
-                                                                <span class="text-muted ml-1">${user.role}</span>
+                                                                <span class="text-muted ml-1">${user.company}${user.role ? ' - ' + user.role : ''}</span>
                                                             </div>
                                                             <div class="col">
                                                                 <span class="pull-right text-success"><i class="fa fa-check-circle"></i></span>
@@ -198,7 +198,7 @@
                     historyHTML.push('<div class="card"><div class="card-body px-3 py-0">');
                     for (const [i, auditor] of group.auditors.entries()) {
                         historyHTML.push(`<div class="card-text p-2 py-3 row ${ ( i > 0 ? 'border-top' : '') }">`);
-                        historyHTML.push(`<div class="col"><span class="h6">${auditor.name}</span><span class="text-muted ml-1">${auditor.role}</span></div>`);
+                        historyHTML.push(`<div class="col-10"><span class="h6">${auditor.name}</span><span class="text-muted ml-1">${auditor.company}${auditor.role ? ' - ' + auditor.role : ''}</span></div>`);
                         historyHTML.push('<div class="col">');
                         if (auditor.status === auditConst2.status.checked) {
                             historyHTML.push('<span class="pull-right text-success"><i class="fa fa-check-circle"></i></span>');

+ 5 - 4
app/view/wap/inspection.ejs

@@ -2,14 +2,15 @@
 <html lang="zh">
 <head>
     <meta charset="UTF-8">
-    <title>质量巡检单生成助手</title>
+    <title>巡检助手</title>
     <meta name="viewport" content="width=device-width, initial-scale=1">
     <link rel="stylesheet" href="/public/css/bootstrap/bootstrap.min.css">
     <link rel="stylesheet" href="/public/css/wap/main.css">
     <link rel="stylesheet" href="/public/css/toast.css">
     <link rel="stylesheet" href="/public/css/font-awesome/font-awesome.min.css">
     <link rel="stylesheet" href="/public/css/toastr.css">
-    <link rel="shortcut icon" href="/public/images/favicon.ico">
+    <link rel="apple-touch-icon-precomposed" href="/public/images/logo.png">
+    <link rel="shortcut icon" href="/public/images/logo.png">
     <style>
         body,
         html {
@@ -206,7 +207,7 @@
 </head>
 <body>
 <div class="container mb-3 px-0">
-    <h5 class="text-center py-2 xj-title mb-0">质量巡检单生成助手</h5>
+    <h5 class="text-center py-2 xj-title mb-0">巡检助手</h5>
     <div id="chat-box" class="chat-box mb-3">
         <div id="messages"></div>
         <!-- 表单预览卡片 -->
@@ -287,7 +288,7 @@
             $('#messages').append($message);
             $chatBox.scrollTop($chatBox[0].scrollHeight);
         };
-        appendMessage("👋 嗨,我是质量巡检单生成助手,告诉我项目名称可以帮你快速生成巡检单", "ai", 'mt-3');
+        appendMessage("👋 嗨,我是巡检助手,告诉我项目名称可以帮你快速生成巡检单", "ai", 'mt-3');
         const updatePreviewForm = (data) => {
             $('#field-check_item').text(data.check_item || '—');
             $('#field-check_situation').text(data.check_situation || '—');

+ 11 - 1
config/menu.js

@@ -125,11 +125,21 @@ const menu = {
     },
     quality: {
         name: '质量管理',
-        icon: 'fa-file-text-o',
+        icon: 'fa-balance-scale',
         display: true,
         children: null,
         caption: '质量管理',
         controller: 'quality',
+        notIncludedUrl: ['/inspection'],
+    },
+    inspection: {
+        name: '质量巡检',
+        icon: 'fa-newspaper-o',
+        display: true,
+        children: null,
+        caption: '质量巡检',
+        controllers: ['quality'],
+        includedUrl: { quality: ['/inspection'] },
     },
     file: {
         name: '资料管理',

+ 3 - 0
sql/update.sql

@@ -62,6 +62,9 @@ ALTER TABLE `zh_s2b_spec_pull`
 ADD COLUMN `extra_option` varchar(1000) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '{}' COMMENT '额外配置' AFTER `pull_class`,
 ADD COLUMN `check_api` varchar(50) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '' COMMENT 'api验证方法' AFTER `extra_option`;
 
+ALTER TABLE `zh_tender_permission`
+ADD COLUMN `inspection` varchar(255) NOT NULL DEFAULT '' COMMENT '质量巡检权限(,分隔,具体见代码定义)' AFTER `quality`;
+
 ------------------------------------
 -- 表数据
 ------------------------------------