浏览代码

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

TonyKang 4 年之前
父节点
当前提交
9d34032d18

+ 1 - 2
app/controller/material_controller.js

@@ -616,8 +616,6 @@ module.exports = app => {
                     const filepath = path.join('public/upload', this.ctx.tender.id.toString(), 'tc', 'fujian_' + create_time + fileInfo.ext);
                     await ctx.helper.saveStreamFile(stream, path.join(this.app.baseDir, 'app', filepath));
                     files.push({ filepath, name: stream.filename });
-                    // 将上传的文件流消费掉,防止浏览器卡死
-                    stream && (await sendToWormhole(stream));
                 }
                 const upload_time = this.ctx.helper.dateTran(new Date());
                 const payload = files.map(file => {
@@ -631,6 +629,7 @@ module.exports = app => {
                         tid: ctx.tender.id,
                         user_id: ctx.session.sessionUser.accountId,
                         mid: ctx.material.id,
+                        s_order: ctx.params.order,
                         upload_time,
                         filepath: file.filepath,
                         file_size: ctx.helper.bytesToSize(idx === 'isString' ? parts.field.size : parts.field.size[idx]),

+ 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;

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

@@ -115,7 +115,7 @@ $(document).ready(function () {
  * @param {Array} files 文件数组
  */
 function validateFiles(files) {
-    const reg = /(doc|docx|excel|xlsx|xls|txt|zip|jpg|jpeg|png|bmp|BMP|JPG|PNG|JPEG)$/;
+    const reg = /(doc|docx|excel|pdf|xlsx|xls|txt|zip|jpg|jpeg|png|bmp|BMP|JPG|PNG|JPEG)$/;
     return files.every(file => {
         if (file.size > 1024 * 1024 * 10) {
             toastr.error('文件大小限制为10MB');

+ 30 - 20
app/public/js/stage.js

@@ -209,9 +209,9 @@ $(document).ready(() => {
                     {title: '变更令号', field: 'p_code', width: 100, formatter: '@', readOnly: true, hAlign: 0, },
                     {title: '名称', field: 'name', width: 120, formatter: '@', readOnly: true, hAlign: 0,},
                     {title: '变更部位', field: 'b_bwmx', width: 100, formatter: '@', readOnly: true, hAlign: 0,},
-                    //{title: '总数量', field: 'b_amount', width: 60, formatter: '@', readOnly: true, hAlign: 2, },
-                    {title: '可变更数量', field: 'vamount', width: 60, readOnly: true, hAlign: 2, getValue: function (data) {return data.vamount ? data.vamount + '' : '0';}},
-                    {title: '本期计量', field: 'uamount', width: 60, formatter: '@', hAlign: 2, type: 'Number', },
+                    //{title: '总数量', field: 'b_amount', width: 60, readOnly: true, hAlign: 2, },
+                    {title: '可变更数量', field: 'vamount', width: 60, readOnly: true, hAlign: 2, type: 'Number', getValue: function (data) {return data.vamount ? data.vamount + '' : '0';}},
+                    {title: '本期计量', field: 'uamount', width: 60, hAlign: 2, type: 'Number', },
                 ],
                 emptyRows: 0,
                 headRows: 1,
@@ -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();
@@ -3049,6 +3056,8 @@ $(document).ready(() => {
         $('#edit-att').hide();
         $('#show-att').show();
         if (att !== undefined) {
+            // 进来先把编辑功能隐藏
+            $('#btn-att a').eq(3).hide()
             $('#show-att tr').eq(0).children('td').text(att.filename + att.fileext);
             const name = att.code !== null && att.code !== '' ? att.code : (att.b_code !== null ? att.b_code : '');
             $('#show-att tr').eq(1).children('td').text($.trim(name + ' ' + att.lname));
@@ -3060,20 +3069,14 @@ $(document).ready(() => {
             // 附件uid等于当前用户id, 附件上传本人
             if (parseInt(cur_uid) === att.uid) {
                 $('#btn-att').show();
-                let showDel = true;
-
-                // 审核完成后再上传的,上传者可删除附件
-                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.checking && stage.user_id === parseInt(cur_uid)) showDel = false;
-
-                // 台账未上报、当前用户为原报, 可以删除附件
-                if (stage.status === auditConst.status.uncheck && stage.user_id !== parseInt(cur_uid)) showDel = false;
-
+                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 (showDel) $('#btn-att a').eq(3).show();
                 // $('#btn-att a').eq(3).show();
                 $('#btn-att a').eq(2).hide();
@@ -3094,6 +3097,7 @@ $(document).ready(() => {
             toastr.error('附件信息获取失败');
         }
     });
+    // $('body').on('click', '.alllist-table a', handleFileList);
     $('body').on('click', '#btn-att a', function () {
         const content = $(this).attr('content');
         const fid = $('#showAttachment').attr('file-id');
@@ -3168,7 +3172,13 @@ $(document).ready(() => {
                 });
                 attData.splice(att_index, 1);
                 // 重新生成List
-                getAllList();
+
+                if ($('#alllist-table tr').length === 1) {
+                    getAllList(parseInt($('#currentPage').text()) - 1);
+
+                } else {
+                    getAllList(parseInt($('#currentPage').text()));
+                }
                 getNodeList(node.id);
                 $('#showAttachment').hide();
                 $('#showAttachment').attr('file-id', '');

+ 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;
             }
         }
     }

+ 7 - 0
app/service/material_audit.js

@@ -423,6 +423,13 @@ module.exports = app => {
             const transaction = await this.db.beginTransaction();
             try {
                 await transaction.update(this.tableName, { id: audit.id, status: checkData.checkType, opinion: checkData.opinion, end_time: time });
+                // 顺移气候审核人流程顺序
+                this.initSqlBuilder();
+                this.sqlBuilder.setAndWhere('mid', { value: materialId, 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);
                 const newAuditors = [];
                 newAuditors.push({
                     tid: audit.tid, mid: audit.mid, aid: preAuditor.aid,

+ 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">

+ 4 - 4
app/view/material/file.ejs

@@ -18,15 +18,15 @@
       <div class="sjs-height-0">
         <table class="table table-bordered">
           <thead>
-            <tr><th width="50">序号</th><th>名称</th><th width="90">大小</th><th width="100">上传时间</th><th width="100">操作</th></tr>
+            <tr><th width="50">序号</th><th>名称</th><th width="90">大小</th><th width="90">调差期</th><th width="150">上传时间</th><th width="100">操作</th></tr>
           </thead>
           <tbody id="file-list">
             <% fileList.forEach(function(file, idx){ %>
               <tr>
                 <td><%=idx + 1%></td>
-                <td>
-                  <a href="/<%- file.filepath %>" target="_blank"><%=file.file_name%></a>
-                </td><td><%=file.file_size%></td>
+                <td><a href="/<%- file.filepath %>" target="_blank"><%=file.file_name%></a></td>
+                <td><%=file.file_size%></td>
+                <td>第<%= file.s_order %>期</td>
                 <td><%=file.upload_time%></td>
                 <td>
                   <% if(material.status !== auditConst.status.checked &&

+ 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">

+ 2 - 4
app/view/spss/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="统计分析">统计分析</h2>
-        </div>
+    <div class="sidebar-title" data-toggle="tooltip" data-placement="right" data-original-title="统计分析">
+        统计分析
     </div>
     <div class="scrollbar-auto">
         <% include ./sub_menu_list.ejs %>

+ 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">

+ 2 - 4
app/view/stage_extra/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%>期 - 其他台账">其他台账</h2>
-        </div>
+    <div class="sidebar-title" data-toggle="tooltip" data-placement="right" data-original-title="第<%- ctx.stage.order%>期 - 其他台账">
+        其他台账
     </div>
     <div class="scrollbar-auto">
         <% include ./sub_menu_list.ejs %>

+ 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">

+ 1 - 0
config/web.js

@@ -547,6 +547,7 @@ const JsFiles = {
                 mergeFiles: [
                     '/public/js/sub_menu.js',
                     '/public/js/material_file.js',
+                    '/public/js/material_audit.js',
                 ],
                 mergeFile: 'material_file',
             },

+ 3 - 0
sql/update.sql

@@ -99,3 +99,6 @@ ALTER TABLE `zh_project_account` ADD `wx_type` TEXT NULL DEFAULT NULL COMMENT '
 
 ALTER TABLE `zh_rpt_custom_define`
 ADD COLUMN `stage_select`  text CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL COMMENT '用户定制信息 - 多期汇总表' AFTER `gather_select`;
+
+ALTER TABLE `calculation`.`zh_material_file`
+ADD COLUMN `s_order` VARCHAR(255) NOT NULL  COMMENT '期数order' AFTER `file_name`;