zhongzewei 7 лет назад
Родитель
Сommit
27d93fbf35

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

@@ -136,6 +136,9 @@ var sheetCommonObj = {
                 else {
                     sheet.setValue(row, col, data[row][setting.header[col].dataCode], ch);
                     sheet.setTag(row, 0, data[row].ID, ch);
+                    if(typeof setting.owner === 'undefined'){
+                        sheet.getCell(row, 0, GC.Spread.Sheets.SheetArea.viewport).locked(true);
+                    }
                 }
             }
             for(let i = data.length; i < sheet.getRowCount(); i++){
@@ -203,6 +206,7 @@ var sheetCommonObj = {
                                     me.unLockAllCells(sheet);
                                     me.reLockSomeCodes(sheet, 0, repositoryGljObj.currentCache.length);
                                     sheet.setValue(row, 0, orgCode);
+                                    sheet.getCell(row, 0).formatter("@");
                                     sheet.setActiveCell(row, 0);
                                 });
                                 $('#codAleClose').click(function () {
@@ -210,6 +214,7 @@ var sheetCommonObj = {
                                     me.unLockAllCells(sheet);
                                     me.reLockSomeCodes(sheet, 0, repositoryGljObj.currentCache.length);
                                     sheet.setValue(row, 0, orgCode);
+                                    sheet.getCell(row, 0).formatter("@");
                                     sheet.setActiveCell(row, 0);
                                 });
                                 // sheet.setValue(row, col, orgCode);

+ 17 - 15
web/maintain/ration_repository/js/ration_glj.js

@@ -190,7 +190,8 @@ var rationGLJOprObj = {
                         let maxCount = info.cellRange.row + info.cellRange.rowCount -1 > me.cache["_GLJ_" + me.currentRationItem.ID].length -1 ?
                         me.cache["_GLJ_" + me.currentRationItem.ID].length - info.cellRange.row : info.cellRange.rowCount;
                         for(let i = 0; i < maxCount; i++){
-                            me.cache["_GLJ_" + me.currentRationItem.ID][info.cellRange.row + i].consumeAmt = tempConsumes[i].consumeAmt;
+                            let roundCons = me.round(tempConsumes[i].consumeAmt, 3);
+                            me.cache["_GLJ_" + me.currentRationItem.ID][info.cellRange.row + i].consumeAmt = roundCons;
                         }
                         me.updateRationItem();
                         if(info.cellRange.row + info.cellRange.rowCount -1 >= me.cache["_GLJ_" + me.currentRationItem.ID].length -1){
@@ -235,7 +236,8 @@ var rationGLJOprObj = {
                     }
                     else{
                         args.sheet.setValue(args.row, args.col, parseNum);
-                        editGlj["consumeAmt"] = parseNum;
+                        let roundNum = me.round(parseNum, 3);
+                        editGlj["consumeAmt"] = roundNum;
                         me.updateRationItem();
                     }
                 }
@@ -349,26 +351,25 @@ var rationGLJOprObj = {
             }
         })
     },
-
+    round(v, e){
+        var t=1;
+        for(;e>0;t*=10,e--);
+        for(;e<0;t/=10,e++);
+        return Math.round(v*t)/t;
+    },
     rationCal: function () {
-        let me = this;
+        let me = rationGLJOprObj;
         let price = {gljType1: [], gljType2: [], gljType3: []}, rst = {labourPrice: 0, materialPrice: 0, machinePrice: 0}, rationBasePrc = 0;
-        function round(v,e){
-            var t=1;
-            for(;e>0;t*=10,e--);
-            for(;e<0;t/=10,e++);
-            return Math.round(v*t)/t;
-        }
         if(me.currentRationItem && me.cache['_GLJ_' + me.currentRationItem.ID]){
             let cacheArr = me.cache['_GLJ_' + me.currentRationItem.ID];
             cacheArr.forEach(function (gljData) {
                 if(gljData.gljType && gljData.basePrice && gljData.consumeAmt){
                     let parent = me.distTypeTree.distTypes[me.distTypeTree.prefix + gljData.gljType].parent;
                     if(parent && parent.data.ID <= 3){
-                        price['gljType' + parent.data.ID].push(round( gljData.basePrice * gljData.consumeAmt, 3));//取三位
+                        price['gljType' + parent.data.ID].push(me.round( gljData.basePrice * gljData.consumeAmt, 3));//取三位
                     }
                     if(!parent && gljData.gljType <= 3){
-                        price['gljType' + gljData.gljType].push(round( gljData.basePrice * gljData.consumeAmt, 3));//取三位
+                        price['gljType' + gljData.gljType].push(me.round( gljData.basePrice * gljData.consumeAmt, 3));//取三位
                     }
                 }
             });
@@ -377,7 +378,7 @@ var rationGLJOprObj = {
                 price.gljType1.forEach(function (singlePrc) {
                     labourPrice += singlePrc;
                 });
-                let roundPrice = round(labourPrice, 2);
+                let roundPrice = me.round(labourPrice, 2);
                 rst.labourPrice = roundPrice;
                 rationBasePrc += roundPrice;
             }
@@ -386,7 +387,7 @@ var rationGLJOprObj = {
                 price.gljType2.forEach(function (singlePrc) {
                     materialPrice += singlePrc;
                 });
-                let roundPrice = round(materialPrice, 2);
+                let roundPrice = me.round(materialPrice, 2);
                 rst.materialPrice = roundPrice;
                 rationBasePrc += roundPrice;
             }
@@ -395,7 +396,7 @@ var rationGLJOprObj = {
                 price.gljType3.forEach(function (singlePrc) {
                     machinePrice += singlePrc;
                 });
-                let roundPrice = round(machinePrice, 2);
+                let roundPrice = me.round(machinePrice, 2);
                 rst.machinePrice = roundPrice;
                 rationBasePrc += roundPrice;
             }
@@ -460,6 +461,7 @@ var rationGLJOprObj = {
                 cache:false,
                 timeout:5000,
                 success:function(result){
+                    console.log(result);
                     sheetCommonObj.cleanSheet(me.sheet, me.setting, -1);
                     if (result) {
                         var cacheArr = [];

+ 1 - 1
web/maintain/std_glj_lib/html/gongliao.html

@@ -213,7 +213,7 @@
     <script type="text/javascript" src="/public/web/storageUtil.js"></script>
     <SCRIPT type="text/javascript">
         let userAccount = '<%=userAccount %>';
-        var gljSetting = {
+        let gljSetting = {
             view: {
                 //addHoverDom: gljTypeTreeOprObj.addHoverDom,
                 //removeHoverDom: gljTypeTreeOprObj.removeHoverDom,

+ 36 - 23
web/maintain/std_glj_lib/js/glj.js

@@ -377,9 +377,12 @@ let repositoryGljObj = {
                             let field = me.setting.header[col].dataCode;
                             if(field === 'gljType'){
                                 me.workBook.getSheet(0).getCell(me.editingRowIdx, col).value(
-                                    me.distTypeTree.distTypes[me.distTypeTree.prefix + me.currentEditingGlj[field]].data.fullName);
+                                    typeof me.currentEditingGlj[field] !== 'undefined'?
+                                        me.distTypeTree.distTypes[me.distTypeTree.prefix + me.currentEditingGlj[field]].data.fullName
+                                        : '');
                             }
                             else{
+                                me.workBook.getSheet(0).getCell(me.editingRowIdx, 0).formatter("@");
                                 me.workBook.getSheet(0).getCell(me.editingRowIdx, col).value(me.currentEditingGlj[me.setting.header[col].dataCode]);
                             }
                         }
@@ -415,10 +418,9 @@ let repositoryGljObj = {
         if (me.currentEditingGlj["ID"]) {
             rObj["ID"] = me.currentEditingGlj["ID"];
             rObj.gljClass = me.currentEditingGlj.gljClass;
-            for(let col =0; col< me.setting.header.length; col++){
-                if(me.currentEditingGlj[me.setting.header[col].dataCode] !== rObj[me.setting.header[col].dataCode]){
-                    me.addGljObj = rObj;
-                    if(rObj[me.setting.header[0].dataCode] && rObj[me.setting.header[1].dataCode] && rObj[me.setting.header[5].dataCode]){
+                if(me.currentEditingGlj[me.setting.header[args.col].dataCode] !== rObj[me.setting.header[args.col].dataCode]){
+                    if(rObj[me.setting.header[0].dataCode] && rObj[me.setting.header[1].dataCode] && rObj[me.setting.header[5].dataCode] &&
+                        rObj[me.setting.header[0].dataCode].toString().trim().length !== 0 && rObj[me.setting.header[1].dataCode].toString().trim().length !== 0 && rObj[me.setting.header[5].dataCode].toString().trim().length !== 0){
                         if(rObj.gljType !== me.currentEditingGlj.gljType){//修改了工料机类型
                             if(me.currentGlj){
                                 me.currentGlj.component = [];
@@ -451,14 +453,21 @@ let repositoryGljObj = {
                                     updateArr.push(updateGljs.updateBasePrcArr[i]);
                                 }
                             }
-                            rObj.basePrice = !isNaN(parseFloat(rObj.basePrice)) && (rObj.basePrice && typeof rObj.basePrice !== 'undefined') ? parseFloat(rObj.basePrice) : 0;
+                            rObj.basePrice = !isNaN(parseFloat(rObj.basePrice)) && (rObj.basePrice && typeof rObj.basePrice !== 'undefined') ? that.round(parseFloat(rObj.basePrice), 2) : 0;
                         }
                         rObj.component = me.currentGlj.component;
                         updateArr.push(rObj);
-                        break;
+                    }
+                    else{
+                        if(me.setting.header[args.col].dataCode === 'gljType'){
+                            let distTypeVal =  me.distTypeTree.distTypes[me.distTypeTree.prefix + me.currentEditingGlj[me.setting.header[args.col].dataCode]].data.fullName;
+                            args.sheet.setValue(args.row, args.col, distTypeVal);
+                        }
+                        else{
+                            args.sheet.setValue(args.row, args.col, me.currentEditingGlj[me.setting.header[args.col].dataCode]);
+                        }
                     }
                 }
-            }
             //--------------------------------------
             if(me.currentEditingGlj.basePrice !== rObj.basePrice){
                 //update basePrice of ration when editting basePrice of glj
@@ -491,20 +500,22 @@ let repositoryGljObj = {
         }
         //新增
         else {
-            me.addGljObj = rObj;
-            let isCanSav = true;
-            if(!rObj[me.setting.header[0].dataCode] || !rObj[me.setting.header[1].dataCode] || !rObj[me.setting.header[5].dataCode]){
-                isCanSav = false;
-            }
-            if(isCanSav){
-                me.addGljObj = null;
-                rObj.component = [];
-                //如果类型为混凝土、砂浆、配合比、机械台班时,添加时填写的单价清空
-                if(me.allowComponent.indexOf(rObj.gljType) !== -1){
-                    rObj.basePrice = 0;
+            if(typeof rObj.code !== 'undefined'){
+                me.addGljObj = rObj;
+                let isCanSav = true;
+                if(!rObj[me.setting.header[0].dataCode] || !rObj[me.setting.header[1].dataCode] || !rObj[me.setting.header[5].dataCode]){
+                    isCanSav = false;
+                }
+                if(isCanSav){
+                    me.addGljObj = null;
+                    rObj.component = [];
+                    //如果类型为混凝土、砂浆、配合比、机械台班时,添加时填写的单价清空
+                    if(me.allowComponent.indexOf(rObj.gljType) !== -1){
+                        rObj.basePrice = 0;
+                    }
+                    rObj.basePrice = !isNaN(parseFloat(rObj.basePrice)) && (rObj.basePrice && typeof rObj.basePrice !== 'undefined') ? parseFloat(rObj.basePrice) : 0;
+                    addArr.push(rObj);
                 }
-                rObj.basePrice = !isNaN(parseFloat(rObj.basePrice)) && (rObj.basePrice && typeof rObj.basePrice !== 'undefined') ? parseFloat(rObj.basePrice) : 0;
-                addArr.push(rObj);
             }
         }
         if(me.gljCurTypeId !== 732){
@@ -620,6 +631,7 @@ let repositoryGljObj = {
     validUpdateObj: function (pasteObj, rowIdx) {
         let rst = {updateGlj: [], updateBasePrcArr: []}, backUpObj = {},
             me = repositoryGljObj,
+            that = gljComponentOprObj,
             tempObj = me.currentCache[rowIdx],
             reCalBasePrc = false,
             isValid = true;
@@ -684,7 +696,7 @@ let repositoryGljObj = {
             if(!isExsit) isValid = false;
         }
         //
-        pasteObj.basePrice = !isNaN(parseFloat(pasteObj.basePrice)) && (pasteObj.basePrice && typeof pasteObj.basePrice !== 'undefined') ? parseFloat(pasteObj.basePrice) :
+        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;
@@ -748,6 +760,7 @@ let repositoryGljObj = {
         return true;
     },
     onClipboardPasting: function(sender, args) {
+        console.log(`oncp`);
         let me = repositoryGljObj;
         /*if (args.cellRange.colCount != me.setting.header.length || me.gljCurTypeId < 0 || me.parentNodeIds["_pNodeId_" + me.gljCurTypeId]) {
          args.cancel = true;
@@ -773,7 +786,6 @@ let repositoryGljObj = {
                 //updateItems = items;
                 for(let i = 0; i < items.length; i++){
                     let updateObj = me.validUpdateObj(items[i], info.cellRange.row + i);
-                    console.log(updateObj);
                     if(updateObj && typeof updateObj.updateGlj !== 'undefined'){
                         updateArr = updateObj.updateGlj;
                         if(typeof updateObj.updateBasePrc !== 'undefined'){
@@ -1008,6 +1020,7 @@ let gljTypeTreeOprObj = {
             that = gljComponentOprObj,
             gljTypeId = treeNode.ID;
         me.gljCurTypeId = treeNode.ID;
+        me.addGljObj = null;
         //me.currentCache = me.getCache();
         sheetCommonObj.cleanSheet(that.workBook.getSheet(0), that.setting, 5);
         that.workBook.getSheet(0).getRange(-1, 0 , -1, 1, GC.Spread.Sheets.SheetArea.viewport).locked(true);

+ 95 - 94
web/maintain/std_glj_lib/js/gljComponent.js

@@ -143,121 +143,121 @@ let gljComponentOprObj = {
     onCellEditEnd: function (sender, args) {
         let me = gljComponentOprObj, that = repositoryGljObj, updateBasePrc = [];
         let gljList = that.gljList, updateArr = [], materialComponent = [202, 203, 204], machineComponent = [302, 303];
-        if(args.editingText !== me.currentEditingComponent.code){
-            if(args.col === 0 && args.editingText && args.editingText.trim().length > 0){
-                let component = that.currentGlj.component, hasCode = false;
-                for(let i = 0; i < gljList.length; i++){
-                    if(gljList[i].code === args.editingText){//有效的组成物
-                        hasCode = true;
-                        if((materialComponent.indexOf(that.currentGlj.gljType) !== -1 && gljList[i].gljType === 201)
-                            || (that.currentGlj.gljType === 301 && machineComponent.indexOf(gljList[i].gljType) !== -1 )){//普通材料
-                            //是否与原有组成物不同
-                            let isExist = false;
-                            for(let j = 0; j < component.length; j++){
-                                if(component[j].ID === gljList[i].ID){
-                                    isExist = true;
-                                    break;
-                                }
+        //if(args.editingText !== me.currentEditingComponent.code){
+        if(args.col === 0 && args.editingText && args.editingText.trim().length > 0 && args.editingText !== me.currentEditingComponent.code){
+            let component = that.currentGlj.component, hasCode = false;
+            for(let i = 0; i < gljList.length; i++){
+                if(gljList[i].code === args.editingText){//有效的组成物
+                    hasCode = true;
+                    if((materialComponent.indexOf(that.currentGlj.gljType) !== -1 && gljList[i].gljType === 201)
+                        || (that.currentGlj.gljType === 301 && machineComponent.indexOf(gljList[i].gljType) !== -1 )){//普通材料
+                        //是否与原有组成物不同
+                        let isExist = false;
+                        for(let j = 0; j < component.length; j++){
+                            if(component[j].ID === gljList[i].ID){
+                                isExist = true;
+                                break;
                             }
-                            if(!isExist){
-                                let rObj = {};
-                                rObj.ID = gljList[i].ID;
-                                //rObj.basePrice = gljList[i].basePrice;
-                                if(typeof that.currentComponent[args.row] !== 'undefined'){
-                                    rObj.consumeAmt = that.currentComponent[args.row].consumeAmt;
-                                    let index;
-                                    for(let j = 0; j < component.length; j++){
-                                        if(component[j].ID === that.currentComponent[args.row].ID){
-                                            index = j;
-                                            break;
-                                        }
-                                    }
-                                    component.splice(index, 1);
-                                    component.splice(index, 0, rObj);
-                                    //计算工料机单价
-                                    let gljBasePrc = me.reCalGljBasePrc(that.getCurrentComponent(component));
-                                    if(gljBasePrc !== that.currentGlj.basePrice){
-                                        that.currentGlj.basePrice = gljBasePrc;
-                                        that.reshowGljBasePrc(that.currentGlj);
-                                        //工料机单价改变,重算引用了该工料机的定额单价
-                                        updateBasePrc.push({gljId: that.currentGlj.ID, gljType: that.currentGlj.gljType, basePrice: that.currentGlj.basePrice});
+                        }
+                        if(!isExist){
+                            let rObj = {};
+                            rObj.ID = gljList[i].ID;
+                            //rObj.basePrice = gljList[i].basePrice;
+                            if(typeof that.currentComponent[args.row] !== 'undefined'){
+                                rObj.consumeAmt = that.currentComponent[args.row].consumeAmt;
+                                let index;
+                                for(let j = 0; j < component.length; j++){
+                                    if(component[j].ID === that.currentComponent[args.row].ID){
+                                        index = j;
+                                        break;
                                     }
-                                    updateArr.push(that.currentGlj);
                                 }
-                                else{
-                                    rObj.consumeAmt = 0;
-                                    component.push(rObj);
-                                    //计算工料机单价
-                                    let gljBasePrc = me.reCalGljBasePrc(that.getCurrentComponent(component));
-                                    if(gljBasePrc !== that.currentGlj.basePrice){
-                                        that.currentGlj.basePrice = gljBasePrc;
-                                        that.reshowGljBasePrc(that.currentGlj);
-                                        //工料机单价改变,重算引用了该工料机的定额单价
-                                        updateBasePrc.push({gljId: that.currentGlj.ID, gljType: that.currentGlj.gljType, basePrice: that.currentGlj.basePrice});
-                                    }
-                                    updateArr.push(that.currentGlj);
+                                component.splice(index, 1);
+                                component.splice(index, 0, rObj);
+                                //计算工料机单价
+                                let gljBasePrc = me.reCalGljBasePrc(that.getCurrentComponent(component));
+                                if(gljBasePrc !== that.currentGlj.basePrice){
+                                    that.currentGlj.basePrice = gljBasePrc;
+                                    that.reshowGljBasePrc(that.currentGlj);
+                                    //工料机单价改变,重算引用了该工料机的定额单价
+                                    updateBasePrc.push({gljId: that.currentGlj.ID, gljType: that.currentGlj.gljType, basePrice: that.currentGlj.basePrice});
                                 }
-                                break;
+                                updateArr.push(that.currentGlj);
                             }
                             else{
-                                //已存在
-                                alert("已存在!");
-                                args.sheet.setValue(args.row, args.col, me.currentEditingComponent[me.setting.header[args.col].dataCode] ?
-                                    me.currentEditingComponent[me.setting.header[args.col].dataCode]: '');
+                                rObj.consumeAmt = 0;
+                                component.push(rObj);
+                                //计算工料机单价
+                                let gljBasePrc = me.reCalGljBasePrc(that.getCurrentComponent(component));
+                                if(gljBasePrc !== that.currentGlj.basePrice){
+                                    that.currentGlj.basePrice = gljBasePrc;
+                                    that.reshowGljBasePrc(that.currentGlj);
+                                    //工料机单价改变,重算引用了该工料机的定额单价
+                                    updateBasePrc.push({gljId: that.currentGlj.ID, gljType: that.currentGlj.gljType, basePrice: that.currentGlj.basePrice});
+                                }
+                                updateArr.push(that.currentGlj);
                             }
-
+                            break;
                         }
                         else{
-                            if(materialComponent.indexOf(that.currentGlj.gljType) === 1){
-                                alert("该组成物只能是普通材料!");
-                            }
-                            else if(that.currentGlj.gljType === 301){
-                                alert("该组成物只能是机械组成物或机上人工!")
-                            }
+                            //已存在
+                            alert("已存在!");
                             args.sheet.setValue(args.row, args.col, me.currentEditingComponent[me.setting.header[args.col].dataCode] ?
                                 me.currentEditingComponent[me.setting.header[args.col].dataCode]: '');
-                            //无效
                         }
+
                     }
-                }
-                if(!hasCode){
-                    alert("不存在此工料机,请先添加!");
-                    args.sheet.setValue(args.row, args.col, me.currentEditingComponent[me.setting.header[args.col].dataCode] ?
-                        me.currentEditingComponent[me.setting.header[args.col].dataCode] : '');
-                    //不存在
-                }
-            }
-            else if(args.col === 4 && me.currentEditingComponent.code && args.editingText && args.editingText.trim().length > 0){//消耗量
-                let consumeAmt = parseFloat(args.editingText);
-                if(!isNaN(consumeAmt) && consumeAmt !== me.currentEditingComponent.consumeAmt){
-                    let component = that.currentGlj.component;
-                    for(let i = 0; i < component.length; i++){
-                        if(component[i].ID === that.currentComponent[args.row].ID){
-                            component[i].consumeAmt = consumeAmt
+                    else{
+                        if(materialComponent.indexOf(that.currentGlj.gljType) === 1){
+                            alert("该组成物只能是普通材料!");
+                        }
+                        else if(that.currentGlj.gljType === 301){
+                            alert("该组成物只能是机械组成物或机上人工!")
                         }
+                        args.sheet.setValue(args.row, args.col, me.currentEditingComponent[me.setting.header[args.col].dataCode] ?
+                            me.currentEditingComponent[me.setting.header[args.col].dataCode]: '');
+                        //无效
                     }
-                    that.currentComponent[args.row].consumeAmt = consumeAmt;
-                    //计算工料机单价
-                    let gljBasePrc = me.reCalGljBasePrc(that.currentComponent);
-                    if(gljBasePrc !== that.currentGlj.basePrice){
-                        that.currentGlj.basePrice = gljBasePrc;
-                        that.reshowGljBasePrc(that.currentGlj);
-                        //工料机单价改变,重算引用了该工料机的定额单价
-                        updateBasePrc.push({gljId: that.currentGlj.ID, gljType: that.currentGlj.gljType, basePrice: that.currentGlj.basePrice});
+                }
+            }
+            if(!hasCode){
+                alert("不存在此工料机,请先添加!");
+                args.sheet.setValue(args.row, args.col, me.currentEditingComponent[me.setting.header[args.col].dataCode] ?
+                    me.currentEditingComponent[me.setting.header[args.col].dataCode] : '');
+                //不存在
+            }
+        }
+        else if(args.col === 4 && me.currentEditingComponent.code && args.editingText && args.editingText.trim().length > 0){//消耗量
+            let consumeAmt = parseFloat(args.editingText);
+            if(!isNaN(consumeAmt) && consumeAmt !== me.currentEditingComponent.consumeAmt){
+                let roundCons = me.round(consumeAmt, 3);
+                let component = that.currentGlj.component;
+                for(let i = 0; i < component.length; i++){
+                    if(component[i].ID === that.currentComponent[args.row].ID){
+                        component[i].consumeAmt = roundCons;
                     }
-                    updateArr.push(that.currentGlj);
                 }
-                else{
-                    //只能输入数值
-                    args.sheet.setValue(args.row, args.col, me.currentEditingComponent[me.setting.header[args.col].dataCode] ?
-                        me.currentEditingComponent[me.setting.header[args.col].dataCode]: 0);
-
+                that.currentComponent[args.row].consumeAmt = roundCons;
+                //计算工料机单价
+                let gljBasePrc = me.reCalGljBasePrc(that.currentComponent);
+                if(gljBasePrc !== that.currentGlj.basePrice){
+                    that.currentGlj.basePrice = gljBasePrc;
+                    that.reshowGljBasePrc(that.currentGlj);
+                    //工料机单价改变,重算引用了该工料机的定额单价
+                    updateBasePrc.push({gljId: that.currentGlj.ID, gljType: that.currentGlj.gljType, basePrice: that.currentGlj.basePrice});
                 }
+                updateArr.push(that.currentGlj);
             }
             else{
-                args.sheet.setValue(args.row, args.col, '');
+                //只能输入数值
+                args.sheet.setValue(args.row, args.col, me.currentEditingComponent[me.setting.header[args.col].dataCode] ?
+                    me.currentEditingComponent[me.setting.header[args.col].dataCode]: 0);
+
             }
         }
+        else{
+            args.sheet.setValue(args.row, args.col, '');
+        }
         if(updateArr.length > 0){
             me.updateComponent(updateArr);
             if(updateBasePrc.length > 0){
@@ -349,8 +349,9 @@ let gljComponentOprObj = {
                 if(row + i < that.currentComponent.length){
                     let currentObj = that.currentComponent[row + i];
                     if(items[i].consumeAmt.trim().length > 0 && items[i].consumeAmt !== currentObj.consumeAmt){
+                        let roundCons = me.round(items[i].consumeAmt, 3);
                         isChange = true;
-                        currentObj.consumeAmt = items[i].consumeAmt;
+                        currentObj.consumeAmt = roundCons;
                         for(let j = 0; j < component.length; j++){
                             if(component[j].ID === currentObj.ID){
                                 component[j].consumeAmt = currentObj.consumeAmt;