Browse Source

台账,生成父项时,应清理设计量,其他错漏,设计错漏数据

MaiXinRong 5 years ago
parent
commit
019d7b83ad
3 changed files with 14 additions and 3 deletions
  1. 12 1
      app/base/base_bills_service.js
  2. 1 1
      app/base/base_tree_service.js
  3. 1 1
      app/public/js/ledger.js

+ 12 - 1
app/base/base_bills_service.js

@@ -21,7 +21,14 @@ class BaseBillsSerivce extends TreeService {
 
     // 继承方法
     clearParentingData(data) {
+        console.log(1);
         data.unit_price = null;
+        data.sgfh_qty = null;
+        data.sgfh_tp = null;
+        data.sjcl_qty = null;
+        data.sjcl_tp = null;
+        data.qtcl_qty = null;
+        data.qtcl_tp = null;
         data.quantity = null;
         data.total_price = null;
         data.deal_qty = null;
@@ -89,7 +96,11 @@ class BaseBillsSerivce extends TreeService {
             const result = await this.transaction.insert(this.tableName, data);
             if (children.length === 0) {
                 await this.transaction.update(this.tableName,
-                    {is_leaf: false, quantity: null, unit_price: null, total_price: null, deal_qty: null, deal_tp: null},
+                    {
+                        is_leaf: false,
+                        sgfh_qty: null, sgfh_tp: null, qtcl_qty: null, qtcl_tp: null, sjcl_qty: null, sjcl_tp: null,
+                        quantity: null, unit_price: null, total_price: null, deal_qty: null, deal_tp: null
+                    },
                     { where: {tender_id: tenderId, ledger_id: selectData.ledger_id} });
             }
             await this.transaction.commit();

+ 1 - 1
app/base/base_tree_service.js

@@ -635,7 +635,7 @@ class TreeService extends Service {
      * 节点成为父项时,可能需要修改父项数据,供子类继承
      * @param data
      */
-    clearParentingData(data) {
+    clearParentingData (data) {
     }
 
     /**

+ 1 - 1
app/public/js/ledger.js

@@ -98,7 +98,7 @@ $(document).ready(function() {
                 const data = SpreadJsObj.getSelectObject(sheet);
                 if (data) {
                     $('#bills-expr').val(data[col.field]).attr('field', col.field).attr('org', data[col.field])
-                        .attr('readOnly', readOnly || cell.locked() || (data.children && data.children.length > 0);
+                        .attr('readOnly', readOnly || cell.locked() || (data.children && data.children.length > 0));
                 } else {
                     $('#bills-expr').val('').attr('readOnly', true);
                 }