ledger_check.js 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562
  1. 'use strict';
  2. /**
  3. *
  4. *
  5. * @author Mai
  6. * @date
  7. * @version
  8. */
  9. const ledgerCheckType = {
  10. sibling: {value: 1, text: '项目节、清单同层', fun: 'checkSibling', },
  11. empty_code: {value: 2, text: '项目节、清单编号同时为空', fun: 'checkCodeEmpty', },
  12. calc: {value: 3, text: '清单数量不等于计量单元之和', fun: 'checkCalc', },
  13. zero: {value: 4, text: '清单数量或单价为0', fun: 'checkZero', },
  14. zeroPos: {value: 12, text: '计量单元数量为0', fun: 'checkZeroPos', },
  15. pos_drawingCode: {value: 13, text: '计量单元图册号为空', fun: 'checkPosDrawingCode', },
  16. tp: {value: 5, text: '清单金额≠数量×单价', fun: 'checkTp', },
  17. over: {value: 6, text: '超计', fun: 'checkOver', },
  18. same_code: {value: 7, text: '重复项目节', fun: 'checkSameCode', },
  19. same_bills: {value: 14, text: '重复清单(同部位)', fun: 'checkSameBwBills', },
  20. limit3f: {
  21. fun: 'check3fLimit', items: [
  22. { value: 8, text: '违规计量(工序报验)', key: 'gxbyOver', type: 'gxby', },
  23. { value: 9, text: '遗漏计量(工序报验)', key: 'gxbyLost', type: 'gxby', },
  24. { value: 10, text: '违规计量(档案管理)', key: 'daglOver', type: 'dagl', },
  25. { value: 11, text: '遗漏计量(档案管理)', key: 'daglLost', type: 'dagl', },
  26. ]
  27. },
  28. multiLimit3f: {
  29. value: 12, text: '联动计量', fun: 'check3fMultiLimit'
  30. },
  31. minus_cb: { value: 13, text: '负变更清单漏计', url: window.location.pathname + '/stageCheck?type=minus_cb' },
  32. change_over: { value: 14, text: '变更令超计', url: window.location.pathname + '/stageCheck?type=change_over'},
  33. change_detail: { value: 15, text: '变更统计错误', url: window.location.pathname + '/stageCheck?type=change_detail'},
  34. };
  35. const ledgerCheckUtil = {
  36. checkSibling: function (ledgerTree, ledgerPos, decimal, option) {
  37. const error = [];
  38. for (const node of ledgerTree.nodes) {
  39. if (!node.children || node.children.length === 0) continue;
  40. let hasXmj, hasGcl;
  41. for (const child of node.children) {
  42. if (child.b_code) hasXmj = true;
  43. if (!child.b_code) hasGcl = true;
  44. }
  45. if (hasXmj && hasGcl) error.push(node);
  46. }
  47. return error;
  48. },
  49. checkCodeEmpty: function (ledgerTree, ledgerPos, decimal, option) {
  50. const error = [];
  51. const checkNodeCode = function (node) {
  52. if ((!node.code || node.code === '') && (!node.b_code || node.b_code === '')) error.push(node);
  53. if (node.children && node.children.length > 0) {
  54. for (const child of node.children) {
  55. checkNodeCode(child);
  56. }
  57. }
  58. };
  59. for (const topLevel of ledgerTree.children) {
  60. if ([1, 3, 4].indexOf(topLevel.node_type) < 0) continue;
  61. checkNodeCode(topLevel);
  62. }
  63. return error;
  64. },
  65. checkCalc: function (ledgerTree, ledgerPos, decimal, option) {
  66. const error = [];
  67. for (const node of ledgerTree.nodes) {
  68. if (node.children && node.children.length > 0) continue;
  69. const nodePos = ledgerPos.getLedgerPos(node.id);
  70. if (!nodePos || nodePos.length === 0) continue;
  71. const checkData = {}, calcData = {};
  72. for (const f of option.fields) {
  73. checkData[f] = node[f] || 0;
  74. calcData[f] = 0;
  75. }
  76. for (const np of nodePos) {
  77. for (const f of option.fields) {
  78. calcData[f] = ZhCalc.add(calcData[f], np[f]) || 0;
  79. }
  80. }
  81. if (!_.isMatch(checkData, calcData)) {
  82. error.push(node);
  83. }
  84. }
  85. return error;
  86. },
  87. checkZero: function (ledgerTree, ledgerPos, decimal, option) {
  88. const error = [];
  89. for (const node of ledgerTree.nodes) {
  90. if ((!node.b_code || node.b_code === '')) continue;
  91. if (node.children && node.children.length > 0) continue;
  92. if ((checkZero(node.sgfh_qty) && checkZero(node.qtcl_qty) && checkZero(node.sjcl_qty)
  93. && checkZero(node.deal_qty) && checkZero(node.quantity))
  94. || checkZero(node.unit_price)) error.push(node);
  95. }
  96. return error;
  97. },
  98. checkZeroPos: function (ledgerTree, ledgerPos, decimal, option) {
  99. const error = [];
  100. for (const node of ledgerTree.nodes) {
  101. if (node.children && node.children.length > 0) continue;
  102. const nodePos = ledgerPos.getLedgerPos(node.id);
  103. if (!nodePos || nodePos.length === 0) continue;
  104. for (const np of nodePos) {
  105. if (checkZero(np.sgfh_qty) && checkZero(np.qtcl_qty) && checkZero(np.sjcl_qty) && checkZero(np.quantity)) {
  106. error.push(node);
  107. break;
  108. }
  109. }
  110. }
  111. return error;
  112. },
  113. checkPosDrawingCode: function (ledgerTree, ledgerPos, decimal, option) {
  114. const error = [];
  115. for (const node of ledgerTree.nodes) {
  116. if (node.children && node.children.length > 0) continue;
  117. const nodePos = ledgerPos.getLedgerPos(node.id);
  118. if (!nodePos || nodePos.length === 0) continue;
  119. for (const np of nodePos) {
  120. if (!np.drawing_code) {
  121. error.push(node);
  122. break;
  123. }
  124. }
  125. }
  126. return error;
  127. },
  128. checkTp: function (ledgerTree, ledgerPos, decimal, option) {
  129. const error = [];
  130. for (const node of ledgerTree.nodes) {
  131. if (node.children && node.children.length > 0) continue;
  132. if (option.filter && option.filter(node)) continue;
  133. const checkData = {}, calcData = {};
  134. for (const f of option.fields) {
  135. checkData[f.tp] = node[f.tp] || 0;
  136. calcData[f.tp] = ZhCalc.mul(node.unit_price, node[f.qty], decimal.tp) || 0;
  137. }
  138. if (!_.isMatch(checkData, calcData)) error.push(node);
  139. }
  140. return error;
  141. },
  142. checkOver: function(ledgerTree, ledgerPos, decimal, option) {
  143. const error = [];
  144. for (const node of ledgerTree.nodes) {
  145. if (node.children && node.children.length > 0) continue;
  146. if (checkUtils.billsOver(node, ledgerPos, option.checkInfo)) error.push(node);
  147. }
  148. return error;
  149. },
  150. checkSameCode: function (ledgerTree, ledgerPos, decimal, option) {
  151. const error = [];
  152. //let xmj = ledgerTree.nodes.filter(x => { return /^((GD*)|G)?[0-9]+/.test(x.code); });
  153. let xmj = [];
  154. const addXmjCheck = function (node) {
  155. if (/^((GD*)|G)?[0-9]+/.test(node.code)) xmj.push(node);
  156. for (const child of node.children) {
  157. addXmjCheck(child);
  158. }
  159. };
  160. for (const topLevel of ledgerTree.children) {
  161. if ([1, 2, 3, 4].indexOf(topLevel.node_type) < 0) continue;
  162. addXmjCheck(topLevel);
  163. }
  164. const xmjPart = {}, xmjIndex = [];
  165. for (const x of xmj) {
  166. if (!xmjPart[x.code]) {
  167. xmjPart[x.code] = [];
  168. xmjIndex.push(x.code);
  169. }
  170. xmjPart[x.code].push(x);
  171. }
  172. for (const x of xmjIndex) {
  173. if (xmjPart[x].length > 1) error.push(...xmjPart[x]);
  174. }
  175. return error;
  176. },
  177. checkSameBwBills: function(ledgerTree, ledgerPos, decimal, option) {
  178. const error = [];
  179. for (const node of ledgerTree.nodes) {
  180. if (!node.children || node.children.length === 0) continue;
  181. const gatherGcl = [];
  182. for (const child of node.children) {
  183. if (!child.b_code) continue;
  184. let gcl = gatherGcl.find(g => {
  185. return g.b_code === child.b_code &&
  186. (g.name || child.name ? g.name === child.name : true) &&
  187. (g.unit || child.unit ? g.unit === child.unit : true) &&
  188. checkZero(ZhCalc.sub(g.unit_price, child.unit_price));
  189. });
  190. if (!gcl) {
  191. gcl = { source: [], b_code: child.b_code || '', name: child.name || '', unit: child.unit || '', unit_price: child.unit_price || 0 };
  192. gatherGcl.push(gcl);
  193. }
  194. gcl.source.push(child);
  195. }
  196. gatherGcl.forEach(g => {
  197. if (g.source.length > 1) error.push(...g.source);
  198. })
  199. }
  200. return error;
  201. },
  202. check3fLimit: function (ledgerTree, ledgerPos, decimal, option) {
  203. const error = {};
  204. for (const i of ledgerCheckType.limit3f.items) {
  205. error[i.key] = [];
  206. }
  207. if (option.checkType.length === 0) return error;
  208. const findPrecision = function (list, unit) {
  209. if (unit) {
  210. for (const p in list) {
  211. if (list[p].unit && list[p].unit === unit) {
  212. return list[p];
  213. }
  214. }
  215. }
  216. return list.other;
  217. };
  218. const getRatio = function (type, status) {
  219. const statusConst = type === 'gxby' ? option.status.gxby : option.status.dagl;
  220. const sc = statusConst.find(x => { return x.value === status });
  221. return sc ? sc.ratio : null;
  222. };
  223. const getValid = function (type, status, limit) {
  224. if (limit) {
  225. const statusConst = type === 'gxby' ? option.status.gxby : option.status.dagl;
  226. const sc = statusConst.find(x => { return x.value === status; });
  227. return sc ? (sc.limit ? 1 : 0) : 0;
  228. } else {
  229. return -1;
  230. }
  231. };
  232. const check3f = function (data, limit, ratio) {
  233. if (limit === 0) {
  234. if (data.contract_tp || data.pre_contract_tp) return 1; // 违规
  235. }
  236. if (limit === 1) {
  237. if (ratio === 0) {
  238. if (!data.contract_tp && !data.pre_contract_tp) return 2; // 漏计
  239. } else {
  240. const tp = ZhCalc.mul(data.final_1_tp, ZhCalc.div(ratio, 100, 4), decimal.tp);
  241. const checkTp = ZhCalc.add(data.contract_tp, data.pre_contract_tp);
  242. if (tp > checkTp) return 1; // 违规
  243. if (tp < checkTp) return 2; // 漏计
  244. }
  245. }
  246. return 0; // 合法
  247. };
  248. const check3fQty = function (data, limit, ratio, unit) {
  249. if (limit === 0) {
  250. if (data.contract_qty || data.qc_qty || data.pre_contract_qty || data.pre_qc_qty) return 1; // 违规
  251. }
  252. if (limit === 1) {
  253. if (!ratio || ratio === 0) {
  254. if (!data.contract_qty && !data.qc_qty && !data.pre_contract_qty && !data.pre_qc_qty) return 2; // 漏计
  255. } else {
  256. const precision = findPrecision(tenderInfo.precision, unit);
  257. const checkQty = ZhCalc.mul(data.final_1_qty, ZhCalc.div(ratio, 100, 4), precision.value);
  258. const qty = ZhCalc.add(data.contract_qty, data.pre_contract_qty) || 0;
  259. if (qty > checkQty) return 1; // 违规
  260. if (qty < checkQty) return 2; // 漏计
  261. }
  262. }
  263. return 0; // 合法
  264. };
  265. const checkLeafBills3fLimit = function(bills, checkInfo) {
  266. const over = [], lost = [];
  267. const posRange = ledgerPos.getLedgerPos(bills.id);
  268. if (posRange && posRange.length > 0) {
  269. for (const p of posRange) {
  270. const posCheckInfo = _.assign({}, checkInfo);
  271. for (const ct of option.checkType) {
  272. if (p[ct + '_limit'] > 0) {
  273. posCheckInfo[ct + '_limit'] = p[ct + '_limit'];
  274. }
  275. }
  276. for (const ct of option.checkType) {
  277. const checkResult = check3fQty(p, getValid(ct, p[ct + '_status'], posCheckInfo[ct + '_limit']),
  278. getRatio(ct, p[ct + '_status']), bills.unit);
  279. if (checkResult === 1) {
  280. if (over.indexOf(ct) === -1) over.push(ct);
  281. }
  282. if (checkResult === 2) {
  283. if (lost.indexOf(ct) === -1) lost.push(ct);
  284. }
  285. }
  286. }
  287. } else {
  288. for (const ct of option.checkType) {
  289. const checkResult = bills.is_tp
  290. ? check3f(bills, getValid(ct, bills[ct + '_status'], checkInfo[ct + '_limit']), getRatio(ct, bills[ct + '_status']))
  291. : check3fQty(bills, getValid(ct, bills[ct + '_status'], checkInfo[ct + '_limit']), getRatio(ct, bills[ct + '_status']), bills.unit);
  292. if (checkResult === 1) {
  293. if (over.indexOf(ct) === -1) over.push(ct);
  294. }
  295. if (checkResult === 2) {
  296. if (lost.indexOf(ct) === -1) lost.push(ct);
  297. }
  298. }
  299. }
  300. if (over.indexOf('gxby') >= 0) error.gxbyOver.push(bills);
  301. if (over.indexOf('dagl') >= 0) error.daglOver.push(bills);
  302. if (lost.indexOf('gxby') >= 0) error.gxbyLost.push(bills);
  303. if (lost.indexOf('dagl') >= 0) error.daglLost.push(bills);
  304. };
  305. const recursiveCheckBills3fLimit = function (bills, parentCheckInfo) {
  306. const checkInfo = _.assign({}, parentCheckInfo);
  307. for (const ct of option.checkType) {
  308. if (bills[ct + '_limit'] > 0) {
  309. checkInfo[ct + '_limit'] = bills[ct + '_limit'];
  310. }
  311. }
  312. if (bills.children && bills.children.length > 0) {
  313. for (const c of bills.children) {
  314. recursiveCheckBills3fLimit(c, checkInfo);
  315. }
  316. } else {
  317. checkLeafBills3fLimit(bills, checkInfo);
  318. }
  319. };
  320. for (const b of ledgerTree.children) {
  321. recursiveCheckBills3fLimit(b, {});
  322. }
  323. return error;
  324. },
  325. check3fMultiLimit: function(ledgerTree, ledgerPos, decimal, option) {
  326. const error = [];
  327. if (option.limits.length === 0) return error;
  328. const findPrecision = function (list, unit) {
  329. if (unit) {
  330. for (const p in list) {
  331. if (list[p].unit && list[p].unit === unit) {
  332. return list[p];
  333. }
  334. }
  335. }
  336. return list.other;
  337. };
  338. const check3fTp = function (data, limit, range) {
  339. if (limit === 0) {
  340. if (data.contract_tp || data.pre_contract_tp) return 1; // 违规
  341. }
  342. if (limit === 1) {
  343. const lower = ZhCalc.mul(data.total_price, ZhCalc.div(range.lower, 100, 4), decimal.tp);
  344. const upper = ZhCalc.mul(data.total_price, ZhCalc.div(range.upper, 100, 4), decimal.tp);
  345. const checkTp = ZhCalc.add(data.contract_tp, data.pre_contract_tp) || 0;
  346. if (checkTp > upper) return 1; // 违规
  347. if (checkTp < lower) return 2; // 漏计
  348. }
  349. return 0; // 合法
  350. };
  351. const check3fQty = function (data, limit, range, unit) {
  352. if (limit === 0) {
  353. if (data.contract_qty || data.qc_qty || data.pre_contract_qty || data.pre_qc_qty) return 1; // 违规
  354. }
  355. if (limit === 1) {
  356. const precision = findPrecision(tenderInfo.precision, unit);
  357. const lower = ZhCalc.mul(data.final_1_qty, ZhCalc.div(range.lower, 100, 4), precision.value);
  358. const upper = ZhCalc.mul(data.final_1_qty, ZhCalc.div(range.upper, 100, 4), precision.value);
  359. const checkQty = ZhCalc.add(data.contract_qty, data.pre_contract_qty) || 0;
  360. if (checkQty > upper) return 1; // 违规
  361. if (checkQty < lower) return 2; // 漏计
  362. }
  363. return 0; // 合法
  364. };
  365. const valueCheck = {
  366. num(value, checkValue, operation) {
  367. switch (operation) {
  368. case '=':
  369. return !_.isNil(value) ? value === checkValue : false;
  370. case '>':
  371. return !_.isNil(value) ? value > checkValue : false;
  372. case '<':
  373. return !_.isNil(value) ? value < checkValue : false;
  374. case '>=':
  375. return !_.isNil(value) ? value >= checkValue : false;
  376. case '<=':
  377. return !_.isNil(value) ? value <= checkValue : false;
  378. default:
  379. return true;
  380. }
  381. },
  382. date(value, range, operation) {
  383. const curDate = new Date();
  384. switch (operation) {
  385. case '=':
  386. return moment(value).add({ days: range }).isSame(curDate, 'day');
  387. case '>':
  388. return moment(value).add({ days: range }).isBefore(curDate);
  389. case '<':
  390. return moment(value).add({ days: range }).isAfter(curDate);
  391. default:
  392. return true;
  393. }
  394. },
  395. gxby(value, checkValue, operation) {
  396. return valueCheck.num(value, checkValue, operation);
  397. },
  398. dagl(value, checkValue, operation) {
  399. return valueCheck.num(value, checkValue, operation);
  400. },
  401. gxbyDate(checkDate, operation) {
  402. return valueCheck.date(checkDate, operation);
  403. }
  404. };
  405. const checkMultiCondition = function (status, check, condition) {
  406. let result = true;
  407. for (const c of condition) {
  408. const data = !c.source || c.source === '3f' ? status : check;
  409. result = c.rela && c.rela === 'or'
  410. ? (result || valueCheck[c.check](data[c.field], c.value, c.operation))
  411. : (result && valueCheck[c.check](data[c.field], c.value, c.operation));
  412. }
  413. return result;
  414. };
  415. const checkMulti3f = function(bills, checkData, statusData, limitOption) {
  416. if (!checkMultiCondition(statusData, checkData, limitOption.condition)) return;
  417. if (bills.is_tp) return check3fTp(checkData, limitOption.limit, limitOption);
  418. return check3fQty(checkData, limitOption.limit, limitOption, bills.unit);
  419. };
  420. const getErrorInfo = function(bills, lo, checkResult, pos = null) {
  421. if (!checkResult || checkResult <= 0) return;
  422. const errorType = checkResult === 1 ? '超计' : '漏计';
  423. if (!lo.rangeHint) lo.rangeHint = lo.limit ? (lo.lower === lo.upper ? `${lo.lower}%` : `${lo.lower}%~${lo.upper}%`) : '不允许计量';
  424. if (pos) {
  425. error.push({ledger_id: ledgerTree.getNodeKey(bills), pid: pos.id, code: pos.code, b_code: '', name: pos.name, data: pos, errorType: 's2b_multi', memo: `${errorType}:${lo.hint}(${lo.rangeHint})` });
  426. } else {
  427. error.push({ledger_id: ledgerTree.getNodeKey(bills), pid: '', code: bills.code, b_code: bills.b_code, name: bills.name, data: bills, errorType: 's2b_multi', memo: `${errorType}:${lo.hint}(${lo.rangeHint})` });
  428. }
  429. };
  430. const checkLeafBills3fMultiLimit = function(bills, multiLimit, leafXmj) {
  431. if (!multiLimit) return;
  432. const limitOption = option.limits.find(x => { return x.limit_id === multiLimit });
  433. if (!limitOption) return;
  434. const posRange = ledgerPos.getLedgerPos(bills.id);
  435. if (posRange && posRange.length > 0) {
  436. for (const p of posRange) {
  437. for (const lo of limitOption.options) {
  438. const checkResult = checkMulti3f(bills, p, p, lo);
  439. getErrorInfo(bills, lo, checkResult, p);
  440. }
  441. }
  442. } else {
  443. for (const lo of limitOption.options) {
  444. const checkResult = checkMulti3f(bills, bills, leafXmj, lo);
  445. getErrorInfo(bills, lo, checkResult);
  446. }
  447. }
  448. };
  449. const recursiveCheckBills3fMultiLimit = function (bills, parentLimit = '', leafXmj = null) {
  450. const limit = bills.multi_limit || parentLimit;
  451. if (bills.children && bills.children.length > 0) {
  452. for (const c of bills.children) {
  453. recursiveCheckBills3fMultiLimit(c, limit, c.b_code ? (bills.b_code ? leafXmj : bills) : c);
  454. }
  455. } else {
  456. checkLeafBills3fMultiLimit(bills, limit, bills.b_code ? leafXmj : bills);
  457. }
  458. };
  459. for (const x of ledgerTree.children) {
  460. recursiveCheckBills3fMultiLimit(x);
  461. }
  462. return error;
  463. },
  464. };
  465. const ledgerCheck2 = async function (setting) {
  466. const ledger = setting.ledgerTree, ledgerPos = setting.ledgerPos, decimal = setting.decimal;
  467. const checkOption = setting.checkOption;
  468. const assignWarningData = function (nodes, checkType, warningData) {
  469. for (const node of nodes) {
  470. warningData.push({
  471. type: checkType,
  472. ledger_id: node.ledger_id,
  473. pid: node.pid,
  474. code: node.code,
  475. b_code: node.b_code,
  476. name: node.name,
  477. memo: node.memo,
  478. })
  479. }
  480. };
  481. const checkData = {
  482. check_time: new Date(),
  483. warning_data: [],
  484. };
  485. const progressData = [];
  486. for (const prop in ledgerCheckType) {
  487. if (!checkOption[prop] || !checkOption[prop].enable) continue;
  488. const checkInfo = ledgerCheckType[prop];
  489. if (checkInfo.items) {
  490. const errors = ledgerCheckUtil[checkInfo.fun](ledger, ledgerPos, decimal, checkOption[prop]) || {};
  491. for (const i of checkInfo.items) {
  492. if (checkOption[prop].checkType.indexOf(i.type) < 0) continue;
  493. assignWarningData(errors[i.key], i.value, checkData.warning_data);
  494. progressData.push({key: prop + i.key, caption: i.text, error: errors[i.key].length});
  495. }
  496. } else if (checkInfo.url) {
  497. const errors = await postDataAsync(checkInfo.url, {}, false);
  498. if (errors && errors[prop]) {
  499. errors[prop].forEach(mcb => {
  500. checkData.warning_data.push({
  501. type: checkInfo.value, code: mcb.memo, b_code: mcb.b_code, name: mcb.name, lid: mcb.lid, pid: mcb.pid,
  502. });
  503. });
  504. }
  505. progressData.push({key: prop, caption: checkInfo.text, error: errors && errors[prop] ? errors[prop].length : 0});
  506. } else {
  507. const errors = ledgerCheckUtil[checkInfo.fun](ledger, ledgerPos, decimal, checkOption[prop]) || [];
  508. assignWarningData(errors, checkInfo.value, checkData.warning_data);
  509. progressData.push({key: prop, caption: checkInfo.text, error: errors.length});
  510. }
  511. }
  512. setting.checkList.clearCheckData();
  513. if (checkData.warning_data.length > 0) {
  514. setting.checkList.loadCheckData(checkData);
  515. } else {
  516. setting.checkList.hide();
  517. }
  518. return progressData;
  519. };
  520. const getCheckType = function (option) {
  521. const result = {};
  522. for (const o in option) {
  523. if (option[o].enable) {
  524. if (ledgerCheckType[o].items) {
  525. for (const i of ledgerCheckType[o].items) {
  526. result[o + i.key] = i;
  527. }
  528. } else {
  529. result[o] = ledgerCheckType[o];
  530. }
  531. }
  532. }
  533. return result;
  534. };