Browse Source

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

TonyKang 3 years ago
parent
commit
d069512802

+ 46 - 2
app/controller/datacollect_controller.js

@@ -46,8 +46,9 @@ module.exports = app => {
         async index(ctx) {
             try {
                 // 获取标段审批信息
-                const noticeList = await ctx.service.noticePush.getNotice(ctx.session.sessionProject.id);
-                console.log(noticeList);
+                const tenderidList = [];
+                console.log(ctx.session.sessionProject.dataCollect);
+                const noticeList = await ctx.service.noticePush.getNoticeByDataCollect(ctx.session.sessionProject.id, tenderidList);
                 const renderData = {
                     noticeList,
                     acLedger: auditConst.ledger,
@@ -65,6 +66,49 @@ module.exports = app => {
                 ctx.redirect(this.menu.menu.dashboard.url);
             }
         }
+
+        async loadData(ctx) {
+            try {
+                const responseData = { err: 0, msg: '', data: {} };
+                // const tenderidList = [];
+                // const noticeList = await ctx.service.noticePush.getNoticeByDataCollect(ctx.session.sessionProject.id, tenderidList);
+                const tenderList = await ctx.service.tender.getList('', null, 1);
+                const thisMonth = new Date();
+                const [startMonth, endMonth] = ctx.helper.getStartEndMonth(thisMonth);
+                for (const t of tenderList) {
+                    const tenderInfo = await ctx.service.tenderInfo.getTenderInfo(t.id);
+                    t.contract_price = tenderInfo.deal_param.contractPrice;
+
+                    if (t.ledger_status === auditConst.ledger.status.checkNo || t.ledger_status === auditConst.ledger.status.uncheck) {
+                        const sum = await ctx.service.ledger.addUp({ tender_id: t.id/* , is_leaf: true*/ });
+                        t.total_price = sum.total_price;
+                        t.deal_tp = sum.deal_tp;
+                    }
+                    t.advance_tp = await ctx.service.advance.getSumAdvance(t.id);
+
+                    if (t.ledger_status === auditConst.ledger.status.checked) {
+                        t.lastStage = await ctx.service.stage.getLastestStage(t.id, true);
+                        if (t.lastStage && t.lastStage.status === auditConst.stage.status.uncheck &&
+                            t.lastStage.user_id !== ctx.session.sessionUser.accountId) {
+                            t.lastStage = await ctx.service.stage.getLastestStage(t.id);
+                        }
+                        if (t.lastStage) await ctx.service.stage.checkStageGatherData(t.lastStage);
+                        t.completeStage = await ctx.service.stage.getLastestCompleteStage(t.id);
+                    }
+                    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);
+                }
+                responseData.data.tenderList = tenderList;
+                ctx.body = responseData;
+            } catch (err) {
+                this.log(err);
+                ctx.body = { err: 1, msg: err.toString(), data: null };
+            }
+        }
     }
 
     return DatacollectController;

+ 4 - 0
app/controller/material_controller.js

@@ -367,6 +367,8 @@ module.exports = app => {
 
                 renderData.materialType = JSON.stringify(materialConst);
                 renderData.jsFiles = this.app.jsFiles.common.concat(this.app.jsFiles.material.info);
+                // 判断之前期有无调用过材料税
+                renderData.old_had_tax = await ctx.service.material.getOldMaterialTax(ctx.tender.id, ctx.params.order);
                 await this.layout('material/info.ejs', renderData, 'material/info_modal.ejs');
             } catch (err) {
                 this.log(err);
@@ -504,6 +506,8 @@ module.exports = app => {
                 renderData.ex_pre_tp_hs = await ctx.service.material.getExPreTpHs(ctx.tender.id, ctx.material.order);
                 renderData.materialType = materialConst;
                 renderData.jsFiles = this.app.jsFiles.common.concat(this.app.jsFiles.material.exponent);
+                // 判断之前期有无调用过材料税
+                renderData.old_had_tax = await ctx.service.material.getOldMaterialTax(ctx.tender.id, ctx.params.order);
                 await this.layout('material/exponent.ejs', renderData, 'material/exponent_modal.ejs');
             } catch (err) {
                 this.log(err);

+ 9 - 0
app/extend/helper.js

@@ -1430,4 +1430,13 @@ module.exports = {
         }
         return result.content;
     },
+
+    getStartEndMonth(month) {
+        // month = new Date('2021-10-03');
+        // const startMonth = new Date(month.getFullYear(), month.getMonth(), 1);
+        // const endMonth = new Date(month.getFullYear(), month.getMonth() + 1, 1);
+        const startMonth = moment(month).startOf('month').format('YYYY-MM-DD HH:mm:ss');
+        const endMonth = moment(month).endOf('month').format('YYYY-MM-DD HH:mm:ss');
+        return [startMonth, endMonth];
+    },
 };

+ 19 - 0
app/lib/ledger.js

@@ -749,6 +749,25 @@ class checkData {
 
             addXmjCheck(topLevel);
         }
+        const xmjPart = {}, xmjIndex = [];
+        for (const x of xmj) {
+            if (!xmjPart[x.code]) {
+                xmjPart[x.code] = [];
+                xmjIndex.push(x.code);
+            }
+            xmjPart[x.code].push(x);
+        }
+        for (const x of xmjIndex) {
+            if (xmjPart[x].length <= 1) continue;
+            for (const xp of xmjPart[x]) {
+                this.checkResult.error.push({
+                    ledger_id: xp.ledger_id,
+                    b_code: xp.b_code,
+                    name: xp.name,
+                    errorType: 'same_code',
+                })
+            }
+        }
         let check = null;
         while (xmj.length > 0) {
             [check, xmj] = this.ctx.helper._.partition(xmj, x => { return x.code === xmj[0].code; });

BIN
app/public/images/juecedaping01.png


BIN
app/public/images/juecedaping02.png


BIN
app/public/images/juecedaping03.png


BIN
app/public/images/juecedaping04.png


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

@@ -30,3 +30,62 @@ function rollStart() {
         ulbox.scrollTop++;
     }
 }
+
+// tableScroll('tableId', '100%', 30, 10);
+var MyMarhq;
+function tableScroll(tableid, hei, speed, len) {
+    clearTimeout(MyMarhq);
+    $('#' + tableid).parent().find('.tableid_').remove()
+    $('#' + tableid).parent().prepend(
+        '<table class="tableid_"><thead>' + $('#' + tableid + ' thead').html() + '</thead></table>'
+    ).css({
+        'position': 'relative',
+        'overflow': 'hidden',
+        'height': hei + 'px'
+    })
+    $(".tableid_").find('th').each(function(i) {
+        $(this).css('width', $('#' + tableid).find('th:eq(' + i + ')').width());
+    });
+    $(".tableid_").css({
+        'position': 'absolute',
+        'top': 0,
+        'left': 0,
+        'z-index': 9
+    })
+    $('#' + tableid).css({
+        'position': 'absolute',
+        'top': 0,
+        'left': 0,
+        'z-index': 1
+    })
+
+    if ($('#' + tableid).find('tbody tr').length > len) {
+        $('#' + tableid).find('tbody').html($('#' + tableid).find('tbody').html() + $('#' + tableid).find('tbody').html());
+        $(".tableid_").css('top', 0);
+        $('#' + tableid).css('top', 0);
+        var tblTop = 0;
+        var outerHeight = $('#' + tableid).find('tbody').find("tr").outerHeight();
+        function Marqueehq() {
+            if (tblTop <= -outerHeight * $('#' + tableid).find('tbody').find("tr").length) {
+                tblTop = 0;
+            } else {
+                tblTop -= 1;
+            }
+            $('#' + tableid).css('margin-top', tblTop + 'px');
+            clearTimeout(MyMarhq);
+            MyMarhq = setTimeout(function() {
+                Marqueehq()
+            }, speed);
+        }
+
+        MyMarhq = setTimeout(Marqueehq, speed);
+        $('#' + tableid).find('tbody').hover(function() {
+            clearTimeout(MyMarhq);
+        }, function() {
+            clearTimeout(MyMarhq);
+            if ($('#' + tableid).find('tbody tr').length > len) {
+                MyMarhq = setTimeout(Marqueehq, speed);
+            }
+        })
+    }
+};

+ 9 - 5
app/public/js/ledger_check.js

@@ -148,12 +148,16 @@ const ledgerCheckUtil = {
 
             addXmjCheck(topLevel);
         }
-        let check = null;
-        while (xmj.length > 0) {
-            [check, xmj] = _.partition(xmj, x => { return x.code === xmj[0].code; });
-            if (check.length > 1) {
-                error.push(...check);
+        const xmjPart = {}, xmjIndex = [];
+        for (const x of xmj) {
+            if (!xmjPart[x.code]) {
+                xmjPart[x.code] = [];
+                xmjIndex.push(x.code);
             }
+            xmjPart[x.code].push(x);
+        }
+        for (const x of xmjIndex) {
+            if (xmjPart[x].length > 1) error.push(...xmjPart[x]);
         }
         return error;
     },

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

@@ -121,7 +121,7 @@ $(document).ready(() => {
         {title: '工料分类', colSpan: '1', rowSpan: '2', field: 'm_type', hAlign: 1, width: 60, readOnly: 'readOnly.isEdit', cellType: 'customizeCombo', comboItems: materialType.m_type, cellTypeKey: 2},
     ];
     if (materialTax) {
-        materialSpreadSettingCols.push({title: '税率', colSpan: '1', rowSpan: '2', field: 'm_tax', hAlign: 2, width: 50, type: 'Number', readOnly: 'readOnly.isEdit'});
+        materialSpreadSettingCols.push({title: '税率(%)', colSpan: '1', rowSpan: '2', field: 'm_tax', hAlign: 2, width: 50, type: 'Number', readOnly: 'readOnly.isEdit'});
     }
     materialSpreadSettingCols = _.concat(materialSpreadSettingCols, [
         {title: '本期应耗数量', colSpan: '1', rowSpan: '2', field: 'quantity', hAlign: 2, width: 90, type: 'Number', readOnly: true},

+ 23 - 2
app/public/js/stage.js

@@ -2021,13 +2021,23 @@ $(document).ready(() => {
 
     // 加载计量单元数据 - 暂时统一加载,如有需要,切换成动态加载并缓存
     postData(window.location.pathname + '/load', { filter: 'ledger;pos;detail;change;tag;cooperation' }, function (result) {
+        result.ledgerData && console.log('ledger: ' + result.ledgerData.length);
+        result.posData && console.log('pos: ' + result.posData.length);
+        result.detailData && console.log('detail: ' + result.detailData.length);
+        result.detailAtt && console.log('detailAtt: ' + result.detailAtt.length);
+        result.changeData && console.log('change: ' + result.changeData.length);
+        result.tags && console.log('tag: ' + result.tags.length);
+        result.cooperation && console.log('cooperation: ' + result.cooperation.length);
         // 加载树结构
+        console.time('loadLedger');
         stageTree.loadDatas(result.ledgerData);
-        // stageTree.loadCurStageData(curStageData);
-        // stageTree.loadPreStageData(preStageData);
+        console.timeEnd('loadLedger');
         checkShowLast(result.ledgerData.length);
+        console.time('calcLedger');
         treeCalc.calculateAll(stageTree);
+        console.timeEnd('calcLedger');
         // 加载解锁相关
+        console.time('loadCooperation');
         if (result.cooperation) {
             stageTree.loadPwd(result.cooperation, 'bills-p-' + userID + '-' + window.location.pathname.split('/')[2], result.cooperationConfirm);
             $('#cooperationCount').html(stageTree.pwd.length || '');
@@ -2035,20 +2045,31 @@ $(document).ready(() => {
             setCooperationSelectHtml();
             reloadCooperationHtml();
         }
+        console.timeEnd('loadCooperation');
+        console.time('loadTag');
         for (const t of result.tags) {
             t.node = stageTree.datas.find(x => {return x.id === t.lid});
         }
         billsTag.loadDatas(result.tags);
+        console.timeEnd('loadTag');
         // 加载部位明细
+        console.time('loadPos');
         stagePos.loadDatas(result.posData);
+        console.timeEnd('loadPos');
         stagePos.calculateAll();
+        console.time('showLedger');
         SpreadJsObj.loadSheetData(slSpread.getActiveSheet(), 'tree', stageTree);
         SpreadJsObj.loadTopAndSelect(slSpread.getActiveSheet(), ckBillsSpread);
+        console.timeEnd('showLedger');
+        console.time('showPos');
         stagePosSpreadObj.loadCurPosData();
         SpreadJsObj.resetTopAndSelect(spSpread.getActiveSheet());
+        console.timeEnd('showPos');
         // 加载中间计量
+        console.time('loadIm');
         stageIm.init(stage, imType, tenderInfo.decimal);
         stageIm.loadData(result.ledgerData, result.posData, result.detailData, result.changeData, result.detailAtt);
+        console.timeEnd('loadIm');
 
         errorList.loadHisErrorData();
         checkList.loadHisCheckData();

+ 1 - 0
app/router.js

@@ -574,6 +574,7 @@ module.exports = app => {
 
     // 决策大屏
     app.get('/datacollect', sessionAuth, 'datacollectController.index');
+    app.post('/datacollect/load', sessionAuth, 'datacollectController.loadData');
 
     // 概算投资
     app.get('/budget', sessionAuth, 'budgetController.list');

+ 7 - 0
app/service/change_audit.js

@@ -634,6 +634,13 @@ module.exports = app => {
             }
             return true;
         }
+
+        async getNumByMonth(tid, startMonth, endMonth) {
+            const sql = 'SELECT COUNT(*) as num FROM ?? WHERE id in (SELECT b.id FROM (SELECT * FROM ?? WHERE tid = ? GROUP BY id ORDER BY usort DESC) as b GROUP BY b.cid) AND status = ? AND sin_time between ? and ?';
+            const sqlParam = [this.tableName, this.tableName, tid, auditConst.auditStatus.checked, startMonth, endMonth];
+            const result = await this.db.queryOne(sql, sqlParam);
+            return result ? result.num : 0;
+        }
     }
 
     return ChangeAudit;

+ 30 - 1
app/service/material.js

@@ -68,11 +68,33 @@ module.exports = app => {
             return material;
         }
 
+        async checkMaterial(tid, order) {
+            if (this.ctx.material) return;
+            const materials = await this.getSelectMaterial(tid, order);
+            this.ctx.material = materials[0]
+        }
+
         /**
          * 获取标段下的全部计量期,按倒序
          * @param tenderId
          * @return {Promise<void>}
          */
+        async getSelectMaterial(tenderId, order) {
+            const materials = await this.db.select(this.tableName, {
+                where: { tid: tenderId, order },
+            });
+            if (materials.length > 0 && materials[0].status !== auditConst.status.checked) {
+                const material = materials[0];
+                const curAuditor = await this.ctx.service.materialAudit.getCurAuditor(material.id, material.times);
+                const isActive = curAuditor ? curAuditor.id === this.ctx.session.sessionUser.accountId : material.user_id === this.ctx.session.sessionUser.accountId;
+                if (isActive) {
+                    material.curTimes = material.times;
+                    material.curOrder = curAuditor ? curAuditor.order : 0;
+                }
+            }
+            return materials;
+        }
+
         async getValidMaterials(tenderId) {
             const materials = await this.db.select(this.tableName, {
                 where: { tid: tenderId },
@@ -130,7 +152,7 @@ module.exports = app => {
                     newMaterial.rate = preMaterial.rate;
                     newMaterial.pre_tp = this.ctx.helper.add(preMaterial.m_tp, preMaterial.pre_tp);
                     newMaterial.ex_pre_tp = this.ctx.helper.add(preMaterial.ex_tp, preMaterial.ex_pre_tp);
-                    newMaterial.m_tax_pre_tp = this.ctx.helper.add(preMaterial.m_tax_tp, preMaterial.m_tax_pre_tp);
+                    newMaterial.m_tax_pre_tp = preMaterial.material_tax ? this.ctx.helper.add(preMaterial.m_tax_tp, preMaterial.m_tax_pre_tp) : preMaterial.m_tax_pre_tp;
                 }
                 // 新增期记录
                 const result = await transaction.insert(this.tableName, newMaterial);
@@ -341,6 +363,13 @@ module.exports = app => {
             const result = await this.db.queryOne(sql, [tid]);
             return result ? result.tp : 0;
         }
+
+        async getOldMaterialTax(tid, order) {
+            const sql = 'SELECT COUNT(id) as count FROM ?? WHERE `tid` = ? AND `order` <= ? AND `material_tax` = 1';
+            const sqlParam = [this.tableName, tid, order];
+            const result = await this.db.queryOne(sql, sqlParam);
+            return result && result.count !== 0;
+        }
     }
 
     return Material;

+ 7 - 0
app/service/material_audit.js

@@ -933,6 +933,13 @@ module.exports = app => {
                 throw err;
             }
         }
+
+        async getNumByMonth(tid, startMonth, endMonth) {
+            const sql = 'SELECT COUNT(*) as num FROM ?? WHERE id in (SELECT MAX(id) FROM ?? WHERE tid = ? GROUP BY mid) AND status = ? AND end_time between ? and ?';
+            const sqlParam = [this.tableName, this.tableName, tid, auditConst.status.checked, startMonth, endMonth];
+            const result = await this.db.queryOne(sql, sqlParam);
+            return result ? result.num : 0;
+        }
     }
 
     return MaterialAudit;

+ 21 - 0
app/service/notice_push.js

@@ -52,6 +52,27 @@ module.exports = app => {
             })
             return notice
         }
+
+        /**
+         * 查询所有推送记录
+         * @param {Integer} pid - 项目id
+         * @param {Integer} uid - 查询人id
+         */
+        async getNoticeByDataCollect(pid, tenderIds = []) {
+            const wheres = { pid };
+            let notice = await this.db.select(this.tableName, {
+                where: wheres,
+                orders: [['create_time', 'desc']],
+                limit: 10,
+                offset: 0
+            })
+            notice = notice.map(v => {
+                const extra = JSON.parse(v.content)
+                delete v.content
+                return { ...v, ...extra }
+            })
+            return notice
+        }
     }
     return NoticePush
 }

+ 8 - 0
app/service/report.js

@@ -160,6 +160,14 @@ module.exports = app => {
                                 customDefine.gather_select, customSelect ? customSelect.gather_select : null));
                             runnableKey.push(filter);
                             break;
+                        case 'mem_select_material':
+                            runnableRst.push(service.material.getSelectMaterial(params.tender_id, params.material_order));
+                            runnableKey.push(filter);
+                            break;
+                        case 'mem_select_material_audit':
+                            runnableRst.push(service.reportMemory.getSelectMaterialAuditors(params.tender_id, params.material_order));
+                            runnableKey.push(filter);
+                            break;
                         case 'mem_material':
                             runnableRst.push(service.reportMemory.getMaterial(params.tender_id, params.material_order, memFieldKeys[filter]));
                             runnableKey.push(filter);

+ 27 - 1
app/service/report_memory.js

@@ -921,8 +921,34 @@ module.exports = app => {
             }
         }
 
+        async getSelectMaterialAuditors(tid, material_order, fields) {
+            await this.ctx.service.material.checkMaterial(tid, material_order);
+            const auditors = await this.ctx.service.materialAudit.getFinalAuditGroup(this.ctx.material.id, this.ctx.material.curTimes);
+            const user = await this.ctx.service.projectAccount.getDataById(this.ctx.material.user_id);
+            const result = [{
+                aid: user.id,
+                name: user.name,
+                company: user.company,
+                role: user.role,
+                mobile: user.mobile,
+                telephone: user.telephone,
+                sign_path: user.sign_path,
+                opinion: user.opinion,
+                end_time: auditors && auditors.length > 0 ? auditors[0].begin_time : null,
+                sort: 0,
+            }, ...auditors];
+            return result;
+        }
+
         async getMaterial(tender_id, material_order, fields) {
-            return await this.ctx.service.material.getValidMaterials(tender_id);
+            const result = await this.ctx.service.material.getValidMaterials(tender_id);
+            if (this._checkFieldsExist(fields, ['checked_time'])) {
+                for (const r of result) {
+                    const auditors = await this.ctx.service.materialAudit.getFinalAuditGroup(r.id, r.curTimes || r.times);
+                    r.checked_time = !r.curTimes ? auditors[auditors.length - 1].end_time : null;
+                }
+            }
+            return result;
         }
 
         _completeMaterialGl(materialGl) {

+ 7 - 0
app/service/revise_audit.js

@@ -803,6 +803,13 @@ module.exports = app => {
                 throw err;
             }
         }
+
+        async getNumByMonth(tid, startMonth, endMonth) {
+            const sql = 'SELECT COUNT(*) as num FROM ?? WHERE id in (SELECT MAX(id) FROM ?? WHERE tender_id = ? GROUP BY rid) AND status = ? AND end_time between ? and ?';
+            const sqlParam = [this.tableName, this.tableName, tid, auditConst.status.checked, startMonth, endMonth];
+            const result = await this.db.queryOne(sql, sqlParam);
+            return result ? result.num : 0;
+        }
     }
 
     return ReviseAudit;

+ 7 - 0
app/service/stage_audit.js

@@ -1368,6 +1368,13 @@ module.exports = app => {
             }
             return result;
         }
+
+        async getNumByMonth(tid, startMonth, endMonth) {
+            const sql = 'SELECT COUNT(*) as num FROM ?? WHERE id in (SELECT MAX(id) FROM ?? WHERE tid = ? GROUP BY sid) AND status = ? AND end_time between ? and ?';
+            const sqlParam = [this.tableName, this.tableName, tid, auditConst.status.checked, startMonth, endMonth];
+            const result = await this.db.queryOne(sql, sqlParam);
+            return result ? result.num : 0;
+        }
     }
 
     return StageAudit;

+ 2 - 6
app/service/stage_detail_att.js

@@ -123,18 +123,14 @@ module.exports = app => {
             await this._analysisDetailAtt(detailAtt);
 
             const index = detailAtt.attachment.findIndex(x => { return x.file_id === fileId });
-            if (index < 0) throw '不存在文件';
+            if (index < 0) throw '不存在文件';
             const att = detailAtt.attachment[index];
             if (att.uid !== this.ctx.session.sessionUser.accountId) throw '您无权删除该文件';
 
             detailAtt.attachment.splice(index, 1);
             await this.db.update(this.tableName, { id: detailAtt.id, attachment: JSON.stringify(detailAtt.attachment) });
 
-            // if (fs.existsSync(path.join(this.ctx.app.baseDir, att.filepath))) {
-            //     await fs.unlinkSync(path.join(this.ctx.app.baseDir, att.filepath));
-            // }
-            await this.ctx.app.fujianOss.delete(ctx.app.config.fujianOssFolder + att.filepath);
-
+            await this.ctx.app.fujianOss.delete(this.ctx.app.config.fujianOssFolder + att.filepath);
 
             await this._complete4Output(detailAtt);
             return detailAtt;

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

@@ -383,7 +383,7 @@
     </div>
 </div>
 <script>
-    const tenderName = '<%- tender.name %>';
+    const tenderName = JSON.parse(unescape('<%- escape(JSON.stringify(tender.name)) %>'));
     const tenderId = '<%- tender.id %>';
     const totalPriceUnit = '<%- tpUnit %>';
     const unitPriceUnit = '<%- upUnit %>';

File diff suppressed because it is too large
+ 662 - 338
app/view/datacollect/index.ejs


+ 1 - 1
app/view/material/exponent.ejs

@@ -49,7 +49,7 @@
                             </select>
                         </div>
                     </div>
-                    <% if (!material.material_tax) { %>
+                    <% if (!material.material_tax && !old_had_tax) { %>
                         <div class="sp-wrap" style="max-width: 800px;min-width: 500px;">
                             <div class="col-12 p-0">
                                 <table class="table table-sm table-bordered">

+ 5 - 5
app/view/material/info.ejs

@@ -54,7 +54,7 @@
                             </select>
                         </div>
                     </div>
-                    <% if (!material.material_tax) { %>
+                    <% if (!material.material_tax && !old_had_tax) { %>
                     <div class="sp-wrap" style="max-width: 800px;min-width: 500px;">
                         <div class="col-12 p-0">
                             <table class="table table-sm table-bordered">
@@ -94,14 +94,14 @@
                                     <td class="text-center"><%= material.ex_tp !== null || material.ex_pre_tp !== null ? ctx.helper.round(ctx.helper.add(material.ex_pre_tp, material.ex_tp), 2) : null %></td>
                                 </tr>
                                 <tr id="rate_set"><td>材料价差费用(含材料税)</td>
-                                    <td class="text-center"><%= material.m_tax_tp !== null ? material.m_tax_tp : null %></td>
-                                    <td class="text-center"><%= material.m_tax_tp !== null || material.m_tax_pre_tp !== null ? ctx.helper.round(ctx.helper.add(material.m_tax_pre_tp, material.m_tax_tp), 2) : null %></td>
+                                    <td class="text-center"><%= material.material_tax ? (material.m_tax_tp !== null ? material.m_tax_tp : null) : '-' %></td>
+                                    <td class="text-center"><%= material.material_tax ? (material.m_tax_tp !== null || material.m_tax_pre_tp !== null ? ctx.helper.round(ctx.helper.add(material.m_tax_pre_tp, material.m_tax_tp), 2) : null) : material.m_tax_pre_tp %></td>
                                     <td class="text-center">-</td>
                                     <td class="text-center">-</td>
                                 </tr>
                                 <tr><td>材料价差费用(含建筑税)</td>
-                                    <td class="text-center">-</td>
-                                    <td class="text-center"><%= pre_tp_hs !== null ? pre_tp_hs : '-' %></td>
+                                    <td class="text-center"><%= !material.material_tax ? (material.m_tp !== null ? ctx.helper.round(ctx.helper.mul(material.m_tp, 1+material.rate/100), 2) : null) : '-' %></td>
+                                    <td class="text-center"><%= !material.material_tax ? (material.m_tp !== null || pre_tp_hs !== null ? ctx.helper.round(ctx.helper.add(pre_tp_hs, ctx.helper.round(ctx.helper.mul(material.m_tp, 1+material.rate/100), 2)), 2) : null) : pre_tp_hs !== null ? pre_tp_hs : '-' %></td>
                                     <td class="text-center"><%= material.ex_tp !== null ? ctx.helper.round(ctx.helper.mul(material.ex_tp, 1+material.rate/100), 2) : null %></td>
                                     <td class="text-center"><%= material.ex_tp !== null || ex_pre_tp_hs !== null ? ctx.helper.round(ctx.helper.add(ex_pre_tp_hs, ctx.helper.round(ctx.helper.mul(material.ex_tp, 1+material.rate/100), 2)), 2) : null %></td>
                                 </tr>

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

@@ -9,6 +9,7 @@
 </div>
 <script>
     const tenders = JSON.parse(unescape('<%- escape(JSON.stringify(tenderList)) %>'));
+    console.log(tenders);
     const categoryType = JSON.parse('<%- JSON.stringify(settingConst.cType) %>');
     const category = JSON.parse(unescape('<%- escape(JSON.stringify(categoryData)) %>'));
     const auditConst = JSON.parse('<%- JSON.stringify(auditConst) %>');

+ 53 - 1
builder_report_index_define.js

@@ -1250,6 +1250,48 @@ const gather_deal_bills = {
 };
 
 // 材差
+const select_material = {
+    name: '材料调差-选择期-数据(mem_select_material)',
+    remark: '',
+    id: 71,
+    key: 'mem_select_material',
+    prefix: '材料调差-选择期',
+    cols: [
+        { name: 'id', field: 'id', type: dataType.int },
+        { name: '标段id', field: 'tid', type: dataType.int },
+        { name: '创建者id', field: 'user_id', type: dataType.int },
+        { name: '审批次数', field: 'times', type: dataType.int },
+        { name: '审批状态', field: 'status', type: dataType.int },
+        { name: '期id列表', field: 'stage_id', type: dataType.str },
+        { name: '期order列表', field: 's_order', type: dataType.str },
+        { name: '材料调差期数', field: 'order', type: dataType.int },
+        { name: '本期金额', field: 'm_tp', type: dataType.currency },
+        { name: '截止上期金额', field: 'pre_tp', type: dataType.currency },
+        { name: '税率', field: 'rate', type: dataType.int },
+        { name: '创建时间', field: 'in_time', type: dataType.str },
+
+    ],
+};
+
+const select_material_audit = {
+    name: '材料调差-选择期-审批人 列表(mem_select_material_audit)',
+    remark: '',
+    id: 72,
+    key: 'mem_select_material_audit',
+    prefix: '材料调差-选择期',
+    cols: [
+        { name: '审批人id', field: 'aid', type: dataType.int },
+        { name: '姓名', field: 'name', type: dataType.str },
+        { name: '公司', field: 'company', type: dataType.str },
+        { name: '角色', field: 'role', type: dataType.str },
+        { name: '手机', field: 'mobile', type: dataType.str },
+        { name: '电话', field: 'telephone', type: dataType.str },
+        { name: '审批意见', field: 'opinion', type: dataType.str },
+        { name: '审批时间', field: 'end_time', type: dataType.str },
+        { name: '审批顺序', field: 'sort', type: dataType.str },
+    ],
+};
+
 const material = {
     name: '材料调差-期列表-数据(mem_material)',
     remark: '',
@@ -1269,6 +1311,16 @@ const material = {
         { name: '截止上期金额', field: 'pre_tp', type: dataType.currency },
         { name: '税率', field: 'rate', type: dataType.int },
         { name: '创建时间', field: 'in_time', type: dataType.str },
+        { name: '月信息价-年月份列表', field: 'months', type: dataType.str },
+        { name: '指数本期金额', field: 'ex_tp', type: dataType.currency },
+        { name: '指数截止上期金额', field: 'ex_pre_tp', type: dataType.currency },
+        { name: '指数调差结果公式', field: 'ex_expr', type: dataType.str },
+        { name: '调差基数值json', field: 'ex_calc', type: dataType.str },
+        { name: '是否已使用材料税,默认为0', field: 'material_tax', type: dataType.int },
+        { name: '材料含税总金额', field: 'm_tax_tp', type: dataType.currency },
+        { name: '截止上期材料含税金额', field: 'm_tax_pre_tp', type: dataType.currency },
+        { name: '小数位数设置JSON', field: 'decimal', type: dataType.currency },
+        { name: '批复时间', field: 'checked_time', type: dataType.str },
 
     ],
 };
@@ -2141,7 +2193,7 @@ const defines = [
     stage_im_zl, stage_im_tz, stage_im_tz_bills,
     stage_rela_im, stage_rela_im_bills,
     gather_stage_bills, gather_tender_info, gather_stage_pay, gather_deal_bills,
-    material, materialGl, material_bills, material_pos, material_gl_detail,
+    select_material, select_material_audit, material, materialGl, material_bills, material_pos, material_gl_detail,
     stage_sum_bills, stage_sum_pay, stage_audit, sign_select,
     stage_change, stage_change_bills, stage_change_ledger,
     gcl_gather_bills, gcl_gather_xmj,

+ 3 - 3
config/menu.js

@@ -19,8 +19,8 @@ const menu = {
     },
     datacollect: {
         name: '决策大屏',
-        icon: 'fa-pie-chart',
-        display: false,
+        icon: 'fa-th-large',
+        display: true,
         url: '/datacollect',
         children: null,
         caption: '决策大屏',
@@ -309,7 +309,7 @@ const settingMenu = {
     },
     datacollect: {
         name: '决策大屏',
-        display: false,
+        display: true,
         url: '/setting/datacollect',
         caption: '决策大屏',
     },

+ 1 - 1
config/web.js

@@ -882,7 +882,7 @@ const JsFiles = {
         },
         datacollect: {
             index: {
-                files: ['/public/js/echarts/echarts.min.js', '/public/js/decimal.min.js', '/public/js/bootstrap/bootstrap-colorpicker.min.js', '/public/js/table/tableSlipe.js'],
+                files: ['/public/js/echarts/echarts.min.js', '/public/js/decimal.min.js', '/public/js/bootstrap/bootstrap-colorpicker.min.js'],
                 mergeFiles: [
                     '/public/js/zh_calc.js',
                 ],