/** * Standard Ration Lib * Created by Mai on 2017/5/16. */ /*var rationChapterSpread, sectionRationsSpread;*/ var rationLibObj = { searchLimit: 50, libType: {complementary: 0, std: 1}, compleRationLibId: 'compleRationLib', doAfterGetRationTree: null, //获取章节树回调 doAfterLoadGetRations: null, //获取章节树下定额后回调 rationChapterSpread: null, sectionRationsSpread: null, resultSpread: null, rationChapterTreeController: null, refreshSettingForHint: function () { TREE_SHEET_HELPER.initSetting($('#stdSectionRations')[0], rationLibObj.sectionRationsSetting); }, checkSpread: function () { if (!this.rationChapterSpread) { this.rationChapterSpread = SheetDataHelper.createNewSpread($('#stdRationChapter')[0]); sheetCommonObj.spreadDefaultStyle(this.rationChapterSpread); this.rationChapterSpread.getSheet(0).name('stdRationLib_chapter'); this.rationChapterSpread.bind(GC.Spread.Sheets.Events.CellDoubleClick, this.onChapterSpreadCellDoubleClick); } if (!this.sectionRationsSpread) { this.sectionRationsSpread = SheetDataHelper.createNewSpread($('#stdSectionRations')[0]); sheetCommonObj.spreadDefaultStyle(this.sectionRationsSpread); if (!projectReadOnly) { this.sectionRationsSpread.bind(GC.Spread.Sheets.Events.CellDoubleClick, this.onRationSpreadCellDoubleClick); } this.refreshSettingForHint(); } }, refreshSpread: function () { if (this.rationChapterSpread) { this.rationChapterSpread.refresh(); } if (this.sectionRationsSpread) { this.sectionRationsSpread.refresh(); } if(this.resultSpread){ this.resultSpread.refresh(); } }, loadStdRationLibs: function () { let select = $('#stdRationLibSelect'); select.empty(); let ration_lib = projectInfoObj.projectInfo.engineeringInfo.ration_lib; ration_lib.push({ isDefault: false, id: rationLibObj.compleRationLibId, name: '我的补充定额' }); let selectedRationLib = sessionStorage.getItem('stdRationLib'); ration_lib.forEach(function (data) { let option = $('