section_tree.js 23 KB

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