|  | @@ -2,6 +2,7 @@
 | 
	
		
			
				|  |  |   * Created by vian on 2017/4/12.
 | 
	
		
			
				|  |  |   */
 | 
	
		
			
				|  |  |  var dbController = {
 | 
	
		
			
				|  |  | +    controller: null,
 | 
	
		
			
				|  |  |      currentEditData: null,
 | 
	
		
			
				|  |  |      insert: function(controller, btn){
 | 
	
		
			
				|  |  |          tools.btnClose(btn);
 | 
	
	
		
			
				|  | @@ -349,31 +350,33 @@ var dbController = {
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |      },
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -    editData: function(controller){
 | 
	
		
			
				|  |  | -        controller.sheet.bind(GC.Spread.Sheets.Events.EditStarting, function (sender, args) {
 | 
	
		
			
				|  |  | -            dbController.currentEditData = args.sheet.getValue(args.row, args.col);
 | 
	
		
			
				|  |  | -        });
 | 
	
		
			
				|  |  | -        controller.sheet.bind(GC.Spread.Sheets.Events.EditEnded, function(sender, args){
 | 
	
		
			
				|  |  | -            var node = controller.tree.selected, updateId, field;
 | 
	
		
			
				|  |  | -            if(node){
 | 
	
		
			
				|  |  | -                updateId = node.getID();
 | 
	
		
			
				|  |  | -                field = billsLibSetting.cols[args.col].data.field;
 | 
	
		
			
				|  |  | -                if(field === 'engineering'){
 | 
	
		
			
				|  |  | -                    if(isNaN(args.editingText) || args.editingText % 1 !== 0){
 | 
	
		
			
				|  |  | -                        args.sheet.setValue(args.row, args.col, dbController.currentEditData ? dbController.currentEditData : '');
 | 
	
		
			
				|  |  | -                        alert('工程专业只能输入整数!');
 | 
	
		
			
				|  |  | -                        return;
 | 
	
		
			
				|  |  | -                    }
 | 
	
		
			
				|  |  | +    onEditStart: function (sender, args) {
 | 
	
		
			
				|  |  | +        dbController.currentEditData = args.sheet.getValue(args.row, args.col);
 | 
	
		
			
				|  |  | +    },
 | 
	
		
			
				|  |  | +    onEditEnded: function (sender, args) {
 | 
	
		
			
				|  |  | +        let controller = dbController.controller;
 | 
	
		
			
				|  |  | +        var node = controller.tree.selected, updateId, field;
 | 
	
		
			
				|  |  | +        if(node){
 | 
	
		
			
				|  |  | +            updateId = node.getID();
 | 
	
		
			
				|  |  | +            field = billsLibSetting.cols[args.col].data.field;
 | 
	
		
			
				|  |  | +            if(field === 'engineering'){
 | 
	
		
			
				|  |  | +                if(isNaN(args.editingText) || args.editingText % 1 !== 0){
 | 
	
		
			
				|  |  | +                    args.sheet.setValue(args.row, args.col, dbController.currentEditData ? dbController.currentEditData : '');
 | 
	
		
			
				|  |  | +                    alert('工程专业只能输入整数!');
 | 
	
		
			
				|  |  | +                    return;
 | 
	
		
			
				|  |  |                  }
 | 
	
		
			
				|  |  | -                node.data[field] = args.editingText;
 | 
	
		
			
				|  |  | -                sheetBillsDatas.datasIdx['rowIdx'+ args.row][field] = args.editingText;
 | 
	
		
			
				|  |  | -                billsAjax.updateBills(userAccount, billsLibId, updateId, field, args.editingText);
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  | -            else {
 | 
	
		
			
				|  |  | -                args.sheet.getCell(args.row, args.col, GC.Spread.Sheets.SheetArea.viewport).value('');
 | 
	
		
			
				|  |  | -            }
 | 
	
		
			
				|  |  | -        });
 | 
	
		
			
				|  |  | +            node.data[field] = args.editingText;
 | 
	
		
			
				|  |  | +            sheetBillsDatas.datasIdx['rowIdx'+ args.row][field] = args.editingText;
 | 
	
		
			
				|  |  | +            billsAjax.updateBills(userAccount, billsLibId, updateId, field, args.editingText);
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +        else {
 | 
	
		
			
				|  |  | +            args.sheet.getCell(args.row, args.col, GC.Spread.Sheets.SheetArea.viewport).value('');
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +    },
 | 
	
		
			
				|  |  | +    editData: function(controller){
 | 
	
		
			
				|  |  | +        controller.sheet.bind(GC.Spread.Sheets.Events.EditStarting, this.onEditStart);
 | 
	
		
			
				|  |  | +        controller.sheet.bind(GC.Spread.Sheets.Events.EditEnded, this.onEditEnded);
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  };
 | 
	
		
			
				|  |  |  
 | 
	
	
		
			
				|  | @@ -1805,43 +1808,52 @@ let pasteController = {
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  var jobsController = {
 | 
	
		
			
				|  |  |      currentEditData: null,
 | 
	
		
			
				|  |  | -    editData: function(controller, sheet, totalJobs, setting){
 | 
	
		
			
				|  |  | +    totalJobs: null,
 | 
	
		
			
				|  |  | +    onEditStart: function (sender, args) {
 | 
	
		
			
				|  |  | +        let me = jobsController;
 | 
	
		
			
				|  |  | +        me.currentEditData = args.sheet.getValue(args.row, args.col);
 | 
	
		
			
				|  |  | +    },
 | 
	
		
			
				|  |  | +    onEditEnded: function (sender, args) {
 | 
	
		
			
				|  |  |          let me = jobsController;
 | 
	
		
			
				|  |  | -        sheet.bind(GC.Spread.Sheets.Events.EditStarting, function (sender, args) {
 | 
	
		
			
				|  |  | -           me.currentEditData = sheet.getValue(args.row, args.col);
 | 
	
		
			
				|  |  | +        let sheet = args.sheet;
 | 
	
		
			
				|  |  | +        let controller = dbController.controller;
 | 
	
		
			
				|  |  | +        let totalJobs = me.totalJobs;
 | 
	
		
			
				|  |  | +        let setting = jobsSetting;
 | 
	
		
			
				|  |  | +        var field, newData = args.editingText, id = sheet.getTag(args.row, args.col);
 | 
	
		
			
				|  |  | +        setting.cols.forEach(function (col, idx) {
 | 
	
		
			
				|  |  | +            if (args.col === idx) {
 | 
	
		
			
				|  |  | +                field = col.data.field;
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  |          });
 | 
	
		
			
				|  |  | -        sheet.bind(GC.Spread.Sheets.Events.EditEnded, function(sender, args) {
 | 
	
		
			
				|  |  | -            var field, newData = args.editingText, id = sheet.getTag(args.row, args.col);
 | 
	
		
			
				|  |  | -            setting.cols.forEach(function (col, idx) {
 | 
	
		
			
				|  |  | -                if (args.col === idx) {
 | 
	
		
			
				|  |  | -                    field = col.data.field;
 | 
	
		
			
				|  |  | -                }
 | 
	
		
			
				|  |  | -            });
 | 
	
		
			
				|  |  | -            if (controller.tree.selected && newData != me.currentEditData) {
 | 
	
		
			
				|  |  | -                var isExist = tools.isExist(totalJobs.jobsArr, field, newData);
 | 
	
		
			
				|  |  | -                var isRepeat = tools.isRepeat(controller.tree.selected.jobs, field ,newData, 'reference', 'job');
 | 
	
		
			
				|  |  | -                //create
 | 
	
		
			
				|  |  | -                if(!id && newData && !isRepeat){
 | 
	
		
			
				|  |  | -                        if(isExist){
 | 
	
		
			
				|  |  | -                            jobsController.createExist(sheet, controller, totalJobs, field, newData, args, setting);
 | 
	
		
			
				|  |  | -                        }
 | 
	
		
			
				|  |  | -                        else {
 | 
	
		
			
				|  |  | -                            jobsController.createNew(sheet, controller, totalJobs, field, newData, args, setting);
 | 
	
		
			
				|  |  | -                        }
 | 
	
		
			
				|  |  | +        if (controller.tree.selected && newData != me.currentEditData) {
 | 
	
		
			
				|  |  | +            var isExist = tools.isExist(totalJobs.jobsArr, field, newData);
 | 
	
		
			
				|  |  | +            var isRepeat = tools.isRepeat(controller.tree.selected.jobs, field ,newData, 'reference', 'job');
 | 
	
		
			
				|  |  | +            //create
 | 
	
		
			
				|  |  | +            if(!id && newData && !isRepeat){
 | 
	
		
			
				|  |  | +                if(isExist){
 | 
	
		
			
				|  |  | +                    jobsController.createExist(sheet, controller, totalJobs, field, newData, args, setting);
 | 
	
		
			
				|  |  |                  }
 | 
	
		
			
				|  |  | -                //update
 | 
	
		
			
				|  |  | -                else if(id && !isRepeat){
 | 
	
		
			
				|  |  | -                    jobsController.update(sheet, controller, totalJobs, field, newData, id, isExist, args, setting);
 | 
	
		
			
				|  |  | -                }
 | 
	
		
			
				|  |  | -                //处理重复
 | 
	
		
			
				|  |  | -                if(isRepeat){
 | 
	
		
			
				|  |  | -                       tools.alertOpr(args, sheet, '该工作内容已存在!', controller.tree.selected.jobs, 'job');
 | 
	
		
			
				|  |  | +                else {
 | 
	
		
			
				|  |  | +                    jobsController.createNew(sheet, controller, totalJobs, field, newData, args, setting);
 | 
	
		
			
				|  |  |                  }
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  | -            else {
 | 
	
		
			
				|  |  | -                sheet.getCell(args.row, args.col).value(me.currentEditData ? me.currentEditData : '');
 | 
	
		
			
				|  |  | +            //update
 | 
	
		
			
				|  |  | +            else if(id && !isRepeat){
 | 
	
		
			
				|  |  | +                jobsController.update(sheet, controller, totalJobs, field, newData, id, isExist, args, setting);
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  | -        });
 | 
	
		
			
				|  |  | +            //处理重复
 | 
	
		
			
				|  |  | +            if(isRepeat){
 | 
	
		
			
				|  |  | +                tools.alertOpr(args, sheet, '该工作内容已存在!', controller.tree.selected.jobs, 'job');
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +        else {
 | 
	
		
			
				|  |  | +            sheet.getCell(args.row, args.col).value(me.currentEditData ? me.currentEditData : '');
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +    },
 | 
	
		
			
				|  |  | +    editData: function(sheet){
 | 
	
		
			
				|  |  | +        let me = jobsController;
 | 
	
		
			
				|  |  | +        sheet.bind(GC.Spread.Sheets.Events.EditStarting, me.onEditStart);
 | 
	
		
			
				|  |  | +        sheet.bind(GC.Spread.Sheets.Events.EditEnded, me.onEditEnded);
 | 
	
		
			
				|  |  |      },
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  
 | 
	
	
		
			
				|  | @@ -2020,43 +2032,52 @@ var jobsController = {
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  var itemsController = {
 | 
	
		
			
				|  |  |      currentEditData: null,
 | 
	
		
			
				|  |  | -    editData: function(controller, sheet, totalItems, setting){
 | 
	
		
			
				|  |  | +    totalItems: null,
 | 
	
		
			
				|  |  | +    onEditStart: function (sender, args) {
 | 
	
		
			
				|  |  |          let me = itemsController;
 | 
	
		
			
				|  |  | -        sheet.bind(GC.Spread.Sheets.Events.EditStarting, function (sender, args) {
 | 
	
		
			
				|  |  | -            me.currentEditData = sheet.getValue(args.row, args.col);
 | 
	
		
			
				|  |  | -        })
 | 
	
		
			
				|  |  | -        sheet.bind(GC.Spread.Sheets.Events.EditEnded, function(sender, args) {
 | 
	
		
			
				|  |  | -            var field, newData = args.editingText, id = sheet.getTag(args.row, args.col);
 | 
	
		
			
				|  |  | -            setting.cols.forEach(function (col, idx) {
 | 
	
		
			
				|  |  | -                if (args.col === idx) {
 | 
	
		
			
				|  |  | -                    field = col.data.field;
 | 
	
		
			
				|  |  | -                }
 | 
	
		
			
				|  |  | -            });
 | 
	
		
			
				|  |  | -            if (controller.tree.selected && newData != me.currentEditData) {
 | 
	
		
			
				|  |  | -                var isExist = tools.isExist(totalItems.itemsArr, field, newData);
 | 
	
		
			
				|  |  | -                var isRepeat = tools.isRepeat(controller.tree.selected.items, field ,newData, 'reference', 'item');
 | 
	
		
			
				|  |  | -                //create
 | 
	
		
			
				|  |  | -                if(!id && newData && !isRepeat){
 | 
	
		
			
				|  |  | -                    if(isExist){
 | 
	
		
			
				|  |  | -                        itemsController.createExist(sheet, controller, totalItems, field, newData, args, setting);
 | 
	
		
			
				|  |  | -                    }
 | 
	
		
			
				|  |  | -                    else {
 | 
	
		
			
				|  |  | -                        itemsController.createNew(sheet, controller, totalItems, field, newData, args, setting);
 | 
	
		
			
				|  |  | -                    }
 | 
	
		
			
				|  |  | -                }
 | 
	
		
			
				|  |  | -                //update
 | 
	
		
			
				|  |  | -                else if(id && !isRepeat){
 | 
	
		
			
				|  |  | -                    itemsController.update(sheet, controller, totalItems, field, newData, id, isExist, args, setting);
 | 
	
		
			
				|  |  | +        me.currentEditData = args.sheet.getValue(args.row, args.col);
 | 
	
		
			
				|  |  | +    },
 | 
	
		
			
				|  |  | +    onEditEnded: function (sender, args) {
 | 
	
		
			
				|  |  | +        let me = itemsController;
 | 
	
		
			
				|  |  | +        let controller = dbController.controller;
 | 
	
		
			
				|  |  | +        let totalItems = me.totalItems;
 | 
	
		
			
				|  |  | +        let setting = itemsSetting;
 | 
	
		
			
				|  |  | +        let sheet = args.sheet;
 | 
	
		
			
				|  |  | +        var field, newData = args.editingText, id = sheet.getTag(args.row, args.col);
 | 
	
		
			
				|  |  | +        setting.cols.forEach(function (col, idx) {
 | 
	
		
			
				|  |  | +            if (args.col === idx) {
 | 
	
		
			
				|  |  | +                field = col.data.field;
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +        });
 | 
	
		
			
				|  |  | +        if (controller.tree.selected && newData != me.currentEditData) {
 | 
	
		
			
				|  |  | +            var isExist = tools.isExist(totalItems.itemsArr, field, newData);
 | 
	
		
			
				|  |  | +            var isRepeat = tools.isRepeat(controller.tree.selected.items, field ,newData, 'reference', 'item');
 | 
	
		
			
				|  |  | +            //create
 | 
	
		
			
				|  |  | +            if(!id && newData && !isRepeat){
 | 
	
		
			
				|  |  | +                if(isExist){
 | 
	
		
			
				|  |  | +                    itemsController.createExist(sheet, controller, totalItems, field, newData, args, setting);
 | 
	
		
			
				|  |  |                  }
 | 
	
		
			
				|  |  | -                //处理重复
 | 
	
		
			
				|  |  | -                if(isRepeat){
 | 
	
		
			
				|  |  | -                    tools.alertOpr(args, sheet, '该项目特征已存在!', controller.tree.selected.items, 'item');
 | 
	
		
			
				|  |  | +                else {
 | 
	
		
			
				|  |  | +                    itemsController.createNew(sheet, controller, totalItems, field, newData, args, setting);
 | 
	
		
			
				|  |  |                  }
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  | -            else {
 | 
	
		
			
				|  |  | -                sheet.getCell(args.row, args.col).value(me.currentEditData ? me.currentEditData : '');
 | 
	
		
			
				|  |  | +            //update
 | 
	
		
			
				|  |  | +            else if(id && !isRepeat){
 | 
	
		
			
				|  |  | +                itemsController.update(sheet, controller, totalItems, field, newData, id, isExist, args, setting);
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  | -        });
 | 
	
		
			
				|  |  | +            //处理重复
 | 
	
		
			
				|  |  | +            if(isRepeat){
 | 
	
		
			
				|  |  | +                tools.alertOpr(args, sheet, '该项目特征已存在!', controller.tree.selected.items, 'item');
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +        else {
 | 
	
		
			
				|  |  | +            sheet.getCell(args.row, args.col).value(me.currentEditData ? me.currentEditData : '');
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +    },
 | 
	
		
			
				|  |  | +    editData: function(sheet){
 | 
	
		
			
				|  |  | +        let me = itemsController;
 | 
	
		
			
				|  |  | +        sheet.bind(GC.Spread.Sheets.Events.EditStarting, me.onEditStart);
 | 
	
		
			
				|  |  | +        sheet.bind(GC.Spread.Sheets.Events.EditEnded, me.onEditEnded);
 | 
	
		
			
				|  |  |      },
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      createNew: function(sheet, controller, totalItems, field, newData, args, setting){
 | 
	
	
		
			
				|  | @@ -2211,39 +2232,46 @@ var itemsController = {
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  var valueController = {
 | 
	
		
			
				|  |  |      currentEditData: null,
 | 
	
		
			
				|  |  | -    editData: function(totalItems, sheet, setting){
 | 
	
		
			
				|  |  | +    onEditStart: function (sender, args) {
 | 
	
		
			
				|  |  |          let me = valueController;
 | 
	
		
			
				|  |  | -        sheet.bind(GC.Spread.Sheets.Events.EditStarting, function (sender, args) {
 | 
	
		
			
				|  |  | -            me.currentEditData = sheet.getValue(args.row, args.col);
 | 
	
		
			
				|  |  | +        me.currentEditData = args.sheet.getValue(args.row, args.col);
 | 
	
		
			
				|  |  | +    },
 | 
	
		
			
				|  |  | +    onEditEnded: function (sender, args) {
 | 
	
		
			
				|  |  | +        let me = valueController;
 | 
	
		
			
				|  |  | +        let totalItems = totalItemsController.totalItems;
 | 
	
		
			
				|  |  | +        let sheet = args.sheet;
 | 
	
		
			
				|  |  | +        let setting = eigenValueSetting;
 | 
	
		
			
				|  |  | +        var newValue = args.editingText, tagId = sheet.getTag(args.row, args.col), field, isRepeat;
 | 
	
		
			
				|  |  | +        setting.cols.forEach(function(col, colIdx){
 | 
	
		
			
				|  |  | +            if(args.col === colIdx){
 | 
	
		
			
				|  |  | +                field = col.data.field;
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  |          });
 | 
	
		
			
				|  |  | -        sheet.bind(GC.Spread.Sheets.Events.EditEnded, function(sender, args){
 | 
	
		
			
				|  |  | -            var newValue = args.editingText, tagId = sheet.getTag(args.row, args.col), field, isRepeat;
 | 
	
		
			
				|  |  | -            setting.cols.forEach(function(col, colIdx){
 | 
	
		
			
				|  |  | -                if(args.col === colIdx){
 | 
	
		
			
				|  |  | -                    field = col.data.field;
 | 
	
		
			
				|  |  | -                }
 | 
	
		
			
				|  |  | -            });
 | 
	
		
			
				|  |  | -            if(selectedId && newValue!== me.currentEditData){
 | 
	
		
			
				|  |  | -                isRepeat = tools.isRepeat(valueController.getValues(totalItems, selectedId), field, newValue, 'document');
 | 
	
		
			
				|  |  | -                if(!tagId && !isRepeat && newValue){//create
 | 
	
		
			
				|  |  | -                        valueController.createValue(sheet, totalItems, selectedId, field, newValue, args);
 | 
	
		
			
				|  |  | -                }
 | 
	
		
			
				|  |  | -                else if(tagId && !isRepeat){//update
 | 
	
		
			
				|  |  | -                        valueController.updateValue(totalItems, tagId, newValue, field, args);
 | 
	
		
			
				|  |  | +        if(selectedId && newValue!== me.currentEditData){
 | 
	
		
			
				|  |  | +            isRepeat = tools.isRepeat(valueController.getValues(totalItems, selectedId), field, newValue, 'document');
 | 
	
		
			
				|  |  | +            if(!tagId && !isRepeat && newValue){//create
 | 
	
		
			
				|  |  | +                valueController.createValue(sheet, totalItems, selectedId, field, newValue, args);
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +            else if(tagId && !isRepeat){//update
 | 
	
		
			
				|  |  | +                valueController.updateValue(totalItems, tagId, newValue, field, args);
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +            if(isRepeat){
 | 
	
		
			
				|  |  | +                if(tagId && newValue){
 | 
	
		
			
				|  |  | +                    sheet.getCell(args.row, args.col, GC.Spread.Sheets.SheetArea.viewport).value(me.currentEditData);
 | 
	
		
			
				|  |  |                  }
 | 
	
		
			
				|  |  | -                if(isRepeat){
 | 
	
		
			
				|  |  | -                    if(tagId && newValue){
 | 
	
		
			
				|  |  | -                        sheet.getCell(args.row, args.col, GC.Spread.Sheets.SheetArea.viewport).value(me.currentEditData);
 | 
	
		
			
				|  |  | -                    }
 | 
	
		
			
				|  |  | -                    else {
 | 
	
		
			
				|  |  | -                        sheet.getCell(args.row, args.col, GC.Spread.Sheets.SheetArea.viewport).value('');
 | 
	
		
			
				|  |  | -                    }
 | 
	
		
			
				|  |  | +                else {
 | 
	
		
			
				|  |  | +                    sheet.getCell(args.row, args.col, GC.Spread.Sheets.SheetArea.viewport).value('');
 | 
	
		
			
				|  |  |                  }
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  | -            else{
 | 
	
		
			
				|  |  | -                sheet.getCell(args.row, args.col).value(me.currentEditData ? me.currentEditData : '');
 | 
	
		
			
				|  |  | -            }
 | 
	
		
			
				|  |  | -        });
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +        else{
 | 
	
		
			
				|  |  | +            sheet.getCell(args.row, args.col).value(me.currentEditData ? me.currentEditData : '');
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +    },
 | 
	
		
			
				|  |  | +    editData: function(sheet){
 | 
	
		
			
				|  |  | +        let me = valueController;
 | 
	
		
			
				|  |  | +        sheet.bind(GC.Spread.Sheets.Events.EditStarting, me.onEditStart);
 | 
	
		
			
				|  |  | +        sheet.bind(GC.Spread.Sheets.Events.EditEnded, me.onEditEnded);
 | 
	
		
			
				|  |  |      },
 | 
	
		
			
				|  |  |      createValue: function(sheet, totalItems, id, field, newValue, args){
 | 
	
		
			
				|  |  |          var newData;
 | 
	
	
		
			
				|  | @@ -2346,34 +2374,42 @@ var valueController = {
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  var totalJobsController = {
 | 
	
		
			
				|  |  |      currentEditData: null,
 | 
	
		
			
				|  |  | -    eiditData: function(totalJobs, sheet, setting){
 | 
	
		
			
				|  |  | +    totalJobs: null,
 | 
	
		
			
				|  |  | +    onEditStart: function (sender, args) {
 | 
	
		
			
				|  |  |          let me = totalJobsController;
 | 
	
		
			
				|  |  | -        sheet.bind(GC.Spread.Sheets.Events.EditStarting, function (sender, args) {
 | 
	
		
			
				|  |  | -            me.currentEditData = sheet.getValue(args.row, args.col);
 | 
	
		
			
				|  |  | -        })
 | 
	
		
			
				|  |  | -        sheet.bind(GC.Spread.Sheets.Events.EditEnded, function(sender, args){
 | 
	
		
			
				|  |  | -            var newData = args.editingText, tagId = sheet.getTag(args.row, args.col), field, isRepeat;
 | 
	
		
			
				|  |  | -            setting.cols.forEach(function(col, colIdx){
 | 
	
		
			
				|  |  | -                if(args.col === colIdx){
 | 
	
		
			
				|  |  | -                    field = col.data.field;
 | 
	
		
			
				|  |  | -                }
 | 
	
		
			
				|  |  | -            });
 | 
	
		
			
				|  |  | -            if(newData != me.currentEditData){
 | 
	
		
			
				|  |  | -                isRepeat = tools.isRepeat(totalJobs.jobsArr, field, newData, 'reference', null);
 | 
	
		
			
				|  |  | -                if(!tagId && !isRepeat && newData){//create
 | 
	
		
			
				|  |  | -                    totalJobsController.createJob(sheet, totalJobs, field, newData, args);
 | 
	
		
			
				|  |  | -                }
 | 
	
		
			
				|  |  | -                else if(tagId && !isRepeat){//update
 | 
	
		
			
				|  |  | -                    totalJobsController.updateJob(totalJobs, tagId, field, newData, args);
 | 
	
		
			
				|  |  | -                }
 | 
	
		
			
				|  |  | -                if(isRepeat){
 | 
	
		
			
				|  |  | -                    tools.alertTotalOpr(args, '该工作内容已存在!', totalJobs.jobsArr);
 | 
	
		
			
				|  |  | -                }
 | 
	
		
			
				|  |  | -            }
 | 
	
		
			
				|  |  | -            else{
 | 
	
		
			
				|  |  | -                sheet.getCell(args.row, args.col).value(me.currentEditData ? me.currentEditData : '');
 | 
	
		
			
				|  |  | +        me.currentEditData = args.sheet.getValue(args.row, args.col);
 | 
	
		
			
				|  |  | +    },
 | 
	
		
			
				|  |  | +    onEditEnded: function (sender, args) {
 | 
	
		
			
				|  |  | +        let me = totalJobsController;
 | 
	
		
			
				|  |  | +        let totalJobs = me.totalJobs;
 | 
	
		
			
				|  |  | +        let sheet = args.sheet;
 | 
	
		
			
				|  |  | +        let setting = totalJobsSetting;
 | 
	
		
			
				|  |  | +        var newData = args.editingText, tagId = sheet.getTag(args.row, args.col), field, isRepeat;
 | 
	
		
			
				|  |  | +        setting.cols.forEach(function(col, colIdx){
 | 
	
		
			
				|  |  | +            if(args.col === colIdx){
 | 
	
		
			
				|  |  | +                field = col.data.field;
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |          });
 | 
	
		
			
				|  |  | +        if(newData != me.currentEditData){
 | 
	
		
			
				|  |  | +            isRepeat = tools.isRepeat(totalJobs.jobsArr, field, newData, 'reference', null);
 | 
	
		
			
				|  |  | +            if(!tagId && !isRepeat && newData){//create
 | 
	
		
			
				|  |  | +                totalJobsController.createJob(sheet, totalJobs, field, newData, args);
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +            else if(tagId && !isRepeat){//update
 | 
	
		
			
				|  |  | +                totalJobsController.updateJob(totalJobs, tagId, field, newData, args);
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +            if(isRepeat){
 | 
	
		
			
				|  |  | +                tools.alertTotalOpr(args, '该工作内容已存在!', totalJobs.jobsArr);
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +        else{
 | 
	
		
			
				|  |  | +            sheet.getCell(args.row, args.col).value(me.currentEditData ? me.currentEditData : '');
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +    },
 | 
	
		
			
				|  |  | +    editData: function(sheet){
 | 
	
		
			
				|  |  | +        let me = totalJobsController;
 | 
	
		
			
				|  |  | +        sheet.bind(GC.Spread.Sheets.Events.EditStarting, me.onEditStart);
 | 
	
		
			
				|  |  | +        sheet.bind(GC.Spread.Sheets.Events.EditEnded, me.onEditEnded);
 | 
	
		
			
				|  |  |      },
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      createJob: function(sheet, totalJobs, field, newData, args){
 | 
	
	
		
			
				|  | @@ -2434,34 +2470,42 @@ var totalJobsController = {
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  var totalItemsController = {
 | 
	
		
			
				|  |  |      currentEditData: null,
 | 
	
		
			
				|  |  | -    eiditData: function(totalItems, sheet, setting){
 | 
	
		
			
				|  |  | +    totalItems: null,
 | 
	
		
			
				|  |  | +    onEditStart: function (sender, args) {
 | 
	
		
			
				|  |  |          let me = totalItemsController;
 | 
	
		
			
				|  |  | -        sheet.bind(GC.Spread.Sheets.Events.EditStarting, function (sender, args) {
 | 
	
		
			
				|  |  | -            me.currentEditData = sheet.getValue(args.row, args.col);
 | 
	
		
			
				|  |  | +        me.currentEditData = args.sheet.getValue(args.row, args.col);
 | 
	
		
			
				|  |  | +    },
 | 
	
		
			
				|  |  | +    onEditEnded: function (sender, args) {
 | 
	
		
			
				|  |  | +        let me = totalItemsController;
 | 
	
		
			
				|  |  | +        let totalItems = me.totalItems;
 | 
	
		
			
				|  |  | +        let sheet = args.sheet;
 | 
	
		
			
				|  |  | +        let setting = totalItemsSetting;
 | 
	
		
			
				|  |  | +        var newData = args.editingText, tagId = sheet.getTag(args.row, args.col), field, isRepeat;
 | 
	
		
			
				|  |  | +        setting.cols.forEach(function(col, colIdx){
 | 
	
		
			
				|  |  | +            if(args.col === colIdx){
 | 
	
		
			
				|  |  | +                field = col.data.field;
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  |          });
 | 
	
		
			
				|  |  | -        sheet.bind(GC.Spread.Sheets.Events.EditEnded, function(sender, args){
 | 
	
		
			
				|  |  | -            var newData = args.editingText, tagId = sheet.getTag(args.row, args.col), field, isRepeat;
 | 
	
		
			
				|  |  | -            setting.cols.forEach(function(col, colIdx){
 | 
	
		
			
				|  |  | -                if(args.col === colIdx){
 | 
	
		
			
				|  |  | -                    field = col.data.field;
 | 
	
		
			
				|  |  | -                }
 | 
	
		
			
				|  |  | -            });
 | 
	
		
			
				|  |  | -            if(newData != me.currentEditData){
 | 
	
		
			
				|  |  | -                isRepeat = tools.isRepeat(totalItems.itemsArr, field, newData, 'reference', null);
 | 
	
		
			
				|  |  | -                if(!tagId && !isRepeat && newData){//create
 | 
	
		
			
				|  |  | -                    totalItemsController.createItem(sheet, totalItems, field, newData, args);
 | 
	
		
			
				|  |  | -                }
 | 
	
		
			
				|  |  | -                else if(tagId && !isRepeat ){//update
 | 
	
		
			
				|  |  | -                    totalItemsController.updateItem(totalItems, tagId, field, newData, args);
 | 
	
		
			
				|  |  | -                }
 | 
	
		
			
				|  |  | -                else if(isRepeat){
 | 
	
		
			
				|  |  | -                    tools.alertTotalOpr(args, '该项目特征已存在!', totalItems.itemsArr);
 | 
	
		
			
				|  |  | -                }
 | 
	
		
			
				|  |  | +        if(newData != me.currentEditData){
 | 
	
		
			
				|  |  | +            isRepeat = tools.isRepeat(totalItems.itemsArr, field, newData, 'reference', null);
 | 
	
		
			
				|  |  | +            if(!tagId && !isRepeat && newData){//create
 | 
	
		
			
				|  |  | +                totalItemsController.createItem(sheet, totalItems, field, newData, args);
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  | -            else{
 | 
	
		
			
				|  |  | -                sheet.getCell(args.row, args.col).value(me.currentEditData ? me.currentEditData : '');
 | 
	
		
			
				|  |  | +            else if(tagId && !isRepeat ){//update
 | 
	
		
			
				|  |  | +                totalItemsController.updateItem(totalItems, tagId, field, newData, args);
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  | -        });
 | 
	
		
			
				|  |  | +            else if(isRepeat){
 | 
	
		
			
				|  |  | +                tools.alertTotalOpr(args, '该项目特征已存在!', totalItems.itemsArr);
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +        else{
 | 
	
		
			
				|  |  | +            sheet.getCell(args.row, args.col).value(me.currentEditData ? me.currentEditData : '');
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +    },
 | 
	
		
			
				|  |  | +    editData: function(sheet){
 | 
	
		
			
				|  |  | +        let me = totalItemsController;
 | 
	
		
			
				|  |  | +        sheet.bind(GC.Spread.Sheets.Events.EditStarting, me.onEditStart);
 | 
	
		
			
				|  |  | +        sheet.bind(GC.Spread.Sheets.Events.EditEnded, me.onEditEnded);
 | 
	
		
			
				|  |  |      },
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      createItem: function(sheet, totalItems, field, newData, args){
 |