Browse Source

台账分解,过滤换行符

MaiXinRong 6 years ago
parent
commit
724cf85e4e
2 changed files with 26 additions and 2 deletions
  1. 23 0
      app/const/deal_pay.js
  2. 3 2
      app/public/js/ledger.js

+ 23 - 0
app/const/deal_pay.js

@@ -0,0 +1,23 @@
+'use strict';
+
+/**
+ * 合同支付相关
+ *
+ * @author Mai
+ * @date
+ * @version
+ */
+
+const payType = {
+    normal: 1,
+    yf: 2,
+    sf: 3,
+    wc: 4
+};
+const payTemplate = [
+    {order: 1, name: '本期应付', ptype: payType.yf},
+    {order: 2, name: '本期实付', ptype: payType.sf},
+    {order: 3, name: '本期计量完成', ptype: payType.wc},
+    {order: 4, name: '质量保证金', ptype: payType.normal},
+    {order: 5, name: '扣回开工预付款', ptype: payType.normal},
+];

+ 3 - 2
app/public/js/ledger.js

@@ -305,7 +305,8 @@ $(document).ready(function() {
                     tender_id: node.tender_id,
                     ledger_id: node.ledger_id
                 };
-                data[col.field] = col.type === 'Number' ? parseFloat(info.editingText) : info.editingText;
+                data[col.field] = col.type === 'Number' ? parseFloat(info.editingText) : info.editingText.replace('\n', '');
+                console.log(JSON.stringify(data));
 
                 info.sheet.zh_tree.update('/tender/' + getTenderId() + '/ledger/update', data, function (result) {
                     treeOperationObj.refreshTree(info.sheet, result);
@@ -332,7 +333,7 @@ $(document).ready(function() {
                         for (let iCol = 0; iCol < info.cellRange.colCount; iCol++) {
                             const curCol = info.cellRange.col + iCol;
                             const colSetting = info.sheet.zh_setting.cols[curCol];
-                            data[colSetting.field] = info.sheet.getText(curRow, curCol);
+                            data[colSetting.field] = info.sheet.getText(curRow, curCol).replace('\n', '');
                         }
                         datas.push(data);
                         nodes.push(node);