瀏覽代碼

导入Excel时,强制转换部分单元格内容为字符串格式

MaiXinRong 5 年之前
父節點
當前提交
6e72f0aa55
共有 1 個文件被更改,包括 5 次插入5 次删除
  1. 5 5
      app/lib/analysis_excel.js

+ 5 - 5
app/lib/analysis_excel.js

@@ -273,16 +273,16 @@ class AnalysisExcelTree {
      */
     _loadXmjNode(row) {
         const node = {};
-        node.code = this.ctx.helper.replaceReturn(row[this.colsDef.code]);
-        node.name = this.ctx.helper.replaceReturn(row[this.colsDef.name]);
-        node.unit = this.ctx.helper.replaceReturn(row[this.colsDef.unit]);
+        node.code = this.ctx.helper.replaceReturn(row[this.colsDef.code] + '');
+        node.name = this.ctx.helper.replaceReturn(row[this.colsDef.name] + '');
+        node.unit = this.ctx.helper.replaceReturn(row[this.colsDef.unit] + '');
         const precision = this.ctx.helper.findPrecision(this.ctx.tender.info.precision, node.unit);
         node.sgfh_qty = this.ctx.helper.round(this.toNumber(row[this.colsDef.sgfh_qty]), precision.value);
         node.dgn_qty1 = this.toNumber(row[this.colsDef.dgn_qty1]);
         node.dgn_qty2 = this.toNumber(row[this.colsDef.dgn_qty2]);
         node.unit_price = this.toNumber(row[this.colsDef.unit_price]);
-        node.drawing_code = this.ctx.helper.replaceReturn(row[this.colsDef.drawing_code]);
-        node.memo = this.ctx.helper.replaceReturn(row[this.colsDef.memo]);
+        node.drawing_code = this.ctx.helper.replaceReturn(row[this.colsDef.drawing_code] + '');
+        node.memo = this.ctx.helper.replaceReturn(row[this.colsDef.memo] + '');
         // if (node.sgfh_qty && node.unit_price) {
         //     node.sgfh_tp = this.ctx.helper.round(this.ctx.helper.mul(node.sgfh_qty, node.unit_price), this.ctx.tender.info.decimal.tp);
         // } else {