Browse Source

1. 还原代码
2. 报表,材差数据,查询往期数据调整

MaiXinRong 3 years ago
parent
commit
c2335e6828

+ 0 - 1
app/public/js/shares/tenders2tree.js

@@ -64,7 +64,6 @@ const Tender2Tree = (function () {
                 if (i === 0 && tender.category) {
                     for (const [j, c] of tender.category.entries()) {
                         const cate = findNode('id', c.cid, category);
-                        if (!cate) continue;
                         tenderCategory = getCategoryTreeNode(cate, c.value, tenderCategory);
                     }
                 }

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

@@ -233,7 +233,6 @@ function initTenderTree () {
                 if (index === 0 && tender.category) {
                     for (const [i,c] of tender.category.entries()) {
                         const cate = findNode('id', c.cid, category);
-                        if (!cate) continue;
                         tenderCategory = getCategoryNode(cate, c.value, tenderCategory, i+1);
                     }
                 }

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

@@ -257,7 +257,6 @@ function initTenderTree () {
                 if (index === 0 && tender.category) {
                     for (const [i,c] of tender.category.entries()) {
                         const cate = findNode('id', c.cid, category);
-                        if (!cate) continue;
                         tenderCategory = getCategoryNode(cate, c.value, tenderCategory, i+1);
                     }
                 }

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

@@ -232,7 +232,6 @@ function initTenderTree () {
                 if (index === 0 && tender.category) {
                     for (const [i,c] of tender.category.entries()) {
                         const cate = findNode('id', c.cid, category);
-                        if (!cate) continue;
                         tenderCategory = getCategoryNode(cate, c.value, tenderCategory, i+1);
                     }
                 }

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

@@ -252,7 +252,6 @@ function initTenderTree () {
                 if (index === 0 && tender.category) {
                     for (const [i,c] of tender.category.entries()) {
                         const cate = findNode('id', c.cid, category);
-                        if (!cate) continue;
                         tenderCategory = getCategoryNode(cate, c.value, tenderCategory, i+1);
                     }
                 }

+ 10 - 3
app/service/report_memory.js

@@ -1003,9 +1003,16 @@ module.exports = app => {
                 } else {
                     const material = this.ctx.helper._.find(materials, {order: material_order});
                     if (!material) return [];
-                    result = await this.ctx.service.materialBillsHistory.getAllDataByCondition({
-                        where: { tid: tender_id, mid: material.id }
-                    });
+
+                    const sql = 'SELECT mb.id, mb.tid, mb.mid, mb.order, mb.order, mb.t_type, mb.code, mb.name, mb.unit, mb.spec, mb.m_type,' +
+                        '    mbh.quantity, mbh.expr,' +
+                        '    mb.basic_price, mb.basic_times, ' +
+                        '    mbh.msg_tp, mbh.msg_times, mbh.msg_spread, mbh.m_up_risk, mbh.m_down_risk, mbh.m_spread, mbh.m_tp, mbh.pre_tp, mbh.m_tax_tp, mbh.tax_pre_tp, mbh.origin, ' +
+                        '    mb.remark, mb.is_summary, mbh.m_tax, mb.in_time' +
+                        '  FROM ' + this.ctx.service.materialBillsHistory.tableName + ' mbh ' +
+                        '  LEFT JOIN ' + this.ctx.service.materialBills.tableName + ' mb ON mbh.mb_id = mb.id ' +
+                        '  WHERE mbh.tid = ? And mbh.mid = ?';
+                    result = await this.ctx.app.mysql.query(sql, [tender_id, material.id]);
                 }
                 this._completeMaterialGl(result);
                 return result;