Quellcode durchsuchen

Merge branch 'master' of http://smartcost.f3322.net:3000/SmartCost/ConstructionOperation

TonyKang vor 7 Jahren
Ursprung
Commit
6981a6b61c

+ 0 - 9
modules/bills_lib/controllers/bills_lib_controllers.js

@@ -3,15 +3,6 @@
  */
 
 let billsLibDao = require("./../models/bills_lib_interfaces");
-//----
-/*let model = require("./../models/bills_lib_model");
-var counter = require("../../../public/counter/counter");
-var StdBillsLib = model.stdBillsLibMod;
-var Bills = model.billsMod;
-var JobContent = model.jobContentMod;
-var ItemCharacter = model.itemCharacterMod;*/
-//---
-//ͳһ�ص�����
 let callback = function(req, res, err, message, data){
     res.json({error: err, message: message, data: data});
 }

+ 2 - 2
modules/bills_lib/models/bills_lib_interfaces.js

@@ -2794,9 +2794,9 @@ billsLibDao.prototype.pasteValues = function(data, callback) {
                         });
                 }
             }
-            else {
+            else if(data.type === 'Update' && data.field === 'value') {
                 return function (cb){
-                    ItemCharacter.update({billsLIbId: billsLibId, id: itemId, 'itemValue.code': orgCode}, {$set: {'itemValue.$.value': data.data}}, function(err){
+                    ItemCharacter.update({billsLibId: billsLibId, id: itemId, 'itemValue.code': orgCode}, {$set: {'itemValue.$.value': data.data}}, function(err){
                         if(err){
                             cb(err);
                         }

+ 20 - 0
modules/ration_repository/controllers/ration_section_tree_controller.js

@@ -49,6 +49,26 @@ class RationChapterTreeController extends BaseController{
             callback(req,res, err, "", results)
         });
     }
+    updateExplanation(req, res){
+        let repId = req.body.repId,
+            nodeId = req.body.nodeId,
+            explanation = req.body.explanation,
+            lastOpr = req.body.lastOpr;
+        rationChapterTreeData.updateExplanation(lastOpr, repId, nodeId, explanation, function (err) {
+            callback(req, res, err, '', null);
+        });
+
+    }
+    updateRuleText(req, res){
+        let repId = req.body.repId,
+            nodeId = req.body.nodeId,
+            ruleText = req.body.ruleText,
+            lastOpr = req.body.lastOpr;
+        rationChapterTreeData.updateRuleText(lastOpr, repId, nodeId, ruleText, function (err) {
+            callback(req, res, err, '', null);
+        });
+
+    }
 }
 
 export default RationChapterTreeController;

+ 27 - 0
modules/ration_repository/models/ration_section_tree.js

@@ -16,6 +16,8 @@ var rationChapterTreeSchema = new Schema({//章节树  //生成唯一id改为sec
     ParentID:Number,
     NextSiblingID:Number,
     name: String,
+    explanation: String,//说明
+    ruleText: String,//计算规则
     isDeleted: Boolean
 });
 var rationChapterTreeModel = chapterTreeDb.model("std_ration_lib_ration_chapter_trees", rationChapterTreeSchema, "std_ration_lib_ration_chapter_trees");
@@ -116,6 +118,31 @@ rationChapterTreeDAO.prototype.removeNodes = function(repId, lastOpr, nodeIds, p
     });
 }
 
+rationChapterTreeDAO.prototype.updateExplanation = function (lastOpr, repId, nodeId, explanation, callback) {
+    rationChapterTreeModel.update({rationRepId: repId, ID: nodeId}, {$set: {explanation: explanation}}, function (err, result) {
+        if(err){
+            callback(err);
+        }
+        else{
+            rationRepositoryDao.updateOprArr({ID: repId}, lastOpr, moment(Date.now()).format('YYYY-MM-DD HH:mm:ss'), function (err) {
+                callback(null);
+            });
+        }
+    });
+};
+rationChapterTreeDAO.prototype.updateRuleText = function (lastOpr, repId, nodeId, ruleText, callback) {
+    rationChapterTreeModel.update({rationRepId: repId, ID: nodeId}, {$set: {ruleText: ruleText}}, function (err, result) {
+        if(err){
+            callback(err);
+        }
+        else{
+            rationRepositoryDao.updateOprArr({ID: repId}, lastOpr, moment(Date.now()).format('YYYY-MM-DD HH:mm:ss'), function (err) {
+                callback(null);
+            });
+        }
+    });
+};
+
 rationChapterTreeDAO.prototype.updateNodes = function(repId, lastOpr, nodes,callback){
     var functions = [];
     for (var i=0; i < nodes.length; i++) {

+ 2 - 81
modules/ration_repository/routes/ration_rep_routes.js

@@ -19,18 +19,7 @@ let coeListController = new CoeListController();
 let searchController = new SearchController();
 let repositoryGljController = new RepositoryGljController();
 
-/*
-var rationRepositoryController = require("../controllers/ration_repository_controller");
-var rationChapterTreeController = require("../controllers/ration_section_tree_controller");
-var rationController = require("../controllers/ration_controller");
-var repositoryGljController = require("../controllers/repository_glj_controller");
-var coeListController = require("../controllers/coe_controller");
-var searchController = require('../controllers/search_controller');
-*/
-
-
 module.exports =  function (app) {
-
     app.get('/rationRepository/main', viewsController.auth, viewsController.init, viewsController.redirectMain);
     app.get('/rationRepository/ration',viewsController.auth, viewsController.init, viewsController.redirectRation);
     app.get('/rationRepository/lmm', viewsController.auth, viewsController.init, viewsController.redirectGlj);
@@ -50,6 +39,8 @@ module.exports =  function (app) {
     apiRouter.post("/createNewNode",rationChapterTreeController.auth, rationChapterTreeController.init, rationChapterTreeController.createNewNode);
     apiRouter.post("/updateNodes",rationChapterTreeController.auth, rationChapterTreeController.init, rationChapterTreeController.updateNodes);
     apiRouter.post("/deleteNodes",rationChapterTreeController.auth, rationChapterTreeController.init, rationChapterTreeController.deleteNodes);
+    apiRouter.post("/updateExplanation",rationChapterTreeController.auth, rationChapterTreeController.init, rationChapterTreeController.updateExplanation);
+    apiRouter.post("/updateRuleText",rationChapterTreeController.auth, rationChapterTreeController.init, rationChapterTreeController.updateRuleText);
 
     apiRouter.post("/getRationItems",rationController.auth, rationController.init, rationController.getRationItemsBySection);
     apiRouter.post("/mixUpdateRationItems",rationController.auth, rationController.init, rationController.mixUpdateRationItems);
@@ -76,73 +67,3 @@ module.exports =  function (app) {
 
     app.use("/rationRepository/api",apiRouter);
 }
-
-/*module.exports =  function (app) {
-
-    app.get('/rationRepository/main', function(req, res) {
-        res.render('maintain/ration_repository/main.html',
-            {
-                userAccount: req.session.userAccount,
-                userID: req.session.userID
-            });
-    });
-    app.get('/rationRepository/ration', function(req, res) {
-        res.render('maintain/ration_repository/dinge.html',
-            {
-                userAccount: req.session.userAccount,
-                userID: req.session.userID
-            });
-    });
-    app.get('/rationRepository/lmm', function(req, res) {
-        res.render('maintain/ration_repository/gongliao.html',
-            {
-                userAccount: req.session.userAccount,
-                userID: req.session.userID
-            });
-    });
-
-    app.get('/rationRepository/coeList', function(req, res) {
-        res.render('maintain/ration_repository/fuzhu.html',
-            {
-                userAccount: req.session.userAccount,
-                userID: req.session.userID
-            });
-    });
-
-    apiRouter.post("/getRationDisplayNames",rationRepositoryController.getDisPlayRationLibs);
-    apiRouter.post("/editRationLibs",rationRepositoryController.updateRationRepositoryName);
-    apiRouter.post("/addRationRepository",rationRepositoryController.addRationRepository);
-    apiRouter.post("/deleteRationLibs",rationRepositoryController.deleteRationLib);
-    apiRouter.post("/getRealLibName",rationRepositoryController.getRealLibName);
-    apiRouter.post("/getLibIDByName",rationRepositoryController.getLibIDByName);
-
-    apiRouter.post("/getRationTree",rationChapterTreeController.getRationChapterTree);
-    apiRouter.post("/createNewNode",rationChapterTreeController.createNewNode);
-    apiRouter.post("/updateNodes",rationChapterTreeController.updateNodes);
-    apiRouter.post("/deleteNodes",rationChapterTreeController.deleteNodes);
-
-    apiRouter.post("/getRationItems",rationController.getRationItemsBySection);
-    apiRouter.post("/mixUpdateRationItems",rationController.mixUpdateRationItems);
-    apiRouter.post("/updateRationBasePrc",rationController.updateRationBasePrc);
-    apiRouter.post("/getRationGljIds",rationController.getRationGljIds);
-    apiRouter.post("/getRationsCodes",rationController.getRationsCodes);
-
-    apiRouter.post("/createNewGljTypeNode",repositoryGljController.createNewGljTypeNode);
-    apiRouter.post("/updateGljNodes",repositoryGljController.updateGljNodes);
-    apiRouter.post("/deleteGljNodes",repositoryGljController.deleteGljNodes);
-    apiRouter.post("/getGljDistType",repositoryGljController.getGljDistType);
-    apiRouter.post("/getGljTree",repositoryGljController.getGljTree);
-    apiRouter.post("/getGljItems",repositoryGljController.getGljItems);
-    apiRouter.post("/mixUpdateGljItems",repositoryGljController.mixUpdateGljItems);
-    apiRouter.post("/getGljItemsByIds",repositoryGljController.getGljItemsByIds);
-    apiRouter.post("/getGljItemsByCodes",repositoryGljController.getGljItemsByCodes);
-
-    apiRouter.post("/getCoeList",coeListController.getCoeList);
-    apiRouter.post("/saveCoeList",coeListController.saveCoeList);
-    apiRouter.post("/getCoeItemsByIDs",coeListController.getCoeItemsByIDs);
-
-    apiRouter.post('/getRationItem', searchController.getRationItem);
-    apiRouter.post('/findRation', searchController.findRation);
-
-    app.use("/rationRepository/api",apiRouter);
-}*/

+ 1 - 0
modules/std_glj_lib/models/schemas.js

@@ -51,6 +51,7 @@ let gljSchema = new Schema({
     code: String,
     name: String,
     specs: String,
+    unit: String,
     basePrice: Number,
     gljClass: Number,
     gljType: Number,

+ 10 - 0
public/web/sheet/sheet_common.js

@@ -10,6 +10,7 @@ var sheetCommonObj = {
         spreadBook.options.allowCopyPasteExcelStyle = false;
         spreadBook.options.tabStripVisible = false;
         spreadBook.options.showHorizontalScrollbar = false;
+        spreadBook.options.allowUserDragDrop = false;
         return spreadBook;
     },
 
@@ -37,6 +38,7 @@ var sheetCommonObj = {
         spreadBook.options.scrollbarMaxAlign = true;
         spreadBook.options.allowCopyPasteExcelStyle = false;
         spreadBook.options.allowExtendPasteRange = true;
+        spreadBook.options.allowUserDragDrop = false;
         var spreadNS = GC.Spread.Sheets;
         var sheet = spreadBook.getSheet(0);
         sheet.suspendPaint();
@@ -62,6 +64,14 @@ var sheetCommonObj = {
             sheet.setColumnWidth(i, setting.header[i].headerWidth?setting.header[i].headerWidth:100);
         }
     },
+    cleanData: function (sheet, setting, rowCount) {
+        sheet.suspendPaint();
+        sheet.suspendEvent();
+        sheet.clear(-1, 0, -1, setting.header.length, GC.Spread.Sheets.SheetArea.viewport, GC.Spread.Sheets.StorageType.data);
+        if (rowCount > 0) sheet.setRowCount(rowCount);
+        sheet.resumeEvent();
+        sheet.resumePaint();
+    },
     cleanSheet: function(sheet, setting, rowCount) {
         sheet.suspendPaint();
         sheet.suspendEvent();

+ 1 - 0
web/maintain/bills_lib/html/tezheng.html

@@ -438,6 +438,7 @@
                     }
                 }
                 let encapDatas = tools.encapValues(sheet, totalItems, uncrossedDatas, crossedDatas);
+                console.log(encapDatas);
                 if(encapDatas.updateDatas.length > 0 || encapDatas.createDatas.length > 0){
                     itemsAjax.pasteValues(userAccount, billsLibId, encapDatas, function(datas){
                         pasteController.pasteValueFront(sheet, totalItems, datas);

+ 1 - 0
web/maintain/bills_lib/scripts/set_sheets.js

@@ -11,6 +11,7 @@ var setSheet = {
         spread.options.scrollbarMaxAlign = true;
         spread.options.allowCopyPasteExcelStyle = false;
         spread.options.allowExtendPasteRange = isExtendPaste? true : false;
+        spread.options.allowUserDragDrop = false;
         spread.getActiveSheet().options.allowCellOverflow = false;
         sheet.showRowOutline(false);
        // sheet.defaults.rowHeight = 30;

+ 9 - 8
web/maintain/ration_repository/dinge.html

@@ -61,7 +61,7 @@
                               <a class="nav-link active" data-toggle="tab" href="#tde" role="tab">定额</a>
                           </li>
                           <li class="nav-item">
-                              <a class="nav-link" data-toggle="tab" href="#tsm" role="tab">说明</a>
+                              <a class="nav-link" data-toggle="tab" href="#tsm" role="tab" id="explanationLink">说明</a>
                           </li>
                           <li class="nav-item">
                               <a class="nav-link" data-toggle="tab" href="#tjs" role="tab">计算规则</a>
@@ -104,19 +104,20 @@
                           <!--说明-->
                           <div class="tab-pane" id="tsm" role="tabpanel">
                               <div class="main-data">
-                                  <div class="m-2"><a href="javacript:void(0);" data-toggle="modal" data-target="#editTsm" title="编辑">编辑说明</a></div>
+                                <!--  <div class="m-2"><a href="javacript:void(0);" data-toggle="modal" data-target="#editTsm" title="编辑">编辑说明</a></div>-->
                                   <div class="main-content m-2">
-                                      <h5>说明</h5><p>一、一般说明</p><p>1.土壤及岩石分类,详见土壤及岩石分类表。</p><p>2.....</p>
+                                      <h5>说明</h5>
+                                      <textarea id="explanationShow" class="form-control"   rows="7" style="background: white;"></textarea>
                                   </div>
                               </div>
                           </div>
                           <!--计算规则-->
                           <div class="tab-pane" id="tjs" role="tabpanel">
                               <div class="main-data">
-                                  <div class="m-2"><a href="javacript:void(0);" data-toggle="modal" data-target="#editTjs" title="编辑">编辑计算规则</a></div>
+                         <!--         <div class="m-2"><a href="javacript:void(0);" data-toggle="modal" data-target="#editTjs" title="编辑">编辑计算规则</a></div>-->
                                   <div class="main-content m-2">
                                       <h5>计算规则</h5>
-                                      <p>土壤、岩石体积,均按挖掘前的天然密度体积以立方米计算。.....</p>
+                                      <textarea id="ruleTextShow" class="form-control"   rows="7" style="background: white;"></textarea>
                                   </div>
                               </div>
                           </div>
@@ -290,13 +291,13 @@
                         <form>
                             <div class="form-group">
                                 <label>内容</label>
-                                <textarea class="form-control" rows="5"></textarea>
+                                <textarea class="form-control" rows="5" id="explanationAdd"></textarea>
                             </div>
                         </form>
                     </div>
                     <div class="modal-footer">
                         <button type="button" class="btn btn-secondary" data-dismiss="modal">取消</button>
-                        <a href="" class="btn btn-primary">确定</a>
+                        <a href="javascript:void(0);" class="btn btn-primary" id="explanationBtn" data-dismiss="modal">确定</a>
                     </div>
                 </div>
             </div>
@@ -320,7 +321,7 @@
                     </div>
                     <div class="modal-footer">
                         <button type="button" class="btn btn-secondary" data-dismiss="modal">取消</button>
-                        <a href="" class="btn btn-primary">确定</a>
+                        <a href="javascript:void(0);" class="btn btn-primary" data-dismiss="modal" id="ruleTextAdd">确定</a>
                     </div>
                 </div>
             </div>

+ 103 - 4
web/maintain/ration_repository/js/section_tree.js

@@ -35,6 +35,13 @@ var zTreeOprObj = {
                         storageUtil.setSessionCache("RationGrp","repositoryID",result.data[0].rationRepId);
                     }
                     zTreeHelper.createTree(result.data, setting, "rationChapterTree", me);
+                    //初始化,初始节点点击
+                    let rootNode = me.treeObj.getNodes()[0];
+                    if(rootNode && rootNode.isParent && rootNode.isFirstNode){
+                        me.treeObj.selectNode(rootNode);
+                        me.onClick(null, 'rationChapterTree', rootNode);
+                    }
+                    explanatoryOprObj.bindEvents($('#explanationShow'), $('#ruleTextShow'));
                 }
             },
             error:function(err){
@@ -185,7 +192,7 @@ var zTreeOprObj = {
             }
             //上移
             else if(treeNode.level === targetNode.level && moveType === 'prev'){
-                    console.log(1);
+
                     if(targetNode.Previous_ID !== -1){
                         let targetPrev = me.treeObj.getNodeByParam('ID', targetNode.Previous_ID,  null);
                         targetPrev.NextSiblingID = treeNode.ID;
@@ -260,7 +267,6 @@ var zTreeOprObj = {
                 else node.__v = 0;
                 reqData.push(node);
             }
-            console.log(reqData);
             $.ajax({
                 type:"POST",
                 url:"api/updateNodes",
@@ -305,7 +311,6 @@ var zTreeOprObj = {
                         }
                         newNodes.push({ rationRepId: rst.data.rationRepId, ID: rst.data.ID, Previous_ID: lastNodeId, ParentID: rst.data.ParentID, NextSiblingID:-1, name:"新增子节点",isParent:false, items:[]});
                         treeNode.isParent = true;
-                        console.log(newNodes);
                         if (me.treeObj) {
                             me.treeObj.addNodes(treeNode, -1, newNodes, isSilent);
                         } else {
@@ -322,6 +327,9 @@ var zTreeOprObj = {
         $("#addBtn_"+treeNode.tId).unbind().remove();
     },
     onClick: function(event,treeId,treeNode) {
+        explanatoryOprObj.setAttribute(explanatoryOprObj.currentTreeNode ? explanatoryOprObj.currentTreeNode : treeNode, treeNode, treeNode.explanation, treeNode.ruleText);
+        explanatoryOprObj.clickUpdate($('#explanationShow'), $('#ruleTextShow'));
+        explanatoryOprObj.showText($('#explanationShow'), $('#ruleTextShow'), treeNode.explanation, treeNode.ruleText);
         var sectionID = treeNode.ID;
         if (!(treeNode.items) || treeNode.items.length == 0) {
             rationOprObj.getRationItems(sectionID);
@@ -332,5 +340,96 @@ var zTreeOprObj = {
         sheetCommonObj.cleanSheet(rationGLJOprObj.sheet, rationGLJOprObj.setting, -1);
         sheetCommonObj.shieldAllCells(rationGLJOprObj.sheet);
     }
-
+};
+//定额章节节点说明、计算规则
+let explanatoryOprObj = {
+    preTreeNode: null,
+    currentTreeNode: null,//定额章节树节点
+    currentExplanation: null,
+    currentRuleText: null,
+    setAttribute: function (preNode, currentNode, explanation, ruleText) {
+        let me = explanatoryOprObj;
+        me.preTreeNode = preNode;
+        me.currentTreeNode = currentNode;
+        me.currentExplanation = explanation;
+        me.currentRuleText = ruleText;
+    },
+    clickUpdate: function (exarea, ruarea) {//解决编辑完后在未失去焦点的时候直接定额章节树
+        let me = explanatoryOprObj;
+        if(exarea.is(':focus')){
+            let explanation = exarea.val();
+            if(explanation !== me.currentExplanation){
+                me.preTreeNode.explanation = explanation;
+                me.unbindEvents(exarea, ruarea);
+                exarea.blur();
+                me.updateExplanation(me.preTreeNode.rationRepId, me.preTreeNode.ID, explanation, function () {
+                    me.bindEvents(exarea, ruarea);
+                });
+            }
+        }
+        if(ruarea.is(':focus')){
+            let ruleText = ruarea.val();
+            if(ruleText !== me.currentRuleText){
+                me.preTreeNode.ruleText = ruleText;
+                me.unbindEvents(exarea, ruarea);
+                ruarea.blur();
+                me.updateRuleText(me.preTreeNode.rationRepId, me.preTreeNode.ID, ruleText, function () {
+                    me.bindEvents(exarea, ruarea);
+                });
+            }
+        }
+    },
+    unbindEvents: function (exarea, ruarea) {
+        exarea.unbind();
+        ruarea.unbind();
+    },
+    bindEvents: function (exarea, ruarea) {
+        let me = explanatoryOprObj;
+        exarea.bind('change', function () {
+            let explanation = exarea.val();
+            let node = me.currentTreeNode;
+            exarea.attr('disabled', true);
+            me.updateExplanation(node.rationRepId, node.ID, explanation, function () {
+                node.explanation = explanation;
+                exarea.attr('disabled', false);
+            });
+        });
+        ruarea.bind('change', function () {
+            let ruleText = ruarea.val();
+            let node = me.currentTreeNode;
+            ruarea.attr('disabled', true);
+            me.updateRuleText(node.rationRepId, node.ID, ruleText, function () {
+                node.ruleText = ruleText;
+                ruarea.attr('disabled', false);
+            });
+        });
+    },
+    showText: function (exarea, ruarea, explanation, ruleText) {
+        exarea.val(explanation && explanation !== 'undefined' ? explanation : '');
+        ruarea.val(ruleText && ruleText !== 'undefined' ? ruleText : '');
+    },
+    //更新说明
+    updateExplanation: function (repId, nodeId, explanation, callback) {
+        $.ajax({
+            type: 'post',
+            url: 'api/updateExplanation',
+            data: {lastOpr: userAccount, repId: repId, nodeId: nodeId, explanation: explanation},
+            dataType: 'json',
+            success: function () {
+                callback();
+            }
+        });
+    },
+    //更新计算规则
+    updateRuleText: function (repId, nodeId, explanation, callback) {
+        $.ajax({
+            type: 'post',
+            url: 'api/updateRuleText',
+            data: {lastOpr: userAccount, repId: repId, nodeId: nodeId, explanation: explanation},
+            dataType: 'json',
+            success: function () {
+                callback();
+            }
+        });
+    }
 };

+ 22 - 19
web/maintain/std_glj_lib/js/glj.js

@@ -191,7 +191,8 @@ let repositoryGljObj = {
                     cacheSection.push(data[i]);
                 }
             }
-            sheetCommonObj.cleanSheet(me.workBook.getSheet(0), me.setting, -1);
+            //sheetCommonObj.cleanSheet(me.workBook.getSheet(0), me.setting, -1);
+            sheetCommonObj.cleanData(me.workBook.getSheet(0), me.setting, -1);
             sheetCommonObj.showData(me.workBook.getSheet(0), me.setting, cacheSection, me.distTypeTree);
 
             cacheSection = null;
@@ -413,7 +414,6 @@ let repositoryGljObj = {
             rObj = sheetCommonObj.combineRowData(me.workBook.getSheet(0), me.setting, args.row, me),
             updateArr = [], addArr = [], updateBasePrcArr = [];
         me.editingRowIdx = args.row;
-        console.log(rObj);
         rObj.basePrice = rObj.basePrice ? rObj.basePrice : 0;
         //更新
         if (me.currentEditingGlj["ID"]) {
@@ -695,19 +695,20 @@ let repositoryGljObj = {
             }
             if(!isExsit) isValid = false;
         }
-        //
-        pasteObj.basePrice = !isNaN(parseFloat(pasteObj.basePrice)) && (pasteObj.basePrice && typeof pasteObj.basePrice !== 'undefined') ? that.round(parseFloat(pasteObj.basePrice), 2) :
-            me.currentCache[rowIdx].basePrice;
-        if(pasteObj.basePrice !== me.currentCache[rowIdx].basePrice){
-            reCalBasePrc = true;
-            tempObj.basePrice = pasteObj.basePrice;
-            let updateGljs = me.getUpdateGljs(tempObj, false);
-            if(updateGljs.updateArr.length > 0 || updateGljs.updateBasePrcArr.length > 0){
-                for(let i = 0; i < updateGljs.updateArr.length; i++){
-                    rst.updateGlj.push(updateGljs.updateArr[i]);
-                }
-                for(let i = 0; i < updateGljs.updateBasePrcArr.length; i++){
-                    rst.updateBasePrcArr.push(updateGljs.updateBasePrcArr[i]);
+        if(typeof pasteObj.basePrice !== 'undefined'){
+            pasteObj.basePrice = !isNaN(parseFloat(pasteObj.basePrice)) && (pasteObj.basePrice && typeof pasteObj.basePrice !== 'undefined') ? that.round(parseFloat(pasteObj.basePrice), 2) :
+                me.currentCache[rowIdx].basePrice;
+            if(pasteObj.basePrice !== me.currentCache[rowIdx].basePrice){
+                reCalBasePrc = true;
+                tempObj.basePrice = pasteObj.basePrice;
+                let updateGljs = me.getUpdateGljs(tempObj, false);
+                if(updateGljs.updateArr.length > 0 || updateGljs.updateBasePrcArr.length > 0){
+                    for(let i = 0; i < updateGljs.updateArr.length; i++){
+                        rst.updateGlj.push(updateGljs.updateArr[i]);
+                    }
+                    for(let i = 0; i < updateGljs.updateBasePrcArr.length; i++){
+                        rst.updateBasePrcArr.push(updateGljs.updateBasePrcArr[i]);
+                    }
                 }
             }
         }
@@ -783,9 +784,11 @@ let repositoryGljObj = {
                 for(let i = 0; i < items.length; i++){
                     let updateObj = me.validUpdateObj(items[i], info.cellRange.row + i);
                     if(updateObj && typeof updateObj.updateGlj !== 'undefined'){
-                        updateArr = updateObj.updateGlj;
+                        //updateArr = updateObj.updateGlj;
+                        updateArr = updateArr.concat(updateObj.updateGlj);
                         if(typeof updateObj.updateBasePrc !== 'undefined'){
-                            updateBasePrcArr = updateObj.updateBasePrc;
+                            //updateBasePrcArr = updateObj.updateBasePrc;
+                            updateBasePrcArr = updateBasePrcArr.concat(updateObj.updateBasePrc);
                         }
                     }
                     else{
@@ -798,9 +801,9 @@ let repositoryGljObj = {
                 for(let i = 0; i < updateCount; i++){
                     let updateObj = me.validUpdateObj(items[i], info.cellRange.row + i);
                     if(updateObj && typeof updateObj.updateGlj !== 'undefined'){
-                        updateArr = updateObj.updateGlj;
+                        updateArr = updateArr.concat(updateObj.updateGlj);
                         if(typeof updateObj.updateBasePrc !== 'undefined'){
-                            updateBasePrcArr = updateObj.updateBasePrc;
+                            updateBasePrcArr = updateBasePrcArr.concat(updateObj.updateBasePrc);
                         }
                     }
                     else{

+ 3 - 1
web/maintain/std_glj_lib/js/gljComponent.js

@@ -397,7 +397,9 @@ let gljComponentOprObj = {
                 if(result.data.length > 0){
                     if(result.data[0]){
                         that.currentComponent =  that.getCurrentComponent(result.data[0].component);
-                        sheetCommonObj.cleanSheet(me.workBook.getSheet(0), me.setting, -1);
+                        me.workBook.getSheet(0).getSelections()[0]
+                        //sheetCommonObj.cleanSheet(me.workBook.getSheet(0), me.setting, -1);
+                        sheetCommonObj.cleanData(me.workBook.getSheet(0), me.setting, -1);
                         sheetCommonObj.showData(me.workBook.getSheet(0), me.setting, that.currentComponent);
                     }
                 }