section_tree.js 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592
  1. /**
  2. * Created by Zhong on 2017/12/18.
  3. */
  4. let pageOprObj = {
  5. rationLibName : null,
  6. rationLibId : null,
  7. gljLibId: gljLibId,
  8. rationTreeData: null,
  9. mixedTreeData: null,
  10. mixedGLJData: null,
  11. initPage : function() {
  12. sectionTreeObj.getSectionTree(this.rationTreeData);
  13. //job
  14. jobContentOprObj.radiosChange(jobContentOprObj.radios, jobContentOprObj.tableAll, jobContentOprObj.tablePartial);
  15. $('#addConBtn').click(jobContentOprObj.bindAddConBtn());
  16. $('#updateConBtn').click(jobContentOprObj.bindUpdateConBtn());
  17. jobContentOprObj.bindAllEvents($('#txtareaAll'));
  18. //fz
  19. annotationOprObj.radiosChange(annotationOprObj.radios, annotationOprObj.fzTableAll, annotationOprObj.fzTablePartial);
  20. $('#fzAddConBtn').click(annotationOprObj.bindAddConBtn());
  21. $('#fzUpdateConBtn').click(annotationOprObj.bindUpdateConBtn());
  22. annotationOprObj.bindAllEvents($('#fzTxtareaAll'));
  23. gljSelOprObj.getGljClassTree(this.mixedTreeData);
  24. gljSelOprObj.getSelGljItems(this.mixedGLJData);
  25. },
  26. getRationLibInfo: function (rationLibId, callback) {
  27. CommonAjax.post('api/getRationLib', {rationRepId: rationLibId}, callback);
  28. },
  29. };
  30. let sectionTreeObj = {
  31. cache: null,//ref to tree.items
  32. tree: null,
  33. controller: null,
  34. workBook: null,
  35. sheet: null,
  36. updateType: {new: 'new', update: 'update'},
  37. insertBtn: $('#tree_Insert'),
  38. removeBtn: $('#tree_remove'),
  39. upLevelBtn: $('#tree_upLevel'),
  40. downLevelBtn: $('#tree_downLevel'),
  41. downMoveBtn: $('#tree_downMove'),
  42. upMoveBtn: $('#tree_upMove'),
  43. type: {std: 'std', complementary: 'complementary'},
  44. setting: {
  45. sheet: {
  46. cols:[
  47. {
  48. head: {
  49. titleNames: ['名称'],
  50. spanCols: [1],
  51. spanRows: [2],
  52. vAlign: [1, 1],
  53. hAlign: [1, 1],
  54. font: 'Arial'
  55. },
  56. data: {
  57. field: 'name',
  58. vAlign: 1,
  59. hAlign: 0,
  60. font: 'Arial'
  61. },
  62. width: 400
  63. }
  64. ],
  65. headRows: 1,
  66. headRowHeight: [47],
  67. emptyRows: 0,
  68. treeCol: 0
  69. },
  70. tree: {
  71. id: 'ID',
  72. pid: 'ParentID',
  73. nid: 'NextSiblingID',
  74. rootId: -1
  75. },
  76. options: {
  77. allowContextMenu: false,
  78. tabStripVisible: false,
  79. allowCopyPasteExcelStyle : false,
  80. allowExtendPasteRange: false,
  81. allowUserDragDrop : false,
  82. allowUserDragFill: false,
  83. scrollbarMaxAlign : true
  84. }
  85. },
  86. isDef: function (v) {
  87. return v !== undefined && v !== null;
  88. },
  89. isFunc: function (v) {
  90. return this.isDef(v) && typeof v === 'function';
  91. },
  92. //sheet things
  93. setOptions: function (workbook, opts) {
  94. for(let opt in opts){
  95. workbook.options[opt] = opts[opt];
  96. }
  97. },
  98. renderFunc: function (sheet, func) {
  99. sheet.suspendPaint();
  100. sheet.suspendEvent();
  101. if(this.isFunc(func)){
  102. func();
  103. }
  104. sheet.resumePaint();
  105. sheet.resumeEvent();
  106. },
  107. buildSheet: function () {
  108. if(!this.isDef(this.workBook)){
  109. this.workBook = new GC.Spread.Sheets.Workbook($('#sectionSpread')[0], {sheetCount: 1});
  110. sheetCommonObj.spreadDefaultStyle(this.workBook);
  111. sheetCommonObj.bindEscKey(this.workBook, [{sheet: this.workBook.getSheet(0), editStarting: this.onEditStarting, editEnded: this.onEditEnded}]);
  112. this.sheet = this.workBook.getSheet(0);
  113. this.bindEvents(this.sheet);
  114. this.setOptions(this.workBook, this.setting.options);
  115. this.sheet.options.clipBoardOptions = GC.Spread.Sheets.ClipboardPasteOptions.values;
  116. }
  117. },
  118. bindEvents: function (sheet) {
  119. let me = sectionTreeObj;
  120. const Events = GC.Spread.Sheets.Events;
  121. sheet.bind(Events.SelectionChanging, me.onSelectionChanging);
  122. sheet.bind(Events.EditEnded, me.onEditEnded);
  123. sheet.bind(Events.EditStarting, me.onEditStarting);
  124. sheet.bind(Events.ClipboardPasting, me.onClipboardPasting);
  125. sheet.bind(Events.ClipboardPasted, me.onClipboardPasted);
  126. },
  127. onSelectionChanging: function (sender, info) {
  128. let me = sectionTreeObj;
  129. if(info.oldSelections.length === 0 && info.newSelections.length > 0 || info.oldSelections[0].row !== info.newSelections[0].row){
  130. let row = info.newSelections[0].row;
  131. let section = me.cache[row];
  132. me.initSelection(section);
  133. }
  134. else {
  135. me.refreshBtn(null);
  136. }
  137. },
  138. onEditStarting: function (sender, args) {
  139. },
  140. onEditEnded: function (sender, args) {
  141. let me = sectionTreeObj;
  142. let postData = [];
  143. let v = me.isDef(args.editingText) ? args.editingText.toString().trim() : '';
  144. let node = me.cache[args.row];
  145. if(me.isDef(node) && node.data.name !== v){
  146. let updateObj = me.getUpdateObj(me.updateType.update, {ID: node.getID(), name: v});
  147. postData.push(updateObj);
  148. //ajax
  149. //update
  150. me.sectionTreeAjax(postData, function (rstData) {
  151. node.data.name = v;
  152. }, function () {
  153. args.sheet.setValue(args.row, args.col, node.data.name ? node.data.name : '');
  154. });
  155. }
  156. },
  157. onClipboardPasting: function (sender, info) {
  158. },
  159. onClipboardPasted: function (sender, info) {
  160. let me = sectionTreeObj;
  161. let items = sheetCommonObj.analyzePasteData({header: [{dataCode: 'name'}]}, info);
  162. let postData = [];
  163. let frontData = [];
  164. for(let i = 0, len = items.length; i < len; i++){
  165. let row = info.cellRange.row + i;
  166. let node = me.cache[row];
  167. if(me.isDef(node) && me.isDef(items[i].name) && node.data.name !== items[i].name){
  168. let updateObj = me.getUpdateObj(me.updateType.update, {ID: node.getID(), name: items[i].name});
  169. postData.push(updateObj);
  170. frontData.push({row: row, name: items[i].name});
  171. node.data.name = items[i].name;
  172. }
  173. }
  174. if(postData.length > 0){
  175. //ajax
  176. me.sectionTreeAjax(postData, function (rstData) {
  177. for(let i = 0, len = frontData.length; i < len; i++){
  178. let node = me.cache[frontData[i]['row']];
  179. if(me.isDef(node)){
  180. node.data.name = frontData[i]['name'];
  181. }
  182. }
  183. }, function () {
  184. for(let i = 0, len = frontData.length; i < len; i++){
  185. let node = me.cache[frontData[i]['row']];
  186. me.sheet.setValue(frontData[i]['row'], 0, me.isDef(node) ? node.data.name : '');
  187. }
  188. });
  189. }
  190. },
  191. loadRateWidth: function () {
  192. if (this.workBook) {
  193. sheetCommonObj.setColumnWidthByRate($('#sectionSpread').width() - 65, this.workBook, [{rateWidth: 1}]);//65: 列头宽度和垂直滚动条宽度和
  194. }
  195. },
  196. getSectionTree: function (treeData) {
  197. /*if(rstData.length > 0){
  198. storageUtil.setSessionCache("RationGrp","repositoryID",rstData[0].rationRepId);
  199. }*/
  200. //init
  201. this.buildSheet();
  202. this.initTree(treeData);
  203. this.cache = this.tree.items;
  204. this.bindBtn();
  205. this.initController(this.tree, this.sheet, this.setting.sheet);
  206. this.controller.showTreeData();
  207. this.setColor(this.cache);
  208. this.sheet.setFormatter(-1, 0, '@');
  209. this.initSelection(this.tree.selected);
  210. this.loadRateWidth();
  211. },
  212. setColor: function (nodes) {
  213. let me = this;
  214. me.renderFunc(me.sheet, function () {
  215. for(let i = 0, len = nodes.length; i < len; i++){
  216. if(nodes[i].data.type === me.type.complementary){
  217. me.sheet.getCell(i, 0).foreColor('gray');
  218. }
  219. }
  220. });
  221. },
  222. initTree: function (datas) {
  223. this.tree = idTree.createNew(this.setting.tree);
  224. this.tree.loadDatas(datas);
  225. this.tree.selected = this.tree.items.length > 0 ? this.tree.items[0] : null;
  226. },
  227. initController: function (tree, sheet, setting) {
  228. this.controller = TREE_SHEET_CONTROLLER.createNew(tree, sheet, setting);
  229. },
  230. refreshBtn: function (selected) {
  231. let me = this;
  232. me.insertBtn.removeClass('disabled');
  233. me.removeBtn.removeClass('disabled');
  234. me.upLevelBtn.removeClass('disabled');
  235. me.downLevelBtn.removeClass('disabled');
  236. me.downMoveBtn.removeClass('disabled');
  237. me.upMoveBtn.removeClass('disabled');
  238. if(!me.isDef(selected)){
  239. me.removeBtn.addClass('disabled');
  240. me.upLevelBtn.addClass('disabled');
  241. me.downLevelBtn.addClass('disabled');
  242. me.downMoveBtn.addClass('disabled');
  243. me.upMoveBtn.addClass('disabled');
  244. }
  245. else {
  246. if(!me.isDef(selected.preSibling)){
  247. me.downLevelBtn.addClass('disabled');
  248. me.upMoveBtn.addClass('disabled');
  249. }
  250. if(!me.isDef(selected.nextSibling)){
  251. me.downMoveBtn.addClass('disabled');
  252. }
  253. if(!me.isDef(selected.parent)){
  254. me.upLevelBtn.addClass('disabled');
  255. }
  256. }
  257. },
  258. bindBtn: function () {
  259. let me = this;
  260. me.insertBtn.click(function () {
  261. me.insert();
  262. });
  263. $('#delConfirm').click(function () {
  264. if(me.canRemoveSection){
  265. me.remove(me.tree.selected);
  266. }
  267. else {
  268. $('#delAlert').modal('hide');
  269. }
  270. });
  271. me.removeBtn.click(function () {
  272. //不可删除有子节点或有定额数据的节点
  273. let section = me.cache[me.workBook.getActiveSheet().getActiveRowIndex()];
  274. if(!section){
  275. return;
  276. }
  277. let sectionName = me.isDef(section.data.name) ? section.data.name : '';
  278. let sectionRations = rationOprObj.currentRations[`_SEC_ID_${section.data.ID}`];
  279. if(section.children.length > 0 || (sectionRations && sectionRations.length > 0)){
  280. me.canRemoveSection = false;
  281. $('#delAlert').find('.modal-body h5').text('当前节点下有数据,不可删除。');
  282. }
  283. else {
  284. me.canRemoveSection = true;
  285. $('#delAlert').find('.modal-body h5').text(`确认要删除章节 “${sectionName}”吗?`);
  286. }
  287. $('#delAlert').modal('show');
  288. });
  289. me.upLevelBtn.click(function () {
  290. me.upLevel(me.tree.selected);
  291. });
  292. me.downLevelBtn.click(function () {
  293. me.downLevel(me.tree.selected);
  294. });
  295. me.downMoveBtn.click(function () {
  296. me.downMove(me.tree.selected);
  297. });
  298. me.upMoveBtn.click(function () {
  299. me.upMove(me.tree.selected);
  300. });
  301. },
  302. insert: function () {
  303. let me = sectionTreeObj;
  304. me.insertBtn.addClass('disabled');
  305. let postData = [],
  306. newID = uuid.v1();
  307. let selected = me.tree.selected;
  308. let insertObj = me.getUpdateObj(me.updateType.new, {ID: newID, NextSiblingID: -1, ParentID: -1, name: ''});
  309. if(me.isDef(selected)) {
  310. let updateObj = me.getUpdateObj(me.updateType.update, {ID: selected.getID(), NextSiblingID: newID});
  311. postData.push(updateObj);
  312. insertObj.updateData.ParentID = selected.getParentID();
  313. if(me.isDef(selected.nextSibling)){
  314. insertObj.updateData.NextSiblingID = selected.getNextSiblingID();
  315. }
  316. }
  317. postData.push(insertObj);
  318. if(postData.length > 0){
  319. //ajax
  320. me.sectionTreeAjax(postData, function (rstData) {
  321. me.controller.insertByID(newID);
  322. me.refreshBtn(me.tree.selected);
  323. //fresh tools
  324. me.initTools(me.tree.selected);
  325. me.workBook.focus();
  326. me.initSelection(me.tree.selected);
  327. });
  328. }
  329. },
  330. remove: function (selected) {
  331. let me = this;
  332. me.removeBtn.addClass('disabled');
  333. let postData = [],
  334. IDs = [],
  335. deleteObj = {
  336. deleted: true,
  337. deleteDateTime: new Date(),
  338. deleteBy: userID
  339. };
  340. if(!selected){
  341. return;
  342. }
  343. getDelIds(selected);
  344. function getDelIds(node){
  345. if(me.isDef(node)){
  346. IDs.push(node.getID());
  347. if(node.children.length > 0){
  348. for(let i = 0, len = node.children.length; i < len; i++){
  349. getDelIds(node.children[i]);
  350. }
  351. }
  352. }
  353. }
  354. if(me.isDef(selected.preSibling)){
  355. let updateObj = me.getUpdateObj(me.updateType.update, {ID: selected.preSibling.getID(), NextSiblingID: selected.getNextSiblingID()});
  356. postData.push(updateObj);
  357. }
  358. if(IDs.length > 0){
  359. for(let i = 0, len = IDs.length; i < len; i++){
  360. let delObj = me.getUpdateObj(me.updateType.update, {ID: IDs[i], deleteInfo: deleteObj});
  361. postData.push(delObj);
  362. }
  363. }
  364. if(postData.length > 0){
  365. //ajax
  366. me.sectionTreeAjax(postData, function (rstData) {
  367. $('#delAlert').modal('hide');
  368. me.removeRationsCodes(rationOprObj.currentRations["_SEC_ID_" + selected.data.ID]);
  369. me.controller.delete();
  370. me.refreshBtn(me.tree.selected);
  371. me.initTools(me.tree.selected);
  372. me.initSelection(me.tree.selected);
  373. me.workBook.focus();
  374. });
  375. }
  376. },
  377. removeRationsCodes: function (rations) {
  378. for(let ration of rations){
  379. rationOprObj.rationsCodes.splice(rationOprObj.rationsCodes.indexOf(ration.code), 1);
  380. }
  381. },
  382. upLevel: function (selected) {
  383. let me = this;
  384. me.upLevelBtn.addClass('disabled');
  385. let postData = [],
  386. parent = selected.parent;
  387. if(!me.isDef(parent)){
  388. return;
  389. }
  390. //更新父节点
  391. postData.push(me.getUpdateObj(me.updateType.update, {ID: parent.getID(), NextSiblingID: selected.getID()}));
  392. //更新前节点
  393. if(me.isDef(selected.preSibling)){
  394. postData.push(me.getUpdateObj(me.updateType.update, {ID: selected.preSibling.getID(), NextSiblingID: -1}));
  395. }
  396. //更新选中节点的后兄弟节点
  397. let nextIDs = [];
  398. getNext(selected);
  399. function getNext(node){
  400. if(me.isDef(node.nextSibling)){
  401. nextIDs.push(node.getNextSiblingID());
  402. getNext(node.nextSibling);
  403. }
  404. }
  405. for(let nextID of nextIDs){
  406. postData.push(me.getUpdateObj(me.updateType.update, {ID: nextID, ParentID: selected.getID()}));
  407. }
  408. //更新选中节点
  409. postData.push(me.getUpdateObj(me.updateType.update,
  410. {ID: selected.getID(), NextSiblingID: parent.getNextSiblingID(), ParentID: parent.getParentID()}));
  411. if(postData.length > 0){
  412. //ajax
  413. me.sectionTreeAjax(postData, function (rstData) {
  414. me.controller.upLevel();
  415. me.refreshBtn(me.tree.selected);
  416. me.workBook.focus();
  417. });
  418. }
  419. },
  420. downLevel: function (selected) {
  421. let me = this;
  422. me.downLevelBtn.addClass('disabled');
  423. let postData = [],
  424. preSibling = selected.preSibling;
  425. if(!me.isDef(preSibling)){
  426. return;
  427. }
  428. //更新前节点
  429. postData.push(me.getUpdateObj(me.updateType.update, {ID: preSibling.getID(), NextSiblingID: selected.getNextSiblingID()}));
  430. //更新前节点最末子节点
  431. if(preSibling.children.length > 0){
  432. postData.push(me.getUpdateObj(me.updateType.update,
  433. {ID: preSibling.children[preSibling.children.length - 1].getID(), NextSiblingID: selected.getID()}));
  434. }
  435. //更新选中节点
  436. postData.push(me.getUpdateObj(me.updateType.update, {ID: selected.getID(), NextSiblingID: -1, ParentID: preSibling.getID()}));
  437. if(postData.length > 0){
  438. //ajax
  439. me.sectionTreeAjax(postData, function (rstData) {
  440. me.controller.downLevel();
  441. me.refreshBtn(me.tree.selected);
  442. me.workBook.focus();
  443. });
  444. }
  445. },
  446. upMove: function (selected) {
  447. let me = this;
  448. me.upMoveBtn.addClass('disabled');
  449. let postData = [];
  450. if(!me.isDef(selected)){
  451. return;
  452. }
  453. if(!me.isDef(selected.preSibling)){
  454. return;
  455. }
  456. let updateObj = me.getUpdateObj(me.updateType.update, {ID: selected.getID(), NextSiblingID: selected.preSibling.getID()});
  457. postData.push(updateObj);
  458. let updatePre = me.getUpdateObj(me.updateType.update, {ID: selected.preSibling.getID(), NextSiblingID: selected.getNextSiblingID()});
  459. postData.push(updatePre);
  460. if(me.isDef(selected.preSibling.preSibling)){
  461. let updatePrepre = me.getUpdateObj(me.updateType.update, {ID: selected.preSibling.preSibling.getID(), NextSiblingID: selected.getID()});
  462. postData.push(updatePrepre);
  463. }
  464. if(postData.length > 0){
  465. //ajax
  466. me.sectionTreeAjax(postData, function (rstData) {
  467. me.controller.upMove();
  468. me.refreshBtn(me.tree.selected);
  469. me.workBook.focus();
  470. });
  471. }
  472. },
  473. downMove: function (selected) {
  474. let me = this;
  475. me.downMoveBtn.addClass('disabled');
  476. let postData = [];
  477. if(!me.isDef(selected)){
  478. return;
  479. }
  480. if(!me.isDef(selected.nextSibling)){
  481. return;
  482. }
  483. if(me.isDef(selected.preSibling)){
  484. let updatePre = me.getUpdateObj(me.updateType.update, {ID: selected.preSibling.getID(), NextSiblingID: selected.getNextSiblingID()});
  485. postData.push(updatePre);
  486. }
  487. let updateObj = me.getUpdateObj(me.updateType.update, {ID: selected.getID(), NextSiblingID: selected.nextSibling.getNextSiblingID()});
  488. postData.push(updateObj);
  489. let updateNext = me.getUpdateObj(me.updateType.update, {ID: selected.getNextSiblingID(), NextSiblingID: selected.getID()});
  490. postData.push(updateNext);
  491. if(postData.length > 0){
  492. //ajax
  493. me.sectionTreeAjax(postData, function (rstData) {
  494. me.controller.downMove();
  495. me.refreshBtn(me.tree.selected);
  496. me.workBook.focus();
  497. });
  498. }
  499. },
  500. getUpdateObj: function (updateType, updateData) {
  501. let updateObj = Object.create(null);
  502. updateObj.updateType = '';
  503. updateObj.updateData = Object.create(null);
  504. updateObj.updateData.rationRepId = pageOprObj.rationLibId;
  505. if(this.isDef(updateType)){
  506. updateObj.updateType = updateType;
  507. }
  508. if(this.isDef(updateData)){
  509. for(let attr in updateData){
  510. updateObj.updateData[attr] = updateData[attr];
  511. }
  512. }
  513. return updateObj;
  514. },
  515. sectionTreeAjax: function (postData, scFunc, errFunc) {
  516. CommonAjax.post('api/updateRationSection', {updateData: postData}, scFunc, errFunc);
  517. },
  518. initTools: function (node) {
  519. if(this.isDef(node)){
  520. explanatoryOprObj.setAttribute(explanatoryOprObj.currentTreeNode ? explanatoryOprObj.currentTreeNode : node, node, node.data.explanation, node.data.ruleText);
  521. explanatoryOprObj.clickUpdate($('#explanationShow'), $('#ruleTextShow'));
  522. explanatoryOprObj.showText($('#explanationShow'), $('#ruleTextShow'), node.data.explanation, node.data.ruleText);
  523. //job
  524. jobContentOprObj.currentSituation = typeof node.data.jobContentSituation !== 'undefined'? node.data.jobContentSituation : jobContentOprObj.situations.NONE;
  525. jobContentOprObj.setAttribute(jobContentOprObj.currentTreeNode ? jobContentOprObj.currentTreeNode : node, node);
  526. jobContentOprObj.clickUpdate($('#txtareaAll'));
  527. //fz
  528. annotationOprObj.currentSituation = typeof node.data.annotationSituation !== 'undefined'? node.data.annotationSituation : annotationOprObj.situations.NONE;
  529. annotationOprObj.clickUpdate($('#fzTxtareaAll'));
  530. }
  531. },
  532. //模仿默认点击
  533. initSelection: function (node) {
  534. let me = this;
  535. if(!me.isDef(node)){
  536. sheetCommonObj.cleanSheet(rationOprObj.workBook.getActiveSheet(), rationOprObj.setting, -1);
  537. sheetCommonObj.cleanSheet(rationGLJOprObj.sheet, rationGLJOprObj.setting, -1);
  538. sheetCommonObj.cleanSheet(rationCoeOprObj.sheet, rationCoeOprObj.setting, -1);
  539. sheetCommonObj.cleanSheet(rationAssistOprObj.sheet, rationAssistOprObj.setting, -1);
  540. sheetCommonObj.cleanSheet(rationInstObj.sheet, rationInstObj.setting, -1);
  541. return;
  542. }
  543. node.tree.selected = node ? node : null
  544. me.workBook.getActiveSheet().setActiveCell(node.serialNo(), 0);
  545. me.initTools(node);
  546. me.refreshBtn(node);
  547. if(!me.isDef(node.children) || node.children.length === 0){
  548. rationOprObj.canRations = true;
  549. rationOprObj.workBook.getSheet(0).clearSelection();
  550. rationOprObj.getRationItems(node.data.ID, function () {
  551. rationOprObj.workBook.getActiveSheet().setActiveCell(0, 0);
  552. rationOprObj.rationSelInit(0, true);
  553. });
  554. rationOprObj.setCombo(rationOprObj.workBook.getSheet(0), 'dynamic');
  555. }
  556. else {
  557. rationOprObj.canRations = false;
  558. rationOprObj.currentSectionId = node.data.ID;
  559. rationOprObj.workBook.getSheet(0).setRowCount(30);
  560. rationOprObj.setCombo(rationOprObj.workBook.getSheet(0), null);
  561. // jobContentOprObj.setRadiosDisabled(true, jobContentOprObj.radios);
  562. jobContentOprObj.hideTable($('#tableAll'), $('#tablePartial'));
  563. // annotationOprObj.setRadiosDisabled(true, annotationOprObj.radios);
  564. annotationOprObj.hideTable($('#fzTableAll'), $('#fzTablePartial'));
  565. sheetCommonObj.cleanSheet(rationOprObj.workBook.getSheet(0), rationOprObj.setting, -1);
  566. sheetCommonObj.cleanSheet(rationGLJOprObj.sheet, rationGLJOprObj.setting, -1);
  567. sheetCommonObj.cleanSheet(rationCoeOprObj.sheet, rationCoeOprObj.setting, -1);
  568. sheetCommonObj.cleanSheet(rationAssistOprObj.sheet, rationAssistOprObj.setting, -1);
  569. sheetCommonObj.cleanSheet(rationInstObj.sheet, rationInstObj.setting, -1);
  570. }
  571. //rationGLJOprObj.sheet.getParent().focus(false);
  572. me.workBook.focus(true);
  573. }
  574. };