Przeglądaj źródła

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

MaiXinRong 3 lat temu
rodzic
commit
56eb81f298

+ 24 - 5
app/controller/datacollect_controller.js

@@ -47,10 +47,12 @@ module.exports = app => {
             try {
                 // 获取标段审批信息
                 const tenderidList = [];
-                console.log(ctx.session.sessionProject.dataCollect);
                 const noticeList = await ctx.service.noticePush.getNoticeByDataCollect(ctx.session.sessionProject.id, tenderidList);
+                // 获取分类
+                const categoryData = await this.ctx.service.category.getListByCategoryLevel(ctx.session.sessionProject.id);
                 const renderData = {
                     noticeList,
+                    categoryData,
                     acLedger: auditConst.ledger,
                     acStage: auditConst.stage,
                     acChange: auditConst.flow,
@@ -97,10 +99,27 @@ module.exports = app => {
                     }
                     t.material_tp = await ctx.service.material.getSumMaterial(t.id);
                     // 获取本标段 本月计量期审批通过数目,变更令审批通过数目,台账修订通过数目,材料调差通过数目
-                    t.month_stage_num = await this.ctx.service.stageAudit.getNumByMonth(t.id, startMonth, endMonth);
-                    t.month_change_num = await this.ctx.service.changeAudit.getNumByMonth(t.id, startMonth, endMonth);
-                    t.month_revise_num = await this.ctx.service.reviseAudit.getNumByMonth(t.id, startMonth, endMonth);
-                    t.month_material_num = await this.ctx.service.materialAudit.getNumByMonth(t.id, startMonth, endMonth);
+                    t.month_stage_num = await ctx.service.stageAudit.getNumByMonth(t.id, startMonth, endMonth);
+                    t.month_change_num = await ctx.service.changeAudit.getNumByMonth(t.id, startMonth, endMonth);
+                    t.month_revise_num = await ctx.service.reviseAudit.getNumByMonth(t.id, startMonth, endMonth);
+                    t.month_material_num = await ctx.service.materialAudit.getNumByMonth(t.id, startMonth, endMonth);
+                    // 获取标段计量月统计及截止月累计计量
+                    const stageList = await ctx.service.stage.getStageByDataCollect(t.id);
+                    const month_stage = [];
+                    for (const s of stageList) {
+                        const monthOneStage = ctx.app._.find(month_stage, { yearmonth: s.s_time });
+                        if (monthOneStage) {
+                            monthOneStage.tp = ctx.helper.add(monthOneStage.tp, s.tp);
+                        } else {
+                            const data = {
+                                yearmonth: s.s_time,
+                                tp: s.tp,
+                                end_tp: s.end_tp,
+                            };
+                            month_stage.push(data);
+                        }
+                    }
+                    t.month_stage = month_stage;
                 }
                 responseData.data.tenderList = tenderList;
                 ctx.body = responseData;

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

@@ -83,7 +83,7 @@ font-size: .875rem;
 }
 .custom-control-warning-input:checked ~ .custom-control-warning-label::before{
   border-color:#da9500 ;
-  background-color:#da9500 
+  background-color:#da9500
 }
 .custom-control-warning-label{
   color:#da9500;
@@ -191,23 +191,23 @@ input.nospin[type="number"]{-moz-appearance:textfield;}
 /*滚动条*/
 /* 滚动条 */
 /*水平滚动条的样式*/
-/*::-webkit-scrollbar-thumb:horizontal { 
+/*::-webkit-scrollbar-thumb:horizontal {
 	width: 5px;
 	background-color: #e9ecef;
 	-webkit-border-radius: 0;
 }*/
 /*滚动条的背景颜色,滚动条的圆角宽度*/
 /*::-webkit-scrollbar-track-piece {
-	background-color: #efefef; 
-	-webkit-border-radius: 0; 
+	background-color: #efefef;
+	-webkit-border-radius: 0;
 }*/
 /*滚动条的宽度,滚动条的高度*/
 /*::-webkit-scrollbar {
-	width: 14px; 
-	height: 14px; 
+	width: 14px;
+	height: 14px;
 }*/
 /*垂直滚动条的样式*/
-/*::-webkit-scrollbar-thumb:vertical { 
+/*::-webkit-scrollbar-thumb:vertical {
 	height: 50px;
 	background-color: #e9ecef;
 	-webkit-border-radius: 0;
@@ -216,7 +216,7 @@ input.nospin[type="number"]{-moz-appearance:textfield;}
 	border: 1px solid #ced4da;
 }*/
 /*滚动条的hover样式*/
-/*::-webkit-scrollbar-thumb:hover { 
+/*::-webkit-scrollbar-thumb:hover {
 	height: 50px;
 	background-color: #ced4da;
 	-webkit-border-radius: 0;
@@ -834,7 +834,7 @@ input.nospin[type="number"]{-moz-appearance:textfield;}
   font-size: 14px
 }
 .bd-toc {
-  
+
     position: sticky;
     top:3rem;
     height: calc(100vh - 10rem);
@@ -992,7 +992,7 @@ body{
   line-height: 30px;
 }
 .panel-title > .title-main .btn.pull-right {
-    margin: 5px 0 0 0 
+    margin: 5px 0 0 0
 }
 .panel-content{
   padding-top:35px;
@@ -1206,7 +1206,7 @@ a.maintain-icon .fa{
     }
 }
 
-a.maintain-icon:hover .fa{ 
+a.maintain-icon:hover .fa{
     animation-iteration-count:0
 }
 /*审批列表*/
@@ -1329,10 +1329,10 @@ overflow-y: auto;
   position: relative;
 }
 .circle{
-  width: 62px; 
+  width: 62px;
   height: 62px;
   border-radius: 50%;
-  background: none; 
+  background: none;
   border: 4px solid #D7B014;
 }
 .circle-num{
@@ -1551,7 +1551,7 @@ overflow-y: auto;
 .height-20{
   height: 19%;
 }
-#review_box{
+#review_box, #review_box2{
   height: 100%;
   overflow: hidden;
 }
@@ -1564,7 +1564,7 @@ overflow-y: auto;
   height: -moz-calc(100% - 53px);
   height: calc(100% - 53px);
 }
-#comment1, #comment2{
+#comment1, #comment2, #comment3, #comment4{
   margin: 0;
   padding: 0;
 }
@@ -1719,4 +1719,4 @@ overflow-y: auto;
   font-size: 14px;
   line-height: 18px;
   color: rgba(0, 0, 0, 0.6);
-}
+}

+ 4 - 4
app/public/js/change_information.js

@@ -180,8 +180,8 @@ $(document).ready(() => {
             // const cid = $('#changeId').val();
             // $('#downloadZip').attr('href', `/tender/${tid}/change/${cid}/download/compresse-file?fileIds=${JSON.stringify(fileIds)}`);
             // $('#downloadZip')[0].click();
-            if (fileIds.length > 10) {
-              return toastr.warning(`最大允许10个文件(当前${fileIds.length}个)`);
+            if (fileIds.length > 20) {
+              return toastr.warning(`最大允许20个文件(当前${fileIds.length}个)`);
             }
             const tid = $('#tenderId').val();
             const cid = $('#changeId').val();
@@ -297,7 +297,7 @@ function findDecimal(unit) {
 // 生成附件列表
 function getAllList(currPageNum = 1) {
     // 每页最多几个附件
-    const pageCount = 15;
+    const pageCount = 20;
     // 附件总数
     const total = attData.length;
     // 总页数
@@ -312,7 +312,7 @@ function getAllList(currPageNum = 1) {
     for(const [index,att] of currPageAttData.entries()) {
         html += `<tr>
         <td width="25"><input type="checkbox" class="check-file" file-id=${att.id}></td>
-        <td>${((currPageNum-1)*15)+index+1}</td>
+        <td>${((currPageNum-1)*pageCount)+index+1}</td>
         <td><a href="javascript:void(0)" class="pl-0 col-11 att-file-name" file-id=${att.id}>${att.filename}${att.fileext}</a></td>
         <td>${moment(att.in_time * 1000).format('YYYY-MM-DD')}<br>${bytesToSize(att.filesize)}</td>
         <td>

+ 32 - 0
app/public/js/datacollect_scroll.js

@@ -1,4 +1,5 @@
 window.onload = roll(50);
+window.onload = roll2(50);
 function roll(t) {
     var ul1 = document.getElementById("comment1");
     var ul2 = document.getElementById("comment2");
@@ -23,6 +24,7 @@ function rollStart() {
     var ul1 = document.getElementById("comment1");
     var ul2 = document.getElementById("comment2");
     var ulbox = document.getElementById("review_box");
+    // console.log(ulbox.scrollTop);
     // 正常滚动不断给scrollTop的值+1,当滚动高度大于列表内容高度时恢复为0
     if (ulbox.scrollTop >= ul1.scrollHeight) {
         ulbox.scrollTop = 0;
@@ -30,6 +32,36 @@ function rollStart() {
         ulbox.scrollTop++;
     }
 }
+function roll2(t) {
+    var ul3 = document.getElementById("comment3");
+    var ul4 = document.getElementById("comment4");
+    var ulbox2 = document.getElementById("review_box2");
+    ul4.innerHTML = ul3.innerHTML;
+    ulbox2.scrollTop = 0; // 开始无滚动时设为0
+    // var timer = setInterval(rollStart, t); // 设置定时器,参数t用在这为间隔时间(单位毫秒),参数t越小,滚动速度越快
+    var timer2 = setInterval(rollStart2, '40');
+    ulbox2.onmouseover = function () {
+        clearInterval(timer2);
+    }
+    // 鼠标移出div后继续滚动
+    ulbox2.onmouseout = function () {
+        // timer = setInterval(rollStart, t);
+        timer2 = setInterval(rollStart2, '40');
+    }
+}
+function rollStart2() {
+    // 上面声明的DOM对象为局部对象需要再次声明
+    var ul3 = document.getElementById("comment3");
+    var ul4 = document.getElementById("comment4");
+    var ulbox2 = document.getElementById("review_box2");
+    // console.log(ulbox2.scrollTop);
+    // 正常滚动不断给scrollTop的值+1,当滚动高度大于列表内容高度时恢复为0
+    if (ulbox2.scrollTop >= ul3.scrollHeight) {
+        ulbox2.scrollTop = 0;
+    } else {
+        ulbox2.scrollTop++;
+    }
+}
 
 // tableScroll('tableId', '100%', 30, 10);
 var MyMarhq;

+ 4 - 4
app/public/js/ledger.js

@@ -3631,7 +3631,7 @@ $(document).ready(function() {
       const filename = name.substring(0, name.lastIndexOf("."));
       const fileext = name.substr(name.indexOf("."));
       const filesize = file.size;
-      if (filesize > 10 * 1024 * 1024) {
+      if (filesize > 30 * 1024 * 1024) {
           toastr.error('文件大小过大!');
           $('#change-att-btn').val('');
           return false;
@@ -3677,8 +3677,8 @@ $(document).ready(function() {
       });
 
       if (fileIds.length) {
-        if (fileIds.length > 10) {
-          return toastr.warning(`最大允许10个文件(当前${fileIds.length}个)`)
+        if (fileIds.length > 20) {
+          return toastr.warning(`最大允许20个文件(当前${fileIds.length}个)`)
         }
         toastr.success('正在进行压缩文件...', '', { timeOut: 0, extendedTimeOut: 0})
         $(this).attr('disabled', "true")
@@ -3763,7 +3763,7 @@ function getNodeList(node) {
 // 生成所有附件列表
 function getAllList(currPageNum = 1) {
   // 每页最多几个附件
-  const pageCount = 15;
+  const pageCount = 20;
   // 附件总数
   const total = attData.length;
   // 总页数

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

@@ -9,7 +9,7 @@
 
 $(document).ready(function () {
     // 每页最多几个附件
-    const pageCount = 15;
+    const pageCount = 20;
     // 全局fileData初始化
     let fileData = fileList || []
     // let currPageFileData = [];
@@ -257,8 +257,8 @@ $(document).ready(function () {
         // console.log('fileIds', fileIds)
 
         if (fileIds.length) {
-            if (fileIds.length > 10) {
-              return toastr.warning(`最大允许10个文件(当前${fileIds.length}个)`)
+            if (fileIds.length > 20) {
+              return toastr.warning(`最大允许20个文件(当前${fileIds.length}个)`)
             }
             toastr.success('正在进行下载并压缩文件...', '', { timeOut: 0, extendedTimeOut: 0})
             $(this).attr('disabled', "true");

+ 3 - 3
app/public/js/sr_detail.js

@@ -74,7 +74,7 @@ function customizeStageTreeSetting(setting, customDisplay) {
 // 生成所有附件列表
 function getAllList(currPageNum = 1) {
     // 每页最多几个附件
-    const pageCount = 15;
+    const pageCount = 20;
     // 附件总数
     const total = attData.length;
     // 总页数
@@ -1217,8 +1217,8 @@ $(document).ready(() => {
         });
 
         if (fileIds.length) {
-            if (fileIds.length > 10) {
-              return toastr.warning(`最大允许10个文件(当前${fileIds.length}个)`)
+            if (fileIds.length > 20) {
+              return toastr.warning(`最大允许20个文件(当前${fileIds.length}个)`)
             }
             toastr.success('正在进行压缩文件...', '', { timeOut: 0, extendedTimeOut: 0})
             $(this).attr('disabled', "true")

+ 4 - 4
app/public/js/stage.js

@@ -109,7 +109,7 @@ function initTreeColSettingEvents(setting) {
 // 生成所有附件列表
 function getAllList(currPageNum = 1) {
     // 每页最多几个附件
-    const pageCount = 15;
+    const pageCount = 20;
     // 附件总数
     const total = attData.length;
     // 总页数
@@ -4175,7 +4175,7 @@ $(document).ready(() => {
         const filename = name.substring(0, name.lastIndexOf("."));
         const fileext = name.substr(name.indexOf("."));
         const filesize = file.size;
-        if (filesize > 10 * 1024 * 1024) {
+        if (filesize > 30 * 1024 * 1024) {
             toastr.error('文件大小过大!');
             $('#change-att-btn').val('');
             return false;
@@ -4221,8 +4221,8 @@ $(document).ready(() => {
         });
 
         if (fileIds.length) {
-            if (fileIds.length > 10) {
-              return toastr.warning(`最大允许10个文件(当前${fileIds.length}个)`)
+            if (fileIds.length > 20) {
+              return toastr.warning(`最大允许20个文件(当前${fileIds.length}个)`)
             }
             toastr.success('正在进行压缩文件...', '', { timeOut: 0, extendedTimeOut: 0})
             $(this).attr('disabled', "true")

+ 25 - 0
app/service/category.js

@@ -173,6 +173,31 @@ module.exports = app => {
             }
         }
 
+        /**
+         * 获取项目下全部分类数据
+         *
+         * @param {Number} pid - 标段id
+         * @returns {Promise<*>}
+         */
+        async getListByCategoryLevel(pid) {
+            let data = await this.getAllDataByCondition({ where: { pid }, orders: [['level', 'asc']] });
+            data = this._.filter(data, function(item) {
+                return item.level !== 0;
+            });
+            const values = await this.ctx.service.categoryValue.getAllDataByCondition({
+                where: { pid },
+                orders: [['sort', 'asc'], ['id', 'asc']],
+            });
+            // values 按名称排序
+            // values.sort((a, b) => a.value.localeCompare(b.value, 'zh-Hans-CN', { sensitivity: 'accent' }));
+            for (const d of data) {
+                d.value = values.filter(function (v) {
+                    return v.cid === d.id;
+                });
+            }
+            return data;
+        }
+
     }
 
     return Category;

+ 14 - 0
app/service/stage.js

@@ -693,6 +693,20 @@ module.exports = app => {
             }
             return list;
         }
+
+        async getStageByDataCollect(tenderId) {
+            const stages = await this.db.select(this.tableName, {
+                columns: ['s_time', 'contract_tp', 'qc_tp', 'pre_contract_tp', 'pre_qc_tp'],
+                where: { tid: tenderId },
+                orders: [['order', 'desc']],
+            });
+            for (const s of stages) {
+                s.tp = this.ctx.helper.add(s.contract_tp, s.qc_tp);
+                s.pre_tp = this.ctx.helper.add(s.pre_contract_tp, s.pre_qc_tp);
+                s.end_tp = this.ctx.helper.add(s.pre_tp, s.tp);
+            }
+            return stages;
+        }
     }
 
     return Stage;

+ 3 - 0
app/view/advance/detail.ejs

@@ -94,16 +94,19 @@
                                             <li class="list-group-item" data-auditorId="<%- item.audit_id %>">
                                                 <i class="fa fa fa-play-circle fa-rotate-90"></i> <%- item.name %>
                                                 <small class="text-muted"><%- item.role %></small>
+                                                <span class="pull-right">原报</span>
                                             </li>
                                             <% } else if(idx === auditors.length -1 && idx !== 0) { %>
                                             <li class="list-group-item" data-auditorId="<%- item.audit_id %>">
                                                 <i class="fa fa fa-stop-circle"></i> <%- item.name %>
                                                 <small class="text-muted"><%- item.role %></small>
+                                                <span class="pull-right">终审</span>
                                             </li>
                                             <% } else {%>
                                             <li class="list-group-item" data-auditorId="<%- item.audit_id %>">
                                                 <i class="fa fa-chevron-circle-down"></i> <%- item.name %>
                                                 <small class="text-muted"><%- item.role %></small>
+                                                <span class="pull-right"><%- ctx.helper.transFormToChinese(idx) -%>审</span>
                                             </li>
                                             <% } %>
                                             <% }) %>

Plik diff jest za duży
+ 881 - 238
app/view/datacollect/index.ejs


+ 1 - 0
app/view/wap/dashboard.ejs

@@ -54,6 +54,7 @@
                                 <tr><th>截止上期完成计量</th><td class="text-right"><%- audit.pre_gather_tp ? audit.pre_gather_tp : 0 %></td></tr>
                                 <tr><th>截止本期完成计量</th><td class="text-right"><%- audit.end_gather_tp ? audit.end_gather_tp : 0 %></td></tr>
                                 <tr><th>本期应付</th><td class="text-right"><%- audit.yf_tp ? audit.yf_tp : 0 %></td></tr>
+                                <tr><th>本期实付</th><td class="text-right"><%- audit.sf_tp ? audit.sf_tp : 0 %></td></tr>
                             </table>
                         </div>
                         <div class="">

+ 8 - 0
app/view/wap/shenpi_stage.ejs

@@ -84,6 +84,14 @@
                                 <b>¥<%- stage.yf_tp ? stage.yf_tp : 0 %></b>
                             </td>
                         </tr>
+                        <tr>
+                            <td>
+                                <p class="mb-0">本期实付</p>
+                                <b>¥<%- stage.sf_tp ? stage.sf_tp : 0 %></b>
+                            </td>
+                            <td>
+                            </td>
+                        </tr>
                         </tbody></table>
                 </dd>
             </dl>

+ 8 - 0
app/view/wap/tender.ejs

@@ -178,6 +178,14 @@
                                     <b>¥<%- s.yf_tp ? s.yf_tp : 0 %></b>
                                 </td>
                             </tr>
+                            <tr>
+                                <td>
+                                    <p class="mb-0">本期实付</p>
+                                    <b>¥<%- s.sf_tp ? s.sf_tp : 0 %></b>
+                                </td>
+                                <td>
+                                </td>
+                            </tr>
                             <% if (s.curAuditor && s.status == auditConst.status.checking && s.curAuditor.aid === ctx.session.sessionUser.accountId) { %>
                             <tr>
                                 <td colspan="2">

+ 1 - 1
config/config.local.js

@@ -108,7 +108,7 @@ module.exports = appInfo => {
         },
     };
 
-    config.fujianOssPath = 'https://jiliang-qa-oss.smartcost.com.cn/qa/';
+    config.fujianOssPath = 'https://jiliang-qa-oss-cdn.smartcost.com.cn/qa/';
     config.fujianOssFolder = 'qa/';
 
     // 自带接口系统地址

+ 1 - 1
config/config.qa.js

@@ -70,7 +70,7 @@ module.exports = appInfo => {
         },
     };
 
-    config.fujianOssPath = 'https://jiliang-qa-oss.smartcost.com.cn/qa/';
+    config.fujianOssPath = 'https://jiliang-qa-oss-cdn.smartcost.com.cn/qa/';
     config.fujianOssFolder = 'qa/';
 
     // 自带接口系统地址