cs_tools.js 26 KB

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