浏览代码

Merge branch 'master' of http://192.168.1.41:3000/maixinrong/Calculation

MaiXinRong 4 年之前
父节点
当前提交
f322bff942

+ 4 - 3
app/controller/stage_controller.js

@@ -159,6 +159,7 @@ module.exports = app => {
                 renderData.jsFiles = this.app.jsFiles.common.concat(this.app.jsFiles.stage.index);
                 renderData.whiteList = this.ctx.app.config.multipart.whitelist;
                 renderData.imType = tenderConst.imType;
+                renderData.curAuditor = ctx.stage.curAuditor;
                 // 获取附件列表
                 const attData = await ctx.service.stageAtt.getDataByTenderIdAndStageId(ctx.tender.id, ctx.params.order);
                 for (const index in attData) {
@@ -1199,7 +1200,7 @@ module.exports = app => {
         }
 
         /**
-         * 检测当前期当用用户是否在审核列表中,如果是的话运行再次上传附件
+         * 检查当前期当前用户是否在审核列表中,如果是的话允许再次上传附件
          * @param {Object} ctx 上下文
          */
         _checkStageCanModifyRe(ctx) {
@@ -1212,6 +1213,7 @@ module.exports = app => {
                         ctx.reUploadPermission = true;
                         return;
                     }
+
                     throw '该计量期当前您无权操作';
 
                 } else {
@@ -1412,8 +1414,7 @@ module.exports = app => {
             };
             let stream;
             try {
-                this._checkStageCanModify(ctx);
-
+                this._checkStageCanModifyRe(ctx);
                 stream = await ctx.getFileStream({ requireFile: false });
                 let fileData = {};
                 if (stream.filename !== undefined) {

+ 16 - 3
app/public/css/main.css

@@ -218,7 +218,7 @@ input.nospin[type="number"]{-moz-appearance:textfield;}
   height: 100%;
   z-index: 4;
   left:55px;
-  padding-top:50px;
+  /*padding-top:50px;*/
   border-right: 1px solid #ddd;
   width: 200px;
 }
@@ -323,6 +323,11 @@ input.nospin[type="number"]{-moz-appearance:textfield;}
   line-height: normal;
   z-index: 999
 }
+.sidebar-title{
+  padding: 10px;
+  border-bottom: 1px solid #ddd;
+  margin-bottom: 10px;
+}
 .side-menu{
   position: fixed;
   right:15px;
@@ -380,7 +385,7 @@ input.nospin[type="number"]{-moz-appearance:textfield;}
     box-sizing: border-box;
 }
 .panel-sidebar .scrollbar-auto {
-    height: 100%;
+    height: calc(100vh - 100px);
     width: 100%;
     overflow-y: auto;
     position: static;
@@ -966,7 +971,7 @@ legend {
 }
 .side-fold {
   right:50px;
-  bottom:20px;
+  bottom:5px;
 }
 .side-fold a{
   font-size:24px;
@@ -991,6 +996,14 @@ legend {
 .custom-switch .custom-control-label::after{
   top:.25rem;
 }
+.search-group {
+  position: relative;
+}
+.search-group .remove-btn {
+  position:absolute;
+  right:10px;
+  top:3px;
+}
 /*菜单栏系统维护图标*/
 a.maintain-icon{
   position:relative;

+ 28 - 11
app/public/js/stage.js

@@ -2629,6 +2629,8 @@ $(document).ready(() => {
                     $('#show-calc-img').attr('src', '');
                     $('#calc-img').attr('src', '');
                     $('#view-calc-img').attr('src', '');
+                    $('#view-calc-remark').val('');
+                    $('#text-edit').val('')
                     $('#edit-img').modal('hide');
                     // postData(window.location.pathname + '/detail/merge-img', {updateType: 'clear', lid: data.lid, pid: data.pid, uuid: data.uuid}, function (result) {
                     //     stageIm.loadUpdateDetailData(result);
@@ -2645,6 +2647,8 @@ $(document).ready(() => {
                     $('#show-calc-img').attr('src', '');
                     $('#calc-img').attr('src', '');
                     $('#view-calc-img').attr('src', '');
+                    $('#view-calc-remark').val('');
+                    $('#text-edit').val('')
                     $('#edit-img').modal('hide');
                 }
             });
@@ -2744,10 +2748,10 @@ $(document).ready(() => {
             $('#view-calc-img').attr('src', calcImgSrc);
 
             const calcImgRemark = data && data.calc_img_remark || '';
-            $('#view-calc-remark').text(calcImgRemark);
+            $('#view-calc-remark').val(calcImgRemark);
             $("#view-calc-remark").attr('readonly', true);
             // 处理 编辑 -> 添加草图中textarea多余的空格
-            $('#text-edit').text(calcImgRemark)
+            $('#text-edit').val(calcImgRemark)
         }
     }
     class CheckedChange {
@@ -3002,6 +3006,9 @@ $(document).ready(() => {
     });
     // 上传附件
     $('#upload-file-btn').click(function () {
+        if (curAuditor && curAuditor.aid !== parseInt(cur_uid)) {
+            return toastr.error('无法上传图片!');
+        }
         const files = $('#upload-file')[0].files;
         const node = SpreadJsObj.getSelectObject(slSpread.getActiveSheet());
         const formData = new FormData();
@@ -3060,19 +3067,29 @@ $(document).ready(() => {
             // 附件uid等于当前用户id, 附件上传本人
             if (parseInt(cur_uid) === att.uid) {
                 $('#btn-att').show();
-                let showDel = true;
+                let showDel = false;
+                if (!curAuditor) {
+                    stage.status === auditConst.status.checked && parseInt(att.re_upload) && (showDel = true)
+                    stage.status === auditConst.status.uncheck && parseInt(cur_uid) === stage.user_id && (showDel = true)
+                    stage.status === auditConst.status.checkNo && parseInt(cur_uid) === stage.user_id && (showDel = true)
+                } else {
+                    curAuditor.aid === parseInt(cur_uid) && (showDel = true)
+                }
+                // if (curAuditor && curAuditor.aid !== parseInt(cur_uid)) showDel = false
+                // // 审核完成后再上传的,上传者可删除附件
+                // if (stage.status === auditConst.status.checked && !parseInt(att.re_upload)) showDel = false;
 
-                // 审核完成后再上传的,上传者可删除附件
-                if (stage.status === auditConst.status.checked && !parseInt(att.re_upload)) showDel = false;
+                // // 审核被退回,原报上传的附件可以删除
+                // if (stage.status === auditConst.status.checkNo && parseInt(cur_uid) !== stage.user_id) showDel = false;
 
-                // 审核被退回,原报上传的附件可以删除
-                if (stage.status === auditConst.status.checkNo && parseInt(cur_uid) !== stage.user_id) showDel = false;
+                // // 审核中,原报上传的图片不能删除
+                // if (stage.status === auditConst.status.checking && stage.user_id === parseInt(cur_uid)) showDel = false;
 
-                // 审核中,原报上传的图片不能删除
-                if (stage.status === auditConst.status.checking && stage.user_id === parseInt(cur_uid)) showDel = false;
+                // // 但该阶段不属于该审核人操作的阶段
+                // if (curAuditor.aid !== parseInt(cur_uid)) showDel = false;
 
-                // 台账未上报、当前用户为原报, 可以删除附件
-                if (stage.status === auditConst.status.uncheck && stage.user_id !== parseInt(cur_uid)) showDel = false;
+                // // 台账未上报、当前用户为原报, 可以删除附件
+                // if (stage.status === auditConst.status.uncheck && stage.user_id !== parseInt(cur_uid)) showDel = false;
 
                 if (showDel) $('#btn-att a').eq(3).show();
                 // $('#btn-att a').eq(3).show();

+ 1 - 0
app/public/js/stage_im.js

@@ -888,6 +888,7 @@ const stageIm = (function () {
                 });
                 imData.calc_img = d.calc_img;
                 imData.calc_img_org = d.calc_img_org;
+                imData.calc_img_remark = d.calc_img_remark;
             }
         }
     }

+ 24 - 16
app/public/report/js/rpt_main.js

@@ -657,6 +657,8 @@ let rptControlObj = {
                         for (const signatureRel of result.signatureRelInfo) {
                             signatureRelArr.push(JSON.parse(signatureRel.rel_content));
                         }
+                        downloadPDFReport(result.data, pageSize, rpt_names, signatureRelArr, result.signatureRelInfo, refRptTplIds, STAGE_AUDIT);
+                        /*
                         for (let idx = 0; idx < result.data.length; idx++) {
                             let pageData = result.data[idx];
                             // if (current_stage_status === 3) {
@@ -676,6 +678,7 @@ let rptControlObj = {
                             // JpcJsPDFHelper.outputAsPdf(pageData, pageSize, rpt_names[idx], signatureRelArr);
                             JpcJsPDFHelper.outputAsPdf(pageData, pageSize, rpt_names[idx], singleSignatureRelArr, STAGE_AUDIT); // 精确控制签名
                         }
+                        //*/
                     },
                     function(failRst){
                         // closeWaitingView();
@@ -804,6 +807,27 @@ let rptControlObj = {
     }
 };
 
+function downloadPDFReport(pageDataArr, pageSize, rpt_names, signatureRelArr, signatureRelInfo, refRptTplIds, STAGE_AUDIT) {
+    rptControlObj.currentDownloadIdx = 0;
+    const private_download = function() {
+        if (rptControlObj.currentDownloadIdx < pageDataArr.length) {
+            let singleSignatureRelArr = [];
+            for (let rIdx = 0; rIdx < signatureRelInfo.length; rIdx++) {
+                if (signatureRelInfo[rIdx].rpt_id === refRptTplIds[idx]) {
+                    singleSignatureRelArr = signatureRelArr[rIdx]; // 有些报表可能没有签名
+                    break;
+                }
+            }
+            let pageData = pageDataArr[rptControlObj.currentDownloadIdx];
+            let rptName = rpt_names[rptControlObj.currentDownloadIdx];
+            rptControlObj.currentDownloadIdx++;
+            JpcJsPDFHelper.outputAsPdf(pageData, pageSize, rptName, singleSignatureRelArr, STAGE_AUDIT); // 精确控制签名
+            if (rptControlObj.currentDownloadIdx < pageDataArr.length) setTimeout(private_download, 2000);
+        }
+    }
+    private_download();
+}
+
 function downloadReport(urls) {
     //考虑到多个报表下载,一些浏览器(如chrome)不允许一下子下载多个文件,得缓缓处理,统一在这处理
     rptControlObj.currentDownloadUrl = null;
@@ -819,22 +843,6 @@ function downloadReport(urls) {
     private_download();
 }
 
-// function dynamicLoadJs(url, callback) {
-//     let head = document.getElementsByTagName('head')[0];
-//     let script = document.createElement('script');
-//     script.type = 'text/javascript';
-//     script.src = url;
-//     if(callback) {
-//         script.onload = script.onreadystatechange = function () {
-//             if (!this.readyState || this.readyState === "loaded" || this.readyState === "complete"){
-//                 callback();
-//                 script.onload = script.onreadystatechange = null;
-//             }
-//         };
-//     }
-//     head.appendChild(script);
-// }
-
 function dynamicLoadJs(url, type, callback) {
     let head = document.getElementsByTagName('head')[0];
     let script = document.createElement('script');

+ 38 - 38
app/service/stage_audit.js

@@ -32,7 +32,7 @@ module.exports = app => {
          * @param {Number} stageId - 期id
          * @param {Number} auditorId - 审核人id
          * @param {Number} times - 第几次审批
-         * @returns {Promise<*>}
+         * @return {Promise<*>}
          */
         async getAuditor(stageId, auditorId, times = 1) {
             const sql = 'SELECT la.`aid`, pa.`name`, pa.`company`, pa.`role`, pa.`mobile`, pa.`telephone`, la.`times`, la.`order`, la.`status`, la.`opinion`, la.`begin_time`, la.`end_time` ' +
@@ -49,7 +49,7 @@ module.exports = app => {
          * @param {Number} stageId - 期id
          * @param {Number} times - 第几次审批
          * @param {Number} order_sort - 列表排序方式
-         * @returns {Promise<*>}
+         * @return {Promise<*>}
          */
         async getAuditors(stageId, times = 1, order_sort = 'asc') {
             const sql = 'SELECT la.`aid`, pa.`name`, pa.`company`, pa.`role`, pa.`mobile`, pa.`telephone`, la.`times`, la.`order`, la.`status`, la.`opinion`, la.`begin_time`, la.`end_time`, g.`sort` ' +
@@ -81,7 +81,7 @@ module.exports = app => {
          * @param {Number} tenderId - 标段id
          * @param {Number} auditorId - 审核人id
          * @param {Number} times - 第几次审批
-         * @returns {Promise<*>}
+         * @return {Promise<*>}
          */
         async getStatusName(stageId) {
             const sql = 'SELECT pa.`name` ' +
@@ -97,7 +97,7 @@ module.exports = app => {
          *
          * @param {Number} stageId - 期id
          * @param {Number} times - 第几次审批
-         * @returns {Promise<*>}
+         * @return {Promise<*>}
          */
         async getCurAuditor(stageId, times = 1) {
             const sql = 'SELECT la.`aid`, pa.`name`, pa.`company`, pa.`role`, pa.`mobile`, pa.`telephone`, la.`times`, la.`order`, la.`status`, la.`opinion`, la.`begin_time`, la.`end_time` ' +
@@ -113,7 +113,7 @@ module.exports = app => {
          *
          * @param {Number} stageId - 期id
          * @param {Number} times - 第几次审批
-         * @returns {Promise<number>}
+         * @return {Promise<number>}
          */
         async getNewOrder(stageId, times = 1) {
             const sql = 'SELECT Max(??) As max_order FROM ?? Where `sid` = ? and `times` = ?';
@@ -128,7 +128,7 @@ module.exports = app => {
          * @param {Number} stageId - 期id
          * @param {Number} auditorId - 审核人id
          * @param {Number} times - 第几次审批
-         * @returns {Promise<number>}
+         * @return {Promise<number>}
          */
         async addAuditor(stageId, auditorId, times = 1) {
             const newOrder = await this.getNewOrder(stageId, times);
@@ -136,7 +136,7 @@ module.exports = app => {
                 tid: this.ctx.tender.id,
                 sid: stageId,
                 aid: auditorId,
-                times: times,
+                times,
                 order: newOrder,
                 status: auditConst.status.uncheck,
             };
@@ -150,14 +150,14 @@ module.exports = app => {
          * @param {Number} stageId - 标段id
          * @param {Number} auditorId - 审核人id
          * @param {Number} times - 第几次审批
-         * @returns {Promise<*>}
+         * @return {Promise<*>}
          * @private
          */
         async _syncOrderByDelete(transaction, stageId, order, times) {
             this.initSqlBuilder();
             this.sqlBuilder.setAndWhere('sid', {
                 value: stageId,
-                operate: '='
+                operate: '=',
             });
             this.sqlBuilder.setAndWhere('order', {
                 value: order,
@@ -183,12 +183,12 @@ module.exports = app => {
          * @param {Number} stageId - 期id
          * @param {Number} auditorId - 审核人id
          * @param {Number} times - 第几次审批
-         * @returns {Promise<boolean>}
+         * @return {Promise<boolean>}
          */
         async deleteAuditor(stageId, auditorId, times = 1) {
             const transaction = await this.db.beginTransaction();
             try {
-                const condition = {sid: stageId, aid: auditorId, times: times};
+                const condition = { sid: stageId, aid: auditorId, times };
                 const auditor = await this.getDataByCondition(condition);
                 if (!auditor) {
                     throw '该审核人不存在';
@@ -196,7 +196,7 @@ module.exports = app => {
                 await this._syncOrderByDelete(transaction, stageId, auditor.order, times);
                 await transaction.delete(this.tableName, condition);
                 await transaction.commit();
-            } catch(err) {
+            } catch (err) {
                 await transaction.rollback();
                 throw err;
             }
@@ -208,7 +208,7 @@ module.exports = app => {
          *
          * @param {Number} stageId - 期id
          * @param {Number} times - 第几次审批
-         * @returns {Promise<boolean>}
+         * @return {Promise<boolean>}
          */
         async start(stageId, times = 1) {
             const audit = await this.getDataByCondition({ sid: stageId, times, order: 1 });
@@ -278,20 +278,20 @@ module.exports = app => {
         async _checked(stageId, checkData, times) {
             const time = new Date();
             // 整理当前流程审核人状态更新
-            const audit = await this.getDataByCondition({sid: stageId, times: times, status: auditConst.status.checking});
+            const audit = await this.getDataByCondition({ sid: stageId, times, status: auditConst.status.checking });
             if (!audit) {
                 throw '审核数据错误';
             }
-            const nextAudit = await this.getDataByCondition({sid: stageId, times: times, order: audit.order + 1});
+            const nextAudit = await this.getDataByCondition({ sid: stageId, times, order: audit.order + 1 });
             const tpData = await this.ctx.service.stageBills.getSumTotalPrice(this.ctx.stage);
 
             const transaction = await this.db.beginTransaction();
             try {
-                await transaction.update(this.tableName, {id: audit.id, status: checkData.checkType, opinion: checkData.opinion, end_time: time});
+                await transaction.update(this.tableName, { id: audit.id, status: checkData.checkType, opinion: checkData.opinion, end_time: time });
                 // 计算并合同支付最终数据
                 const [yfPay, sfPay] = await this.ctx.service.stagePay.calcAllStagePays(this.ctx.stage, transaction);
                 this.ctx.stage.tp_history.push({
-                    times: times, order: audit.order,
+                    times, order: audit.order,
                     contract_tp: tpData.contract_tp,
                     qc_tp: tpData.qc_tp,
                     yf_tp: yfPay.tp,
@@ -305,7 +305,7 @@ module.exports = app => {
                     await this.ctx.service.stageBonus.updateHistory(this.ctx.stage, transaction);
                     await this.ctx.service.stageOther.updateHistory(this.ctx.stage, transaction);
                     // 流程至下一审批人
-                    await transaction.update(this.tableName, {id: nextAudit.id, status: auditConst.status.checking, begin_time: time});
+                    await transaction.update(this.tableName, { id: nextAudit.id, status: auditConst.status.checking, begin_time: time });
                     // 同步 期信息
                     await transaction.update(this.ctx.service.stage.tableName, {
                         id: stageId, status: auditConst.status.checking,
@@ -399,7 +399,7 @@ module.exports = app => {
         async _checkNo(stageId, checkData, times) {
             const time = new Date();
             // 整理当前流程审核人状态更新
-            const audit = await this.getDataByCondition({sid: stageId, times: times, status: auditConst.status.checking});
+            const audit = await this.getDataByCondition({ sid: stageId, times, status: auditConst.status.checking });
             if (!audit) {
                 throw '审核数据错误';
             }
@@ -420,13 +420,13 @@ module.exports = app => {
                 // 计算并合同支付最终数据
                 const [yfPay, sfPay] = await this.ctx.service.stagePay.calcAllStagePays(this.ctx.stage, transaction);
                 this.ctx.stage.tp_history.push({
-                    times: times, order: audit.order,
+                    times, order: audit.order,
                     contract_tp: tpData.contract_tp,
                     qc_tp: tpData.qc_tp,
                     yf_tp: yfPay.tp,
                     sf_tp: sfPay.tp,
                 });
-                await transaction.update(this.tableName, {id: audit.id, status: checkData.checkType, opinion: checkData.opinion, end_time: time});
+                await transaction.update(this.tableName, { id: audit.id, status: checkData.checkType, opinion: checkData.opinion, end_time: time });
                 // 同步 期信息
                 await transaction.update(this.ctx.service.stage.tableName, {
                     id: stageId, status: checkData.checkType,
@@ -508,7 +508,7 @@ module.exports = app => {
                 // 计算并合同支付最终数据
                 const [yfPay, sfPay] = await this.ctx.service.stagePay.calcAllStagePays(this.ctx.stage, transaction);
                 this.ctx.stage.tp_history.push({
-                    times: times, order: audit.order,
+                    times, order: audit.order,
                     contract_tp: tpData.contract_tp,
                     qc_tp: tpData.qc_tp,
                     yf_tp: yfPay.tp,
@@ -519,18 +519,18 @@ module.exports = app => {
                     id: stageId,
                     contract_tp: tpData.contract_tp,
                     qc_tp: tpData.qc_tp,
-                    times: times,
+                    times,
                     yf_tp: yfPay.tp,
                     sf_tp: sfPay.tp,
                     tp_history: JSON.stringify(this.ctx.stage.tp_history),
                     cache_time_r: this.ctx.stage.cache_time_l,
                 });
-                await transaction.update(this.tableName, {id: audit.id, status: checkData.checkType, opinion: checkData.opinion, end_time: time});
+                await transaction.update(this.tableName, { id: audit.id, status: checkData.checkType, opinion: checkData.opinion, end_time: time });
                 // 顺移气候审核人流程顺序
                 this.initSqlBuilder();
-                this.sqlBuilder.setAndWhere('sid', { value: this.ctx.stage.id, operate: '=', });
-                this.sqlBuilder.setAndWhere('order', { value: audit.order, operate: '>', });
-                this.sqlBuilder.setUpdateData('order', { value: 2, selfOperate: '+', });
+                this.sqlBuilder.setAndWhere('sid', { value: this.ctx.stage.id, operate: '=' });
+                this.sqlBuilder.setAndWhere('order', { value: audit.order, operate: '>' });
+                this.sqlBuilder.setUpdateData('order', { value: 2, selfOperate: '+' });
                 const [sql, sqlParam] = this.sqlBuilder.build(this.tableName, 'update');
                 const data = await transaction.query(sql, sqlParam);
                 // 上一审批人,当前审批人 再次添加至流程
@@ -593,7 +593,7 @@ module.exports = app => {
          * @param {Number} stageId - 标段id
          * @param {auditConst.status.checked|auditConst.status.checkNo} checkType - 审批结果
          * @param {Number} times - 第几次审批
-         * @returns {Promise<void>}
+         * @return {Promise<void>}
          */
         async check(stageId, checkData, times = 1) {
             if (checkData.checkType !== auditConst.status.checked && checkData.checkType !== auditConst.status.checkNo && checkData.checkType !== auditConst.status.checkNoPre) {
@@ -604,7 +604,7 @@ module.exports = app => {
             // if (!audit) {
             //     throw '审核数据错误';
             // }
-            //const time = new Date();
+            // const time = new Date();
 
             switch (checkData.checkType) {
                 case auditConst.status.checked:
@@ -739,7 +739,7 @@ module.exports = app => {
          * 审批
          * @param {Number} stageId - 标段id
          * @param {Number} times - 第几次审批
-         * @returns {Promise<void>}
+         * @return {Promise<void>}
          */
         async checkAgain(stageId, times = 1) {
             const time = new Date();
@@ -812,7 +812,7 @@ module.exports = app => {
          * 获取审核人需要审核的期列表
          *
          * @param auditorId
-         * @returns {Promise<*>}
+         * @return {Promise<*>}
          */
         async getAuditStage(auditorId) {
             const sql = 'SELECT sa.`aid`, sa.`times`, sa.`order`, sa.`begin_time`, sa.`end_time`, sa.`tid`, sa.`sid`,' +
@@ -830,7 +830,7 @@ module.exports = app => {
          * @param {Number} pid - 查询标段
          * @param {Number} uid - 查询人
          * @param {Date} time - 查询时间
-         * @returns {Promise<*>}
+         * @return {Promise<*>}
          */
         async getNoticeStage(pid, uid, time) {
             const sql = 'SELECT * FROM (SELECT t.`name`, t.`project_id`, t.`type`, t.`user_id`, ' +
@@ -853,7 +853,7 @@ module.exports = app => {
          * 获取审核人流程列表
          *
          * @param auditorId
-         * @returns {Promise<*>}
+         * @return {Promise<*>}
          */
         async getAuditGroupByList(stageId, times) {
             const sql = 'SELECT la.`aid`, pa.`name`, pa.`company`, pa.`role`, la.`times`, la.`sid`, la.`aid`, la.`order` ' +
@@ -870,7 +870,7 @@ module.exports = app => {
          * 获取审核人流程列表
          *
          * @param auditorId
-         * @returns {Promise<*>}
+         * @return {Promise<*>}
          */
         async getAuditGroupByListWithOwner(stageId, times) {
             const result = await this.getAuditGroupByList(stageId, times);
@@ -891,7 +891,7 @@ module.exports = app => {
          * @param transaction - 新增一期的事务
          * @param {Object} preStage - 上一期
          * @param {Object} newStage - 最新一期
-         * @returns {Promise<*>}
+         * @return {Promise<*>}
          */
         async copyPreStageAuditors(transaction, preStage, newStage) {
             const auditors = await this.getAuditGroupByList(preStage.id, preStage.times);
@@ -903,7 +903,7 @@ module.exports = app => {
                     aid: a.aid,
                     times: newStage.times,
                     order: newAuditors.length + 1,
-                    status: auditConst.status.uncheck
+                    status: auditConst.status.uncheck,
                 };
                 newAuditors.push(na);
             }
@@ -969,7 +969,7 @@ module.exports = app => {
          * 取待审批期列表(wap用)
          *
          * @param auditorId
-         * @returns {Promise<*>}
+         * @return {Promise<*>}
          */
         async getAuditStageByWap(auditorId) {
             const sql = 'SELECT sa.`aid`, sa.`times`, sa.`begin_time`, sa.`end_time`, sa.`tid`, sa.`sid`,' +
@@ -988,7 +988,7 @@ module.exports = app => {
          * 删除本次审批流程
          * @param {Number} stageId - 标段id
          * @param {Number} times - 第几次审批
-         * @returns {Promise<void>}
+         * @return {Promise<void>}
          */
         async timesDelete() {
             const transaction = await this.db.beginTransaction();

+ 7 - 4
app/view/change/info.ejs

@@ -71,10 +71,13 @@
     }
 </style>
 <div class="panel-sidebar">
-    <div class="panel-title">
-        <div class="title-bar">
-            <h2 class="text-truncate" style="white-space:nowrap; overflow:hidden; text-overflow:ellipsis;" data-toggle="tooltip" data-placement="right" title=""  data-original-title="<%- tender.name %>"><%- tender.name %></h2>
-        </div>
+    <!--<div class="panel-title">-->
+        <!--<div class="title-bar">-->
+            <!--<h2 class="text-truncate" style="white-space:nowrap; overflow:hidden; text-overflow:ellipsis;" data-toggle="tooltip" data-placement="right" title=""  data-original-title="<%- tender.name %>"><%- tender.name %></h2>-->
+        <!--</div>-->
+    <!--</div>-->
+    <div class="sidebar-title" data-toggle="tooltip" data-placement="right" data-original-title="<%- tender.name %>">
+        <%- (tender.name.length > 15 ? tender.name.substring(0,15) + '...' : tender.name) %>
     </div>
     <div class="scrollbar-auto">
         <div class="nav-box">

+ 2 - 4
app/view/material/material_sub_menu.ejs

@@ -1,8 +1,6 @@
 <div class="panel-sidebar" id="sub-menu">
-    <div class="panel-title">
-        <div class="title-bar">
-            <h2 class="text-truncate" style="white-space:nowrap; overflow:hidden; text-overflow:ellipsis;" data-toggle="tooltip" data-placement="right" title=""  data-original-title="第<%- ctx.material.order%>期 - <%- tender.name %>">第<%- ctx.material.order%>期 - <%- tender.name %></h2>
-        </div>
+    <div class="sidebar-title" data-toggle="tooltip" data-placement="right" data-original-title="第<%- ctx.material.order%>期 - <%- tender.name %>">
+        第<%- ctx.material.order %>期 - <%- (tender.name.length > 11 ? tender.name.substring(0,11) + '...' : tender.name) %>
     </div>
     <div class="scrollbar-auto">
         <div class="nav-box">

+ 21 - 9
app/view/stage/audit_modal.ejs

@@ -380,7 +380,7 @@
                                                         <label>审批意见<b class="text-danger">*</b></label>
                                                         <textarea class="form-control form-control-sm" name="opinion">不同意</textarea>
                                                     </div>
-                                                    <div id="reject-process" class="alert alert-warning">
+                                                    <div class="alert alert-warning reject-process">
                                                         <div class="form-check form-check-inline">
                                                             <!-- <input class="form-check-input" type="radio" name="checkType" id="inlineRadio1" value="<%- auditConst.status.checkNo %>" <% if (auditors[iA].order === 1 || auditors[iA].aid === auditors[0].aid) { %>checked<% } %>> -->
                                                             <input class="form-check-input" type="radio" name="checkType" id="inlineRadio1" value="<%- auditConst.status.checkNo %>">
@@ -1403,15 +1403,16 @@
                                                         <label>审批意见<b class="text-danger">*</b></label>
                                                         <textarea class="form-control form-control-sm" name="opinion">不同意</textarea>
                                                     </div>
-                                                    <div class="alert alert-warning">
+                                                    <div class="alert alert-warning reject-process">
                                                         <div class="form-check form-check-inline">
-                                                            <input class="form-check-input" type="radio" name="checkType" id="inlineRadio1" value="<%- auditConst.status.checkNo %>" <% if (auditors[iA].order === 1 || auditors[iA].aid === auditors[0].aid) { %>checked<% } %>>
+                                                            <input class="form-check-input" type="radio" name="checkType" id="inlineRadio1" value="<%- auditConst.status.checkNo %>">
+                                                            <!-- <input class="form-check-input" type="radio" name="checkType" id="inlineRadio1" value="<%- auditConst.status.checkNo %>" <% if (auditors[iA].order === 1 || auditors[iA].aid === auditors[0].aid) { %>checked<% } %>> -->
                                                             <label class="form-check-label" for="inlineRadio1">退回原报 <%- ctx.stage.user.name %></label>
                                                         </div>
                                                         <% if (auditors[iA].order > 1 && auditors[iA].aid !== auditors[0].aid) { %>
                                                             <% const auditorIndex = ctx.stage.auditors2.findIndex(function (item) { return item.aid === auditors[iA].aid }) %>
                                                             <div class="form-check form-check-inline">
-                                                                <input class="form-check-input" type="radio" name="checkType" id="inlineRadio2" value="<%- auditConst.status.checkNoPre %>" checked>
+                                                                <input class="form-check-input" type="radio" name="checkType" id="inlineRadio2" value="<%- auditConst.status.checkNoPre %>">
                                                                 <label class="form-check-label" for="inlineRadio2">退回上一审批人 <%- ctx.stage.auditors2[auditorIndex-1].name %></label>
                                                             </div>
                                                         <% } %>
@@ -1539,7 +1540,7 @@
         };
         if (!parseInt($('[name=checkType]:checked', this).val())) {
             if (!$('#warning-text').length) {
-                $('#reject-process').prepend('<p id="warning-text" style="color: red; margin: 0;">请选择退回流程</p>');
+                $('.reject-process').prepend('<p id="warning-text" style="color: red; margin: 0;">请选择退回流程</p>');
             }
             return false;
         } else {
@@ -1552,16 +1553,27 @@
 
     });
     $('#audit-check3').submit(function (e) {
-        $(this).parent().parent().modal('hide');
+        // $(this).parent().parent().modal('hide');
         const data = {
             opinion: $('[name=opinion]', this).val().replace(/\r\n/g, '<br/>').replace(/\n/g, '<br/>').replace(/\s/g, ' '),
             checkType: parseInt($('[name=checkType]:checked', this).val()),
         };
-        postData(this.action, data, function () {
+        if (!parseInt($('[name=checkType]:checked', this).val())) {
+            if (!$('#warning-text').length) {
+                $('.reject-process').prepend('<p id="warning-text" style="color: red; margin: 0;">请选择退回流程</p>');
+            }
+            return false;
+        } else {
+            postData(this.action, data, function () {
             window.location.reload();
         });
-        $('#hide-all').hide();
-        return false;
+        }
+        return false
+        // postData(this.action, data, function () {
+        //     window.location.reload();
+        // });
+        // $('#hide-all').hide();
+        // return false;
     });
     $('.modal').on('shown.bs.modal', function () {
         const height = $(this)[0].scrollHeight

+ 1 - 0
app/view/stage/index.ejs

@@ -587,6 +587,7 @@
     const ckColSetting = 'stage-col-visible-1.0.3-<%- tender.id %>';
     const auditConst = JSON.parse('<%- JSON.stringify(auditConst) %>');
     const cur_uid = '<%- ctx.session.sessionUser.accountId %>';
+    const curAuditor = JSON.parse('<%- JSON.stringify(curAuditor) %>');
 </script>
 <% if (ctx.stage.status === auditConst.status.uncheck && ctx.session.sessionUser.accountId === ctx.stage.user_id) {%>
 <script>

+ 2 - 4
app/view/stage/stage_sub_menu.ejs

@@ -1,8 +1,6 @@
 <div class="panel-sidebar" id="sub-menu">
-    <div class="panel-title">
-        <div class="title-bar">
-            <h2 class="text-truncate" style="white-space:nowrap; overflow:hidden; text-overflow:ellipsis;" data-toggle="tooltip" data-placement="right" title=""  data-original-title="第<%- ctx.stage.order%>期 - <%- tender.name %>">第<%- ctx.stage.order%>期 - <%- tender.name %></h2>
-        </div>
+    <div class="sidebar-title" data-toggle="tooltip" data-placement="right" data-original-title="第<%- ctx.stage.order%>期 - <%- tender.name %>">
+        第<%- ctx.stage.order%>期 - <%- (tender.name.length > 11 ? tender.name.substring(0,11) + '...' : tender.name) %>
     </div>
     <div class="scrollbar-auto">
         <div class="nav-box">

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

@@ -89,7 +89,7 @@
                         </div>
                     </div>
                     <!--标段设置-->
-                    <div class="col-6 p-0 mb-3">
+                    <div class="col-12 p-0 mb-3">
                         <div class="card">
                             <div class="card-body">
                                 <h5 class="card-title">标段设置</h5>
@@ -104,14 +104,14 @@
                         </div>
                     </div>
                     <!--图表-->
-                    <div class="card mb-3 mr-1">
+                    <div class="card mb-3">
                         <div class="card-body">
                             <h5 class="card-title">期进度表</h5>
                             <div id="chartContainer4" style="height: 300px; width: 100%;">
                             </div>
                         </div>
                     </div>
-                    <div class="card mb-3 mr-1">
+                    <div class="card mb-3">
                         <div class="card-body">
                             <h5 class="card-title">月进度表</h5>
                             <div id="chartContainer3" style="height: 300px; width: 100%;">

+ 2 - 4
app/view/tender/tender_sub_menu.ejs

@@ -1,8 +1,6 @@
 <div class="panel-sidebar" id="sub-menu">
-    <div class="panel-title">
-        <div class="title-bar">
-            <h2 class="text-truncate" data-toggle="tooltip" data-placement="right" title=""  data-original-title="<%- ctx.tender.data.name %>"><%- ctx.tender.data.name %></h2>
-        </div>
+    <div class="sidebar-title" data-toggle="tooltip" data-placement="right" data-original-title="<%- ctx.tender.data.name %>">
+        <%- (ctx.tender.data.name.length > 15 ? ctx.tender.data.name.substring(0,15) + '...' : ctx.tender.data.name) %>
     </div>
     <div class="scrollbar-auto">
         <div class="nav-box">