cs_tools.js 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576
  1. 'use strict';
  2. /**
  3. * cs_errorList:错误列表
  4. * 使用范围:
  5. * 台账分解(原报)、台账修订(原报)、计量台账(所有角色)
  6. *
  7. * posSearch & billsSearch:台账搜索相关
  8. * 使用范围:
  9. * 0号台账:台账分解、台账审批、台账修订、部位台账;
  10. * 期计量:计量台账、部位台账
  11. *
  12. * 所有工具均基于spreadjs,请放在gc.spread.sheets.all.10.0.1.min.js/spreadjs_zh.js之后
  13. *
  14. * @author Mai
  15. * @date
  16. * @version
  17. */
  18. const showSideTools = function (show) {
  19. const left = $('#left-view'), right = $('#right-view'), parent = left.parent();
  20. if (show) {
  21. right.show();
  22. autoFlashHeight();
  23. /**
  24. * right.show()后, parent被撑开成2倍left.height, 导致parent.width减少了10px
  25. * 第一次left.width调整后,parent的缩回left.height, 此时parent.width又增加了10px
  26. * 故需要通过最终的parent.width再计算一次left.width
  27. *
  28. * Q: 为什么不通过先计算left.width的宽度,以避免计算两次left.width?
  29. * A: 右侧工具栏不一定显示,当右侧工具栏显示过一次后,就必须使用parent和right来计算left.width
  30. *
  31. */
  32. //left.css('width', parent.width() - right.outerWidth());
  33. //left.css('width', parent.width() - right.outerWidth());
  34. const percent = 100 - right.outerWidth() /parent.width() * 100;
  35. left.css('width', percent + '%');
  36. } else {
  37. left.width(parent.width());
  38. right.hide();
  39. }
  40. };
  41. (function($){
  42. /**
  43. * 错误列表
  44. * @param setting
  45. * {
  46. * tabSelector: 'a[content=#error-list]',
  47. * selector: '#error-list',
  48. * relaSpread: ledgerSpread,
  49. * storeKey: 'ledger-error-' + tenderId,
  50. * }
  51. * @returns {{spread: *}}
  52. */
  53. $.cs_errorList = function (setting) {
  54. if (!setting.spreadSetting) {
  55. setting.spreadSetting = {
  56. cols: [
  57. {title: '行号', field: 'serialNo', width: 80, formatter: '@'},
  58. {title: '清单编号', field: 'b_code', width: 150, formatter: '@'},
  59. {title: '清单名称', field: 'name', width: 230, formatter: '@'},
  60. ],
  61. emptyRows: 0,
  62. headRows: 1,
  63. headRowHeight: [32],
  64. defaultRowHeight: 21,
  65. headerFont: '12px 微软雅黑',
  66. font: '12px 微软雅黑',
  67. selectedBackColor: '#fffacd',
  68. readOnly: true,
  69. };
  70. }
  71. const clearErrorData = function () {
  72. if (setting.storeKey) removeLocalCache(setting.storeKey);
  73. };
  74. const autoShowHistory = function (show) {
  75. if (setting.storeKey) {
  76. setLocalCache(setting.storeKey + '-showHis', show.toString());
  77. }
  78. };
  79. if (setting.selector && setting.relaSpread) {
  80. const resultId = setting.id + '-spread';
  81. const obj = $(setting.selector);
  82. obj.html(
  83. ' <div id="' + resultId + '" class="sjs-sh">\n' +
  84. ' </div>'
  85. );
  86. autoFlashHeight();
  87. const spread = SpreadJsObj.createNewSpread($('#' + resultId)[0]);
  88. const sheet = spread.getActiveSheet();
  89. SpreadJsObj.initSheet(sheet, setting.spreadSetting);
  90. SpreadJsObj.forbiddenSpreadContextMenu('#' + resultId, spread);
  91. spread.getActiveSheet().bind(spreadNS.Events.CellDoubleClick, function (e, info) {
  92. const sheet = info.sheet;
  93. const data = sheet.zh_data;
  94. if (!data) { return }
  95. const curBills = data[info.row];
  96. if (!curBills) { return }
  97. SpreadJsObj.locateTreeNode(setting.relaSpread.getActiveSheet(), curBills.ledger_id, true);
  98. if (setting.afterLocated) {
  99. setting.afterLocated();
  100. }
  101. });
  102. const loadErrorData = function (data, his = false) {
  103. const sourceTree = setting.relaSpread.getActiveSheet().zh_tree;
  104. if (!sourceTree) return;
  105. for (const d of data) {
  106. d.serialNo = sourceTree.getNodeIndex(sourceTree.getItems(d.ledger_id)) + 1;
  107. }
  108. data.sort(function (a, b) {
  109. return a.serialNo - b.serialNo;
  110. });
  111. SpreadJsObj.loadSheetData(sheet, SpreadJsObj.DataType.Data, data);
  112. if (!his && setting.storeKey) {
  113. setLocalCache(setting.storeKey, JSON.stringify(data));
  114. }
  115. $(setting.tabSelector).show();
  116. };
  117. const showErrorList = function () {
  118. const tab = $(setting.tabSelector), tabPanel = $(tab.attr('content'));
  119. $('a', '#side-menu').removeClass('active');
  120. tab.addClass('active');
  121. $('.tab-content .tab-pane').removeClass('active');
  122. tabPanel.addClass('active');
  123. showSideTools(true);
  124. spread.refresh();
  125. if (setting.afterShow) setting.afterShow();
  126. };
  127. const loadHisErrorData = function () {
  128. if (setting.storeKey) {
  129. const storeStr = getLocalCache(setting.storeKey);
  130. const storeData = storeStr ? JSON.parse(storeStr) : [];
  131. if (storeData.length > 0) {
  132. loadErrorData(storeData, true);
  133. const showHis = getLocalCache(setting.storeKey + '-showHis');
  134. if (showHis === 'true') {
  135. showErrorList();
  136. removeLocalCache(setting.storeKey + '-showHis');
  137. }
  138. }
  139. }
  140. };
  141. return {
  142. spread: spread,
  143. loadErrorData: loadErrorData,
  144. clearErrorData: clearErrorData,
  145. loadHisErrorData: loadHisErrorData,
  146. show: showErrorList,
  147. autoShowHistory: autoShowHistory,
  148. };
  149. } else {
  150. const loadErrorData = function (data) {
  151. if (setting.storeKey) {
  152. setLocalCache(setting.storeKey, JSON.stringify(data));
  153. }
  154. };
  155. return {
  156. loadErrorData: loadErrorData,
  157. clearErrorData: clearErrorData,
  158. autoShowHistory: autoShowHistory,
  159. };
  160. }
  161. };
  162. $.ledger_checkList = function (setting) {
  163. const checkTypeText = [];
  164. for (const ct in setting.checkType) {
  165. checkTypeText[setting.checkType[ct].value] = setting.checkType[ct].text;
  166. }
  167. if (!setting.spreadSetting) {
  168. setting.spreadSetting = {
  169. cols: [
  170. {
  171. title: '类型', field: 'type', width: 150, formatter: '@',
  172. getValue: function (data){
  173. if (setting.checkType) {
  174. return checkTypeText[data.type] || '';
  175. } else {
  176. return '';
  177. }
  178. }
  179. },
  180. {title: '行号', field: 'serialNo', hAlign: 1, width: 40, formatter: '@'},
  181. {title: '项目节编号', field: 'code', width: 80, formatter: '@'},
  182. {title: '清单编号', field: 'b_code', width: 80, formatter: '@'},
  183. {title: '名称', field: 'name', width: 150, formatter: '@'},
  184. ],
  185. emptyRows: 0,
  186. headRows: 1,
  187. headRowHeight: [32],
  188. defaultRowHeight: 21,
  189. headerFont: '12px 微软雅黑',
  190. font: '12px 微软雅黑',
  191. selectedBackColor: '#fffacd',
  192. readOnly: true,
  193. };
  194. }
  195. const clearCheckData = function () {
  196. if (setting.storeKey) removeLocalCache(setting.storeKey);
  197. };
  198. const autoShowHistory = function (show) {
  199. if (setting.storeKey) {
  200. setLocalCache(setting.storeKey + '-showHis', show.toString());
  201. }
  202. };
  203. if (setting.selector && setting.relaSpread) {
  204. const resultId = setting.id + '-spread';
  205. const obj = $(setting.selector);
  206. const dropdown = [];
  207. if (setting.checkType) {
  208. dropdown.push('<div class="dropdown">');
  209. dropdown.push('<button class="btn btn-sm btn-outline-primary dropdown-toggle" type="button" id="'+ setting.id + 'drop" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">所有类型</button>');
  210. dropdown.push('<div class="dropdown-menu" aria-labelledby="'+ setting.id + 'drop">');
  211. dropdown.push('<a class="dropdown-item" href="javascript: void(0);" check-type="all">所有类型</a>');
  212. for (const ct in setting.checkType) {
  213. dropdown.push('<a class="dropdown-item" href="javascript: void(0);" check-type="' + setting.checkType[ct].value +'">' + setting.checkType[ct].text + '</a>');
  214. }
  215. dropdown.push('</div>');
  216. dropdown.push('</div>');
  217. }
  218. obj.html(
  219. '<div class="sjs-bar">\n' +
  220. ' <div class="pb-1 d-flex">\n' + dropdown.join('') +
  221. ' <span class="ml-auto pr-2" id="' + setting.id + '-time">检查时间:2020-08-01 13:20:25</span>\n' +
  222. ' </div>\n' +
  223. '</div>' +
  224. '<div id="' + resultId + '" class="sjs-sh">\n' +
  225. '</div>'
  226. );
  227. autoFlashHeight();
  228. const spread = SpreadJsObj.createNewSpread($('#' + resultId)[0]);
  229. const sheet = spread.getActiveSheet();
  230. SpreadJsObj.initSheet(sheet, setting.spreadSetting);
  231. SpreadJsObj.forbiddenSpreadContextMenu('#' + resultId, spread);
  232. spread.getActiveSheet().bind(spreadNS.Events.CellDoubleClick, function (e, info) {
  233. const sheet = info.sheet;
  234. const data = sheet.zh_data;
  235. if (!data) { return }
  236. const curBills = data[info.row];
  237. if (!curBills) { return }
  238. SpreadJsObj.locateTreeNode(setting.relaSpread.getActiveSheet(), curBills.ledger_id, true);
  239. if (setting.afterLocated) {
  240. setting.afterLocated();
  241. }
  242. });
  243. const filterCheckData = function () {
  244. const filter = $(this).attr('check-type');
  245. $('#' + setting.id + 'drop').html(this.innerHTML);
  246. for (const d of sheet.zh_data) {
  247. if (filter === 'all') {
  248. d.visible = true;
  249. } else {
  250. d.visible = d.type == filter;
  251. }
  252. }
  253. SpreadJsObj.refreshTreeRowVisible(sheet);
  254. };
  255. $('a[check-type]').bind('click', filterCheckData);
  256. const hideCheckData = function () {
  257. const tab = $(setting.tabSelector), tabPanel = $(tab.attr('content'));
  258. if (tab.hasClass('active')) {
  259. $('a', '#side-menu').removeClass('active');
  260. tab.addClass('active');
  261. $('.tab-content .tab-pane').removeClass('active');
  262. tabPanel.addClass('active');
  263. showSideTools(false);
  264. if (spread) spread.refresh();
  265. if (setting.afterShow) setting.afterShow();
  266. tab.hide();
  267. }
  268. };
  269. const loadCheckData = function (data, his = false) {
  270. const sourceTree = setting.relaSpread.getActiveSheet().zh_tree;
  271. if (!sourceTree) return;
  272. for (const d of data.warning_data) {
  273. d.serialNo = sourceTree.getNodeIndex(sourceTree.getItems(d.ledger_id)) + 1;
  274. }
  275. $('#' + setting.id + '-time').html('检查时间:' + moment(data.check_time).format('YYYY-MM-DD hh:mm:ss'));
  276. SpreadJsObj.loadSheetData(sheet, SpreadJsObj.DataType.Data, data.warning_data);
  277. if (!his && setting.storeKey) {
  278. setLocalCache(setting.storeKey, JSON.stringify(data));
  279. }
  280. $(setting.tabSelector).show();
  281. };
  282. const showCheckList = function () {
  283. const tab = $(setting.tabSelector), tabPanel = $(tab.attr('content'));
  284. $('a', '#side-menu').removeClass('active');
  285. tab.addClass('active');
  286. $('.tab-content .tab-pane').removeClass('active');
  287. tabPanel.addClass('active');
  288. showSideTools(true);
  289. spread.refresh();
  290. if (setting.afterShow) setting.afterShow();
  291. };
  292. const loadHisCheckData = function () {
  293. if (setting.storeKey) {
  294. const storeStr = getLocalCache(setting.storeKey);
  295. const storeData = storeStr ? JSON.parse(storeStr) : null;
  296. if (storeData) {
  297. loadCheckData(storeData, true);
  298. const showHis = getLocalCache(setting.storeKey + '-showHis');
  299. if (showHis === 'true') {
  300. showCheckList();
  301. removeLocalCache(setting.storeKey + '-showHis');
  302. }
  303. }
  304. }
  305. };
  306. return {
  307. spread: spread,
  308. loadCheckData: loadCheckData,
  309. clearCheckData: clearCheckData,
  310. loadHisCheckData: loadHisCheckData,
  311. show: showCheckList,
  312. hide: hideCheckData,
  313. autoShowHistory: autoShowHistory,
  314. };
  315. } else {
  316. const loadCheckData = function (data) {
  317. if (setting.storeKey) {
  318. setLocalCache(setting.storeKey, JSON.stringify(data));
  319. }
  320. };
  321. return {
  322. loadCheckData: loadCheckData,
  323. clearCheckData: clearCheckData,
  324. autoShowHistory: autoShowHistory,
  325. };
  326. }
  327. };
  328. $.posSearch = function (setting) {
  329. if (!setting.selector || !setting.searchSpread) return;
  330. const searchHtml =
  331. ' <div class="ml-2">\n' +
  332. ' <div class="input-group input-group-sm">\n' +
  333. ' <input type="text" class="form-control" placeholder="输入名称查找" id="pos-keyword">\n' +
  334. ' <div class="input-group-append">\n' +
  335. ' <span class="input-group-text" id="pos-search-hint">结果:0</span>\n' +
  336. ' </div>\n' +
  337. ' <div class="input-group-append" >\n' +
  338. ' <button class="btn btn-outline-secondary" type="button" title="上一个" id="search-pre-pos"><i class="fa fa-angle-double-left"></i></button>\n' +
  339. ' <button class="btn btn-outline-secondary" type="button" title="下一个" id="search-next-pos"><i class="fa fa-angle-double-right"></i></button>\n' +
  340. ' </div>\n' +
  341. ' </div>\n' +
  342. ' </div>\n';
  343. $(setting.selector).html(searchHtml);
  344. const sheet = setting.searchSpread.getActiveSheet();
  345. const searchObj = (function () {
  346. let resultArr = [];
  347. const search = function (keyword) {
  348. if (keyword && keyword !== '') {
  349. resultArr = [];
  350. const sortData = sheet.zh_data;
  351. if (sortData) {
  352. for (let i = 0, iLength = sortData.length; i < iLength; i++) {
  353. const sd = sortData[i];
  354. if (sd.name && sd.name.indexOf(keyword) > -1) {
  355. resultArr.push({index: i, data: sd});
  356. }
  357. }
  358. }
  359. } else {
  360. resultArr = [];
  361. }
  362. $('#pos-search-hint').html('结果:' + resultArr.length);
  363. };
  364. const searchAndLocate = function (keyword) {
  365. search(keyword);
  366. if (resultArr.length > 0) {
  367. const sel = sheet.getSelections()[0];
  368. const curRow = sel ? sel.row : 0;
  369. const pos = resultArr[0];
  370. if (pos.index !== curRow) {
  371. sheet.setSelection(pos.index, sel ? sel.col : 0, 1, 1);
  372. sheet.getParent().focus();
  373. sheet.showRow(pos.index, spreadNS.VerticalPosition.center);
  374. SpreadJsObj.reloadRowsBackColor(sheet, [pos.index, curRow]);
  375. }
  376. }
  377. };
  378. const locateNext = function () {
  379. if (resultArr.length > 0) {
  380. const sel = sheet.getSelections()[0];
  381. const curRow = sel ? sel.row : 0;
  382. let next = _.find(resultArr, function (d) {
  383. return d.index > curRow;
  384. });
  385. if (!next) next = resultArr[0];
  386. if (next.index !== curRow) {
  387. sheet.setSelection(next.index, sel ? sel.col : 0, 1, 1);
  388. sheet.getParent().focus();
  389. sheet.showRow(next.index, spreadNS.VerticalPosition.center);
  390. SpreadJsObj.reloadRowsBackColor(sheet, [next.index, curRow]);
  391. }
  392. }
  393. };
  394. const locatePre = function () {
  395. if (resultArr.length > 0) {
  396. const sel = sheet.getSelections()[0];
  397. const curRow = sel ? sel.row : 0;
  398. let next = _.findLast(resultArr, function (d) {
  399. return d.index < curRow;
  400. });
  401. if (!next) next = resultArr[resultArr.length - 1];
  402. if (next.index !== curRow) {
  403. sheet.setSelection(next.index, sel ? sel.col : 0, 1, 1);
  404. sheet.getParent().focus();
  405. sheet.showRow(next.index, spreadNS.VerticalPosition.center);
  406. SpreadJsObj.reloadRowsBackColor(sheet, [next.index, curRow]);
  407. }
  408. }
  409. };
  410. return {search, searchAndLocate, locateNext, locatePre};
  411. })();
  412. // $('#pos-keyword').bind('input propertychange', function () {
  413. // posSearch.search(this.value);
  414. // });
  415. $('#pos-keyword').bind('keydown', function(e){
  416. if (e.keyCode == 13) searchObj.searchAndLocate(this.value);
  417. });
  418. $('#search-pre-pos').click(function () {
  419. searchObj.locatePre();
  420. });
  421. $('#search-next-pos').click(function () {
  422. searchObj.locateNext();
  423. });
  424. return searchObj;
  425. };
  426. $.billsSearch = function (setting) {
  427. if (!setting.selector || !setting.searchSpread || !setting.resultSpreadSetting) return;
  428. if (!setting.searchRangeStr) setting.searchRangeStr = '项目节编号/清单编号/名称';
  429. const resultId = setting.id + '-search-result';
  430. const obj = $(setting.selector);
  431. let filter = [];
  432. if (setting.searchOver || setting.searchEmpty) {
  433. filter.push('<select class="form-control form-control-sm" id="search-filter">');
  434. filter.push('<option value="">台账</option>');
  435. if (setting.customSearch) {
  436. for (const cs of setting.customSearch) {
  437. if (cs.valid) filter.push('<option value="' + cs.key + '">' + cs.title + '</option>');
  438. }
  439. }
  440. filter.push('</select>');
  441. // filter.push('<div class="input-group-prepend">');
  442. // filter.push('<button class="btn btn-outline-secondary dropdown-toggle" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">台帐</button>');
  443. // filter.push('<div class="dropdown-menu">');
  444. // filter.push('<a class="dropdown-item" href="javascripty: void(0)" id="search-bills">台账</a>');
  445. // filter.push('<a class="dropdown-item" href="javascripty: void(0)" id="search-over">超计</a>');
  446. // filter.push('<a class="dropdown-item" href="javascripty: void(0)" id="search-less">漏计</a>');
  447. // filter.push('</div>');
  448. // filter.push('</div>');
  449. }
  450. obj.html(
  451. ' <div class="sjs-bar">\n' +
  452. ' <div class="input-group input-group-sm pb-1">\n' +
  453. ' <div class="input-group-prepend">\n' +
  454. filter.join('') +
  455. ' </div>' +
  456. ' <input id="searchKeyword" type="text" class="form-control" placeholder="可查找 ' + setting.searchRangeStr + '" aria-label="Recipient\'s username" aria-describedby="button-addon2">\n' +
  457. ' <div class="input-group-append">\n' +
  458. ' <button class="btn btn-outline-secondary" type="button"">搜索</button>\n' +
  459. ' </div>\n' +
  460. ' </div>\n' +
  461. ' </div>\n' +
  462. ' <div id="' + resultId + '" class="sjs-sh">\n' +
  463. ' </div>'
  464. );
  465. autoFlashHeight();
  466. const resultSpread = SpreadJsObj.createNewSpread($('#' + resultId)[0]);
  467. SpreadJsObj.initSheet(resultSpread.getActiveSheet(), setting.resultSpreadSetting);
  468. SpreadJsObj.forbiddenSpreadContextMenu('#' + resultId, resultSpread);
  469. const searchSheet = setting.searchSpread.getActiveSheet();
  470. let searchResult = [];
  471. const search = function () {
  472. const filter = $('#search-filter').val();
  473. if (filter) {
  474. searchCustom(filter);
  475. } else {
  476. searchBills();
  477. }
  478. };
  479. const searchBills = function () {
  480. const keyword = $('#searchKeyword', obj).val();
  481. searchResult = [];
  482. const sortData = SpreadJsObj.getSortData(searchSheet);
  483. for (const node of sortData) {
  484. if ((node.code && node.code.indexOf(keyword) > -1) ||
  485. node.b_code && node.b_code.indexOf(keyword) > -1 ||
  486. node.name && node.name.indexOf(keyword) > -1) {
  487. const data = JSON.parse(JSON.stringify(node));
  488. data.visible = true;
  489. searchResult.push(data);
  490. }
  491. }
  492. SpreadJsObj.loadSheetData(resultSpread.getActiveSheet(), 'data', searchResult);
  493. };
  494. const getCheckFun = function (key) {
  495. const cs = setting.customSearch.find(function (x) {return x.key === key});
  496. return cs ? cs.check : null;
  497. };
  498. const searchCustom = function (key) {
  499. const keyword = $('#searchKeyword', obj).val();
  500. const checkFun = getCheckFun(key);
  501. searchResult = [];
  502. const sortData = SpreadJsObj.getSortData(searchSheet);
  503. for (const node of sortData) {
  504. if (node.children && node.children.length > 0) continue;
  505. if (checkFun && checkFun(node)) {
  506. if (!keyword ||
  507. (node.code && node.code.indexOf(keyword) > -1) ||
  508. (node.b_code && node.b_code.indexOf(keyword) > -1) ||
  509. (node.name && node.name.indexOf(keyword) > -1)) {
  510. const data = JSON.parse(JSON.stringify(node));
  511. data.visible = true;
  512. searchResult.push(data);
  513. }
  514. }
  515. }
  516. calculateCompletePercent(searchResult);
  517. SpreadJsObj.loadSheetData(resultSpread.getActiveSheet(), 'data', searchResult);
  518. };
  519. const calculateCompletePercent = function (searchResult) {
  520. if (!searchResult) return;
  521. for (const sr of searchResult) {
  522. const base = ZhCalc.add(sr.total_price, sr.end_qc_tp);
  523. sr.complete_percent = base !== 0 ? ZhCalc.mul(ZhCalc.div(sr.end_gather_tp, base), 100, 2) : 0;
  524. }
  525. };
  526. $('input', obj).bind('keydown', function (e) {
  527. if (e.keyCode == 13) search();
  528. });
  529. $('button', obj).bind('click', () => {search()});
  530. resultSpread.getActiveSheet().bind(spreadNS.Events.CellDoubleClick, function (e, info) {
  531. const sheet = info.sheet;
  532. const data = sheet.zh_data;
  533. if (!data) { return }
  534. const curBills = data[info.row];
  535. if (!curBills) { return }
  536. SpreadJsObj.locateTreeNode(searchSheet, curBills.ledger_id, true);
  537. if (setting.afterLocated) {
  538. setting.afterLocated();
  539. }
  540. });
  541. return {spread: resultSpread};
  542. };
  543. })(jQuery);