Browse Source

中间计量,计量单元模式,图号取值

MaiXinRong 5 years ago
parent
commit
a70e91d919
3 changed files with 8 additions and 14 deletions
  1. 0 8
      app/public/js/stage.js
  2. 5 3
      app/public/js/stage_im.js
  3. 3 3
      app/service/deal_bills.js

+ 0 - 8
app/public/js/stage.js

@@ -1403,14 +1403,6 @@ $(document).ready(() => {
             build: function ($trigger, e) {
                 const target = SpreadJsObj.safeRightClickSelection($trigger, e, spSpread);
                 return target.hitTestType === spreadNS.SheetArea.viewport || target.hitTestType === spreadNS.SheetArea.rowHeader;
-            },
-            items: {
-                'debug': {
-                    name: 'debug',
-                    callback: function (key, opt) {
-                        console.log(SpreadJsObj.getSelectObject(spSpread.getActiveSheet()));
-                    }
-                }
             }
         })
     }

+ 5 - 3
app/public/js/stage_im.js

@@ -496,7 +496,7 @@ const stageIm = (function () {
         for (const p of posterity) {
             if (p.children && p.children.length > 0 ) { continue; }
             if (!p.b_code || p.b_code === '') { continue }
-            if (!p.gather_qty || p.gather_qty === 0 ) { continue; }
+            if (!p.gather_tp || p.gather_tp === 0) { continue; }
             let im = nodeImData.find(function (d) {
                 return d.lid === node.id &&
                     d.code === p.b_code && p.name === d.name && p.unit === d.unit && checkZero(ZhCalc.sub(p.unit_price, d.unit_price));
@@ -573,7 +573,7 @@ const stageIm = (function () {
                     bw: bw,
                     peg: peg ? getPegStr(peg.name) : '',
                     xm: node.name,
-                    drawing_code: getDrawingCode(node),
+                    drawing_code: getDrawingCode(p),
                     changes: [],
                 };
                 im.calc_memo = '本期计量:' + im.jl + ' ' + im.unit;
@@ -642,7 +642,9 @@ const stageIm = (function () {
         for (const d of datas) {
             const detail = _.find(details, {uuid: d.uuid});
             if (detail) {
-                _.assignIn(detail, d);
+                _.assignIn(detail, d, function (oV, sV, key) {
+                    return imFields.indexOf(key) > -1 && !_.isUndefined(sV) ? sV : oV;
+                });
             } else {
                 details.push(d);
             }

+ 3 - 3
app/service/deal_bills.js

@@ -129,9 +129,9 @@ module.exports = app => {
                     const data = {
                         deal_id: bills.length + 1,
                         tender_id: tenderId,
-                        code: row[iCode],
-                        name: row[iName],
-                        unit: row[iUnit],
+                        code: this.ctx.helper.replaceReturn(row[iCode]),
+                        name: this.ctx.helper.replaceReturn(row[iName]),
+                        unit: this.ctx.helper.replaceReturn(row[iUnit]),
                         unit_price: (row[iUp] === undefined || row[iUp] === null) ? 0 : this._.toNumber(row[iUp]),
                         quantity: (row[iQty] === undefined || row[iQty] === null) ? 0 : this._.toNumber(row[iQty]),
                         total_price: (row[iTp] === undefined || row[iTp] === null) ? 0 : this._.toNumber(row[iTp]),