Browse Source

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

TonyKang 3 years ago
parent
commit
4994921b65

+ 1 - 1
app/controller/change_controller.js

@@ -1108,7 +1108,6 @@ module.exports = app => {
                         fileext: fileInfo.ext,
                         filesize: Array.isArray(parts.field.size) ? parts.field.size[index] : parts.field.size,
                         filepath,
-                        orginpath: ctx.app.config.fujianOssPath + filepath,
                         extra_upload,
                     };
                     const result = await ctx.service.changeAtt.save(parts.field, fileData, ctx.session.sessionUser.accountId);
@@ -1119,6 +1118,7 @@ module.exports = app => {
                     // fileData.filesize = await ctx.helper.bytesToSize(fileData.filesize);
                     fileData.uid = ctx.session.sessionUser.accountId;
                     fileData.id = result.insertId;
+                    fileData.orginpath = ctx.app.config.fujianOssPath + filepath;
                     delete fileData.filepath;
                     files.push(fileData);
                     ++index;

+ 2 - 0
app/controller/ledger_controller.js

@@ -160,6 +160,7 @@ module.exports = app => {
                 }
 
                 const whiteList = this.ctx.app.config.multipart.whitelist;
+                const categoryData = await this.ctx.service.category.getAllCategory(this.ctx.session.sessionProject.id);
                 const renderData = {
                     tender: tender.data,
                     tenderInfo: tender.info,
@@ -180,6 +181,7 @@ module.exports = app => {
                     stdChapters,
                     dealBillsPermission: this._canUpdateDealBills(tender.data, auditors.filter(x => {return x.audit_order > 0})),
                     shenpiConst,
+                    categoryData,
                 };
                 if ((tender.data.ledger_status === auditConst.status.uncheck || tender.data.ledger_status === auditConst.status.checkNo) && tender.data.user_id === ctx.session.sessionUser.accountId) {
                     // renderData.accountGroup = accountGroup;

+ 3 - 0
app/controller/revise_controller.js

@@ -345,6 +345,7 @@ module.exports = app => {
             renderData.readOnly = true;
             renderData.history = true;
             renderData.historyRevise = await ctx.service.ledgerRevise.getAllReviseList(ctx.tender.id);
+            renderData.categoryData = await this.ctx.service.category.getAllCategory(this.ctx.session.sessionProject.id);
             await this.layout('revise/info.ejs', renderData, 'revise/info_modal.ejs');
         }
 
@@ -363,6 +364,7 @@ module.exports = app => {
             renderData.history = false;
             renderData.historyRevise = [];
             renderData.curAuditor = await ctx.service.reviseAudit.getCurAuditor(revise.id, revise.times);
+            renderData.categoryData = await this.ctx.service.category.getAllCategory(this.ctx.session.sessionProject.id);
             await this.layout('revise/info.ejs', renderData, 'revise/info_modal.ejs');
         }
 
@@ -385,6 +387,7 @@ module.exports = app => {
             });
             renderData.auditorList = await ctx.service.reviseAudit.getAuditors(revise.id, revise.times);
             renderData.curAuditor = await ctx.service.reviseAudit.getCurAuditor(revise.id, revise.times);
+            renderData.categoryData = await this.ctx.service.category.getAllCategory(this.ctx.session.sessionProject.id);
             await this.layout('revise/info.ejs', renderData, 'revise/info_modal.ejs');
         }
 

+ 1 - 0
app/controller/stage_controller.js

@@ -207,6 +207,7 @@ module.exports = app => {
                 renderData.sfAttDelPower = ctx.session.sessionUser.accountId === ctx.stage.user_id || ctx.helper._.findIndex(ctx.stage.auditors2, { aid: ctx.session.sessionUser.accountId }) !== -1;
                 const projectFunInfo = await this.ctx.service.project.getFunRela(ctx.session.sessionProject.id);
                 renderData.hintOver = projectFunInfo.hintOver && ctx.tender.info.fun_rela.hintOver;
+                renderData.categoryData = await this.ctx.service.category.getAllCategory(this.ctx.session.sessionProject.id);
                 await this.layout('stage/index.ejs', renderData, 'stage/modal.ejs');
             } catch (err) {
                 this.log(err);

+ 4 - 1
app/controller/tender_controller.js

@@ -178,6 +178,8 @@ module.exports = app => {
                 renderData.tenderList = await this.ctx.service.tender.getList(list_status, renderData.userPermission, this.ctx.session.sessionUser.is_admin);
 
                 for (const t of renderData.tenderList) {
+                    const tenderInfo = await this.ctx.service.tenderInfo.getTenderInfo(t.id);
+                    t.deal_tp = tenderInfo.deal_param.contractPrice;
                     if (t.ledger_status === auditConst.ledger.status.checked) {
                         t.lastStage = await this.ctx.service.stage.getLastestStage(t.id, true);
                         t.completeStage = await this.ctx.service.stage.getLastestCompleteStage(t.id);
@@ -1272,8 +1274,9 @@ module.exports = app => {
                         throw '数据错误';
                 }
             } catch (err) {
+                console.log(err);
                 this.log(err);
-                this.ajaxErrorBody(err, '导入数据失败');
+                ctx.ajaxErrorBody(err, '导入数据失败');
             }
         }
 

+ 2 - 2
app/extend/context.js

@@ -48,9 +48,9 @@ module.exports = {
 
     ajaxErrorBody(error, msg) {
         if (error.stack) {
-            return {err: 4, msg: msg, data: null};
+            this.body = {err: 4, msg: msg, data: null};
         } else {
-            return {err: 3, msg: error.toString(), data: null};
+            this.body = {err: 3, msg: error.toString(), data: null};
         }
     },
 

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

@@ -618,7 +618,7 @@ $(document).ready(() => {
                         const select = SpreadJsObj.getSelectObject(changeSpreadSheet);
                         const sel = changeSpreadSheet.getSelections()[0];
                         changeSpreadObj.resetXmjSpread(select);
-                        console.log(select, sel);
+                        // console.log(select, sel);
                         if (!readOnly && select && sel.row !== changeSpreadSheet.getRowCount() - 1 && !_.find(changeUsedData, { id: select.id })) {
                             return false;
                         } else {
@@ -1165,7 +1165,7 @@ function tableDataRemake(changeListData) {
                                 (leafInfo.mx_id ? leafInfo.mx_id : '') + '!_!' +
                                 (leafInfo.bwmx !== undefined ? leafInfo.bwmx : (listinfo.leafXmjs.length > 1 && listinfo.name ? listinfo.name : (leafInfo.jldy !== undefined ? leafInfo.jldy : ''))) + '*;*' + (leafInfo.quantity !== null ? leafInfo.quantity : 0);
                         } else {
-                            console.log(clinfo, listinfo.leafXmjs);
+                            // console.log(clinfo, listinfo.leafXmjs);
                             toastr.warning('台账清单列表已不存在'+ clinfo.code +',已更新变更清单列表');
                             // changeList.splice(index, 1);
                             removeList.push(clinfo);
@@ -1216,7 +1216,7 @@ function tableDataRemake(changeListData) {
             }
         }
         if(updateList.length > 0) {
-            console.log(updateList);
+            // console.log(updateList);
             postData(window.location.pathname + '/save', { type:'update_list', updateData: updateList }, function (result) {
             }, function () {
             });

+ 2 - 2
app/public/js/change_set.js

@@ -68,7 +68,7 @@ $(document).ready(() => {
             }
         }
         changeListData = gclGatherData.concat(dealBillList).sort(sortByCode);
-        console.log(changeListData);
+        // console.log(changeListData);
         // 先加载台账数据
         let listHtml = '';
         let list_index = 1;
@@ -724,7 +724,7 @@ function tableDataRemake(changeListData) {
                     const leafInfo = listinfo.leafXmjs.find(function (item) {
                         return (item.bwmx === undefined || item.bwmx === clinfo[2]) && (item.quantity !== null ? item.quantity === parseFloat(clinfo[5]) : 0 === parseFloat(clinfo[5]));
                     });
-                    console.log(leafInfo);
+                    // console.log(leafInfo);
                     if (leafInfo) {
                         pushbwmx = leafInfo.code + '!_!' + (leafInfo.jldy !== undefined ? leafInfo.jldy : '') + '!_!' + (leafInfo.gcl_id ? leafInfo.gcl_id : '') + '!_!' + (leafInfo.bwmx !== undefined ? leafInfo.bwmx : '') + '*;*' + (leafInfo.quantity !== null ? leafInfo.quantity : 0);
                     } else {

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

@@ -198,18 +198,18 @@ function checkValidForm() {
 }
 $(window).resize(checkTableWidth);
 function checkTableWidth() {
-    if($('table th').eq(2).outerWidth() < 107) {
-        $('table th').eq(2).html('本期<br>合同计量');
-        $('table th').eq(3).html('本期数量<br>变更计量');
-        $('table th').eq(4).html('本期<br>完成计量');
-        $('table th').eq(5).html('截止上期<br>完成计量');
-        $('table th').eq(6).html('截止本期<br>完成计量');
+    if($('table th').eq(3).outerWidth() < 107) {
+        $('table th').eq(3).html('本期<br>合同计量');
+        $('table th').eq(4).html('本期数量<br>变更计量');
+        $('table th').eq(5).html('本期<br>完成计量');
+        $('table th').eq(6).html('截止上期<br>完成计量');
+        $('table th').eq(7).html('截止本期<br>完成计量');
     } else {
-        $('table th').eq(2).html('本期合同计量');
-        $('table th').eq(3).html('本期数量变更计量');
-        $('table th').eq(4).html('本期完成计量');
-        $('table th').eq(5).html('截止上期完成计量');
-        $('table th').eq(6).html('截止本期完成计量');
+        $('table th').eq(3).html('本期合同计量');
+        $('table th').eq(4).html('本期数量变更计量');
+        $('table th').eq(5).html('本期完成计量');
+        $('table th').eq(6).html('截止上期完成计量');
+        $('table th').eq(7).html('截止本期完成计量');
     }
 }
 

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

@@ -115,7 +115,7 @@ $(function () {
         }
         ledgerTree.sortTreeNode(true);
         // treeCalc.calculateAll(ledgerTree);
-        console.log(ledgerTree);
+        // console.log(ledgerTree);
 
         SpreadJsObj.loadSheetData(ledgerSpread.getActiveSheet(), SpreadJsObj.DataType.Tree, ledgerTree);
     }, null, true);
@@ -230,7 +230,7 @@ $(function () {
         // 重新计算每一期计量进度金额并提交
         const stageTpList = calcStageTp(under_ledger);
         const stageSjTp = calcStageSjTp(under_ledger);
-        console.log(under_ledger, stageSjTp);
+        // console.log(under_ledger, stageSjTp);
         postData(window.location.pathname + '/save',  { select_ledger: _.map(select_ledger, 'ledger_id'), under_ledger, parent_ledger, stageTpList, stageSjTp, type: 'sz' } , function (result) {
             toastr.success('设置成功');
             setTimeout(function () {
@@ -264,7 +264,7 @@ $(function () {
         // 重新计算每一期计量进度金额并提交
         const stageTpList = calcStageTp(under_ledger);
         const stageSjTp = calcStageSjTp(under_ledger);
-        console.log(stageSjTp);
+        // console.log(stageSjTp);
         postData(window.location.pathname + '/save',  { select_ledger: _.map(select_ledger, 'ledger_id'), under_ledger, parent_ledger, stageTpList, stageSjTp, type: 'xz' } , function (result) {
             toastr.success('进度台账数据修正成功');
             setTimeout(function () {

+ 34 - 15
app/public/js/sr_detail.js

@@ -83,6 +83,7 @@ function getAllList(currPageNum = 1) {
     $('#currentPage').text(total === 0 ? 0 : currPageNum);
     // 当前页附件内容
     const currPageAttData = attData.slice((currPageNum-1)*pageCount, currPageNum*pageCount);
+    currPageFileData = currPageAttData;
     let html = '';
     for(const att of currPageAttData) {
         html += `<tr>
@@ -142,7 +143,7 @@ function getHintMsg () {
     }
 }
 
-
+let currPageFileData = [];
 $(document).ready(() => {
     let detail, searchLedger;
     // 界面布局
@@ -1221,20 +1222,38 @@ $(document).ready(() => {
             }
             toastr.success('正在进行压缩文件...', '', { timeOut: 0, extendedTimeOut: 0})
             $(this).attr('disabled', "true")
-            const btn = $(this)
-            postCompressFile(`/tender/${relaTender.id}/measure/stage/${relaStage.order}/download/compresse-file`, {fileIds}, function(result) {
-              toastr.clear()
-              toastr.success('压缩文件成功')
-              btn.removeAttr('disabled')
-              const href = window.URL.createObjectURL(result)
-              $('#zipDown').attr('href', href);
-              $('#zipDown').attr('download', `${relaTender.name}-计量台账-第${relaStage.order}期-附件.zip`);
-              $("#zipDown")[0].click();
-            }, () => {
-              btn.removeAttr('disabled')
-              toastr.clear()
-              toastr.error('批量下载失败')
-            });
+            const btn = $(this);
+
+            const fileArr = [];
+            for (const id of fileIds) {
+                const fileInfo = _.find(currPageFileData, { id: parseInt(id) });
+                fileArr.push({
+                    url: fileInfo.orginpath, //文件的oss存储路径 (必填)
+                    name: fileInfo.filename, // 文件名 (可选, 不需要填扩展名)
+                    foldPath: '' // (可选, 文件在压缩包中的存储路径)
+                });
+            }
+            const packageName = `${relaTender.name}-计量台账-第${relaStage.order}期-附件.zip`;
+            try {
+                zipOss.downloadFromAliOss(fileArr, packageName, btn);
+            } catch (e) {
+                btn.removeAttr('disabled');
+                toastr.clear();
+                toastr.error('批量下载失败');
+            }
+            // postCompressFile(`/tender/${relaTender.id}/measure/stage/${relaStage.order}/download/compresse-file`, {fileIds}, function(result) {
+            //   toastr.clear()
+            //   toastr.success('压缩文件成功')
+            //   btn.removeAttr('disabled')
+            //   const href = window.URL.createObjectURL(result)
+            //   $('#zipDown').attr('href', href);
+            //   $('#zipDown').attr('download', `${relaTender.name}-计量台账-第${relaStage.order}期-附件.zip`);
+            //   $("#zipDown")[0].click();
+            // }, () => {
+            //   btn.removeAttr('disabled')
+            //   toastr.clear()
+            //   toastr.error('批量下载失败')
+            // });
         }
     });
 

+ 13 - 6
app/public/js/tender_list_info.js

@@ -201,6 +201,7 @@ function calculateParent(node) {
         node.yf_tp = 0;
         node.end_yf_tp = 0;
         node.advance_tp = 0;
+        node.deal_tp = 0;
         for (const c of node.children) {
             calculateParent(c);
             node.total_price = ZhCalc.add(node.total_price, c.total_price);
@@ -212,6 +213,7 @@ function calculateParent(node) {
             node.yf_tp = ZhCalc.add(node.yf_tp, c.yf_tp);
             node.end_yf_tp = ZhCalc.add(node.end_yf_tp, c.end_yf_tp);
             node.advance_tp = ZhCalc.add(node.advance_tp, c.advance_tp);
+            node.deal_tp = ZhCalc.add(node.deal_tp, c.deal_tp);
         }
     }
 }
@@ -300,7 +302,7 @@ function recursiveGetTenderNodeHtml (node, arr, pid) {
     const html = [];
     html.push('<tr pid="' + pid + '">');
     // 名称
-    html.push('<td style="width: 20%" class="in-' + node.level + '">');
+    html.push('<td style="width: 14%" class="in-' + node.level + '">');
     if (node.cid) {
         html.push('<span onselectstart="return false" style="{-moz-user-select:none}" class="fold-switch mr-1" title="收起" cid="'+ node.sort_id +'"><i class="fa fa-minus-square-o"></i></span> <i class="fa fa-folder-o"></i> ', node.name);
     } else {
@@ -312,7 +314,7 @@ function recursiveGetTenderNodeHtml (node, arr, pid) {
     }
     html.push('</td>');
     // 计量模式
-    html.push('<td style="width: 6%" class="text-center">');
+    html.push('<td style="width: 5%" class="text-center">');
     if (node.measure_type) {
         html.push(node.measure_type === measureType.tz.value ? '0号台账' : '工程量清单');
     }
@@ -330,11 +332,15 @@ function recursiveGetTenderNodeHtml (node, arr, pid) {
     }
     html.push('</td>');
     // 上一流程审批时间
-    html.push('<td style="width: 8%">');
+    html.push('<td style="width: 7%">');
     if (!node.cid && node.pre_flow) {
         html.push(node.pre_flow.name + ' ' + moment(node.pre_flow.time).format('YYYY-MM-DD'));
     }
     html.push('</td>');
+    // 签约合同价
+    html.push('<td style="width: 6%" class="text-right">');
+    html.push(node.deal_tp || '');
+    html.push('</td>');
     // 0号台账合同
     html.push('<td style="width: 6%" class="text-right">');
     html.push(node.total_price || '');
@@ -385,11 +391,12 @@ function getTenderTreeHtml () {
         const html = [];
         html.push('<table class="table table-hover table-bordered">');
         html.push('<thead style="position: fixed;left:56px;top: 34px;">', '<tr>');
-        html.push('<th class="text-center" style="width: 20%">', '标段名称', '</th>');
-        html.push('<th class="text-center" style="width: 6%">', '计量模式', '</th>');
+        html.push('<th class="text-center" style="width: 14%">', '标段名称', '</th>');
+        html.push('<th class="text-center" style="width: 5%">', '计量模式', '</th>');
         html.push('<th class="text-center" style="width: 6%">', '计量进度', '</th>');
         html.push('<th class="text-center" style="width: 6%">', '当前流程', '</th>');
-        html.push('<th class="text-center" style="width: 8%">', '上一流程审批时间', '</th>');
+        html.push('<th class="text-center" style="width: 7%">', '上一流程审批时间', '</th>');
+        html.push('<th class="text-center" style="width: 6%">', '签约合同价', '</th>');
         html.push('<th class="text-center" style="width: 6%">', '0号台账', '</th>');
         html.push('<th class="text-center" style="width: 6%">', '本期完成', '</th>');
         html.push('<th class="text-center" style="width: 6%">', '截止本期合同', '</th>');

+ 15 - 9
app/public/js/tender_list_progress.js

@@ -197,6 +197,7 @@ function calculateParent(node) {
         node.gather_tp = 0;
         node.sum_tp = 0;
         node.lastStage = 0;
+        node.deal_tp = 0;
         for (const c of node.children) {
             calculateParent(c);
             node.end_qc_tp = ZhCalc.add(node.end_qc_tp, c.end_qc_tp);
@@ -206,6 +207,7 @@ function calculateParent(node) {
             node.lastStage = c.cid
                 ? Math.max(node.lastStage, c.lastStage)
                 : (c.lastStage ? Math.max(node.lastStage, c.lastStage.order) : node.lastStage);
+            node.deal_tp = ZhCalc.add(node.deal_tp, c.deal_tp);
         }
     }
 }
@@ -322,26 +324,29 @@ function recursiveGetTenderNodeHtml (node, arr, pid) {
     }
     html.push('</td>');
     // 计量进度
-    html.push('<td style="width: 10%">');
+    html.push('<td style="width: 8%">');
     if (!node.cid && node.cur_flow) {
         html.push(node.cur_flow.title + ' (' + '<span class="' + node.cur_flow.status_class +'">' + node.cur_flow.status + '</span>' + ')');
     }
     html.push('</td>');
     // 当前流程
-    html.push('<td style="width: 10%">');
+    html.push('<td style="width: 8%">');
     if (!node.cid && node.cur_flow) {
         html.push(node.cur_flow.name + ' ' + '<span class="' + node.cur_flow.status_class +'">' + node.cur_flow.status + '</span>');
     }
     html.push('</td>');
     // 上一流程审批时间
-    html.push('<td style="width: 10%">');
+    html.push('<td style="width: 8%">');
     if (!node.cid && node.pre_flow) {
         html.push(node.pre_flow.name + ' ' + moment(node.pre_flow.time).format('YYYY-MM-DD'));
     }
     html.push('</td>');
+    // 签约合同价
+    html.push('<td width="8%" class="text-right">');
+    html.push(node.deal_tp ? node.deal_tp : '');
+    html.push('</td>');
     // 总价
-    html.push('<td width="10%" class="text-right">');
-    const sum = node.lastStage ? ZhCalc.add(node.total_price, node.lastStage.end_qc_tp) : node.total_price;
+    html.push('<td width="8%" class="text-right">');
     html.push(node.sum_tp ? node.sum_tp : '');
     html.push('</td>');
     // 截止本期累计完成/本期完成/未完成
@@ -367,10 +372,11 @@ function getTenderTreeHtml () {
         html.push('<table class="table table-hover table-bordered">');
         html.push('<thead style="position: fixed;left:56px;top: 34px;">', '<tr>');
         html.push('<th style="width: 25%" class="text-center">', '标段名称', '</th>');
-        html.push('<th class="text-center" style="width: 10%">', '计量进度', '</th>');
-        html.push('<th class="text-center" style="width: 10%">', '当前流程', '</th>');
-        html.push('<th class="text-center" style="width: 10%">', '上一流程审批时间', '</th>');
-        html.push('<th style="width: 10%" class="text-center">', '总价 <i class="fa fa-question-circle text-primary"  data-placement="bottom" data-toggle="tooltip" data-original-title="0号台账+截止本期数量变更"></i>', '</th>');
+        html.push('<th class="text-center" style="width: 8%">', '计量进度', '</th>');
+        html.push('<th class="text-center" style="width: 8%">', '当前流程', '</th>');
+        html.push('<th class="text-center" style="width: 8%">', '上一流程审批时间', '</th>');
+        html.push('<th class="text-center" style="width: 8%">', '签约合同价', '</th>');
+        html.push('<th style="width: 8%" class="text-center">', '总价 <i class="fa fa-question-circle text-primary"  data-placement="bottom" data-toggle="tooltip" data-original-title="0号台账+截止本期数量变更"></i>', '</th>');
         html.push('<th style="width: 35%" class="text-center">', '截止上期完成/本期完成/未完成', '</th>');
         html.push('</tr>', '</thead>');
         parentId = 0;

+ 31 - 4
app/public/report/js/rpt_custom.js

@@ -330,7 +330,6 @@ const rptCustomObj = (function () {
     };
 
     const reloadReportData = function (result) {
-        // hintBox.unWaitBox();
         let pageRst = result.data;
         if (result.signatureRelInfo && result.signatureRelInfo.length > 0) {
             CURRENT_ROLE_REL_ID = result.signatureRelInfo[0].id;
@@ -346,7 +345,6 @@ const rptCustomObj = (function () {
             CURRENT_ROLE_REL_ID = -1;
             ROLE_REL_LIST = [];
         }
-        // if (ROLE_REL_LIST)
         let canvas = zTreeOprObj.canvas;
         if (pageRst && pageRst.items && pageRst.items.length > 0) {
             zTreeOprObj.resetAfter(pageRst);
@@ -378,7 +376,6 @@ const rptCustomObj = (function () {
                 for (const k in result.debugInfo.key) {
                     console.log(k + ':', ...result.debugInfo.key[k]);
                 }
-                //console.log(result.debugInfo.key);
                 console.log('其他debug信息:');
                 for (const di of result.debugInfo.other) {
                     console.log(...di);
@@ -671,7 +668,7 @@ const rptCustomObj = (function () {
         for (const topItem of topTreeNodes) {
             _pushRptLine(topItem, 0);
         }
-    }
+    };
 
     const initTenderTree = function (tenders, category) {
         const gsSpread = SpreadJsObj.createNewSpread($('#gather-source-spread')[0]);
@@ -782,8 +779,38 @@ const rptCustomObj = (function () {
         }
     };
 
+    const postReportData = function (url, params, successCallback, errorCallBack, showWaiting = true) {
+        if (showWaiting) showWaitingView();
+        $.ajax({
+            type:"POST",
+            url: url,
+            data: {'params': JSON.stringify(params)},
+            dataType: 'json',
+            cache: false,
+            timeout: 60000,
+            beforeSend: function(xhr) {
+                let csrfToken = Cookies.get('csrfToken_j');
+                xhr.setRequestHeader('x-csrf-token', csrfToken);
+            },
+            success: function(result){
+                successCallback(result);
+                if (showWaiting) closeWaitingView();
+            },
+            error: function(jqXHR, textStatus, errorThrown){
+                toastr.error('error: ' + textStatus + " " + errorThrown);
+                if (errorCallBack) {
+                    errorCallBack();
+                }
+                if (showWaiting) closeWaitingView();
+            }
+        });
+    };
+
     const changeMaterial = function (obj) {
         $('#material-select').attr('m-order', $(obj).attr('m-order')).html(obj.innerText);
+        const data = {};
+        getCommonParams(data);
+        postReportData('/tender/report_api/getReport', data, reloadReportData);
     };
 
     return {

+ 2 - 2
app/service/material_list_notjoin.js

@@ -97,8 +97,8 @@ module.exports = app => {
             const materialListData = await this.ctx.service.materialList.getAllDataByCondition({
                 where: searchSql,
             });
-            console.log(data);
-            console.log(materialListData);
+            // console.log(data);
+            // console.log(materialListData);
             if (materialListData && materialListData.length !== 0) {
                 // 对应修改更新本期应耗数量值和总的本期金额计算
                 const mbIdList = [];

+ 2 - 2
app/service/revise_pos.js

@@ -174,7 +174,7 @@ module.exports = app => {
         }
 
         async updatePosArr(tid, data) {
-            console.log(data);
+            // console.log(data);
             if (data.length === 0) return;
             const op = await this.getDataById(data[0].id);
             const bills = await this.ctx.service.reviseBills.getDataById(op.lid);
@@ -364,4 +364,4 @@ module.exports = app => {
     }
 
     return RevisePos;
-};
+};

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

@@ -121,7 +121,7 @@
                                     <% if (ctx.session.sessionProject.page_show.openChangeRevise) { %>
                                     <select class="input-group-text" id="select-list">
                                         <option value="0" selected>所有清单</option>
-                                        <option value="1">新增部位</option>
+                                        <option value="1">新增清单</option>
                                     </select>
                                     <% } %>
                                 </div>

+ 14 - 10
app/view/measure/stage.ejs

@@ -24,16 +24,16 @@
                 <table class="table table-bordered">
                     <thead>
                     <tr>
-                        <th class="text-center" width="80px">计量期数</th>
+                        <th class="text-center" width="70px">计量期数</th>
                         <th class="text-center" width="70px">计量月份</th>
-                        <th class="text-center" width="70px">计量周期</th>
-                        <th class="text-center" width="110px">本期合同计量</th>
-                        <th class="text-center" width="110px">本期数量变更计量</th>
-                        <th class="text-center" width="110px">本期完成计量</th>
-                        <th class="text-center" width="110px">截止上期完成计量</th>
-                        <th class="text-center" width="110px">截止本期完成计量</th>
-                        <th class="text-center" width="110px">本期应付</th>
-                        <th class="text-center" width="110px">本期实付</th>
+                        <th class="text-center" width="70px">截止日期</th>
+                        <th class="text-center" width="100px">本期合同计量</th>
+                        <th class="text-center" width="100px">本期数量变更计量</th>
+                        <th class="text-center" width="100px">本期完成计量</th>
+                        <th class="text-center" width="100px">截止上期完成计量</th>
+                        <th class="text-center" width="100px">截止本期完成计量</th>
+                        <th class="text-center" width="100px">本期应付</th>
+                        <th class="text-center" width="100px">本期实付</th>
                         <th class="text-center" width="200px">审批进度</th>
                         <th class="text-center" width="90px">操作</th>
                     </tr>
@@ -48,7 +48,11 @@
                             <% } %>
                         </td>
                         <td class="text-center"><%- s.s_time %></td>
-                        <td class="text-center"><%- s.period %></td>
+                        <td class="text-center">
+                            <span data-toggle="tooltip" data-placement="bottom" data-original-title="<%- (s.period ? s.period : '') %>">
+                                <%- (s.period ? s.period.split('~')[1] : '') %>
+                            </span>
+                        </td>
                         <% if (ctx.tender.info.display.thousandth) { %>
                         <td class="text-right"><%- (s.contract_tp ? ctx.helper.formatNum(s.contract_tp, '#,##0.######') : '')%></td>
                         <td class="text-right"><%- (s.qc_tp ? ctx.helper.formatNum(s.qc_tp, '#,##0.######') : '')%></td>

+ 4 - 1
app/view/shares/tender_select_modal.ejs

@@ -37,4 +37,7 @@
             </div>
         </div>
     </div>
-</div>
+</div>
+<script>
+    const category = JSON.parse('<%- JSON.stringify(categoryData) %>');
+</script>

+ 1 - 2
app/view/stage/detail_modal.ejs

@@ -10,7 +10,6 @@
                     <label>中间计量模式 <a href="/public/images/example/jiliangmoshi.png" target="_blank" data-toggle="tooltip" data-placement="bottom" data-original-title="点击查看相关报表"><i class="fa fa-question-circle-o"></i></a></label>
                     <div class="row" id="im-type">
                         <% for (const i in imType) { %>
-                        <% console.log(ctx.stage.im_type === imType[i].value); %>
                         <div class="col-4">
                             <div class="card border-primary" name="im-type" im-type="<%- imType[i].value %>" <% if (ctx.stage.im_type !== imType[i].value) { %>style="cursor:pointer;"<% } %>>
                                 <div class="card-body<% if (ctx.stage.im_type === imType[i].value) { %> text-primary<% } %>">
@@ -164,4 +163,4 @@
         </div>
     </div>
 </div>
-<% include ./audit_modal.ejs %>
+<% include ./audit_modal.ejs %>

+ 2 - 2
app/view/stage/measure.ejs

@@ -7,7 +7,7 @@
                         <li class="nav-item"><a class="nav-link" href="/stage">返回</a></li>
                         <li class="nav-item"><a class="nav-link active" href="/stage/<%- stage.order %>/measure">本期计量台账</a></li>
                         <li class="nav-item"><a class="nav-link" href="/stage/<%- stage.order %>/deal">合同支付</a></li>
-                        <li class="nav-item"><a class="nav-link" href="/stage/<%- stage.order %>/report">报表</a></li>
+                        <li class="nav-item"><a class="nav-link" href="/stage/<%- stage.order %>/report">输出报表</a></li>
                     </ul>
                 </div>
             </div>
@@ -466,4 +466,4 @@
             </ul>
         </div>
     </div>
-</div>
+</div>

+ 1 - 1
app/view/stage/report.ejs

@@ -7,7 +7,7 @@
                         <li class="nav-item"><a class="nav-link" href="/stage">返回</a></li>
                         <li class="nav-item"><a class="nav-link active" href="/stage/<%- stage.order %>/measure">本期计量台账</a></li>
                         <li class="nav-item"><a class="nav-link" href="/stage/<%- stage.order %>/deal">合同支付</a></li>
-                        <li class="nav-item"><a class="nav-link" href="/stage/<%- stage.order %>/report">报表</a></li>
+                        <li class="nav-item"><a class="nav-link" href="/stage/<%- stage.order %>/report">输出报表</a></li>
                     </ul>
                 </div>
             </div>

+ 1 - 1
app/view/stage/stage_sub_menu.ejs

@@ -73,7 +73,7 @@
         <div class="nav-box">
             <ul class="nav-list list-unstyled">
                 <li class="<% if (ctx.url === '/tender/' + ctx.tender.id + '/measure/stage/' + ctx.stage.order + '/report') { %>active<% } %>">
-                    <a href="/tender/<%- ctx.tender.id %>/measure/stage/<%- ctx.stage.order %>/report"><span class="ml-3">报表</span></a>
+                    <a href="/tender/<%- ctx.tender.id %>/measure/stage/<%- ctx.stage.order %>/report"><span class="ml-3">输出报表</span></a>
                 </li>
             </ul>
         </div>

+ 1 - 1
app/view/stage/stage_sub_mini_menu.ejs

@@ -75,7 +75,7 @@
         <div class="nav-box">
             <ul class="nav-list list-unstyled">
                 <li class="<% if (ctx.url === '/tender/' + ctx.tender.id + '/measure/stage/' + ctx.stage.order + '/report') { %>active<% } %>">
-                    <a href="/tender/<%- ctx.tender.id %>/measure/stage/<%- ctx.stage.order %>/report"><span class="ml-3">报表</span></a>
+                    <a href="/tender/<%- ctx.tender.id %>/measure/stage/<%- ctx.stage.order %>/report"><span class="ml-3">输出报表</span></a>
                 </li>
             </ul>
         </div>

+ 1 - 1
app/view/tender/tender_sub_menu.ejs

@@ -55,7 +55,7 @@
         <% } %>
         <div class="nav-box">
             <ul class="nav-list list-unstyled">
-                <li <% if (ctx.url === '/tender/' + ctx.tender.id + '/report') { %>class="active"<% } %>><a href="/tender/<%- ctx.tender.id %>/report" class="h3"><i class="fa fa-file-text-o fa-fw"></i> <span>报表</span></a></li>
+                <li <% if (ctx.url === '/tender/' + ctx.tender.id + '/report') { %>class="active"<% } %>><a href="/tender/<%- ctx.tender.id %>/report" class="h3"><i class="fa fa-file-text-o fa-fw"></i> <span>输出报表</span></a></li>
             </ul>
         </div>
         <div class="nav-box">

+ 1 - 1
app/view/tender/tender_sub_mini_menu.ejs

@@ -57,7 +57,7 @@
         <% } %>
         <div class="nav-box">
             <ul class="nav-list list-unstyled">
-                <li <% if (ctx.url === '/tender/' + ctx.tender.id + '/report') { %>class="active"<% } %>><a href="/tender/<%- ctx.tender.id %>/report" class="h3"><i class="fa fa-file-text-o fa-fw"></i> <span>报表</span></a></li>
+                <li <% if (ctx.url === '/tender/' + ctx.tender.id + '/report') { %>class="active"<% } %>><a href="/tender/<%- ctx.tender.id %>/report" class="h3"><i class="fa fa-file-text-o fa-fw"></i> <span>输出报表</span></a></li>
             </ul>
         </div>
         <% if (ctx.session.sessionProject.page_show.openNetCaSign) { %>

+ 4 - 4
config/menu.js

@@ -117,11 +117,11 @@ const tenderMenu = {
         ],
     },
     report: {
-        name: '报表',
+        name: '输出报表',
         display: false,
         children: [
             {
-                name: '报表',
+                name: '输出报表',
                 icon: '<i class="fa fa-file-text-o"></i> ',
                 display: true,
                 url: '/report',
@@ -223,11 +223,11 @@ const stageMenu = {
         ],
     },
     report: {
-        name: '报表',
+        name: '输出报表',
         display: false,
         children: [
             {
-                name: '报表',
+                name: '输出报表',
                 icon: '<i class="fa fa-file-text-o"></i> ',
                 display: true,
                 url: '/report',

+ 2 - 0
config/web.js

@@ -571,6 +571,7 @@ const JsFiles = {
                 files: [
                     '/public/js/spreadjs/sheets/v11/gc.spread.sheets.all.11.2.2.min.js',
                     '/public/js/decimal.min.js',
+                    '/public/js/axios/axios.min.js', '/public/js/js-xlsx/jszip.min.js', '/public/js/file-saver/FileSaver.min.js',
                 ],
                 mergeFiles: [
                     '/public/js/component/menu.js',
@@ -581,6 +582,7 @@ const JsFiles = {
                     '/public/js/shares/sjs_setting.js',
                     '/public/js/zh_calc.js',
                     '/public/js/path_tree.js',
+                    '/public/js/zip_oss.js',
                     '/public/js/stage_im.js',
                     '/public/js/sr_detail.js',
                 ],