浏览代码

导入其他标段计量数据,变更明细数据调整

MaiXinRong 3 年之前
父节点
当前提交
26029633b2
共有 2 个文件被更改,包括 3 次插入3 次删除
  1. 1 1
      app/service/stage_change.js
  2. 2 2
      app/service/stage_import_change.js

+ 1 - 1
app/service/stage_change.js

@@ -375,7 +375,7 @@ module.exports = app => {
         }
 
         async getSumLoadFinalData(sid) {
-            const sql = 'Select cf.tid, cf.sid, cf.lid, cf.cid, cf.cbid, cf.qty, c.code As c_code' +
+            const sql = 'Select cf.tid, cf.sid, cf.lid, cf.cid, cf.cbid, cf.qty, cf.stimes, cf.sorder, c.code As c_code' +
                 '  FROM ' + this.tableName + ' cf' +
                 '  Left Join ' + this.ctx.service.change.tableName + ' c ON cf.cid = c.cid' +
                 '  Where cf.sid = ?';

+ 2 - 2
app/service/stage_import_change.js

@@ -190,7 +190,7 @@ module.exports = app => {
         async getSubtotal(stage) {
             const helper = this.ctx.helper;
             const tender = await this._getTender(stage);
-            const sql = 'SELECT sc.*, c.quality FROM ' + this.tableName + ' sc' +
+            const sql = 'SELECT sc.*, c.quality, c.name FROM ' + this.tableName + ' sc' +
                 '  LEFT JOIN ' + this.ctx.service.change.tableName + ' c ON sc.rela_cid = c.cid' +
                 '  WHERE sid = ?';
             const data = await this.db.query(sql, [stage.id]);
@@ -201,7 +201,7 @@ module.exports = app => {
                 if (!bd) {
                     const bills = await this.db.get(this.ctx.service.ledger.departTableName(tender.id), { id: d.lid });
                     if (!bills) continue;
-                    bd = { lid: d.lid, quality: d.quality, unit_price: bills.unit_price };
+                    bd = { lid: d.lid, quality: d.quality, unit_price: bills.unit_price, qty: d.rela_qty, cid: d.rela_cid, name: d.name };
                     bqData.push(bd);
                 }
                 const tp = this.ctx.helper.mul(d.rela_qty, bd.unit_price, tender.info.decimal.tp);