浏览代码

展开收起记录

laiguoran 3 年之前
父节点
当前提交
14ccd6fd94
共有 2 个文件被更改,包括 22 次插入12 次删除
  1. 17 9
      app/public/js/change_revise.js
  2. 5 3
      app/public/js/revise.js

+ 17 - 9
app/public/js/change_revise.js

@@ -8,7 +8,7 @@
  * @version
  */
 
-const ckBillsSpread = window.location.pathname + '-billsSelect';
+const ckBillsSpread = '/tender/' + window.location.pathname.split('/')[2] + '/change/revise-billsSelect';
 const invalidFields = {
     parent: ['sgfh_qty', 'sgfh_tp', 'sjcl_qty', 'sjcl_tp', 'qtcl_qty', 'qtcl_tp', 'deal_qty', 'deal_tp', 'unit_price'],
     gcl: ['dgn_qty1', 'dgn_qty2'],
@@ -125,7 +125,7 @@ $(document).ready(() => {
         tabSelector: '#error-list-tab',
         selector: '#error-list',
         relaSpread: billsSpread,
-        storeKey: 'revise-error-' + window.location.pathname.split('/')[2] + '-' + window.location.pathname.split('/')[4],
+        storeKey: 'change-revise-error-' + window.location.pathname.split('/')[2],
         afterLocated:  function () {
             posSpreadObj.loadCurPosData();
         },
@@ -139,7 +139,7 @@ $(document).ready(() => {
         tabSelector: '#check-list-tab',
         selector: '#check-list',
         relaSpread: billsSpread,
-        storeKey: 'revise-check-' + window.location.pathname.split('/')[2] + '-' + window.location.pathname.split('/')[4],
+        storeKey: 'change-revise-check-' + window.location.pathname.split('/')[2],
         checkType: getCheckType(checkOption),
         afterLocated:  function () {
             posSpreadObj.loadCurPosData();
@@ -153,7 +153,7 @@ $(document).ready(() => {
         tabSelector: '#sum-load-miss-tab',
         selector: '#sum-load-miss',
         relaSpread: billsSpread,
-        storeKey: 'revise-slm-' + window.location.pathname.split('/')[2] + '-' + window.location.pathname.split('/')[4],
+        storeKey: 'change-revise-slm-' + window.location.pathname.split('/')[2],
         id: 'revise-slm',
         afterLocated:  function () {
             posSpreadObj.loadCurPosData();
@@ -174,6 +174,8 @@ $(document).ready(() => {
         keys: ['id', 'tender_id', 'ledger_id'],
         calcFields: ['sgfh_tp', 'sjcl_tp', 'qtcl_tp', 'total_price'],
         autoExpand: 3,
+        markExpandKey: 'change-bills-expand',
+        markExpandSubKey: window.location.pathname.split('/')[2],
     };
     if (!isTz) {
         treeSetting.calcFields.push('deal_tp');
@@ -398,14 +400,17 @@ $(document).ready(() => {
             if (info.newSelections) {
                 if (!info.oldSelections || info.newSelections[0].row !== info.oldSelections[0].row || info.newSelections[0].rowCount !== info.oldSelections[0].rowCount) {
                     billsTreeSpreadObj.refreshOperationValid(info.sheet);
-                    SpreadJsObj.resetTopAndSelect(posSheet);
-                    posSpreadObj.loadCurPosData();
-                    SpreadJsObj.saveTopAndSelect(billsSheet, ckBillsSpread);
-                    posSearch.search($('#pos-keyword').val());
+                    billsTreeSpreadObj.refreshPosData();
                 }
             }
             billsTreeSpreadObj.loadExprToInput(info.sheet);
         },
+        refreshPosData: function() {
+            SpreadJsObj.resetTopAndSelect(posSheet);
+            posSpreadObj.loadCurPosData();
+            SpreadJsObj.saveTopAndSelect(billsSheet, ckBillsSpread);
+            posSearch.search($('#pos-keyword').val());
+        },
         /**
          * 新增节点
          * @param spread
@@ -468,6 +473,7 @@ $(document).ready(() => {
                         const sel = sheet.getSelections()[0];
                         if (sel) {
                             sheet.setSelection(sel.row, sel.col, 1, sel.colCount);
+                            billsTreeSpreadObj.refreshPosData();
                         }
                         self.refreshOperationValid(sheet);
                     });
@@ -493,6 +499,7 @@ $(document).ready(() => {
                         if (sel) {
                             sheet.setSelection(tree.nodes.indexOf(refreshData.create[0]), sel.col, sel.rowCount, sel.colCount);
                             SpreadJsObj.reloadRowsBackColor(sheet, [sel.row, tree.nodes.indexOf(refreshData.create[0])]);
+                            billsTreeSpreadObj.refreshPosData();
                         }
                     }
                     self.refreshOperationValid(sheet);
@@ -1888,7 +1895,8 @@ $(document).ready(() => {
 
         posSpreadObj.loadCurPosData();
         SpreadJsObj.resetTopAndSelect(posSheet);
-
+        billsTreeSpreadObj.refreshOperationValid(billsSheet);
+        billsTreeSpreadObj.loadExprToInput(billsSheet);
         checkList.loadHisCheckData();
     }, null);
     $.divResizer({

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

@@ -119,6 +119,8 @@ $(document).ready(() => {
         keys: ['id', 'tender_id', 'ledger_id'],
         calcFields: ['sgfh_tp', 'sjcl_tp', 'qtcl_tp', 'total_price'],
         autoExpand: 3,
+        markExpandKey: 'revise-bills-expand',
+        markExpandSubKey: window.location.pathname.split('/')[2],
     };
     if (!isTz) {
         treeSetting.calcFields.push('deal_tp');
@@ -126,7 +128,7 @@ $(document).ready(() => {
     treeSetting.calcFun = function (node) {
         node.dgn_price = ZhCalc.round(ZhCalc.div(node.total_price, node.dgn_qty1), 2);
     };
-    const billsTree = createNewPathTree('revise', treeSetting);    
+    const billsTree = createNewPathTree('revise', treeSetting);
     // 初始化 计量单元
     const pos = new PosData({ id: 'id', ledgerId: 'lid' });
 
@@ -1696,7 +1698,7 @@ $(document).ready(() => {
                     const curCol = info.cellRange.col + iCol;
                     const colSetting = info.sheet.zh_setting.cols[curCol];
                     if (!colSetting) continue;
-                    
+
                     posData[colSetting.field] = trimInvalidChar(info.sheet.getText(curRow, curCol));
                     if (colSetting.type === 'Number') {
                         const num = _.toNumber(posData[colSetting.field]);
@@ -1869,7 +1871,7 @@ $(document).ready(() => {
         SpreadJsObj.resetTopAndSelect(posSheet);
 
         checkList.loadHisCheckData();
-    }, null);    
+    }, null);
     $.divResizer({
         select: '#revise-resize',
         callback: function () {