Browse Source

无意义的修改

MaiXinRong 5 years ago
parent
commit
e1eb00543d
4 changed files with 47 additions and 43 deletions
  1. 17 17
      app/public/js/ledger.js
  2. 15 11
      app/public/js/revise.js
  3. 14 14
      app/public/js/stage.js
  4. 1 1
      app/public/js/stage_change.js

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

@@ -49,7 +49,7 @@ $(document).ready(function() {
         node.dgn_price = ZhCalc.round(ZhCalc.div(node.total_price, node.dgn_qty1), 2);
     };
     const ledgerTree = createNewPathTree('ledger', treeSetting);
-    // 初始化 部位明细
+    // 初始化 计量单元
     const pos = new PosData({
         id: 'id', ledgerId: 'lid',
     });
@@ -380,7 +380,7 @@ $(document).ready(function() {
                 if (orgValue == info.editingText || ((!orgValue || orgValue === '') && (info.editingText === ''))) {
                     return;
                 }
-                // 台账模式,检查部位明细相关
+                // 台账模式,检查计量单元相关
                 if (checkTzMeasureType()) {
                     if (col.field === 'sgfh_qty' || col.field === 'sgfh_tp' ||
                         col.field === 'sjcl_qty' || col.field === 'sjcl_tp' ||
@@ -388,7 +388,7 @@ $(document).ready(function() {
                         if (!node.children || node.children.length ===0) {
                             const lPos = pos.getLedgerPos(node.id);
                             if (lPos && lPos.length > 0) {
-                                toastr.error('清单含有部位明细,请在部位明细输入数量');
+                                toastr.error('清单含有计量单元,请在计量单元输入数量');
                                 SpreadJsObj.reLoadRowData(info.sheet, info.row);
                                 return;
                             }
@@ -397,7 +397,7 @@ $(document).ready(function() {
                     if (col.field === 'b_code' && (info.editingText === '' || !info.editingText)) {
                         const lPos = pos.getLedgerPos(node.id);
                         if (lPos && lPos.length > 0) {
-                            toastr.error('清单含有部位明细,请先删除部位明细,再删除清单编号');
+                            toastr.error('清单含有计量单元,请先删除计量单元,再删除清单编号');
                             SpreadJsObj.reLoadRowData(info.sheet, info.row);
                             return;
                         }
@@ -455,7 +455,7 @@ $(document).ready(function() {
                             if (lPos && lPos.length > 0) {
                                 if (value === '' && colSetting.field === 'b_code') {
                                     if (!bHint) {
-                                        toastr.warning('清单含有部位明细,请先删除部位明细,再删除清单编号');
+                                        toastr.warning('清单含有计量单元,请先删除计量单元,再删除清单编号');
                                         bHint = true;
                                     }
                                     continue;
@@ -464,7 +464,7 @@ $(document).ready(function() {
                                     colSetting.field === 'sjcl_qty' || colSetting.field === 'sjcl_tp' ||
                                     colSetting.field === 'qtcl_qty' || colSetting.field === 'qtcl_tp') {
                                     if (!bHint) {
-                                        toastr.warning('清单含有部位明细,数量金额根据部位明细汇总计算所得,不可编辑');
+                                        toastr.warning('清单含有计量单元,数量金额根据计量单元汇总计算所得,不可编辑');
                                         bHint = true;
                                     }
                                     continue;
@@ -581,8 +581,8 @@ $(document).ready(function() {
             const hint = [];
             if (bParentHint) hint.push('含有子项的清单,不可粘贴数量、单价、金额');
             if (bGclHint) hint.push('工程量清单,不可粘贴设计数量');
-            if (bQtyHint) hint.push('含有部位明细的清单,不可粘贴数量');
-            if (bCodeHint) hint.push('含有部位明细的清单,清单编号不可粘贴空值');
+            if (bQtyHint) hint.push('含有计量单元的清单,不可粘贴数量');
+            if (bCodeHint) hint.push('含有计量单元的清单,清单编号不可粘贴空值');
             if (bNumHint) hint.push('单价、数量等应输入数字或可计算的表达式');
             // if (hint.length > 0) hint.unshift('复制粘贴的数据中,存在非法数据,已过滤:');
             // if (hint.length > 0) toastr.warning(hint.join('</br>'));
@@ -628,9 +628,9 @@ $(document).ready(function() {
                                 if (lPos && lPos.length > 0) {
                                     if (!bHint) {
                                         if (col.field === 'code') {
-                                            toastr.warning('清单含有部位明细,请先删除部位明细,再删除清单编号');
+                                            toastr.warning('清单含有计量单元,请先删除计量单元,再删除清单编号');
                                         } else {
-                                            toastr.warning('清单含有部位明细,数量金额根据部位明细汇总计算所得,不可删除');
+                                            toastr.warning('清单含有计量单元,数量金额根据计量单元汇总计算所得,不可删除');
                                         }
                                         bHint = true;
                                     }
@@ -1030,7 +1030,7 @@ $(document).ready(function() {
     }
 
     const posSearch = $.posSearch({selector: '#pos-search', searchSpread: posSpread});
-    // 台账模式加载部位明细数据
+    // 台账模式加载计量单元数据
     if (checkTzMeasureType()) {
         $.divResizer({
             select: '#main-resize',
@@ -1043,13 +1043,13 @@ $(document).ready(function() {
         });
         SpreadJsObj.initSheet(posSpread.getActiveSheet(), posSpreadSetting);
     }
-    // 绑定部位明细编辑事件
+    // 绑定计量单元编辑事件
     const posOperationObj = {
         editStarting: function (e, info) {
             posOperationObj.ledgerTreeNode = SpreadJsObj.getSelectObject(ledgerSpread.getActiveSheet());
         },
         /**
-         * 加载部位明细 根据当前台账选择节点
+         * 加载计量单元 根据当前台账选择节点
          */
         loadCurPosData: function () {
             const node = treeOperationObj.getSelectNode(ledgerSpread.getActiveSheet());
@@ -1082,11 +1082,11 @@ $(document).ready(function() {
                     SpreadJsObj.reLoadRowData(info.sheet, info.row);
                     return;
                 } else if (newText && newText !== '' && node.children && node.children.length > 0) {
-                    toastr.error('父节点不可插入部位明细');
+                    toastr.error('父节点不可插入计量单元');
                     SpreadJsObj.reLoadRowData(info.sheet, info.row);
                     return;
                 } else if (newText && newText !== '' && (!node.b_code || node.b_code === '')) {
-                    toastr.error('项目节不可插入部位明细');
+                    toastr.error('项目节不可插入计量单元');
                     SpreadJsObj.reLoadRowData(info.sheet, info.row);
                     return;
                 }
@@ -1204,7 +1204,7 @@ $(document).ready(function() {
             }
         },
         /**
-         * 删除 部位明细
+         * 删除 计量单元
          * @param sheet
          */
         deletePos: function (sheet) {
@@ -1243,7 +1243,7 @@ $(document).ready(function() {
                 return;
             }
             if (node.children && (node.children.length > 0)) {
-                toastr.error('仅清单子项可以含有部位明细');
+                toastr.error('仅清单子项可以含有计量单元');
                 posOperationObj.loadCurPosData();
                 return;
             }

+ 15 - 11
app/public/js/revise.js

@@ -64,7 +64,7 @@ $(document).ready(() => {
     // 加载至spread
     SpreadJsObj.loadSheetData(billsSheet, SpreadJsObj.DataType.Tree, billsTree);
     SpreadJsObj.loadTopAndSelect(billsSheet, ckBillsSpread);
-    // 初始化 部位明细
+    // 初始化 计量单元
     const pos = new PosData({ id: 'id', ledgerId: 'lid' });
     pos.loadDatas(posData);
 
@@ -315,7 +315,7 @@ $(document).ready(() => {
                 if (orgValue == info.editingText || ((!orgValue || orgValue === '') && (info.editingText === ''))) {
                     return;
                 }
-                // 台账模式,检查部位明细相关
+                // 台账模式,检查计量单元相关
                 if (isTz) {
                     if (col.field === 'sgfh_qty' || col.field === 'sgfh_tp' ||
                         col.field === 'sjcl_qty' || col.field === 'sjcl_tp' ||
@@ -323,7 +323,7 @@ $(document).ready(() => {
                         if (!node.children || node.children.length ===0) {
                             const lPos = pos.getLedgerPos(node.id);
                             if (lPos && lPos.length > 0) {
-                                toastr.error('清单含有部位明细,不可修改施工图复核数量');
+                                toastr.error('清单含有计量单元,不可修改施工图复核数量');
                                 SpreadJsObj.reLoadRowData(info.sheet, info.row);
                                 return;
                             }
@@ -332,7 +332,7 @@ $(document).ready(() => {
                     if (col.field === 'b_code' && (info.editingText === '' || !info.editingText)) {
                         const lPos = pos.getLedgerPos(node.id);
                         if (lPos && lPos.length > 0) {
-                            toastr.error('清单含有部位明细,请先删除部位明细,再删除清单编号');
+                            toastr.error('清单含有计量单元,请先删除计量单元,再删除清单编号');
                             SpreadJsObj.reLoadRowData(info.sheet, info.row);
                             return;
                         }
@@ -395,8 +395,8 @@ $(document).ready(() => {
                 usedUp: {type: 'error', msg: '清单已计量,不可修改单价'},
                 usedCode: {type: 'error', msg: '清单已计量,编号不可修改为空值'},
                 invalidExpr: {type: 'error', msg: '粘贴的表达式非法'},
-                posCode: {type: 'error', msg: '清单含有部位明细,请先删除部位明细,再修改清单编号为空'},
-                posQty: {type: 'error', msg: '清单含有部位明细,数量金额根据部位明细汇总计算所得,不可修改'},
+                posCode: {type: 'error', msg: '清单含有计量单元,请先删除计量单元,再修改清单编号为空'},
+                posQty: {type: 'error', msg: '清单含有计量单元,数量金额根据计量单元汇总计算所得,不可修改'},
             };
 
             const tree = info.sheet.zh_tree;
@@ -514,6 +514,10 @@ $(document).ready(() => {
                 pos.updateDatas(data.pos);
                 const result = tree.loadPostData(data.ledger);
                 self.refreshTree(sheet, result);
+                const sel = sheet.getSelections()[0];
+                if (sel) {
+                    sheet.setSelection(tree.nodes.indexOf(refreshData.create[0]), sel.col, sel.rowCount, sel.colCount);
+                }
                 self.refreshOperationValid(sheet);
                 removeLocalCache(copyBlockTag);
             }, null, true);
@@ -638,7 +642,7 @@ $(document).ready(() => {
 
     const posSpreadObj = {
         /**
-         * 加载部位明细 根据当前台账选择节点
+         * 加载计量单元 根据当前台账选择节点
          */
         loadCurPosData: function () {
             const node = SpreadJsObj.getSelectObject(billsSheet);
@@ -676,11 +680,11 @@ $(document).ready(() => {
                 SpreadJsObj.reLoadRowData(info.sheet, info.row);
                 return;
             } else if (newText && newText !== '' && node.children && node.children.length > 0) {
-                toastr.error('父节点不可插入部位明细');
+                toastr.error('父节点不可插入计量单元');
                 SpreadJsObj.reLoadRowData(info.sheet, info.row);
                 return;
             } else if (newText && newText !== '' && (!node.b_code || node.b_code === '')) {
-                toastr.error('项目节不可插入部位明细');
+                toastr.error('项目节不可插入计量单元');
                 SpreadJsObj.reLoadRowData(info.sheet, info.row);
                 return;
             }
@@ -790,7 +794,7 @@ $(document).ready(() => {
             }
         },
         /**
-         * 删除 部位明细
+         * 删除 计量单元
          * @param sheet
          */
         deletePos: function (sheet) {
@@ -850,7 +854,7 @@ $(document).ready(() => {
                 return;
             }
             if (node.children && (node.children.length > 0)) {
-                toastr.error('仅清单子项可以含有部位明细');
+                toastr.error('仅清单子项可以含有计量单元');
                 posSpreadObj.loadCurPosData();
                 return;
             }

+ 14 - 14
app/public/js/stage.js

@@ -162,7 +162,7 @@ $(document).ready(() => {
         node.final_dgn_price = ZhCalc.round(ZhCalc.div(node.end_gather_tp, ZhCalc.add(node.deal_dgn_qty1, node.c_dgn_qty1)), tenderInfo.decimal.up);
     };
     const stageTree = createNewPathTree('stage', stageTreeSetting);
-    // 初始化 部位明细 数据结构
+    // 初始化 计量单元 数据结构
     const stagePosSetting = {
         id: 'id', ledgerId: 'lid',
         updateFields: ['contract_qty', 'qc_qty', 'postil'],
@@ -467,7 +467,7 @@ $(document).ready(() => {
     //初始化所有附件列表
     getAllList();
 
-    // 初始化 部位明细 Spread
+    // 初始化 计量单元 Spread
     const spSpread = SpreadJsObj.createNewSpread($('#stage-pos')[0]);
     const spCol = _.find(posSpreadSetting.cols, {field: 'qc_qty'});
     spCol.readOnly = true;
@@ -556,7 +556,7 @@ $(document).ready(() => {
                     } else {
                         const nodePos = stagePos.getLedgerPos(node.id);
                         if (nodePos && nodePos.length > 0) {
-                            toastr.error('该清单有部位明细,请在部位明细处计量');
+                            toastr.error('该清单有计量单元,请在计量单元处计量');
                             SpreadJsObj.reLoadRowData(info.sheet, info.row);
                             return;
                         }
@@ -789,7 +789,7 @@ $(document).ready(() => {
                 }
             }
             if (data.updateData.length === 0) {
-                toastr.info('其下全部部位明细均已计量');
+                toastr.info('其下全部计量单元均已计量');
                 return;
             }
             postData(window.location.pathname + '/update', {pos: data}, function (result) {
@@ -824,7 +824,7 @@ $(document).ready(() => {
         },
         items: {
             'measureAll': {
-                name: '计量其下所有部位明细',
+                name: '计量其下所有计量单元',
                 icon: 'fa-rocket',
                 callback: function (key, opt) {
                     const node = SpreadJsObj.getSelectObject(slSpread.getActiveSheet());
@@ -836,7 +836,7 @@ $(document).ready(() => {
                 }
             },
             'measureAllFiveTenth': {
-                name: '计量其下所有部位明细(计量50%)',
+                name: '计量其下所有计量单元(计量50%)',
                 icon: 'fa-plane',
                 callback: function (key, opt) {
                     const node = SpreadJsObj.getSelectObject(slSpread.getActiveSheet());
@@ -848,7 +848,7 @@ $(document).ready(() => {
                 }
             },
             'measureAllOneTenth': {
-                name: '计量其下所有部位明细(计量10%)',
+                name: '计量其下所有计量单元(计量10%)',
                 icon: 'fa-car',
                 callback: function (key, opt) {
                     const node = SpreadJsObj.getSelectObject(slSpread.getActiveSheet());
@@ -860,7 +860,7 @@ $(document).ready(() => {
                 }
             },
             'hint1': {
-                name: '最多计量200条清单下1000条部位明细',
+                name: '最多计量200条清单下1000条计量单元',
                 className: 'text-danger',
                 visible: function (key, opt) {
                     const select = SpreadJsObj.getSelectObject(slSpread.getActiveSheet());
@@ -987,7 +987,7 @@ $(document).ready(() => {
             }
         },
         /**
-         * 加载部位明细 根据当前台账选择节点
+         * 加载计量单元 根据当前台账选择节点
          */
         loadCurPosData: function () {
             const node = SpreadJsObj.getSelectObject(slSpread.getActiveSheet());
@@ -1015,11 +1015,11 @@ $(document).ready(() => {
                 }
                 // 台账模式下,不可新增
                 if (checkTzMeasureType() && !posData) {
-                    toastr.error('台账模式不可新增部位明细数据');
+                    toastr.error('台账模式不可新增计量单元数据');
                     SpreadJsObj.reLoadRowData(info.sheet, info.row);
                     return ;
                 }
-                // 不同节点下,部位明细检查输入
+                // 不同节点下,计量单元检查输入
                 //const node = SpreadJsObj.getSelectObject(slSpread.getActiveSheet());
                 const node = stagePosSpreadObj.stageTreeNode;
                 if (!node) {
@@ -1027,11 +1027,11 @@ $(document).ready(() => {
                     SpreadJsObj.reLoadRowData(info.sheet, info.row);
                     return;
                 } else if (info.editingText !== '' && node.children && node.children > 0) {
-                    toastr.error('父节点不可插入部位明细');
+                    toastr.error('父节点不可插入计量单元');
                     SpreadJsObj.reLoadRowData(info.sheet, info.row);
                     return;
                 } else if (info.editingText !== '' && !node.b_code || node.b_code === '') {
-                    toastr.error('项目节不可插入部位明细');
+                    toastr.error('项目节不可插入计量单元');
                     SpreadJsObj.reLoadRowData(info.sheet, info.row);
                     return;
                 }
@@ -1290,7 +1290,7 @@ $(document).ready(() => {
         }
     });
 
-    // 加载部位明细数据 - 暂时统一加载,如有需要,切换成动态加载并缓存
+    // 加载计量单元数据 - 暂时统一加载,如有需要,切换成动态加载并缓存
     console.time('loadPosFromServer');
     postData(window.location.pathname + '/pos', null, function (result) {
         console.timeEnd('loadPosFromServer');

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

@@ -117,7 +117,7 @@ $(document).ready(() => {
         cols: [
             {title: '相关台账|项目节编号', colSpan: '5|1', rowSpan: '1|1', field: 'l_code', hAlign: 0, width: 120, formatter: '@', readOnly: true},
             {title: '|名称', colSpan: '|1', rowSpan: '1', field: 'l_name', hAlign: 0, width: 150, formatter: '@', readOnly: true},
-            {title: '|部位明细', colSpan: '|1', rowSpan: '1', field: 'p_name', hAlign: 0, width: 150, type: 'Number', readOnly: true},
+            {title: '|计量单元', colSpan: '|1', rowSpan: '1', field: 'p_name', hAlign: 0, width: 150, type: 'Number', readOnly: true},
             {title: '|0号台帐数量', colSpan: '|1', rowSpan: '1', field: 'l_qty', hAlign: 2, width: 80, formatter: '@', readOnly: true},
             {title: '|本期变更数量', colSpan: '|1', rowSpan: '1', field: 'qty', hAlign: 2, width: 80, type: 'Number', readOnly: true},
         ],