Bladeren bron

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

TonyKang 6 jaren geleden
bovenliggende
commit
ee4b0bf030

+ 5 - 4
modules/all_models/stdGlj_glj.js

@@ -34,11 +34,12 @@ const std_glj = new Schema({
     gljType: Number,
     shortName: String,
     unit: String,
-    adjCoe: Number,
     component: [std_gljComponent],
-    materialType: Number, //三材类型:钢材1、钢筋2、木材3、水泥4、标准砖5
-    materialCoe: Number, //三材系数
-    model: Number, //机型
+    //以下仅普通材料可用
+    grossWeightCoe: Number, //毛重系数
+    purchaseStorageRate: Number, //采购保管费率
+    offSiteTransportLossRate: Number, //场外运输损耗率
+    handlingLossRate: Number, //每增一次装卸损耗率
 },{versionKey: false});
 
 mongoose.model('std_glj_lib_gljList', std_glj, 'std_glj_lib_gljList');

+ 0 - 3
modules/all_models/stdRation_ration.js

@@ -34,9 +34,6 @@ const rationItemSchema = new Schema({
     name: String,
     unit: String,
     basePrice: Number,
-    labourPrice: Number,
-    materialPrice: Number,
-    machinePrice: Number,
     sectionId: Number,
     rationRepId: {type: Number, index: true},
     caption: String,

+ 5 - 2
modules/common/const/bills_fixed.js

@@ -55,7 +55,9 @@ const fixedFlag = {
     //暂列金额
     PROVISIONAL:26,
     //安全生产费
-    SAFE_COST:27
+    SAFE_COST:27,
+    //100章清单
+    ONE_HUNDRED_BILLS: 28
 };
 /*建筑安装工程费、土地使用及拆迁补偿费、养护工程其他费用、预备费、基本预备费、价差预备费、一二三四部分合计、贷款利息、总造价、
 
@@ -89,7 +91,8 @@ const fixedFlagList = [
     {name: "材料", value: fixedFlag.MATERIAL},
     {name: "施工机械", value: fixedFlag.CONSTRUCTION_MACHINE},
     {name: "暂列金额", value: fixedFlag.PROVISIONAL},
-    {name:"安全生产费",value:fixedFlag.SAFE_COST}
+    {name:"安全生产费",value:fixedFlag.SAFE_COST},
+    {name:"第100章清单 总则",value:fixedFlag.ONE_HUNDRED_BILLS},
 ];
 
 export {fixedFlag as default, fixedFlagList as List};

+ 1 - 1
modules/ration_repository/controllers/ration_repository_controller.js

@@ -279,7 +279,7 @@ class RationRepositoryController extends baseController {
                 task.push({
                     updateOne: {
                         filter: {ID: ration.ID},
-                        update: {$set: {labourPrice: ration.labourPrice, materialPrice: ration.materialPrice, machinePrice: ration.machinePrice, basePrice: ration.basePrice}}
+                        update: {$set: {basePrice: ration.basePrice}}
                     }
                 });
             }

+ 15 - 235
modules/ration_repository/models/ration_item.js

@@ -400,7 +400,6 @@ rationItemDAO.prototype.updateRationBasePrc = function (basePrcArr, callback) {
                     }
                 }
                 gljDao.getStdCompleGljItems(compleGljIds, stdGljIds, function (err, allGljs) {
-                    const processDecimal = -6;
                     if(err){
                         cb(err);
                     }
@@ -415,139 +414,31 @@ rationItemDAO.prototype.updateRationBasePrc = function (basePrcArr, callback) {
                             for(let i=0; i<rationGljList.length; i++){
                                 let theGlj = gljIndex[rationGljList[i].gljId];
                                 if(theGlj !== undefined && theGlj){
-                                    let gljParentType = -1;
                                     if(theGlj.ID === adjGljId){
-                                        theGlj.gljType = adjGljType;
-                                    }
-                                    if(theGlj.gljType <= 3){
-                                        gljParentType = theGlj.gljType;
-                                    }
-                                    if(theGlj.gljType > 200 && theGlj.gljType < 300){
-                                        gljParentType = 2;
-                                    }
-                                    if(theGlj.gljType > 300 && theGlj.gljType < 400){
-                                        gljParentType = 3;
-                                    }
-                                    //管理费
-                                    if(theGlj.gljType === 6){
-                                        gljParentType = 6;
-                                    }
-                                    //利润
-                                    if(theGlj.gljType === 7){
-                                        gljParentType = 7;
-                                    }
-                                    //风险费
-                                    if(theGlj.gljType === 8){
-                                        gljParentType = 8;
-                                    }
-                                    if(theGlj)
-                                    if(theGlj.ID === adjGljId){
-                                        gljArr.push({gljId: theGlj.ID, basePrice: adjBasePrice, gljParentType: gljParentType});
-                                    }
-                                    else {
+                                        gljArr.push({gljId: theGlj.ID, basePrice: adjBasePrice, consumeAmt: rationGljList[i].consumeAmt});
+                                    } else {
                                         if(theGlj.priceProperty && Object.keys(theGlj.priceProperty).length > 0){
                                             let priceKeys = Object.keys(theGlj.priceProperty);
-                                            gljArr.push({gljId: theGlj.ID, basePrice: parseFloat(theGlj.priceProperty[priceKeys[0]]), gljParentType: gljParentType});
-                                        }
-                                        else {
-                                            gljArr.push({gljId: theGlj.ID, basePrice: parseFloat(theGlj.basePrice), gljParentType: gljParentType});
+                                            gljArr.push({gljId: theGlj.ID, basePrice: parseFloat(theGlj.priceProperty[priceKeys[0]]), consumeAmt: rationGljList[i].consumeAmt});
+                                        } else {
+                                            gljArr.push({gljId: theGlj.ID, basePrice: parseFloat(theGlj.basePrice), consumeAmt: rationGljList[i].consumeAmt});
                                         }
                                     }
                                 }
                             }
-                            gljArr.forEach(function (gljItem) {
-                                rationGljList.forEach(function (rationGlj) {
-                                    if(gljItem.gljId === rationGlj.gljId){
-                                        gljItem.consumeAmt = parseFloat(rationGlj.consumeAmt);
-                                    }
-                                })
-                            });
                             //recalculate the price of ration
-                            let labourPrc = [],
-                                materialPrc = [],
-                                machinePrc = [],
-                                managePrc = [],
-                                profitPrc = [],
-                                riskPrc = [],
-                                singlePrc,
-                                updatePrc = {labourPrice: 0, materialPrice: 0, machinePrice: 0, managePrice: 0, profitPrice: 0, riskPrice: 0, basePrice: 0};
+                            let basePrice = 0;
                             gljArr.forEach(function (gljItem) {
-                                if(gljItem.gljParentType !== -1){
-                                    singlePrc = scMathUtil.roundTo(gljItem.basePrice * gljItem.consumeAmt, -3);
-                                    if(gljItem.gljParentType === 1){
-                                        labourPrc.push(singlePrc);
-                                    }
-                                    else if(gljItem.gljParentType ===2){
-                                        materialPrc.push(singlePrc);
-                                    }
-                                    else if(gljItem.gljParentType === 3){
-                                        machinePrc.push(singlePrc);
-                                    }
-                                    else if(gljItem.gljParentType === 6){
-                                        managePrc.push(singlePrc);
-                                    }
-                                    else if(gljItem.gljParentType === 7){
-                                        profitPrc.push(singlePrc);
-                                    }
-                                    else if(gljItem.gljParentType === 8){
-                                        riskPrc.push(singlePrc);
-                                    }
-                                }
+                                basePrice += gljItem.basePrice * gljItem.consumeAmt;
                             });
-                            if(labourPrc.length > 0){
-                                let sumLaP = 0;
-                                for(let i=0; i<labourPrc.length; i++){
-                                    sumLaP = scMathUtil.roundTo(sumLaP + labourPrc[i], processDecimal);
-                                }
-                                updatePrc.labourPrice = scMathUtil.roundTo(sumLaP, -2);
-                            }
-                            if(materialPrc.length > 0){
-                                let sumMtP = 0;
-                                for(let i= 0; i<materialPrc.length; i++){
-                                    sumMtP = scMathUtil.roundTo(sumMtP + materialPrc[i], processDecimal);
-                                }
-                                updatePrc.materialPrice = scMathUtil.roundTo(sumMtP, -2);
-                            }
-                            if(machinePrc.length > 0){
-                                let sumMaP = 0;
-                                for(let i =0; i< machinePrc.length; i++){
-                                    sumMaP = scMathUtil.roundTo(sumMaP + machinePrc[i], processDecimal);
-                                }
-                                updatePrc.machinePrice = scMathUtil.roundTo(sumMaP, -2);
-                            }
-                            if(managePrc.length > 0){
-                                let sumMgP = 0;
-                                for(let i =0; i< managePrc.length; i++){
-                                    sumMgP = scMathUtil.roundTo(sumMgP + managePrc[i], processDecimal);
-                                }
-                                updatePrc.managePrice = scMathUtil.roundTo(sumMgP, -2);
-                            }
-                            if(profitPrc.length > 0){
-                                let sumPfP = 0;
-                                for(let i =0; i< profitPrc.length; i++){
-                                    sumPfP = scMathUtil.roundTo(sumPfP + profitPrc[i], processDecimal);
-                                }
-                                updatePrc.profitPrice = scMathUtil.roundTo(sumPfP, -2);
-                            }
-                            if(riskPrc.length > 0){
-                                let sumRkP = 0;
-                                for(let i =0; i< riskPrc.length; i++){
-                                    sumRkP = scMathUtil.roundTo(sumRkP + riskPrc[i], processDecimal);
-                                }
-                                updatePrc.riskPrice = scMathUtil.roundTo(sumRkP, -2);
-                            }
-                            updatePrc.basePrice = scMathUtil.roundTo(
-                                updatePrc.labourPrice + updatePrc.materialPrice + updatePrc.machinePrice + updatePrc.managePrice + updatePrc.profitPrice + updatePrc.riskPrice, -2);
+                            basePrice = scMathUtil.roundTo(basePrice, 0);
                             let task = {
                                 updateOne: {
                                     filter: {
                                         ID: rationItem.ID
                                     },
                                     update: {
-                                        labourPrice: updatePrc.labourPrice.toString(),
-                                        materialPrice: updatePrc.materialPrice.toString(),
-                                        machinePrice: updatePrc.machinePrice.toString(),
-                                        basePrice: updatePrc.basePrice.toString()
+                                        basePrice: basePrice.toString()
                                     }
                                 }
                             };
@@ -732,125 +623,15 @@ rationItemDAO.prototype.updateRationTemplate = async function (rationRepId, rati
 
 //计算导入数据的价格
 rationItemDAO.prototype.calcForRation = function (stdGljList, ration) {
-    const processDecimal = -6;
-    //根据工料机类型划分价格
-    const labour = [1],
-        material = [201, 202, 203, 204, 205, 206, 207],
-        machine = [301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312],
-        manage = [6],
-        profit = [7],
-        risk = [8];
-    let labourPrc = [], materialPrc = [], machinePrc = [], managePrc = [], profitPrc = [], riskPrc = [],
-        singlePrc, updatePrc = {labourPrice: 0, materialPrice: 0, machinePrice: 0, basePrice: 0, managePrice: 0, profitPrice: 0, riskPrice: 0};
     let rationGljList = ration.rationGljList;
-    for(let rationGlj of rationGljList){
+    let basePrice = 0;
+    for(let rationGlj of rationGljList) {
         let glj = stdGljList[rationGlj.gljId];
-        let prcType = isDef(glj) ? getParentType(glj.gljType) : null;
-        if(isDef(prcType)){
-            singlePrc = scMathUtil.roundTo(parseFloat(glj.basePrice) * parseFloat(rationGlj.consumeAmt), -3);
-            if(prcType === 'labour'){
-                labourPrc.push(singlePrc);
-            }
-            else if(prcType === 'material'){
-                materialPrc.push(singlePrc);
-            }
-            else if(prcType === 'machine'){
-                machinePrc.push(singlePrc);
-            }
-            else if(prcType === 'manage'){
-                managePrc.push(singlePrc);
-            }
-            else if(prcType === 'profit'){
-                profitPrc.push(singlePrc);
-            }
-            else if(prcType === 'risk'){
-                riskPrc.push(singlePrc);
-            }
-        }
-    }
-    //计算人工费
-    if(labourPrc.length > 0){
-        let sumLaP = 0;
-        for(let i = 0, len  = labourPrc.length; i < len; i++){
-            sumLaP = scMathUtil.roundTo(sumLaP + labourPrc[i], processDecimal);
-        }
-        updatePrc.labourPrice = scMathUtil.roundTo(sumLaP, -2);
-    }
-    //材料费
-    if(materialPrc.length > 0){
-        let sumMtP = 0;
-        for(let i = 0, len  = materialPrc.length; i < len; i++){
-            sumMtP = scMathUtil.roundTo(sumMtP + materialPrc[i], processDecimal);
-        }
-        updatePrc.materialPrice = scMathUtil.roundTo(sumMtP, -2);
-    }
-    //机械费
-    if(machinePrc.length > 0){
-        let sumMaP = 0;
-        for(let i = 0, len  = machinePrc.length; i < len; i++){
-            sumMaP = scMathUtil.roundTo(sumMaP + machinePrc[i], processDecimal);
-        }
-        updatePrc.machinePrice = scMathUtil.roundTo(sumMaP, -2);
-    }
-    //管理费
-    if(managePrc.length > 0){
-        let sumMgP = 0;
-        for(let i = 0, len  = managePrc.length; i < len; i++){
-            sumMgP = scMathUtil.roundTo(sumMgP + managePrc[i], processDecimal);
-        }
-        updatePrc.managePrice = scMathUtil.roundTo(sumMgP, -2);
-    }
-    //利润
-    if(profitPrc.length > 0){
-        let sumPfP = 0;
-        for(let i = 0, len  = profitPrc.length; i < len; i++){
-            sumPfP = scMathUtil.roundTo(sumPfP + profitPrc[i], processDecimal);
-        }
-        updatePrc.profitPrice = scMathUtil.roundTo(sumPfP, -2);
-    }
-    //风险费
-    if(riskPrc.length > 0){
-        let sumRkP = 0;
-        for(let i = 0, len  = riskPrc.length; i < len; i++){
-            sumRkP = scMathUtil.roundTo(sumRkP + riskPrc[i], processDecimal);
+        if (glj) {
+            basePrice += glj.basePrice * rationGlj.consumeAmt;
         }
-        updatePrc.riskPrice = scMathUtil.roundTo(sumRkP, -2);
-    }
-    //基价
-    updatePrc.basePrice = scMathUtil.roundTo(
-        updatePrc.labourPrice + updatePrc.materialPrice + updatePrc.machinePrice + updatePrc.managePrice + updatePrc.profitPrice + updatePrc.riskPrice, -2);
-    //更新定额数据
-    ration.labourPrice = updatePrc.labourPrice.toString();
-    ration.materialPrice = updatePrc.materialPrice.toString();
-    ration.machinePrice = updatePrc.machinePrice.toString();
-    ration.basePrice = updatePrc.basePrice.toString();
-
-    function isDef(v){
-        return v !== undefined && v !== null;
     }
-    //是否属于人工、材料、机械类型
-    function getParentType(type){
-        if(labour.includes(type)){
-            return 'labour';
-        }
-        if(material.includes(type)){
-            return 'material';
-        }
-        if(machine.includes(type)){
-            return 'machine';
-        }
-        if(manage.includes(type)){
-            return 'manage';
-        }
-        if(profit.includes(type)){
-            return 'profit';
-        }
-        if(risk.includes(type)){
-            return 'risk'
-        }
-        return null;
-    }
-
+    ration.basePrice = scMathUtil.roundTo(basePrice, 0).toString();
 };
 
 /**
@@ -984,8 +765,7 @@ rationItemDAO.prototype.batchAddFromExcel = async function(rationRepId, data) {
         updateBulk.push({
             updateOne: {
                 filter: {rationRepId: rationRepId, code: ration.code},
-                update: {$set: {rationGljList: ration.rationGljList, labourPrice: ration.labourPrice, materialPrice: ration.materialPrice,
-                    machinePrice: ration.machinePrice, basePrice: ration.basePrice}}
+                update: {$set: {rationGljList: ration.rationGljList, basePrice: ration.basePrice}}
             }
         });
     }

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

@@ -49,6 +49,7 @@ var sheetCommonObj = {
         spreadBook.options.cutCopyIndicatorVisible = false;
         spreadBook.options.allowExtendPasteRange = true;
         spreadBook.options.allowUserDragDrop = false;
+        spreadBook.options.allowUserDragFill = false;
         spreadBook.options.allowUndo = false;
         spreadBook.options.allowContextMenu = false;
         var spreadNS = GC.Spread.Sheets;

+ 3 - 2
public/web/tools_const.js

@@ -7,8 +7,9 @@
  * @date 2018/8/15
  * @version
  */
-//允许使用的工料机类型:人工、普通材料、混凝土、砂浆、配合比、商品混凝土、商品砂浆、机械台班、机械组成物、机上人工、设备
-let allowGljType = [1, 201, 202, 203, 204, 205, 206, 301, 302, 303,5];
+//允许使用的工料机类型:人工、普通材料、混凝土、砂浆、配合比、商品混凝土、商品砂浆、外购砼构件、绿化苗木
+// 机械台班、机械组成物、机上人工、设备
+let allowGljType = [1, 201, 202, 203, 204, 205, 206, 208, 209, 301, 302, 303,5];
 
 //允许含有组成物的工料机类型:混凝土、砂浆、配合比、机械台班
 let allowComponent = [202, 203, 204, 301];

+ 4 - 16
web/maintain/ration_repository/js/ration.js

@@ -71,10 +71,10 @@ let rationOprObj = {
             {headerName:"编码",headerWidth:70,dataCode:"code", dataType: "String", formatter: "@"},
             {headerName:"名称",headerWidth:240,dataCode:"name", dataType: "String"},
             {headerName:"计量单位",headerWidth:70,dataCode:"unit", dataType: "String", hAlign: "center"},
-            {headerName:"人工费",headerWidth:80,dataCode:"labourPrice", dataType: "Number", formatter: "0.00", hAlign: "right"},
+            /*{headerName:"人工费",headerWidth:80,dataCode:"labourPrice", dataType: "Number", formatter: "0.00", hAlign: "right"},
             {headerName:"材料费",headerWidth:80,dataCode:"materialPrice", dataType: "Number", formatter: "0.00",  hAlign: "right"},
-            {headerName:"机械费",headerWidth:80,dataCode:"machinePrice", dataType: "Number", formatter: "0.00", hAlign: "right"},
-            {headerName:"基价",headerWidth:80,dataCode:"basePrice", dataType: "Number", formatter: "0.00", hAlign: "right"},
+            {headerName:"机械费",headerWidth:80,dataCode:"machinePrice", dataType: "Number", formatter: "0.00", hAlign: "right"},*/
+            {headerName:"基价",headerWidth:80,dataCode:"basePrice", dataType: "Number", hAlign: "right"},
             {headerName:"显示名称(以%s表示参数)",headerWidth:240,dataCode:"caption", dataType: "String"},
             {headerName:"取费专业",headerWidth:70,dataCode:"feeType", dataType: "Number", hAlign: "center"}
         ],
@@ -82,11 +82,8 @@ let rationOprObj = {
             comboBox:[
                 {row:-1,col:2,rowCount:-1,colCount:1}
             ],
-            lockedCells:[
-                {row:-1,col:3,rowCount:-1, colCount:1}
-            ],
             lockColumns: [
-                3, 4, 5, 6
+                3
             ]
         }
     },
@@ -521,9 +518,7 @@ let rationOprObj = {
             args.cancel = true;
         }
     },
-    //todo: overwrite?
     onClipboardPasted: function(e, info) {
-        console.log('cp');
         let me = rationOprObj;
         let cacheSection = me.getCache();
         let updateArr = [], addArr = [];
@@ -531,9 +526,6 @@ let rationOprObj = {
         for (let i = 0; i < items.length; i++) {
             let rowIdx = info.cellRange.row + i;
             if (cacheSection) {
-              /*  if(!me.isValidUnit(items[i], rationUnits)){//无效单位
-                    items[i].unit = rowIdx < cacheSection.length  && typeof cacheSection[rowIdx].unit !== 'undefined' ? cacheSection[rowIdx].unit : '';
-                }*/
                 if(!cacheSection[rowIdx] && info.cellRange.col === 0 ){
                     if(me.rationsCodes.indexOf(items[i].code.toString()) === -1){
                         //jobConten
@@ -577,9 +569,6 @@ let rationOprObj = {
                 }
 
             } else {
-               /* if(!me.isValidUnit(items[i], rationUnits)){//无效单位
-                    items[i].unit = '';
-                }*/
                 //add
                 if(info.cellRange.col === 0){
                     //是否含有已存在的编号
@@ -598,7 +587,6 @@ let rationOprObj = {
             }
         };
          if (updateArr.length > 0 || addArr.length > 0) {
-             console.log(updateArr);
              me.mixUpdate = 1;
             me.mixUpdateRequest(updateArr, addArr, []);
         }

+ 5 - 73
web/maintain/ration_repository/js/ration_glj.js

@@ -516,82 +516,17 @@ var rationGLJOprObj = {
     },
     rationCal: function () {
         let me = rationGLJOprObj;
-        let price = {gljType1: [], gljType2: [], gljType3: [], gljType6: [], gljType7: [], gljType8: []},
-            rst = {labourPrice: 0, materialPrice: 0, machinePrice: 0, managePrice: 0, profitPrice: 0, riskPrice: 0},
-            rationBasePrc = 0;
+        let rationBasePrc = 0;
         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(scMathUtil.roundTo( gljData.basePrice * gljData.consumeAmt, -3));//取三位
-                    }
-                    if(!parent && gljData.gljType <= 3){
-                        price['gljType' + gljData.gljType].push(scMathUtil.roundTo( gljData.basePrice * gljData.consumeAmt, -3));//取三位
-                    }
-                    if([6, 7, 8].includes(gljData.gljType)){
-                        price['gljType' + gljData.gljType].push(scMathUtil.roundTo( gljData.basePrice * gljData.consumeAmt, -3));//取三位
-                    }
+                    rationBasePrc += gljData.basePrice * gljData.consumeAmt;
                 }
             });
-            if(price.gljType1.length > 0){
-                let labourPrice = 0;
-                price.gljType1.forEach(function (singlePrc) {
-                    labourPrice = scMathUtil.roundTo(labourPrice + singlePrc, me.processDecimal);
-                });
-                let roundPrice = scMathUtil.roundTo(labourPrice, -2);
-                rst.labourPrice = roundPrice;
-                rationBasePrc = scMathUtil.roundTo(rationBasePrc + roundPrice, -2);
-            }
-            if(price.gljType2.length > 0){
-                let materialPrice = 0;
-                price.gljType2.forEach(function (singlePrc) {
-                    materialPrice = scMathUtil.roundTo(materialPrice + singlePrc, me.processDecimal);
-                });
-                let roundPrice = scMathUtil.roundTo(materialPrice, -2);
-                rst.materialPrice = roundPrice;
-                rationBasePrc = scMathUtil.roundTo(rationBasePrc + roundPrice, -2);
-            }
-            if(price.gljType3.length > 0){
-                let machinePrice = 0;
-                price.gljType3.forEach(function (singlePrc) {
-                    machinePrice = scMathUtil.roundTo(machinePrice + singlePrc, me.processDecimal);
-                });
-                let roundPrice = scMathUtil.roundTo(machinePrice, -2);
-                rst.machinePrice = roundPrice;
-                rationBasePrc = scMathUtil.roundTo(rationBasePrc + roundPrice, -2);
-            }
-            if(price.gljType6.length > 0){
-                let managePrice = 0;
-                price.gljType6.forEach(function (singlePrc) {
-                    managePrice = scMathUtil.roundTo(managePrice + singlePrc, me.processDecimal);
-                });
-                let roundPrice = scMathUtil.roundTo(managePrice, -2);
-                rst.managePrice = roundPrice;
-                rationBasePrc = scMathUtil.roundTo(rationBasePrc + roundPrice, -2);
-            }
-            if(price.gljType7.length > 0){
-                let profitPrice = 0;
-                price.gljType7.forEach(function (singlePrc) {
-                    profitPrice = scMathUtil.roundTo(profitPrice + singlePrc, me.processDecimal);
-                });
-                let roundPrice = scMathUtil.roundTo(profitPrice, -2);
-                rst.profitPrice = roundPrice;
-                rationBasePrc = scMathUtil.roundTo(rationBasePrc + roundPrice, -2);
-            }
-            if(price.gljType8.length > 0){
-                let riskPrice = 0;
-                price.gljType8.forEach(function (singlePrc) {
-                    riskPrice = scMathUtil.roundTo(riskPrice + singlePrc, me.processDecimal);
-                });
-                let roundPrice = scMathUtil.roundTo(riskPrice, -2);
-                rst.riskPrice = roundPrice;
-                rationBasePrc = scMathUtil.roundTo(rationBasePrc + roundPrice, -2);
-            }
-            rst.rationBasePrc = rationBasePrc;
+            rationBasePrc = scMathUtil.roundTo(rationBasePrc, 0);
         }
-        return rst;
+        return rationBasePrc;
     },
     updateRationItem: function(callback) {
         var me = this, updateArr = [];
@@ -599,10 +534,7 @@ var rationGLJOprObj = {
             me.currentRationItem.rationGljList = me.buildRationItemGlj();
             //recalculate ration basePrice
             let price = me.rationCal();
-            me.currentRationItem.labourPrice = price.labourPrice;
-            me.currentRationItem.materialPrice = price.materialPrice;
-            me.currentRationItem.machinePrice = price.machinePrice;
-            me.currentRationItem.basePrice = price.rationBasePrc;
+            me.currentRationItem.basePrice = price;
             updateArr.push(me.currentRationItem);
             rationOprObj.mixUpdateRequest(updateArr, [], [], function () {
                 if(callback) callback();

+ 53 - 197
web/maintain/std_glj_lib/js/glj.js

@@ -85,12 +85,7 @@ let repositoryGljObj = {
     currentCache: null,
     parentNodeIds: {},
     gljList: [],
-    //materialType: ['钢材', '木材', '水泥', '钢筋', '标准砖'],//三材类型:钢材1、钢筋101、木材2、水泥3、标准砖4
-    materialType: {textArr: ['钢材', '钢筋', '木材', '水泥', '标准砖'], comboItems: [{text: '钢材', value: 1}, {text: '钢筋', value: 2},{text: '木材', value: 3},//三材类型:钢材1、钢筋101、木材2、水泥3、标准砖4
-         {text: '水泥', value: 4}, {text: '标准砖', value: 5}]},
-    materialTypeIdx: {'1': '钢材', '2': '钢筋', '3': '木材', '4': '水泥', '5': '标准砖'},
-    machineModel: {textArr: ['特', '大', '中', '小'], comboItems: [{text: '特', value: 1}, {text: '大', value: 2},{text: '中', value: 3}, {text: '小', value: 4}]},
-    machineModelIdx: {'1': '特', '2': '大', '3': '中', '4': '小'},
+    feeDataCode: ['grossWeightCoe', 'purchaseStorageRate', 'offSiteTransportLossRate', 'handlingLossRate'],
     distTypeTree: null,//add
     setting: {
         owner: "glj",
@@ -101,10 +96,6 @@ let repositoryGljObj = {
             {headerName:"单位",headerWidth:60,dataCode:"unit", dataType: "String", hAlign: "center", vAlign: "center"},
             {headerName:"定额价",headerWidth:80,dataCode:"basePrice", dataType: "Number", formatter: "0.00", hAlign: "right", vAlign: "center"},
             {headerName:"类型",headerWidth:90,dataCode:"gljType", dataType: "String", hAlign: "center", vAlign: "center"},
-            {headerName:"调整系数",headerWidth:60,dataCode:"adjCoe", dataType: "Number", hAlign: "center", vAlign: "center"},
-            {headerName:"三材类别",headerWidth:90,dataCode:"materialType", dataType: "String", hAlign: "center", vAlign: "center"},
-            {headerName:"三材系数",headerWidth:60,dataCode:"materialCoe", dataType: "Number", hAlign: "center", vAlign: "center"},
-            {headerName:"机型",headerWidth:60,dataCode:"model", dataType: "Number", hAlign: "center", vAlign: "center"},
         ],
         view:{
             comboBox:[
@@ -193,10 +184,10 @@ let repositoryGljObj = {
             }
         }
         let tailHeaders = [
-            {headerName:"调整系数",headerWidth:60,dataCode:"adjCoe", dataType: "Number", hAlign: "center", vAlign: "center"},
-            {headerName:"三材类别",headerWidth:90,dataCode:"materialType", dataType: "String", hAlign: "center", vAlign: "center"},
-            {headerName:"三材系数",headerWidth:60,dataCode:"materialCoe", dataType: "Number", hAlign: "center", vAlign: "center"},
-            {headerName:"机型",headerWidth:60,dataCode:"model", dataType: "Number", hAlign: "center", vAlign: "center"}
+            {headerName:"毛重系数",headerWidth:90,dataCode:"grossWeightCoe", dataType: "Number", hAlign: "center", vAlign: "center"},
+            {headerName:"采购保管费率",headerWidth:90,dataCode:"purchaseStorageRate", dataType: "Number", hAlign: "center", vAlign: "center"},
+            {headerName:"场外运输损耗率",headerWidth:100,dataCode:"offSiteTransportLossRate", dataType: "Number", hAlign: "center", vAlign: "center"},
+            {headerName:"每增一次装卸损耗率",headerWidth:100,dataCode:"handlingLossRate", dataType: "Number", hAlign: "center", vAlign: "center"},
         ];
         headers = headers.concat(tailHeaders);
         return headers;
@@ -398,13 +389,9 @@ let repositoryGljObj = {
             let cacheSection = data;
             me.sortGljDeep(cacheSection);
             sheetCommonObj.cleanData(me.workBook.getSheet(0), me.setting, -1);
-            sheetsOprObj.showData(me, me.workBook.getSheet(0), me.setting, cacheSection, me.distTypeTree, me.materialTypeIdx, me.machineModelIdx);
-            let gljTypeCol = me.colMapping.fieldToCol['gljType'],
-                materialTypeCol = me.colMapping.fieldToCol['materialType'],
-                modelCol = me.colMapping.fieldToCol['model'];
+            sheetsOprObj.showData(me, me.workBook.getSheet(0), me.setting, cacheSection, me.distTypeTree);
+            let gljTypeCol = me.colMapping.fieldToCol['gljType'];
             sheetCommonObj.setDynamicCombo(me.workBook.getActiveSheet(), 0, gljTypeCol, me.workBook.getActiveSheet().getRowCount(), me.distTypeTree.comboDatas, 10, 'text');
-            sheetCommonObj.setDynamicCombo(me.workBook.getActiveSheet(), 0, materialTypeCol, me.workBook.getActiveSheet().getRowCount(), me.materialType.comboItems, false, 'text');
-            sheetCommonObj.setDynamicCombo(me.workBook.getActiveSheet(), 0, modelCol, me.workBook.getActiveSheet().getRowCount(), me.machineModel.comboItems, false, 'text');
             cacheSection = null;
             let selRow =  me.workBook.getActiveSheet().getSelections()[0].row;
             me.initSel(selRow);
@@ -633,8 +620,7 @@ let repositoryGljObj = {
         let me = repositoryGljObj;
         let thisDataCode = me.setting.header[args.col].dataCode,
             lastDataCode = me.setting.header[me.lastCell.col].dataCode;
-        if(thisDataCode === 'unit'|| lastDataCode === 'unit' || thisDataCode === 'gljType' || lastDataCode === 'gljType'
-            || thisDataCode === 'materialType' || lastDataCode === 'materialType' || thisDataCode === 'model' || lastDataCode === 'model'){
+        if(thisDataCode === 'unit'|| lastDataCode === 'unit' || thisDataCode === 'gljType' || lastDataCode === 'gljType'){
             let rects = [];
             rects.push(args.sheet.getCellRect(args.row, args.col));
             if(me.lastCell){
@@ -720,9 +706,7 @@ let repositoryGljObj = {
             let dataCode = me.setting.header[args.col].dataCode;
             me.currentGlj = me.currentCache[args.row];
             if(dataCode === 'code'
-                || (dataCode === 'adjCoe' && me.currentGlj.gljType !== 1 && me.currentGlj.gljType !== 303)
-                || (dataCode === 'materialCoe' && !me.currentGlj.materialType)
-                || (dataCode === 'model' && me.currentGlj.gljType !== 301)){
+                || (me.feeDataCode.includes(dataCode) && me.currentGlj.gljType !== 201)){//费率数据列只有普通材料能用
                 args.cancel = true;
             }
             else {
@@ -750,7 +734,8 @@ let repositoryGljObj = {
         let me = repositoryGljObj, that = gljComponentOprObj,
             updateArr = [], addArr = [], updateBasePrcArr = [];
         let deESCFields = ['code', 'name', 'specs'];//消除转义字符
-        if(deESCFields.includes(me.setting.header[args.col]['dataCode'])){
+        let dataCode = me.setting.header[args.col].dataCode;
+        if(deESCFields.includes(dataCode)){
             args.editingText = me.isDef(args.editingText) ? args.editingText.toString().replace(/[\r, \n]/g, '') : '';
             args.sheet.setValue(args.row, args.col, args.editingText);
         }
@@ -759,7 +744,7 @@ let repositoryGljObj = {
         //rObj.basePrice = rObj.basePrice ? rObj.basePrice : 0;
         me.initPrice(rObj);
         //更新
-        if (me.currentEditingGlj["ID"] && me.currentGlj) {
+        if (me.currentEditingGlj["ID"] !== null && me.currentEditingGlj["ID"] !== undefined && me.currentGlj) {
             rObj["ID"] = me.currentEditingGlj["ID"];
             rObj.gljClass = me.currentEditingGlj.gljClass;
             if(me.dataChanged(me.currentEditingGlj, rObj, args.col)){
@@ -775,16 +760,13 @@ let repositoryGljObj = {
                             if(me.currentGlj){
                                 me.currentGlj.component = [];
                             }
-                            /*if(me.allowComponent.indexOf(rObj.gljType) !== -1){//更改成可添加组成物的类型,则将定额价设成零
-                             rObj.basePrice = 0;
-                             }*/
-                            //调整系数,工料机类型为人工和机上人工时,可输入整数
-                            if((me.currentEditingGlj.gljType === 1 || me.currentEditingGlj.gljType === 303) && !(rObj.gljType === 1 || rObj.gljType === 303)){
-                                rObj.adjCoe = null;
-                            }
-                            //工料机类型不为机械台班时,清空机型
-                            if(me.currentEditingGlj.gljType === 301 && rObj.gljType !== 301 && me.currentEditingGlj.model){
-                                rObj.model = null;
+                            //工料机类型不为普通材料时,情况费率数据
+                            if (me.currentEditingGlj.gljType === 201 && rObj.gljType !== 201) {
+                                for (let feeCode of me.feeDataCode) {
+                                    if (me.currentEditingGlj[feeCode]) {
+                                        rObj[feeCode] = null;
+                                    }
+                                }
                             }
                             if(componentType.includes(me.currentEditingGlj.gljType)&&
                                 !(machineComponent.includes(me.currentEditingGlj.gljType) && machineComponent.includes(rObj.gljType)) &&
@@ -810,24 +792,13 @@ let repositoryGljObj = {
                             args.sheet.setValue(args.row, args.col, _.find(me.distTypeTree.comboDatas, {value: me.currentGlj.gljType}).text);
                         });
                         return;
-                    }
-                    else if(rObj.adjCoe !== me.currentEditingGlj.adjCoe){//修改调整系数,整数控制
-                        if(isNaN(rObj.adjCoe) || rObj.adjCoe % 1 !== 0){
-                            args.sheet.setValue(args.row, args.col, me.currentEditingGlj.adjCoe ? me.currentEditingGlj.adjCoe : '');
-                            alert('调整系数只能输入整数!');
+                    } else if (me.feeDataCode.includes(dataCode) && rObj[dataCode] !== me.currentEditingGlj[dataCode]) {
+                        if(isNaN(rObj[dataCode])){
+                            args.sheet.setValue(args.row, args.col, me.currentEditingGlj[dataCode] ? me.currentEditingGlj[dataCode] : '');
+                            alert(`${me.setting.header[args.col].headerName}只能输入数值!`);
                             return;
                         }
-
-                    }
-                    else if(rObj.materialCoe !== me.currentEditingGlj.materialCoe){
-                        if(isNaN(rObj.materialCoe)){
-                            args.sheet.setValue(args.row, args.col, me.currentEditingGlj.materialCoe ? me.currentEditingGlj.materialCoe : '');
-                            alert('三材系数只能输入数值!');
-                            return;
-                        }
-                        rObj.materialCoe = scMathUtil.roundTo(parseFloat(rObj.materialCoe), -5);
-                    }
-                    else if(!me.priceIsEqual(rObj, me.currentEditingGlj)){//修改了单价,可修改单价的必为可成为组成物的
+                    } else if(!me.priceIsEqual(rObj, me.currentEditingGlj)){//修改了单价,可修改单价的必为可成为组成物的
                         let rObjPrice = me.getPrice(rObj, args.col),
                             editingGljPrice = me.getPrice(me.currentEditingGlj, args.col);
                         //寻找所有引用了此组成物的工料机,并从组成物中删去此工料机,并重算单价
@@ -849,19 +820,16 @@ let repositoryGljObj = {
                     }
                     rObj.component = me.currentGlj.component;
                     updateArr.push(rObj);
-                }
-                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;
+                } else{
+                    if(dataCode === 'gljType'){
+                        let distTypeVal =  me.distTypeTree.distTypes[me.distTypeTree.prefix + me.currentEditingGlj[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]);
+                    } else{
+                        args.sheet.setValue(args.row, args.col, me.currentEditingGlj[dataCode]);
                     }
                 }
             }
             if(!me.priceIsEqual(rObj, me.currentEditingGlj)){
-                console.log('df');
                 //update basePrice of ration when editting basePrice of glj
                 let gljType = -1;
                 let gljTypeParent = me.distTypeTree.distTypes[me.distTypeTree.prefix + me.currentEditingGlj.gljType].parent;
@@ -879,9 +847,7 @@ let repositoryGljObj = {
                     }
                 }
             }
-        }
-        //新增
-        else {
+        } else { //新增
             if(typeof rObj.code !== 'undefined'){
                 me.addGljObj = rObj;
                 let isCanSav = true;
@@ -891,7 +857,6 @@ let repositoryGljObj = {
                 if(isCanSav){
                     me.addGljObj = null;
                     rObj.component = [];
-                    //rObj.basePrice = !isNaN(parseFloat(rObj.basePrice)) && (rObj.basePrice && typeof rObj.basePrice !== 'undefined') ? scMathUtil.roundTo(parseFloat(rObj.basePrice), -2) : 0;
                     me.initPrice(rObj);
                     addArr.push(rObj);
                 }
@@ -974,9 +939,6 @@ let repositoryGljObj = {
                                         });
                                     }
                                     else {
-                                        if (dataCode === 'materialType') {
-                                            updateObj['materialCoe'] = null;
-                                        }
                                         updateObj[dataCode] = '';
                                     }
                                 }
@@ -1105,8 +1067,7 @@ let repositoryGljObj = {
             that = gljComponentOprObj,
             tempObj = me.currentCache[rowIdx],
             reCalBasePrc = false,
-            isValid = true,
-            materialTypeValid = true;
+            isValid = true;
         //备份原始数据
         for(let atr in tempObj){
             backUpObj[atr] = tempObj[atr];
@@ -1143,18 +1104,12 @@ let repositoryGljObj = {
                 if(pasteObj.gljType === me.distTypeTree.comboDatas[i].text){
                     pasteObj.gljType = me.distTypeTree.comboDatas[i].value;
                     isExsit = true;
-                    //调整系数
-                    if(pasteObj.gljType !== 1 && pasteObj.gljType !== 303){
-                        tempObj.adjCoe = null;
-                    }
-                    else if((pasteObj.gljType === 1 || pasteObj.gljType === 303) && typeof pasteObj.adjCoe !== 'undefined' && !isNaN(pasteObj.adjCoe) && pasteObj.adjCoe % 1 === 0) {
-                        tempObj.adjCoe = pasteObj.adjCoe;
-                    }
-                    if(pasteObj.gljType !== 301 && tempObj.gljType === 301){
-                        tempObj.model = null;
+                    if (pasteObj.gljType !== 201 && tempObj.gljType === 201) {
+                        for (let feeCode of me.feeDataCode) {
+                            tempObj[feeCode] = null;
+                        }
                     }
                     if(componentType.includes(tempObj.gljType) &&
-                        //!(tempObj.gljType === 302 && pasteObj.gljType === 303) && !(tempObj.gljType === 303 && pasteObj.gljType === 302)){//修改了原本是组成物的工料机
                         !(machineComponent.includes(tempObj.gljType) && machineComponent.includes(pasteObj.gljType)) &&
                         !(materialComponent.includes(tempObj.gljType) && materialComponent.includes(pasteObj.gljType))){//修改了原本是组成物的工料机
                         //寻找所有引用了此组成物的工料机,并从组成物中删去此工料机,并重算单价
@@ -1169,9 +1124,6 @@ let repositoryGljObj = {
                         }
                     }
                     tempObj.component = tempObj.gljType === pasteObj.gljType ? tempObj.component : [];
-                    /*if(me.allowComponent.indexOf(tempObj.gljType) !== -1){//更改成可含组成物的工料机类型,定额价设置为零
-                        tempObj.basePrice = tempObj.gljType === me.distTypeTree.comboDatas[i].value ? tempObj.basePrice : 0;
-                    }*/
                     tempObj.gljType = pasteObj.gljType;
                     tempObj.shortName = me.distTypeTree.distTypes[me.distTypeTree.prefix + tempObj.gljType].data.shortName;
                     break;
@@ -1181,12 +1133,14 @@ let repositoryGljObj = {
                 isValid = false;
             }
         }
-        if(typeof pasteObj.adjCoe !== 'undefined' && typeof pasteObj.gljType === 'undefined'){
-            if(tempObj.gljType && (tempObj.gljType === 1 || tempObj.gljType === 303) && typeof pasteObj.adjCoe !== 'undefined' && !isNaN(pasteObj.adjCoe) && pasteObj.adjCoe % 1 === 0) {
-                tempObj.adjCoe = pasteObj.adjCoe;
-            }
-            else {
-                isValid = false;
+        for (let feeCode of me.feeDataCode) {
+            if (typeof pasteObj[feeCode] !== 'undefined' && !isNaN(pasteObj[feeCode])) {
+                if ((typeof pasteObj.gljType !== 'undefined' && pasteObj.gljType === 201) ||
+                    (tempObj.gljType && tempObj.gljType === 201)) {
+                    tempObj[feeCode] = pasteObj[feeCode];
+                } else {
+                    isValid = false;
+                }
             }
         }
         //单价相关
@@ -1226,53 +1180,6 @@ let repositoryGljObj = {
                 }
             }
         }
-        if(typeof pasteObj.materialType !== 'undefined'){
-            if(!me.materialType.textArr.includes(pasteObj.materialType)){
-                isValid = false;
-                materialTypeValid = false;
-            }
-            else {
-                me.materialType.comboItems.forEach(function (item) {
-                   if(item.text === pasteObj.materialType){
-                       tempObj.materialType = item.value;
-                   }
-                });
-            }
-        }
-        if(typeof pasteObj.materialCoe !== 'undefined'){
-            if(isNaN(pasteObj.materialCoe) ||
-                (!tempObj.materialType && (!pasteObj.materialType || !me.materialType.textArr.includes(pasteObj.materialType)))){
-                tempObj.materialType = '';
-                tempObj.materialCoe = null;
-                isValid = false;
-            }
-            else{
-                tempObj.materialCoe = pasteObj.materialCoe !== '' ? scMathUtil.roundTo(parseFloat(pasteObj.materialCoe), -5) : null;
-            }
-        }
-        if(typeof pasteObj.model !== 'undefined'){
-            if(!me.machineModel.textArr.includes(pasteObj.model)){
-                isValid = false;
-            }
-            else {
-                let existsModel = false;
-                if((typeof pasteObj.gljType !== 'undefined' && pasteObj.gljType === 301) ||
-                    (tempObj.gljType && tempObj.gljType === 301)){
-                    me.machineModel.comboItems.forEach(function (item) {
-                        if(item.text === pasteObj.model){
-                            tempObj.model = item.value;
-                            existsModel = true;
-                        }
-                    });
-                    if(!existsModel){
-                        isValid = false;
-                    }
-                }
-                else {
-                    isValid = false;
-                }
-            }
-        }
         if(isValid){
             rst.updateGlj.push(tempObj);
             if(reCalBasePrc){
@@ -1316,38 +1223,11 @@ let repositoryGljObj = {
                 }
             }
         }
-        if(pasteObj.adjCoe && typeof pasteObj.adjCoe !== 'undefined'){
-            if(isNaN(pasteObj.adjCoe) || pasteObj.adjCoe % 1 !== 0){
+        for (let feeCode of me.feeDataCode) {
+            if (typeof pasteObj[feeCode] !== 'undefined' && (isNaN(pasteObj[feeCode]) || pasteObj.gljType !== 201)) {
                 return false;
             }
         }
-        if(pasteObj.materialType){
-            if(!me.materialType.textArr.includes(pasteObj.materialType)){
-                return false;
-            }
-            else {
-                me.materialType.comboItems.forEach(function (item) {
-                    if(item.text === pasteObj.materialType){
-                        pasteObj.materialType = item.value;
-                    }
-                });
-            }
-        }
-        if(pasteObj.materialCoe){
-            if(isNaN(pasteObj.materialCoe) || !pasteObj.materialType){
-                return false;
-            }
-        }
-        if(typeof pasteObj.model !== 'undefined' && pasteObj.model){
-            if(!me.machineModel.textArr.includes(pasteObj.model) || pasteObj.gljType !== 301){
-                return false;
-            }
-            me.machineModel.comboItems.forEach(function (item) {
-                if(item.text === pasteObj.model){
-                    pasteObj.model = item.value;
-                }
-            });
-        }
         if(!priceProperties || priceProperties.length === 0){
             pasteObj.basePrice = !isNaN(parseFloat(pasteObj.basePrice)) && (pasteObj.basePrice && typeof pasteObj.basePrice !== 'undefined') ? parseFloat(pasteObj.basePrice) : 0;
 
@@ -1404,19 +1284,17 @@ let repositoryGljObj = {
         let me = repositoryGljObj;
         let updateArr = [], addArr = [];
         let items = sheetCommonObj.analyzePasteData(me.setting, info);
-        let beginRow = info.cellRange.row, endRow = info.cellRange.row + info.cellRange.rowCount - 1,
+        let beginRow = info.cellRange.row,
+            endRow = info.cellRange.row + info.cellRange.rowCount - 1,
             maxRow = me.currentCache.length - 1,
             updateBasePrcArr = [],
             updateCount, resumeArr = [];
         if(endRow <= maxRow){
-            //updateItems = items;
             for(let i = 0; i < items.length; i++){
                 let updateObj = me.validUpdateObj(items[i], info.cellRange.row + i);
                 if(updateObj && typeof updateObj.updateGlj !== 'undefined' && updateObj.updateGlj.length > 0){
-                    //updateArr = updateObj.updateGlj;
                     updateArr = updateArr.concat(updateObj.updateGlj);
                     if(typeof updateObj.updateBasePrcArr !== 'undefined'){
-                        //updateBasePrcArr = updateObj.updateBasePrc;
                         updateBasePrcArr = updateBasePrcArr.concat(updateObj.updateBasePrcArr);
                     }
                 }
@@ -1433,7 +1311,6 @@ let repositoryGljObj = {
                     }
                 }
             }
-            //if(info.cellRange.colCount >= me.setting.header.length - 4 && info.cellRange.colCount <= me.setting.header.length){
             //[code, ..., gljType]
             if(info.cellRange.colCount >= 5 && info.cellRange.colCount <= me.setting.header.length){
                 for(let i = updateCount ; i < items.length; i++){
@@ -1445,7 +1322,6 @@ let repositoryGljObj = {
             }
         }
         else{
-            //if(info.cellRange.colCount >= me.setting.header.length - 4 && info.cellRange.colCount <= me.setting.header.length && info.cellRange.col + info.cellRange.colCount - 1 >= 5){
             //粘贴的的最大列至少要等于工料机类型列,因为工料机类型必须有效才可新增
             if(info.cellRange.colCount >= 5 && info.cellRange.colCount <= me.setting.header.length && info.cellRange.col + info.cellRange.colCount - 1 >= me.colMapping.fieldToCol['gljType']){
                 for(let i = 0; i < items.length; i++){
@@ -1474,12 +1350,6 @@ let repositoryGljObj = {
                             let gljType = me.currentCache[resumeArr[i]][dCode];
                             info.sheet.setValue(resumeArr[i], col, me.distTypeTree.distTypes["gljType" + gljType].data.fullName);
                         }
-                        else if(dCode === 'materialType'){
-                            info.sheet.setValue(resumeArr[i], col, me.currentCache[resumeArr[i]][dCode] ? me.materialTypeIdx[me.currentCache[resumeArr[i]][dCode]]: '');
-                        }
-                        else if(dCode === 'model'){
-                            info.sheet.setValue(resumeArr[i], col, me.currentCache[resumeArr[i]][dCode] ? me.machineModelIdx[me.currentCache[resumeArr[i]][dCode]]: '');
-                        }
                         else{
                             info.sheet.setValue(resumeArr[i], col, me.currentCache[resumeArr[i]][dCode]);
                         }
@@ -1702,26 +1572,12 @@ let repositoryGljObj = {
             }
             return 0;
         }
-      /*  if(this.currentOprParent){
-            datas.sort(function (a, b) {
-                let rst = 0;
-                if(a.code > b.code){
-                    rst = 1;
-                }
-                else if(a.code < b.code){
-                    rst = -1;
-                }
-                return rst;
-            });
-        }
-        else {*/
-            //排序符号-
-            datas.sort(function (a, b) {
-                let aArr = a.code.split('-'),
-                    bArr = b.code.split('-');
-                return recurCompare(aArr, bArr, 0);
-            });
-       // }
+        //排序符号-
+        datas.sort(function (a, b) {
+            let aArr = a.code.split('-'),
+                bArr = b.code.split('-');
+            return recurCompare(aArr, bArr, 0);
+        });
     },
     //工料机排序
     sortGlj: function() {

+ 1 - 24
web/maintain/std_glj_lib/js/sheetsOpr.js

@@ -22,7 +22,7 @@ let sheetsOprObj = {
             area.vAlign(GC.Spread.Sheets.VerticalAlign.center);
         }
     },
-    showData: function(obj, sheet, setting, data, distTypeTree, materialTypeIdx, machineModelIdx) {
+    showData: function(obj, sheet, setting, data, distTypeTree) {
         var me = this, ch = GC.Spread.Sheets.SheetArea.viewport;
         sheet.suspendPaint();
         sheet.suspendEvent();
@@ -61,12 +61,6 @@ let sheetsOprObj = {
                     let distTypeVal =  distTypeTree.distTypes[distTypeTree.prefix + data[row].gljType].data.fullName;
                     sheet.setValue(row, col, distTypeVal, ch);
                 }
-                else if(setting.header[col].dataCode === 'materialType' && data[row].materialType){
-                    sheet.setValue(row, col, materialTypeIdx[data[row].materialType]);
-                }
-                else if(setting.header[col].dataCode === 'model' && data[row].model){
-                    sheet.setValue(row, col, machineModelIdx[data[row].model]);
-                }
                 else if(setting.header[col].dataCode === 'select'){
                     if(data[row].isChecked === true){
                         sheet.getCell(row, col).value(1);
@@ -86,9 +80,6 @@ let sheetsOprObj = {
         var rst = {priceProperty: {}};
         let gljTypeCombo = sheet.getCellType(row, repositoryGljObj.colMapping.fieldToCol['gljType']);
         let items = gljTypeCombo.items();
-        let materialTypeCombo = sheet.getCellType(row, repositoryGljObj.colMapping.fieldToCol['materialType']);
-        let materialItems = materialTypeCombo.items();
-        let machineItems = sheet.getCellType(row, repositoryGljObj.colMapping.fieldToCol['model']).items();
         let codeCol = 0;
         for (var col = 0; col < setting.header.length; col++) {
             if(repositoryGljObj.pricePropertyCols.includes(col)){
@@ -105,20 +96,6 @@ let sheetsOprObj = {
                     }
                 });
             }
-            else if(setting.header[col].dataCode === 'materialType'){
-                materialItems.forEach(function(item){
-                    if(sheet.getValue(row, col) === item.text){
-                        rst[setting.header[col].dataCode] = item.value;
-                    }
-                });
-            }
-            else if(setting.header[col].dataCode === 'model'){
-                machineItems.forEach(function(item){
-                    if(sheet.getValue(row, col) === item.text){
-                        rst[setting.header[col].dataCode] = item.value;
-                    }
-                });
-            }
             else if (setting.header[col].dataCode === 'code'){
                 codeCol = col;
                 if(repositoryGljObj){