Bläddra i källkod

feat: 定额增加四个分类地区管理费

vian 2 år sedan
förälder
incheckning
95299042be

+ 19 - 15
modules/all_models/ration.js

@@ -11,7 +11,7 @@ var rationAssItemSchema = mongoose.Schema({
     assistID: Number,
     assistCode: String,
     stdValue: Number,
-    actualValue:Number,
+    actualValue: Number,
     stepValue: String,
     decimal: Number,
     carryBit: String,
@@ -30,8 +30,8 @@ let rationSchema = new Schema({
     name: String,
     unit: String,
     quantity: String,
-    contain:String,//含量
-    quantityEXP:String,//工程量表达式
+    contain: String,//含量
+    quantityEXP: String,//工程量表达式
     programID: Number,
     marketUnitFee: String,
     marketTotalFee: String,
@@ -39,15 +39,15 @@ let rationSchema = new Schema({
     deleteInfo: deleteSchema,
     type: Number,                               // 1 定额、2 量价、3 工料机定额
     subType: Number,                            // 子类型:1人工、201材料、301机械、4主材、5设备
-    from:{type: String,default:'std'},          //std, cpt  来自标准、补充
+    from: { type: String, default: 'std' },          //std, cpt  来自标准、补充
     isSubcontract: Boolean,                     // 是否分包
-    installationKey:String,                   //用来记录安装增加费的关联字段
+    installationKey: String,                   //用来记录安装增加费的关联字段
 
     // 定额特有属性:
     libID: Number,
     maskName: String,
     caption: String,
-    isFromDetail:{type: Number,default:0},       // 1 true 2 false
+    isFromDetail: { type: Number, default: 0 },       // 1 true 2 false
     adjustState: String,
     rationProjName: String,
     comments: String,                           // 说明
@@ -55,17 +55,21 @@ let rationSchema = new Schema({
     rationAssList: [rationAssItemSchema],
     content: String,                            // 工作内容
     ruleText: String,                            // 计算规则
-    prefix: {type: String, default: ''},                              //定额是补充、借用时用  补 借
+    prefix: { type: String, default: '' },                              //定额是补充、借用时用  补 借
 
     //工料机特有属性
-    projectGLJID:Number,  //项目工料机ID
-    GLJID:Number,//工料机库ID
-    original_code:String, //原始编码
-    specs:String,//规格型号
-    shortName:String,//缩写
-    customQuantity:String,//自定义消耗
-    adjCoe:Number,
-    remark:String
+    projectGLJID: Number,  //项目工料机ID
+    GLJID: Number,//工料机库ID
+    original_code: String, //原始编码
+    specs: String,//规格型号
+    shortName: String,//缩写
+    customQuantity: String,//自定义消耗
+    adjCoe: Number,
+    remark: String,
+    manageFee1: Number, // 1类管理费
+    manageFee2: Number, // 2类管理费
+    manageFee3: Number, // 3类管理费
+    manageFee4: Number, // 4类管理费
 });
 
 let ration = mongoose.model("ration", rationSchema, "ration");

+ 12 - 8
modules/all_models/stdRation_ration.js

@@ -20,19 +20,19 @@ const rationAssItemSchema = new Schema({
     carryBit: String,
     minValue: String,
     maxValue: String,
-    paramName:String,//参数名称
-    param:String,//参数
-    thirdRationCode:String//第三定额
+    paramName: String,//参数名称
+    param: String,//参数
+    thirdRationCode: String//第三定额
 }, { _id: false });
 
 //定额安装增加费用
 const rationInstSchema = new Schema({
     feeItemId: String,
     sectionId: String
-},{_id: false});
+}, { _id: false });
 
 const rationItemSchema = new Schema({
-    ID:Number,
+    ID: Number,
     code: String,
     name: String,
     unit: String,
@@ -41,7 +41,7 @@ const rationItemSchema = new Schema({
     materialPrice: Number,
     machinePrice: Number,
     sectionId: Number,
-    rationRepId: {type: Number, index: true},
+    rationRepId: { type: Number, index: true },
     caption: String,
     feeType: Number,
     jobContent: String,
@@ -55,8 +55,12 @@ const rationItemSchema = new Schema({
         type: Array,
         default: []
     },
-    jobContentText:String,//默认的工作内容
-    isDeleted: {type: Boolean, default: false}
+    jobContentText: String,//默认的工作内容
+    manageFee1: Number, // 1类地区管理费
+    manageFee2: Number, // 2类地区管理费
+    manageFee3: Number, // 3类地区管理费
+    manageFee4: Number, // 4类地区管理费
+    isDeleted: { type: Boolean, default: false }
 });
 
 mongoose.model('std_ration_lib_ration_items', rationItemSchema, 'std_ration_lib_ration_items');

+ 178 - 173
web/maintain/ration_repository/js/ration.js

@@ -3,7 +3,7 @@
  */
 
 $(document).ready(function () {
-   //定额表与下方子表上下拖动
+    //定额表与下方子表上下拖动
     let rationSubResize = getRationSubResize();
     SlideResize.verticalSlide(rationSubResize.eleObj, rationSubResize.limit, function () {
         if (rationOprObj.workBook) {
@@ -67,36 +67,40 @@ let rationOprObj = {
     currentSectionId: -1,
     rationsCodes: [],
     setting: {
-        header:[
-            {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:"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:"显示名称(以%s表示参数)",headerWidth:240,dataCode:"caption", dataType: "String"},
-            {headerName:"取费专业",headerWidth:70,dataCode:"feeType", dataType: "Number", hAlign: "center"},
-            {headerName:"管理费费率(%)",headerWidth:100,dataCode:"manageFeeRate", dataType: "String", hAlign: "center"},
-            {headerName:"工作内容",headerWidth:130,dataCode:"jobContentText", dataType: "String"},
+        header: [
+            { 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: "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: "显示名称(以%s表示参数)", headerWidth: 240, dataCode: "caption", dataType: "String" },
+            { headerName: "取费专业", headerWidth: 70, dataCode: "feeType", dataType: "Number", hAlign: "center" },
+            { headerName: "管理费费率(%)", headerWidth: 100, dataCode: "manageFeeRate", dataType: "String", hAlign: "center" },
+            { headerName: "一类地区管理费", headerWidth: 100, dataCode: "manageFee1", dataType: "Number", hAlign: "right" },
+            { headerName: "二类地区管理费", headerWidth: 100, dataCode: "manageFee2", dataType: "Number", hAlign: "right" },
+            { headerName: "三类地区管理费", headerWidth: 100, dataCode: "manageFee3", dataType: "Number", hAlign: "right" },
+            { headerName: "四类地区管理费", headerWidth: 100, dataCode: "manageFee4", dataType: "Number", hAlign: "right" },
+            { headerName: "工作内容", headerWidth: 130, dataCode: "jobContentText", dataType: "String" },
         ],
-        view:{
-            comboBox:[
-                {row:-1,col:2,rowCount:-1,colCount:1}
+        view: {
+            comboBox: [
+                { row: -1, col: 2, rowCount: -1, colCount: 1 }
             ],
-            lockedCells:[
-                {row:-1,col:3,rowCount:-1, colCount:1}
+            lockedCells: [
+                { row: -1, col: 3, rowCount: -1, colCount: 1 }
             ],
             lockColumns: [
                 3, 4, 5, 6
             ]
         }
     },
-    buildSheet: function(container) {
+    buildSheet: function (container) {
         let rationRepId = getQueryString("repository");
         let me = rationOprObj;
         me.workBook = sheetCommonObj.buildSheet(container, me.setting, 30);
-        sheetCommonObj.bindEscKey(me.workBook, [{sheet: me.workBook.getSheet(0), editStarting: me.onCellEditStart, editEnded: me.onCellEditEnd}]);
+        sheetCommonObj.bindEscKey(me.workBook, [{ sheet: me.workBook.getSheet(0), editStarting: me.onCellEditStart, editEnded: me.onCellEditEnd }]);
         me.onContextmenuOpr();
         me.rationDelOpr();
         me.setCombo(me.workBook.getSheet(0), 'dynamic');
@@ -112,7 +116,7 @@ let rationOprObj = {
         let me = rationOprObj;
         sheet.suspendPaint();
         sheet.suspendEvent();
-        if(combo){
+        if (combo) {
             combo = sheetCommonObj.getDynamicCombo();
             combo.items(rationAndGljUnits).itemHeight(10).editable(true);
         }
@@ -123,7 +127,7 @@ let rationOprObj = {
     // TODO info.oldSelections is null
     onSelectionChanged: function (sender, info) {
         console.log(info);
-        if(info.oldSelections.length === 0 && info.newSelections.length > 0 || info.oldSelections[0].row !== info.newSelections[0].row){
+        if (info.oldSelections.length === 0 && info.newSelections.length > 0 || info.oldSelections[0].row !== info.newSelections[0].row) {
             let row = info.newSelections[0].row;
             let me = rationOprObj;
             me.rationSelInit(row);
@@ -144,14 +148,14 @@ let rationOprObj = {
         RationTemplate.rationInitSel(cacheSection[row]);
         if (cacheSection && row < cacheSection.length) {
             rationGLJOprObj.getGljItems(cacheSection[row], function () {
-                if (focusOnSection){
+                if (focusOnSection) {
                     sectionTreeObj.workBook.focus(true);
                 } else {
                     me.workBook.focus(true);
                 }
             });
             rationCoeOprObj.getCoeItems(cacheSection[row], function () {
-                if (focusOnSection){
+                if (focusOnSection) {
                     sectionTreeObj.workBook.focus(true);
                 } else {
                     me.workBook.focus(true);
@@ -159,7 +163,7 @@ let rationOprObj = {
             });
             rationAssistOprObj.getAssItems(cacheSection[row]);
             rationInstObj.getInstItems(cacheSection[row], function () {
-                if (focusOnSection){
+                if (focusOnSection) {
                     sectionTreeObj.workBook.focus(true);
                 } else {
                     me.workBook.focus(true);
@@ -177,7 +181,7 @@ let rationOprObj = {
     isInt: function (num) {
         return !isNaN(num) && num % 1 === 0;
     },
-    getCache: function() {
+    getCache: function () {
         let me = this, rst = me.currentRations["_SEC_ID_" + me.currentSectionId];
         if (!(rst)) {
             me.currentRations["_SEC_ID_" + me.currentSectionId] = [];
@@ -185,14 +189,14 @@ let rationOprObj = {
         }
         return rst;
     },
-    updateCache: function(addArr, updateArr, removeIds, result) {
+    updateCache: function (addArr, updateArr, removeIds, result) {
         let me = this, cacheSection = me.getCache();
         if (addArr.length > 0) {
             me.currentRations["_SEC_ID_" + me.currentSectionId] = cacheSection.concat(addArr);
             cacheSection = me.currentRations["_SEC_ID_" + me.currentSectionId];
         }
         for (let i = removeIds.length - 1; i >= 0; i--) {
-            for (let j = cacheSection.length - 1; j >= 0 ; j--) {
+            for (let j = cacheSection.length - 1; j >= 0; j--) {
                 if (cacheSection[j].rationTemplateList) {
                     //清除模板关联
                     _.remove(cacheSection[j].rationTemplateList, function (data) {
@@ -200,7 +204,7 @@ let rationOprObj = {
                     });
                 }
                 if (cacheSection[j]["ID"] == removeIds[i]) {
-                    cacheSection.splice(j,1);
+                    cacheSection.splice(j, 1);
                 }
             }
         }
@@ -222,9 +226,9 @@ let rationOprObj = {
                 if (updateArr[i]["ID"] && cacheSection[j]["ID"]) {
                     if (cacheSection[j]["ID"] == updateArr[i]["ID"]) {
                         updateArr[i]['rationGljList'] = rationGLJOprObj.cache['_GLJ_' + cacheSection[j]['ID']] ?
-                                                            rationGLJOprObj.cache['_GLJ_' + cacheSection[j]['ID']] :
-                                                        cacheSection[j]['rationGljList'] ?
-                                                            cacheSection[j]['rationGljList'] : [];
+                            rationGLJOprObj.cache['_GLJ_' + cacheSection[j]['ID']] :
+                            cacheSection[j]['rationGljList'] ?
+                                cacheSection[j]['rationGljList'] : [];
                         updateArr[i]['rationCoeList'] = cacheSection[j]['rationCoeList'] ? cacheSection[j]['rationCoeList'] : [];
                         updateArr[i]['rationAssList'] = cacheSection[j]['rationAssList'];
                         updateArr[i]['rationInstList'] = cacheSection[j]['rationInstList'];
@@ -234,9 +238,9 @@ let rationOprObj = {
                 } else {
                     if (cacheSection[j][me.setting.header[0].dataCode] == updateArr[i][me.setting.header[0].dataCode]) {
                         updateArr[i]['rationGljList'] = rationGLJOprObj.cache['_GLJ_' + cacheSection[j]['ID']] ?
-                                                            rationGLJOprObj.cache['_GLJ_' + cacheSection[j]['ID']] :
-                                                        cacheSection[j]['rationGljList'] ?
-                                                            cacheSection[j]['rationGljList'] : [];
+                            rationGLJOprObj.cache['_GLJ_' + cacheSection[j]['ID']] :
+                            cacheSection[j]['rationGljList'] ?
+                                cacheSection[j]['rationGljList'] : [];
                         updateArr[i]['rationCoeList'] = cacheSection[j]['rationCoeList'] ? cacheSection[j]['rationCoeList'] : [];
                         updateArr[i]['rationAssList'] = cacheSection[j]['rationAssList'];
                         updateArr[i]['rationInstList'] = cacheSection[j]['rationInstList'];
@@ -252,25 +256,25 @@ let rationOprObj = {
         let me = this;
         $.contextMenu({
             selector: '#rationItemsSheet',
-            build: function($triggerElement, e){
+            build: function ($triggerElement, e) {
                 //控制允许右键菜单在哪个位置出现
                 let target = SheetDataHelper.safeRightClickSelection($triggerElement, e, me.workBook);
                 let sheet = me.workBook.getSheet(0);
                 let cacheSection = me.getCache();
                 let ration = cacheSection[target.row];
-                if(target.hitTestType === 3){//在表格内&& typeof target.row !== 'undefined' && typeof target.col !== 'undefined'
-                    if(typeof target.row !== 'undefined'){
+                if (target.hitTestType === 3) {//在表格内&& typeof target.row !== 'undefined' && typeof target.col !== 'undefined'
+                    if (typeof target.row !== 'undefined') {
                         //控制按钮是否可用
                         sheet.setActiveCell(target.row, target.col);
                     }
                     return {
-                        callback: function(){},
+                        callback: function () { },
                         items: {
                             "delete": {
                                 name: "删除",
                                 disabled: function () {
                                     const inValidCell = !commonUtil.isDef(target.row) || !commonUtil.isDef(target.col);
-                                    const inValidData = !cacheSection ||target.row >= cacheSection.length;
+                                    const inValidData = !cacheSection || target.row >= cacheSection.length;
                                     return locked || inValidCell || inValidData;
                                 },
                                 icon: "fa-remove",
@@ -285,11 +289,12 @@ let rationOprObj = {
                                         $('#delRationConfirm').unbind('click');
                                         $('#delRationAlert').modal('hide');
                                     });
-                                }}
+                                }
+                            }
                         }
                     };
                 }
-                else{
+                else {
                     return false;
                 }
             }
@@ -305,12 +310,12 @@ let rationOprObj = {
             let sels = rationSheet.getSelections(), updateArr = [], removeArr = [], lockCols = me.setting.view.lockColumns;
             let removeCodes = [];
             let cacheSection = me.getCache();
-            if(sels.length > 0){
-                for(let sel = 0; sel < sels.length; sel++){
-                    if(sels[sel].colCount === me.setting.header.length){
-                        if(cacheSection){
-                            for(let i = 0; i < sels[sel].rowCount; i++){
-                                if(sels[sel].row + i < cacheSection.length){
+            if (sels.length > 0) {
+                for (let sel = 0; sel < sels.length; sel++) {
+                    if (sels[sel].colCount === me.setting.header.length) {
+                        if (cacheSection) {
+                            for (let i = 0; i < sels[sel].rowCount; i++) {
+                                if (sels[sel].row + i < cacheSection.length) {
                                     removeArr.push(cacheSection[sels[sel].row + i].ID);
                                     removeCodes.push(cacheSection[sels[sel].row + i].code);
                                     me.rationsCodes.splice(me.rationsCodes.indexOf(cacheSection[sels[sel].row + i].code.toString()), 1);
@@ -318,8 +323,8 @@ let rationOprObj = {
                             }
                         }
                     }
-                    else{
-                        if(sels[sel].col === 0){
+                    else {
+                        if (sels[sel].col === 0) {
                             $('#alertText').text("编号不能为空,修改失败!");
                             $('#alertModalBtn').click();
                             $('#alertModalCls').click(function () {
@@ -327,17 +332,17 @@ let rationOprObj = {
                             $('#alertModalCof').click(function () {
                             })
                         }
-                        else if(sels[sel].col !== 0 && !(sels[sel].col === 3 && sels.col + sels[sel].colCount -1 === 6)){
-                            if(cacheSection){
-                                for(let i = sels[sel].row === -1 ? 1 : 0; i < sels[sel].rowCount; i++){
-                                    if(sels[sel].row + i < cacheSection.length){
-                                        for(let col = sels[sel].col; col <= sels[sel].col + sels[sel].colCount - 1; col++){
-                                            if(lockCols.indexOf(col) === -1){
+                        else if (sels[sel].col !== 0 && !(sels[sel].col === 3 && sels.col + sels[sel].colCount - 1 === 6)) {
+                            if (cacheSection) {
+                                for (let i = sels[sel].row === -1 ? 1 : 0; i < sels[sel].rowCount; i++) {
+                                    if (sels[sel].row + i < cacheSection.length) {
+                                        for (let col = sels[sel].col; col <= sels[sel].col + sels[sel].colCount - 1; col++) {
+                                            if (lockCols.indexOf(col) === -1) {
                                                 cacheSection[sels[sel].row + i][me.setting.header[col].dataCode] = '';
                                             }
                                         }
                                     }
-                                    if(cacheSection[sels[sel].row + i] && typeof cacheSection[sels[sel].row + i] !== 'undefined'){
+                                    if (cacheSection[sels[sel].row + i] && typeof cacheSection[sels[sel].row + i] !== 'undefined') {
                                         updateArr.push(cacheSection[sels[sel].row + i]);
                                     }
                                 }
@@ -346,16 +351,16 @@ let rationOprObj = {
                     }
                 }
             }
-          /*  if(updateArr.length > 0 || removeArr.length > 0){
-                me.mixUpdate = 1;
-                me.mixDel = removeArr.length > 0 ? 1 : 0;
-                me.mixUpdateRequest(updateArr, [], removeArr);
-            }*/
-            if(updateArr.length > 0){
+            /*  if(updateArr.length > 0 || removeArr.length > 0){
+                  me.mixUpdate = 1;
+                  me.mixDel = removeArr.length > 0 ? 1 : 0;
+                  me.mixUpdateRequest(updateArr, [], removeArr);
+              }*/
+            if (updateArr.length > 0) {
                 me.mixUpdate = 1;
                 me.mixUpdateRequest(updateArr, [], []);
             }
-            if(removeArr.length > 0){
+            if (removeArr.length > 0) {
                 let removeInfo = `确定要删除定额 “${removeCodes.join(',')}” 及其下的所有数据吗?`;
                 $('#delRationAlert').find('.modal-body h5').text(removeInfo);
                 $('#delRationAlert').modal('show');
@@ -380,27 +385,27 @@ let rationOprObj = {
     },
     onEnterCell: function (sender, args) {
         let me = rationOprObj;
-        if(me.setting.header[args.col]['dataCode'] === 'unit' || me.lastCol.dataCode === 'unit'){
+        if (me.setting.header[args.col]['dataCode'] === 'unit' || me.lastCol.dataCode === 'unit') {
             args.sheet.repaint();
         }
         me.cellRowIdx = args.row;
         let isHasData = false;
-        if(me.addRationItem){
-            for(let i=0; i<me.setting.header.length; i++){
-                if(me.addRationItem[me.setting.header[i].dataCode]){
+        if (me.addRationItem) {
+            for (let i = 0; i < me.setting.header.length; i++) {
+                if (me.addRationItem[me.setting.header[i].dataCode]) {
                     isHasData = true;
                     break;
                 }
             }
         }
-        if(isHasData){
-            if(me.editingRowIdx !== me.cellRowIdx) {
+        if (isHasData) {
+            if (me.editingRowIdx !== me.cellRowIdx) {
                 let focusToCol = !me.addRationItem.code ? 0 : -1;
-                if(focusToCol !== -1){
+                if (focusToCol !== -1) {
                     $('#rationAlertBtn').click();
                     $('#rationAlertCac').click(function () {
                         me.addRationItem = null;
-                        for(let col=0; col<me.setting.header.length; col++){
+                        for (let col = 0; col < me.setting.header.length; col++) {
                             me.workBook.getSheet(0).getCell(me.editingRowIdx, col).value('');
                         }
                     });
@@ -414,12 +419,12 @@ let rationOprObj = {
             }
         }
     },
-    onCellEditStart: function(sender, args) {
+    onCellEditStart: function (sender, args) {
         let me = rationOprObj;
-        if(!me.canRations || me.setting.view.lockColumns.indexOf(args.col) !== -1){
+        if (!me.canRations || me.setting.view.lockColumns.indexOf(args.col) !== -1) {
             args.cancel = true;
         }
-        else{
+        else {
             let rObj = sheetsOprObj.combineRationRowData(me.workBook.getSheet(0), me.setting, args.row);
             me.currentEditingRation = rObj;
             let cacheSection = me.getCache();
@@ -433,12 +438,12 @@ let rationOprObj = {
             }
         }
     },
-    onCellEditEnd: function(sender, args) {
+    onCellEditEnd: function (sender, args) {
         let me = rationOprObj;
         // 输入编号、名称、单位时,如果输入回车符或粘贴回车符,提交时应转换为空格。
         let dataCode = me.setting.header[args.col].dataCode;
         let deESCFields = ['code', 'name', 'unit'];
-        if(deESCFields.includes(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);
         }
@@ -447,27 +452,27 @@ let rationOprObj = {
             addArr = [];
         me.editingRowIdx = args.row;
         if (me.currentEditingRation["ID"]) {
-            if((!args.editingText || args.editingText.toString().trim().length === 0) && args.col === 0){
+            if ((!args.editingText || args.editingText.toString().trim().length === 0) && args.col === 0) {
                 args.sheet.setValue(args.row, args.col, me.currentEditingRation[dataCode] + '');
             }
             else {
                 rObj["ID"] = me.currentEditingRation["ID"];
-                if(me.currentEditingRation[dataCode] !== rObj[dataCode]){
+                if (me.currentEditingRation[dataCode] !== rObj[dataCode]) {
                     me.addRationItem = rObj;
-                    if(dataCode === 'code'){
-                        if(me.rationsCodes.indexOf(rObj.code.toString()) === -1){
+                    if (dataCode === 'code') {
+                        if (me.rationsCodes.indexOf(rObj.code.toString()) === -1) {
                             me.rationsCodes.splice(me.rationsCodes.indexOf(rObj.code.toString()), 1);
                             me.rationsCodes.push(rObj.code.toString());
                             updateArr.push(rObj);
                         }
-                        else{
+                        else {
                             alert("编码已存在!");
                             args.sheet.setValue(args.row, args.col, me.currentEditingRation[dataCode]);
 
                         }
                     }
                     else if (dataCode === 'feeType') {//取费专业控制为整数    
-                        if(me.isInt(rObj[dataCode])){
+                        if (me.isInt(rObj[dataCode])) {
                             updateArr.push(rObj);
                         }
                         else {
@@ -475,23 +480,23 @@ let rationOprObj = {
                             args.sheet.setValue(args.row, args.col, typeof me.currentEditingRation[dataCode] !== 'undefined' && me.currentEditingRation[dataCode] ? me.currentEditingRation[dataCode] : '');
                         }
                     }
-                    else{
+                    else {
                         updateArr.push(rObj);
                     }
                 }
             }
         }
-        else if(!me.currentEditingRation["ID"]) {
+        else if (!me.currentEditingRation["ID"]) {
             if (!sheetCommonObj.chkIfEmpty(rObj, me.setting)) {
                 //addArr.push(rObj);
                 me.addRationItem = rObj;
-                if(rObj.code && rObj.code.toString().trim().length > 0){
-                    if(me.rationsCodes.indexOf(rObj.code.toString()) === -1){
+                if (rObj.code && rObj.code.toString().trim().length > 0) {
+                    if (me.rationsCodes.indexOf(rObj.code.toString()) === -1) {
                         //jobContent
-                        if(jobContentOprObj && jobContentOprObj.currentSituation === jobContentOprObj.situations.ALL){
+                        if (jobContentOprObj && jobContentOprObj.currentSituation === jobContentOprObj.situations.ALL) {
                             rObj.jobContent = jobContentOprObj.currentJobContent ? jobContentOprObj.currentJobContent : '';
                         }
-                        if(annotationOprObj && annotationOprObj.currentSituation === annotationOprObj.situations.ALL){
+                        if (annotationOprObj && annotationOprObj.currentSituation === annotationOprObj.situations.ALL) {
                             rObj.annotation = annotationOprObj.currentAnnotation ? annotationOprObj.currentAnnotation : '';
                         }
                         me.setInitPrc(rObj);
@@ -499,12 +504,12 @@ let rationOprObj = {
                         me.rationsCodes.push(rObj.code.toString());
                         me.addRationItem = null;
                     }
-                    else{
+                    else {
                         alert('编码已存在!');
                         me.workBook.getSheet(0).setValue(args.row, args.col, '');
                     }
                 }
-                else if(rObj.code && rObj.code.toString.trim().length === 0){
+                else if (rObj.code && rObj.code.toString.trim().length === 0) {
                     me.workBook.getSheet(0).setValue(args.row, args.col, '');
                 }
             }
@@ -517,20 +522,20 @@ let rationOprObj = {
     },
     canPasted: function (beginCol, maxCol) {
         let rst = false;
-        if(maxCol < 3 || beginCol > 6){
+        if (maxCol < 3 || beginCol > 6) {
             rst = true;
         }
         return rst;
     },
-    onClipboardPasting: function(sender, args) {
+    onClipboardPasting: function (sender, args) {
         let me = rationOprObj;
-        let maxCol = args.cellRange.col + args.cellRange.colCount -1;
-        if(!me.canRations || !me.canPasted(args.cellRange.col, maxCol) || maxCol > me.setting.header.length - 1){
+        let maxCol = args.cellRange.col + args.cellRange.colCount - 1;
+        if (!me.canRations || !me.canPasted(args.cellRange.col, maxCol) || maxCol > me.setting.header.length - 1) {
             args.cancel = true;
         }
     },
     //todo: overwrite?
-    onClipboardPasted: function(e, info) {
+    onClipboardPasted: function (e, info) {
         console.log('cp');
         let me = rationOprObj;
         let cacheSection = me.getCache();
@@ -539,80 +544,80 @@ 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){
+                /*  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
-                        if(jobContentOprObj && jobContentOprObj.currentSituation === jobContentOprObj.situations.ALL){
+                        if (jobContentOprObj && jobContentOprObj.currentSituation === jobContentOprObj.situations.ALL) {
                             items[i].jobContent = jobContentOprObj.currentJobContent ? jobContentOprObj.currentJobContent : '';
                         }
-                        if(annotationOprObj && annotationOprObj.currentSituation === annotationOprObj.situations.ALL){
+                        if (annotationOprObj && annotationOprObj.currentSituation === annotationOprObj.situations.ALL) {
                             items[i].annotation = annotationOprObj.currentAnnotation ? annotationOprObj.currentAnnotation : '';
                         }
                         me.setInitPrc(items[i]);
                         addArr.push(items[i]);
                         me.rationsCodes.push(items[i].code.toString());
                     }
-                    else{
+                    else {
                         me.workBook.getSheet(0).setValue(rowIdx, 0, '');
                     }
                 }
-                else if(cacheSection[rowIdx]){
-                    for(let col = 0; col < me.setting.header.length; col++){
-                        if(!items[i][me.setting.header[col].dataCode] && typeof cacheSection[rowIdx][me.setting.header[col].dataCode] !== 'undefined'){
+                else if (cacheSection[rowIdx]) {
+                    for (let col = 0; col < me.setting.header.length; col++) {
+                        if (!items[i][me.setting.header[col].dataCode] && typeof cacheSection[rowIdx][me.setting.header[col].dataCode] !== 'undefined') {
                             items[i][me.setting.header[col].dataCode] = cacheSection[rowIdx][me.setting.header[col].dataCode];
                         }
                     }
-                    if(items[i].feeType && !me.isInt(items[i].feeType)){
+                    if (items[i].feeType && !me.isInt(items[i].feeType)) {
                         items[i].feeType = '';
                         me.workBook.getSheet(0).setValue(rowIdx, 8, '');
                     }
-                    if(info.cellRange.col === 0){
-                        if(me.rationsCodes.indexOf(items[i].code.toString()) === -1){
+                    if (info.cellRange.col === 0) {
+                        if (me.rationsCodes.indexOf(items[i].code.toString()) === -1) {
                             items[i].ID = cacheSection[rowIdx].ID;
                             updateArr.push(items[i]);
                         }
-                        else{
+                        else {
                             me.workBook.getSheet(0).setValue(rowIdx, 0, cacheSection[rowIdx].code);
                         }
                     }
-                    else{
+                    else {
                         items[i].ID = cacheSection[rowIdx].ID;
                         updateArr.push(items[i]);
                     }
                 }
 
             } else {
-               /* if(!me.isValidUnit(items[i], rationUnits)){//无效单位
-                    items[i].unit = '';
-                }*/
+                /* if(!me.isValidUnit(items[i], rationUnits)){//无效单位
+                     items[i].unit = '';
+                 }*/
                 //add
-                if(info.cellRange.col === 0){
+                if (info.cellRange.col === 0) {
                     //是否含有已存在的编号
-                        if(me.rationsCodes.indexOf(items[i].code.toString()) === -1){
-                            //jobConten
-                            if(jobContentOprObj && jobContentOprObj.currentSituation === jobContentOprObj.situations.ALL){
-                                items[i].jobContent = jobContentOprObj.currentJobContent ? jobContentOprObj.currentJobContent : '';
-                            }
-                            if(annotationOprObj && annotationOprObj.currentSituation === annotationOprObj.situations.ALL){
-                                items[i].annotation = annotationOprObj.currentAnnotation ? annotationOprObj.currentAnnotation : '';
-                            }
-                            me.setInitPrc(items[i]);
-                            addArr.push(items[i]);
+                    if (me.rationsCodes.indexOf(items[i].code.toString()) === -1) {
+                        //jobConten
+                        if (jobContentOprObj && jobContentOprObj.currentSituation === jobContentOprObj.situations.ALL) {
+                            items[i].jobContent = jobContentOprObj.currentJobContent ? jobContentOprObj.currentJobContent : '';
                         }
+                        if (annotationOprObj && annotationOprObj.currentSituation === annotationOprObj.situations.ALL) {
+                            items[i].annotation = annotationOprObj.currentAnnotation ? annotationOprObj.currentAnnotation : '';
+                        }
+                        me.setInitPrc(items[i]);
+                        addArr.push(items[i]);
+                    }
                 }
             }
         };
-         if (updateArr.length > 0 || addArr.length > 0) {
-             console.log(updateArr);
-             me.mixUpdate = 1;
+        if (updateArr.length > 0 || addArr.length > 0) {
+            console.log(updateArr);
+            me.mixUpdate = 1;
             me.mixUpdateRequest(updateArr, addArr, []);
         }
-        else{
-             me.getRationItems(me.currentSectionId);
-         }
+        else {
+            me.getRationItems(me.currentSectionId);
+        }
     },
     setInitPrc: function (obj) {
         obj.labourPrice = 0;
@@ -622,22 +627,22 @@ let rationOprObj = {
     },
     isValidUnit: function (rationObj, validUnits) {
         let rst = true;
-        if(typeof rationObj.unit !== 'undefined' && rationObj.unit && validUnits.indexOf(rationObj.unit) === -1){//无效
+        if (typeof rationObj.unit !== 'undefined' && rationObj.unit && validUnits.indexOf(rationObj.unit) === -1) {//无效
             rst = false;
         }
         return rst;
     },
-    mixUpdateRequest: function(updateArr, addArr, removeIds, callback) {
+    mixUpdateRequest: function (updateArr, addArr, removeIds, callback) {
         let me = rationOprObj;
         me.saveInString(updateArr);
         $.ajax({
-            type:"POST",
-            url:"api/mixUpdateRationItems",
-            data:{"rationLibId": getQueryString("repository"), "lastOpr": userAccount, "sectionID": me.currentSectionId, "updateItems": JSON.stringify(updateArr), "addItems": JSON.stringify(addArr), "removeIds": JSON.stringify(removeIds)},
-            dataType:"json",
-            cache:false,
-            timeout:20000,
-            success:function(result){
+            type: "POST",
+            url: "api/mixUpdateRationItems",
+            data: { "rationLibId": getQueryString("repository"), "lastOpr": userAccount, "sectionID": me.currentSectionId, "updateItems": JSON.stringify(updateArr), "addItems": JSON.stringify(addArr), "removeIds": JSON.stringify(removeIds) },
+            dataType: "json",
+            cache: false,
+            timeout: 20000,
+            success: function (result) {
                 if (result.error) {
                     alert('error');
                     me.getRationItems(me.currentSectionId);
@@ -655,24 +660,24 @@ let rationOprObj = {
                     me.rationSelInit(curRow);
                     //add
                     //jobContent
-                    if(jobContentOprObj ){
+                    if (jobContentOprObj) {
                         jobContentOprObj.currentRationItems = cacheSection;
                         jobContentOprObj.setRadiosDisabled(cacheSection.length > 0 ? false : true, jobContentOprObj.radios);
-                        if(cacheSection.length === 0){
+                        if (cacheSection.length === 0) {
                             jobContentOprObj.updateSituation(pageOprObj.rationLibId, me.currentSectionId, 'NONE');
                         }
                         jobContentOprObj.setRadiosChecked(jobContentOprObj.currentSituation, jobContentOprObj.radios);
-                        if(jobContentOprObj.currentSituation === jobContentOprObj.situations.PARTIAL){
+                        if (jobContentOprObj.currentSituation === jobContentOprObj.situations.PARTIAL) {
                             jobContentOprObj.buildTablePartial(jobContentOprObj.tablePartial, jobContentOprObj.getGroup(cacheSection));
                         }
                     }
-                    if(annotationOprObj ){
+                    if (annotationOprObj) {
                         annotationOprObj.setRadiosDisabled(cacheSection.length > 0 ? false : true, annotationOprObj.radios);
-                        if(cacheSection.length === 0){
+                        if (cacheSection.length === 0) {
                             annotationOprObj.updateAnnoSituation(pageOprObj.rationLibId, me.currentSectionId, 'NONE');
                         }
                         annotationOprObj.setRadiosChecked(annotationOprObj.currentSituation, annotationOprObj.radios);
-                        if(annotationOprObj.currentSituation === annotationOprObj.situations.PARTIAL){
+                        if (annotationOprObj.currentSituation === annotationOprObj.situations.PARTIAL) {
                             annotationOprObj.buildTablePartial(annotationOprObj.fzTablePartial, annotationOprObj.getGroup(cacheSection));
                         }
                     }
@@ -681,14 +686,14 @@ let rationOprObj = {
                     me.mixDel = 0;
                 }
                 me.workBook.focus(true);
-                if(callback) callback();
+                if (callback) callback();
             },
-            error:function(){
+            error: function () {
             }
         });
     },
     doAfterGetRation: null,
-    getRationItems: function(sectionID, callback = null){
+    getRationItems: function (sectionID, callback = null) {
         if (sectionID != -1) {
             let me = rationOprObj;
             me.mixUpdate = 0;
@@ -706,13 +711,13 @@ let rationOprObj = {
                 }
             } else */{
                 $.ajax({
-                    type:"POST",
-                    url:"api/getRationItems",
-                    data:{"rationRepId": pageOprObj.rationLibId, "sectionID": sectionID},
-                    dataType:"json",
-                    cache:false,
-                    timeout:10000,
-                    success:function(result){
+                    type: "POST",
+                    url: "api/getRationItems",
+                    data: { "rationRepId": pageOprObj.rationLibId, "sectionID": sectionID },
+                    dataType: "json",
+                    cache: false,
+                    timeout: 10000,
+                    success: function (result) {
                         if (result) {
                             me.currentRations["_SEC_ID_" + sectionID] = result.data;
                             me.sortByCode(me.currentRations["_SEC_ID_" + sectionID]);
@@ -726,11 +731,11 @@ let rationOprObj = {
                         if (!locked) {
                             sectionTreeObj.removeBtn.removeClass('disabled');
                         }
-                        if(callback) {
+                        if (callback) {
                             callback(result.data);
                         }
                     },
-                    error:function(err){
+                    error: function (err) {
                         sectionTreeObj.removeBtn.removeClass('disabled');
                         alert(err);
                     }
@@ -738,7 +743,7 @@ let rationOprObj = {
             }
         }
     },
-    showRationItems: function(sectionID){
+    showRationItems: function (sectionID) {
         let me = rationOprObj,
             sheetGLJ = rationGLJOprObj.sheet, settingGLJ = rationGLJOprObj.setting,
             sheetCoe = rationCoeOprObj.sheet, settingCoe = rationCoeOprObj.setting,
@@ -749,7 +754,7 @@ let rationOprObj = {
             if (me.currentRations && me.currentRations["_SEC_ID_" + sectionID]) {
                 let cacheSection = me.currentRations["_SEC_ID_" + sectionID];
                 sheetsOprObj.showData(me.workBook.getSheet(0), me.setting, cacheSection);
-                if(me.mixDel === 1){
+                if (me.mixDel === 1) {
                     let row = me.workBook.getSheet(0).getSelections()[0].row;
                     if (cacheSection && row < cacheSection.length) {
                         sheetCommonObj.cleanData(sheetGLJ, settingGLJ, -1);
@@ -780,12 +785,12 @@ let rationOprObj = {
                 sheetCommonObj.cleanSheet(sheetAss, settingAss, -1);
                 sheetCommonObj.cleanSheet(sheetInst, settingInst, -1);
             }
-           //--- me.workBook.focus(true);
+            //--- me.workBook.focus(true);
         }
         sectionTreeObj.workBook.focus(true);
     },
-    sortByCode: function(arr){
-        function recurCompare(a, b, index){
+    sortByCode: function (arr) {
+        function recurCompare(a, b, index) {
             if (a[index] && !b[index]) {
                 return 1;
             } else if (!a[index] && b[index]) {
@@ -816,25 +821,25 @@ let rationOprObj = {
             return recurCompare(aArr, bArr, 0);
         });
     },
-    saveInString(datas){
-        for(let i = 0, len = datas.length; i < len; i++){
+    saveInString(datas) {
+        for (let i = 0, len = datas.length; i < len; i++) {
             let data = datas[i];
-            if(data.labourPrice !== undefined && data.labourPrice){
+            if (data.labourPrice !== undefined && data.labourPrice) {
                 data.labourPrice = data.labourPrice.toString();
             }
-            if(data.materialPrice !== undefined && data.materialPrice){
+            if (data.materialPrice !== undefined && data.materialPrice) {
                 data.materialPrice = data.materialPrice.toString();
             }
-            if(data.machinePrice !== undefined && data.machinePrice){
+            if (data.machinePrice !== undefined && data.machinePrice) {
                 data.machinePrice = data.machinePrice.toString();
             }
-            if(data.basePrice !== undefined && data.basePrice){
+            if (data.basePrice !== undefined && data.basePrice) {
                 data.basePrice = data.basePrice.toString();
             }
-            if(data.rationGljList !== undefined && data.rationGljList && data.rationGljList.length > 0){
-                for(let j = 0, jLen = data.rationGljList.length; j < jLen; j++){
+            if (data.rationGljList !== undefined && data.rationGljList && data.rationGljList.length > 0) {
+                for (let j = 0, jLen = data.rationGljList.length; j < jLen; j++) {
                     let raGljObj = data.rationGljList[j];
-                    if(raGljObj.consumeAmt !== undefined && raGljObj.consumeAmt){
+                    if (raGljObj.consumeAmt !== undefined && raGljObj.consumeAmt) {
                         raGljObj.consumeAmt = raGljObj.consumeAmt.toString();
                     }
                 }

+ 48 - 48
web/maintain/ration_repository/js/sheetsOpr.js

@@ -2,7 +2,7 @@
  * Created by Zhong on 2017/9/29.
  */
 let sheetsOprObj = {
-    setAreaAlign: function(area, hAlign, vAlign){
+    setAreaAlign: function (area, hAlign, vAlign) {
         if (!(hAlign) || hAlign === "left") {
             area.hAlign(GC.Spread.Sheets.HorizontalAlign.left);
         } else if (hAlign === "right") {
@@ -22,14 +22,14 @@ let sheetsOprObj = {
             area.vAlign(GC.Spread.Sheets.VerticalAlign.center);
         }
     },
-    showData: function(sheet, setting, data, distTypeTree) {
+    showData: function (sheet, setting, data, distTypeTree) {
         var me = this, ch = GC.Spread.Sheets.SheetArea.viewport;
         sheet.suspendPaint();
         sheet.suspendEvent();
-        if(typeof setting.owner !== 'undefined' && setting.owner === 'gljComponent'){
+        if (typeof setting.owner !== 'undefined' && setting.owner === 'gljComponent') {
             sheet.setRowCount(data.length + 5);
         }
-        else{
+        else {
             sheet.setRowCount(typeof repositoryGljObj !== 'undefined' && repositoryGljObj.currentOprParent === 1 ? data.length : data.length + 10);
         }
         /*if(data.length === 0){
@@ -41,10 +41,10 @@ let sheetsOprObj = {
             var hAlign = "left", vAlign = "center";
             if (setting.header[col].hAlign) {
                 hAlign = setting.header[col].hAlign;
-            } else if (setting.header[col].dataType !== "String"){
+            } else if (setting.header[col].dataType !== "String") {
                 hAlign = "right";
             }
-            vAlign = setting.header[col].vAlign?setting.header[col].vAlign:vAlign;
+            vAlign = setting.header[col].vAlign ? setting.header[col].vAlign : vAlign;
             me.setAreaAlign(sheet.getRange(-1, col, -1, 1), hAlign, vAlign);
             if (setting.header[col].formatter) {
                 //var style = new GC.Spread.Sheets.Style();
@@ -54,14 +54,14 @@ let sheetsOprObj = {
             }
             for (var row = 0; row < data.length; row++) {
                 //var cell = sheet.getCell(row, col, GC.Spread.Sheets.SheetArea.viewport);
-                if(setting.header[col].dataCode === 'gljType' && data[row].gljType){
-                   /* if(typeof repositoryGljObj !== 'undefined' && typeof repositoryGljObj.allowComponent !== 'undefined' && repositoryGljObj.allowComponent.indexOf(data[row].gljType) !== -1){
-                        sheet.getCell(row, 4, GC.Spread.Sheets.SheetArea.viewport).locked(true);
-                    }
-                    else if(typeof repositoryGljObj !== 'undefined' && typeof repositoryGljObj.allowComponent !== 'undefined' && repositoryGljObj.allowComponent.indexOf(data[row].gljType) === -1){
-                        sheet.getCell(row, 4, GC.Spread.Sheets.SheetArea.viewport).locked(false);
-                    }*/
-                    let distTypeVal =  distTypeTree.distTypes[distTypeTree.prefix + data[row].gljType].data.fullName;
+                if (setting.header[col].dataCode === 'gljType' && data[row].gljType) {
+                    /* if(typeof repositoryGljObj !== 'undefined' && typeof repositoryGljObj.allowComponent !== 'undefined' && repositoryGljObj.allowComponent.indexOf(data[row].gljType) !== -1){
+                         sheet.getCell(row, 4, GC.Spread.Sheets.SheetArea.viewport).locked(true);
+                     }
+                     else if(typeof repositoryGljObj !== 'undefined' && typeof repositoryGljObj.allowComponent !== 'undefined' && repositoryGljObj.allowComponent.indexOf(data[row].gljType) === -1){
+                         sheet.getCell(row, 4, GC.Spread.Sheets.SheetArea.viewport).locked(false);
+                     }*/
+                    let distTypeVal = distTypeTree.distTypes[distTypeTree.prefix + data[row].gljType].data.fullName;
                     sheet.setValue(row, col, distTypeVal, ch);
                 }
                 else {
@@ -73,40 +73,40 @@ let sheetsOprObj = {
                     }*/
                 }
             }
-          /*  for(let i = data.length; i < sheet.getRowCount(); i++){
-                sheet.getCell(i, 4, GC.Spread.Sheets.SheetArea.viewport).locked(false);
-            }*/
+            /*  for(let i = data.length; i < sheet.getRowCount(); i++){
+                  sheet.getCell(i, 4, GC.Spread.Sheets.SheetArea.viewport).locked(false);
+              }*/
         }
         sheet.resumeEvent();
         sheet.resumePaint();
         //me.shieldAllCells(sheet);
     },
-    showDataForGljSel: function(sheet, setting, data, distTypeTree) {
+    showDataForGljSel: function (sheet, setting, data, distTypeTree) {
         var me = this, ch = GC.Spread.Sheets.SheetArea.viewport;
         sheet.suspendPaint();
         sheet.suspendEvent();
         let checkBoxType = new GC.Spread.Sheets.CellTypes.CheckBox();
-        if(typeof setting.owner !== 'undefined' && setting.owner === 'gljComponent'){
+        if (typeof setting.owner !== 'undefined' && setting.owner === 'gljComponent') {
             sheet.setRowCount(data.length + 5);
         }
-        else{
+        else {
             sheet.setRowCount(typeof repositoryGljObj !== 'undefined' && repositoryGljObj.currentOprParent === 1 ? data.length : data.length + 10);
         }
         for (var col = 0; col < setting.header.length; col++) {
             var hAlign = "left", vAlign = "center";
             if (setting.header[col].hAlign) {
                 hAlign = setting.header[col].hAlign;
-            } else if (setting.header[col].dataType !== "String"){
+            } else if (setting.header[col].dataType !== "String") {
                 hAlign = "right";
             }
-            vAlign = setting.header[col].vAlign?setting.header[col].vAlign:vAlign;
+            vAlign = setting.header[col].vAlign ? setting.header[col].vAlign : vAlign;
             me.setAreaAlign(sheet.getRange(-1, col, -1, 1), hAlign, vAlign);
             if (setting.header[col].formatter) {
                 sheet.setFormatter(-1, col, setting.header[col].formatter, GC.Spread.Sheets.SheetArea.viewport);
             }
             for (var row = 0; row < data.length; row++) {
-                if(setting.header[col].dataCode === 'gljType' && data[row].gljType){
-                    let distTypeVal =  distTypeTree.distTypes[distTypeTree.prefix + data[row].gljType].data.fullName;
+                if (setting.header[col].dataCode === 'gljType' && data[row].gljType) {
+                    let distTypeVal = distTypeTree.distTypes[distTypeTree.prefix + data[row].gljType].data.fullName;
                     sheet.setValue(row, col, distTypeVal, ch);
                 }
                 else {
@@ -114,19 +114,19 @@ let sheetsOprObj = {
                     sheet.setTag(row, 0, data[row].ID, ch);
                 }
                 //复选框
-                if(setting.header[col].dataCode === 'isComplementary'){
+                if (setting.header[col].dataCode === 'isComplementary') {
                     sheet.setCellType(row, col, checkBoxType);
                     sheet.getCell(row, col).value(1);
                 }
                 //新增组成物表,选择复选框
-                if(setting.header[col].dataCode === 'select'){
+                if (setting.header[col].dataCode === 'select') {
                     sheet.setCellType(row, col, checkBoxType)
-                    if(data[row].isChecked === true){
+                    if (data[row].isChecked === true) {
                         sheet.getCell(row, col).value(1);
                     }
                 }
             }
-            for(let i = data.length; i < sheet.getRowCount(); i++){
+            for (let i = data.length; i < sheet.getRowCount(); i++) {
                 sheet.setCellType(i, 6, null);
             }
         }
@@ -134,35 +134,35 @@ let sheetsOprObj = {
         sheet.resumePaint();
         //me.shieldAllCells(sheet);
     },
-    combineRowData: function(sheet, setting, row, repositoryGljObj) {
+    combineRowData: function (sheet, setting, row, repositoryGljObj) {
         let me = this;
         var rst = {};
         let comboBoxCellType = sheet.getCellType(row, 5);
         let items = comboBoxCellType.items();
         for (var col = 0; col < setting.header.length; col++) {
-            if(setting.header[col].dataCode === 'gljType'){
-                items.forEach(function(item){
-                    if(sheet.getValue(row, col) === item.text){
+            if (setting.header[col].dataCode === 'gljType') {
+                items.forEach(function (item) {
+                    if (sheet.getValue(row, col) === item.text) {
                         rst[setting.header[col].dataCode] = item.value;
-                        if(repositoryGljObj){
+                        if (repositoryGljObj) {
                             rst.shortName = repositoryGljObj.distTypeTree.distTypes[repositoryGljObj.distTypeTree.prefix + item.value].data.shortName;
                         }
                     }
                 });
             }
-            else if (setting.header[col].dataCode === 'code'){
-                if(repositoryGljObj){
+            else if (setting.header[col].dataCode === 'code') {
+                if (repositoryGljObj) {
                     let gljList = repositoryGljObj.gljList,
                         orgCode = repositoryGljObj.orgCode,
                         isExist = false;
-                    for(let i=0; i< gljList.length; i++){
-                        if(gljList[i].code === sheet.getValue(row, col) && sheet.getValue(row, col)!== orgCode){
-                           // sheetCommonObj.lockAllCells(sheet);
+                    for (let i = 0; i < gljList.length; i++) {
+                        if (gljList[i].code === sheet.getValue(row, col) && sheet.getValue(row, col) !== orgCode) {
+                            // sheetCommonObj.lockAllCells(sheet);
                             $('#alertText').text("输入的编号已存在,请重新输入!");
                             $('#codeAlertBtn').click();
                             $('#codAleConfBtn').click(function () {
                                 // me.reLockSomeCodes(sheet, 0, repositoryGljObj.currentCache.length);
-                               // sheetCommonObj.unLockAllCells(sheet);
+                                // sheetCommonObj.unLockAllCells(sheet);
                                 //me.reLockSomeCodes(sheet, 0, repositoryGljObj.currentCache.length);
                                 sheet.setValue(row, 0, orgCode);
                                 sheet.getCell(row, 0).formatter("@");
@@ -180,21 +180,21 @@ let sheetsOprObj = {
                             isExist = true
                         }
                     }
-                    if(!isExist){
+                    if (!isExist) {
                         rst[setting.header[col].dataCode] = sheet.getValue(row, col);
                     }
                 }
-                else{
+                else {
                     rst[setting.header[col].dataCode] = sheet.getValue(row, col);
                 }
             }
-            else{
+            else {
                 rst[setting.header[col].dataCode] = sheet.getValue(row, col);
             }
         }
         return rst;
     },
-    combineRationRowData: function(sheet, setting, row) {
+    combineRationRowData: function (sheet, setting, row) {
         var rst = {};
         for (var col = 0; col < setting.header.length; col++) {
             rst[setting.header[col].dataCode] = sheet.getValue(row, col);
@@ -211,10 +211,10 @@ let sheetsOprObj = {
         unLockStyle.locked = false;
         let lockStyle = new GC.Spread.Sheets.Style();
         lockStyle.locked = true;
-        for(let row = beginRow; row < endRow; row++){
+        for (let row = beginRow; row < endRow; row++) {
             sheet.setStyle(row, 0, lockStyle);
         }
-        for(let row = endRow; row < sheet.getRowCount(); row++){
+        for (let row = endRow; row < sheet.getRowCount(); row++) {
             sheet.setStyle(row, 0, unLockStyle);
         }
         sheet.options.isProtected = true;
@@ -225,11 +225,11 @@ let sheetsOprObj = {
         let defaultStyle = new GC.Spread.Sheets.Style();
         defaultStyle.locked = false;
         sheet.setDefaultStyle(defaultStyle, GC.Spread.Sheets.SheetArea.viewport);
-        let style = new  GC.Spread.Sheets.Style();
+        let style = new GC.Spread.Sheets.Style();
         style.locked = true;
         sheet.suspendPaint();
         sheet.suspendEvent();
-        for(let i = beginRow; i < endRow; i++){
+        for (let i = beginRow; i < endRow; i++) {
             sheet.setStyle(i, 0, style);
         }
         sheet.options.isProtected = true;
@@ -246,7 +246,7 @@ let sheetsOprObj = {
         let style = new GC.Spread.Sheets.Style();
         style.locked = true;
         sheet.setStyle(-1, 0, style);
-        for(let i =rowCount; i<sheetRowCount; i++){
+        for (let i = rowCount; i < sheetRowCount; i++) {
             sheet.setStyle(i, -1, style);
         }
         sheet.options.isProtected = true;