Browse Source

变更概况问题

MaiXinRong 3 years ago
parent
commit
7a43667490

+ 1 - 0
app/const/report.js

@@ -17,6 +17,7 @@ rptCustomType[JV.NODE_CUS_STAGE_SELECT] = 4;
 
 const rptDataType = {};
 rptDataType[JV.NODE_CUS_MATERIAL_SELECT] = 1;
+rptDataType[JV.NODE_CUS_CHANGE_SELECT] = 1;
 
 module.exports = {
     rptCustomType,

+ 1 - 0
app/reports/rpt_component/jpc_value_define.js

@@ -55,6 +55,7 @@ module.exports = {
     NODE_CUS_GATHER_SELECT: 'gather_select',
     NODE_CUS_COMPARE_SELECT: 'compare_select',
     NODE_CUS_MATERIAL_SELECT: 'material_select',
+    NODE_CUS_CHANGE_SELECT: 'change_select',
     NODE_CUS_STAGE_SELECT: 'stage_select',
 
     NODE_MAP_DATA_HANDLE_INFO: '映射数据预处理',

+ 6 - 6
app/service/stage_change.js

@@ -288,7 +288,7 @@ module.exports = app => {
          */
         async getUsedData(tid, cid) {
             if (this.ctx.stage.status === audit.stage.status.checked) {
-                const sql = 'SELECT scf.*, cal.unit_price ' +
+                const sql = 'SELECT scf.* ' +
                     '  FROM ' + this.tableName + ' scf ' +
                     '  LEFT JOIN ' + this.ctx.service.stage.tableName + ' s ON scf.sid = s.id' +
                     '  WHERE scf.tid = ? And scf.cid = ? And s.order = ?';
@@ -303,8 +303,8 @@ module.exports = app => {
         }
 
         async getFinalUsedData(tid, cid) {
-            if (stage.status === audit.stage.status.checked) {
-                const sql = 'SELECT scf.*, cal.unit_price ' +
+            if (this.ctx.stage.status === audit.stage.status.checked) {
+                const sql = 'SELECT scf.* ' +
                     '  FROM ' + this.ctx.service.stageChangeFinal.tableName + ' scf ' +
                     '  LEFT JOIN ' + this.ctx.service.stage.tableName + ' s ON scf.sid = s.id' +
                     '  WHERE scf.tid = ? And scf.cid = ? And s.order <= ?';
@@ -316,8 +316,8 @@ module.exports = app => {
                     '  LEFT JOIN ' + this.ctx.service.stage.tableName + ' s ON scf.sid = s.id' +
                     '  WHERE scf.tid = ? And scf.cid = ? And s.order < ?';
                 const pre = await this.db.query(preSql, [tid, cid, stage.order]);
-                const sql = 'SELECT * FROM ' + this.tableName + ' WHERE sid = ? AND (stimes * 100 + sorder) <= (? * 100 + ?)';
-                const curAll = await this.db.query(sql, [this.ctx.stage.id, this.ctx.stage.curTimes, this.ctx.stage.curOrder]);
+                const sql = 'SELECT * FROM ' + this.tableName + ' WHERE sid';
+                const curAll = await this.db.query(sql, [this.ctx.stage.id]);
                 const cur = this.ctx.helper.filterLastestData(curAll, ['lid', 'pid', 'cid', 'cbid'], 'stimes', 'sorder');
                 return [...pre, ...cur];
             }
@@ -410,7 +410,7 @@ module.exports = app => {
 
         async _getChangeBillsWithUsedInfo(stage) {
             if (stage.status === audit.stage.status.checked) {
-                const sql = 'SELECT scf.*, cal.unit_price ' +
+                const sql = 'SELECT scf.* ' +
                     '  FROM ' + this.ctx.service.stageChangeFinal.tableName + ' scf ' +
                     '  LEFT JOIN ' + this.ctx.service.stage.tableName + ' s ON scf.sid = s.id' +
                     '  WHERE scf.tid = ? And s.order <= ?';

+ 2 - 0
builder_report_index_define.js

@@ -2107,6 +2107,8 @@ const custom_select = {
         { name: '标段汇总-汇总区间(期)', field: 'gather_select.stage_zone', type: dataType.int },
         // stage_select
         { name: '期汇总-选择期', field: 'stage_select.stages', type: dataType.str},
+        // change_select
+        { name: '变更令', field: 'change_select', type: dataType.arr, map: 'arr'}
     ]
 };