Pārlūkot izejas kodu

1. 列显示相关
2. 计量台账,计量单元,台账数量,保留小数位数相关

MaiXinRong 6 mēneši atpakaļ
vecāks
revīzija
73123370ea
2 mainītis faili ar 6 papildinājumiem un 4 dzēšanām
  1. 3 1
      app/public/js/project_spread.js
  2. 3 3
      app/service/stage_pos.js

+ 3 - 1
app/public/js/project_spread.js

@@ -40,6 +40,7 @@ $(document).ready(() => {
         const data = [];
         colSet.forEach(x => {
             const baseCol = BaseSetCol.find(b => { return x.key === b.key });
+            if (!baseCol) return;
             const colData = { ...x, ...baseCol };
             if (colData.bills && colData.bills_valid === undefined) colData.bills_valid = colData.valid;
             if (colData.pos && colData.pos_valid === undefined) colData.pos_valid = colData.valid;
@@ -172,6 +173,8 @@ $(document).ready(() => {
 
             const col = info.sheet.zh_setting.cols[info.col];
             if (col.field.indexOf('valid') < 0) return;
+            if (col.field === 'pos_valid' && !col.pos) return;
+            if (col.field === 'bills_valid' && !col.bills) return;
 
             const node = SpreadJsObj.getSelectObject(info.sheet);
             if (node.fixed.indexOf('valid') >= 0) return;
@@ -207,7 +210,6 @@ $(document).ready(() => {
             const baseCol = BaseSetCol.find(x => { return x.key === keyName; });
             if (!baseCol) continue;
 
-            console.log(baseCol);
             const valid = colSheet.getText(iRow, cols.valid);
             const colSet = { key: keyName, valid: valid === '1' || valid === 'TRUE' ? 1 : 0 };
             if (baseCol.bills) {

+ 3 - 3
app/service/stage_pos.js

@@ -276,9 +276,9 @@ module.exports = app => {
                     if (d.name !== undefined) p.name = d.name;
                     if (d.position !== undefined) p.position = d.position;
                     if (d.sgfh_qty !== undefined || d.qtcl_qty !== undefined || d.sjcl_qty !== undefined) {
-                        p.sgfh_qty = d.sgfh_qty !== undefined ? d.sgfh_qty : op.sgfh_qty;
-                        p.sjcl_qty = d.sjcl_qty !== undefined ? d.sjcl_qty : op.sjcl_qty;
-                        p.qtcl_qty = d.qtcl_qty !== undefined ? d.qtcl_qty : op.qtcl_qty;
+                        p.sgfh_qty = d.sgfh_qty !== undefined ? this.ctx.helper.round(d.sgfh_qty, precision.value) : op.sgfh_qty;
+                        p.sjcl_qty = d.sjcl_qty !== undefined ? this.ctx.helper.round(d.sjcl_qty, precision.value) : op.sjcl_qty;
+                        p.qtcl_qty = d.qtcl_qty !== undefined ? this.ctx.helper.round(d.qtcl_qty, precision.value) : op.qtcl_qty;
                         if (d.sgfh_expr !== undefined) p.sgfh_expr = d.sgfh_expr;
                         if (d.sjcl_expr !== undefined) p.sjcl_expr = d.sjcl_expr;
                         if (d.qtcl_expr !== undefined) p.qtcl_expr = d.qtcl_expr;