compilation.js 45 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283
  1. /**
  2. * 编办管理相关js
  3. *
  4. * @author CaiAoLin
  5. * @date 2017/7/28
  6. * @version
  7. */
  8. const delayTime = 500;
  9. let keyupTime;
  10. function delayKeyup(callback) {
  11. let nowTime = Date.now();
  12. keyupTime = nowTime;
  13. setTimeout(function () {
  14. if (nowTime - keyupTime == 0 && callback) {
  15. callback();
  16. }
  17. }, delayTime);
  18. }
  19. $(document).ready(function () {
  20. let isAdding = false;
  21. let model = '';
  22. let section = 'bill';
  23. let id = $("#compilation-id").val();
  24. // 计价规则页面初始化数据
  25. if ($("#save-lib").length > 0) {
  26. initCompilation();
  27. }
  28. // 计价类型选择
  29. $(".nav-tabs li > a").click(function () {
  30. section = $(this).attr("aria-controls");
  31. });
  32. // 新增编办
  33. $("#add-compilation").click(function () {
  34. try {
  35. let data = getAndValidData(model);
  36. let url = '/compilation/add'
  37. if (model === 'all') {
  38. // 新增编办操作
  39. $.ajax({
  40. url: url,
  41. type: 'post',
  42. data: { name: data.name },
  43. error: function () {
  44. isAdding = false;
  45. },
  46. beforeSend: function () {
  47. isAdding = true;
  48. },
  49. success: function (response) {
  50. isAdding = false;
  51. if (response.err === 0) {
  52. window.location.reload();
  53. } else {
  54. let msg = response.msg === undefined ? '未知错误' : response.msg;
  55. alert(msg);
  56. }
  57. }
  58. });
  59. } else {
  60. // 新增标准清单/定额库
  61. let addLib = {
  62. name: data[model].name,
  63. id: data[model].id
  64. };
  65. // 判断是否有重复的数据
  66. if ($("input:hidden[name='" + model + "_lib'][data-id='" + addLib.id + "']").length > 0) {
  67. alert('重复添加数据!');
  68. return false;
  69. }
  70. let removeHtml = '<a class="pull-right text-danger remove-lib" data-model="' + model + '" ' +
  71. 'title="移除"><span class="glyphicon glyphicon-remove"></span></a>';
  72. let tmpHtml = '<p class="form-control-static">' + removeHtml + addLib.name +
  73. '<input type="hidden" data-id="' + addLib.id + '" name=\'' + model + '_lib\' value=\'' + JSON.stringify(addLib) + '\'>' + '</p>';
  74. $("." + model + "-list").append(tmpHtml);
  75. $('#addcompilation').modal('hide');
  76. }
  77. } catch (error) {
  78. alert(error);
  79. }
  80. });
  81. $("#addTaxGroupBtn").click(function () {
  82. $('#groupEditType').val("add");
  83. $("#taxType").val("");
  84. $("#program_lib").val("");
  85. $("#template_lib").val("");
  86. $("#col_lib").val("");
  87. $("#fee_lib").val("");
  88. $("#norm_lib").val("");
  89. });
  90. //新增计税组合
  91. $("#add-group").click(function () {
  92. let taxMap = { "1": "一般计税", "2": "简易计税" };
  93. let actionType = $('#groupEditType').val();
  94. let normValue = $('#norm_lib').val();
  95. let groupData = getTaxGroupData();
  96. let groupIndex = getGroupIndex(groupData);//用来做重复判断
  97. if (!_.isEmpty(groupData)) {
  98. //重复判断 todo
  99. if ($("input[data-id = " + groupIndex + "]").length <= 0) {
  100. let taxName = groupData.taxType ? taxMap[groupData.taxType] : '';
  101. let p_name = groupData.program_lib ? groupData.program_lib.displayName : "";
  102. let t_name = groupData.template_lib ? groupData.template_lib.name : "";
  103. let c_name = groupData.col_lib ? groupData.col_lib.name : "";
  104. let f_name = groupData.fee_lib ? groupData.fee_lib.name : "";
  105. let htmlString = "<tr class='taxGroup_tr'><td><span>" + taxName + "</span></td>" +
  106. "<td><span>" + p_name + "</span></td>" +
  107. "<td><span>" + normValue + "</span></td>" +
  108. "<td><span>" + t_name + "</span></td>" +
  109. "<td><span>" + c_name + "</span></td>" +
  110. "<td><span>" + f_name + "</span></td>" +
  111. "<td> <a class='btn btn-link btn-sm' style='padding: 0px' onclick='editTaxGroup(this)'> 编辑</a>/<a class='btn btn-link btn-sm ' style='padding: 0px' onclick='deleteTableTr(this,\"taxGroup_tr\")'>删除</a> " +
  112. "<input type='hidden' name='tax_group' data-id ='" + groupIndex + "' value='" + JSON.stringify(groupData) + "'>" +
  113. "</td>" +
  114. "</tr>";
  115. if (actionType == "add") {
  116. $("#tax_group_tbody").append(htmlString);
  117. } else if (actionType == "modify") {
  118. let oldIndex = $("#groupIndex").val();
  119. let parentTr = $("input[data-id = " + oldIndex + "]").parents(".taxGroup_tr");
  120. parentTr.after(htmlString);
  121. parentTr.remove();
  122. }
  123. } else {
  124. alert("已存在相同的组合!");
  125. }
  126. }
  127. $("#addTaxGroup").modal('hide');
  128. });
  129. //新增定额库
  130. /* $("#add-ration").click(function () {
  131. let rationLib = $("select[name='ration_lib']").children("option:selected").val();
  132. let rationLibString = $("select[name='ration_lib']").children("option:selected").text();
  133. if (rationLib == undefined || rationLib == '') {
  134. alert("请选择定额库");
  135. return;
  136. }
  137. if ($("input:hidden[name=ration_lib][data-id = " + rationLib + "]").length <= 0) {
  138. let tem = {
  139. id: rationLib,
  140. name: rationLibString,
  141. isDefault: false
  142. };
  143. let htmlString = `
  144. <tr class='ration_tr' draggable="true">
  145. <td><span class="cursor-default">${tem.name}</span></td>
  146. <td><label class="form-check-label"> <input class="form-check-input" name="ration_isDefault" value="${tem.id}" type="radio"></td>
  147. <td>
  148. <a class='btn btn-link btn-sm ' style="padding: 0px" onclick='deleteTableTr(this,"ration_tr")'>删除</a>
  149. <input type="hidden" name="ration_lib" data-id="${tem.id}" value='${JSON.stringify(tem)}'>
  150. </td>
  151. </tr>`
  152. $("#ration_tbody").append(htmlString);
  153. } else {
  154. alert('已存在相同的定额库')
  155. }
  156. $("#addRation").modal('hide');
  157. }); */
  158. $("#add-ration").click(function () {
  159. const options = $("select[name='ration_lib']").children("option:selected");
  160. let alertArr = [];
  161. let htmlString = '';
  162. for (const option of options) {
  163. const rationLib = $(option).val();
  164. const rationLibString = $(option).text();
  165. if (!rationLib) {
  166. alertString.push(`“${rationLibString}”为无效定额库`);
  167. continue;
  168. }
  169. if ($("input:hidden[name=ration_lib][data-id = " + rationLib + "]").length > 0) {
  170. alertArr.push(`“${rationLibString}”已存在`);
  171. continue;
  172. }
  173. const tem = {
  174. id: rationLib,
  175. name: rationLibString,
  176. isDefault: false
  177. };
  178. htmlString += `
  179. <tr class='ration_tr' draggable="true">
  180. <td><span class="cursor-default">${tem.name}</span></td>
  181. <td><label class="form-check-label"> <input class="form-check-input" name="ration_isDefault" value="${tem.id}" type="radio"></td>
  182. <td>
  183. <a class='btn btn-link btn-sm ' style="padding: 0px" onclick='deleteTableTr(this,"ration_tr")'>删除</a>
  184. <input type="hidden" name="ration_lib" data-id="${tem.id}" value='${JSON.stringify(tem)}'>
  185. </td>
  186. </tr>`;
  187. }
  188. if (alertArr.length) {
  189. alert(alertArr.join('\n'));
  190. } else {
  191. $("#ration_tbody").append(htmlString);
  192. $("#addRation").modal('hide');
  193. }
  194. });
  195. // 复制定额库
  196. $('#copy-lib-confirm').click(async function () {
  197. try {
  198. $.bootstrapLoading.start();
  199. const [valuationID, engineeringID] = window.location.pathname.split('/').slice(-2);
  200. await ajaxPost('/compilation/copyRationLibs', { valuationID, engineeringID });
  201. } catch (err) {
  202. console.log(err);
  203. } finally {
  204. $.bootstrapLoading.end();
  205. }
  206. });
  207. // 复制计价规则
  208. let orgValuationID;
  209. let valuationType;
  210. $('.copy-bill-valuation').click(function () {
  211. valuationType = 'bill_valuation';
  212. orgValuationID = $(this).data('id');
  213. console.log(orgValuationID);
  214. $('#copy-valuation-modal').modal('show');
  215. });
  216. $('.copy-ration-valuation').click(function () {
  217. valuationType = 'ration_valuation';
  218. orgValuationID = $(this).data('id');
  219. console.log(orgValuationID);
  220. $('#copy-valuation-modal').modal('show');
  221. });
  222. $('#copy-valuation-confirm').click(async function () {
  223. const newName = $('#valuation-name').val();
  224. console.log(newName);
  225. if (!newName) {
  226. alert('请输入计价规则');
  227. return;
  228. }
  229. const compilationID = window.location.search.replace('?id=', '');
  230. $.bootstrapLoading.start();
  231. await ajaxPost('/compilation/copyValuation', { compilationID, valuationType, orgValuationID, newName });
  232. $.bootstrapLoading.end();
  233. window.location.reload();
  234. })
  235. // 拖动排序
  236. const dragSelector = '.ration_tr[draggable=true]';
  237. const rationBodySelector = '#ration_tbody';
  238. const wrapper = $('.panel-content')[0];
  239. let dragged;
  240. let rID = null;
  241. const scrollStep = 6;
  242. // 表格数据过多的时候,靠下方的条目想要移动到上方,需要滚动条滚动到相应位置,滚动条向上滚动需要代码自行处理
  243. function scroll(ele, step) {
  244. wrapper.scrollTop -= step;
  245. rID = window.requestAnimationFrame(() => {
  246. scroll(ele, step);
  247. });
  248. }
  249. // 动态绑定(新增的也能监听到)
  250. $(rationBodySelector).on('drag', dragSelector, function (ev) {
  251. const { clientX, clientY } = ev;
  252. const dom = document.elementFromPoint(clientX, clientY);
  253. if (dom.tagName === 'H2' && !rID) {
  254. rID = window.requestAnimationFrame(() => {
  255. scroll(wrapper, scrollStep);
  256. })
  257. } else if (dom.tagName !== 'H2' && rID) {
  258. window.cancelAnimationFrame(rID);
  259. rID = null;
  260. }
  261. });
  262. $(rationBodySelector).on('dragstart', dragSelector, function (ev) {
  263. dragged = this;
  264. $(this).addClass('dragging');
  265. ev.originalEvent.dataTransfer.effectAllowed = 'move';
  266. });
  267. $(rationBodySelector).on('dragend', dragSelector, function (ev) {
  268. $(this).removeClass('dragging');
  269. if (rID) {
  270. window.cancelAnimationFrame(rID);
  271. rID = null;
  272. }
  273. });
  274. $(rationBodySelector).on('dragover', dragSelector, function (ev) {
  275. ev.preventDefault(); // 必须调用此方法,否则drop事件不触发
  276. });
  277. $(rationBodySelector).on('dragenter', dragSelector, function (ev) {
  278. if (this !== dragged) {
  279. $(this).addClass('highlight');
  280. }
  281. });
  282. $(rationBodySelector).on('dragleave', dragSelector, function (ev) {
  283. if (this !== dragged) {
  284. $(this).removeClass('highlight');
  285. }
  286. });
  287. $(rationBodySelector).on('drop', dragSelector, function (ev) {
  288. $(this).removeClass('highlight');
  289. $(this).after($(dragged));
  290. });
  291. // 新增计价规则
  292. $("#add-valuation").click(function () {
  293. try {
  294. if (id === '') {
  295. throw '页面数据有误';
  296. }
  297. let name = $("input[name='valuation_name']").val();
  298. if (name === '') {
  299. throw '请填写计价规则名称';
  300. }
  301. $.ajax({
  302. url: '/compilation/add-valuation',
  303. type: 'post',
  304. data: { name: name, id: id, section: section },
  305. error: function () {
  306. isAdding = false;
  307. },
  308. beforeSend: function () {
  309. isAdding = true;
  310. },
  311. success: function (response) {
  312. isAdding = false;
  313. if (response.err === 0) {
  314. window.location.reload();
  315. } else {
  316. let msg = response.msg === undefined ? '未知错误' : response.msg;
  317. alert(msg);
  318. }
  319. }
  320. });
  321. } catch (error) {
  322. alert(error);
  323. return false;
  324. }
  325. });
  326. // 添加
  327. $(".add-compilation").click(function () {
  328. model = $(this).data('model');
  329. $("#addcompilation .modal-body > div").hide();
  330. switch (model) {
  331. case 'all':
  332. $("#name-area").show();
  333. $("#add-compilation-title").text('添加新费用定额');
  334. break;
  335. case 'bill':
  336. $("#bill-area").show();
  337. $("#add-compilation-title").text('添加标准清单');
  338. break;
  339. case 'ration':
  340. $("#ration-area").show();
  341. $("#add-compilation-title").text('添加定额库');
  342. break;
  343. case 'glj':
  344. $("#glj-area").show();
  345. $("#add-compilation-title").text('添加定额库');
  346. break;
  347. case 'billsGuidance':
  348. $("#billsGuidance-area").show();
  349. $("#add-compilation-title").text('添加清单指引库');
  350. break;
  351. case 'fee':
  352. $("#fee-area").show();
  353. $("#add-compilation-title").text('添加费率标准');
  354. break;
  355. case 'artificial':
  356. $("#artificial-area").show();
  357. $("#add-compilation-title").text('添加人工系数');
  358. break;
  359. case 'program':
  360. $("#program-area").show();
  361. $("#add-compilation-title").text('添加计算程序');
  362. break;
  363. case 'feature':
  364. $("#feature-area").show();
  365. $("#add-compilation-title").text('添加工程特征');
  366. break;
  367. case 'info':
  368. $('#info-area').show();
  369. $('#add-compilation-title').text('添加基本信息');
  370. break;
  371. case 'progressive':
  372. $("#progressive-area").show();
  373. $("#add-compilation-title").text('添加累进区间');
  374. break;
  375. case 'engineer_info':
  376. $('#engineer-info-area').show();
  377. $('#add-compilation-title').text('添加工程信息');
  378. break;
  379. case 'engineer_feature':
  380. $('#engineer-feature-area').show();
  381. $('#add-compilation-title').text('添加工程特征指标');
  382. break;
  383. case 'material':
  384. $('#material-area').show();
  385. $('#add-compilation-title').text('添加主要工料指标');
  386. break;
  387. case 'main_quantity':
  388. $('#main-quantity-area').show();
  389. $('#add-compilation-title').text('添加主要工程量指标');
  390. break;
  391. case 'economic':
  392. $('#economic-area').show();
  393. $('#add-compilation-title').text('添加主要经济指标');
  394. break;
  395. case 'over_height':
  396. $('#over-height-area').show();
  397. $('#add-compilation-title').text('添加超高降效');
  398. break;
  399. }
  400. $("#addcompilation").modal('show');
  401. });
  402. // 保存专业工程标准库
  403. $("#save-lib").click(function () {
  404. if (validLib()) {
  405. $("form").submit();
  406. }
  407. });
  408. // 保存计价规则
  409. $("#save-valuation").click(function () {
  410. $("#saveValuation").submit();
  411. });
  412. // 移除操作
  413. /*$(".remove-lib").on("click", function() {
  414. $(this).parent().remove();
  415. })*/
  416. $(".bill-list, .ration-list, .glj-list, .fee-list, .artificial-list, .program-list, .billsGuidance-list,.feature-list,.info-list,.progressive-list,.engineer_info-list,.engineer_feature-list,.material-list,.main_quantity-list,.economic-list,.over_height-list").on("click", ".remove-lib", function () {
  417. $(this).parent().remove();
  418. });
  419. //更改描述
  420. $('#description').change(function () {
  421. let description = $(this).val();
  422. $.ajax({
  423. url: '/compilation/setDescription',
  424. type: 'post',
  425. dataType: "json",
  426. data: { id: id, description: description },
  427. success: function (response) {
  428. if (response.err !== 0) {
  429. alert('更改失败');
  430. }
  431. }
  432. });
  433. });
  434. //更改版本号
  435. $('#edition').change(function () {
  436. let edition = $(this).val();
  437. $.ajax({
  438. url: '/compilation/setEdition',
  439. type: 'post',
  440. dataType: "json",
  441. data: { id: id, edition: edition },
  442. success: function (response) {
  443. if (response.err !== 0) {
  444. alert('更改失败');
  445. }
  446. }
  447. });
  448. });
  449. //更改代码覆盖路径
  450. $('#overWriteUrl').change(function () {
  451. let overWriteUrl = $(this).val();
  452. if (overWriteUrl == "") overWriteUrl = undefined;
  453. $.ajax({
  454. url: '/compilation/setOverWriteUrl',
  455. type: 'post',
  456. dataType: "json",
  457. data: { id: id, overWriteUrl: overWriteUrl },
  458. success: function (response) {
  459. if (response.err !== 0) {
  460. alert('更改失败');
  461. }
  462. }
  463. });
  464. });
  465. //例题建设项目ID, 用英文字符;分隔建设项目ID
  466. $('#example').keyup(function () {
  467. let exampleVal = $(this).val();
  468. let example = exampleVal.split(/[;,;]/g);
  469. example = Array.from(new Set(example));
  470. delayKeyup(function () {
  471. $.ajax({
  472. url: '/compilation/setExample',
  473. type: 'post',
  474. dataType: "json",
  475. data: { id: id, example: example },
  476. success: function (response) {
  477. if (response.err !== 0) {
  478. alert('更改失败');
  479. }
  480. }
  481. });
  482. });
  483. });
  484. // 计价规则启用/禁止
  485. $(".enable").click(function () {
  486. let goingChangeStatus = switchChange($(this));
  487. let id = $(this).data('id');
  488. if (id === undefined || id === '' || isAdding) {
  489. return false;
  490. }
  491. $.ajax({
  492. url: '/compilation/valuation/' + section + '/enable',
  493. type: 'post',
  494. dataType: "json",
  495. data: { id: id, enable: goingChangeStatus },
  496. error: function () {
  497. isAdding = false;
  498. switchChange($(this));
  499. },
  500. beforeSend: function () {
  501. isAdding = true;
  502. },
  503. success: function (response) {
  504. isAdding = false;
  505. if (response.err !== 0) {
  506. switchChange($(this));
  507. alert('更改失败');
  508. }
  509. }
  510. });
  511. });
  512. // 设置适用类型
  513. $(".fileType").change(function () {
  514. let id = $(this).data('id');
  515. if (id === undefined || id === '' || isAdding) {
  516. return false;
  517. }
  518. let fileTypes = [];
  519. let oldVal = $(this).attr("checked");
  520. if (oldVal) {
  521. $(this).removeAttr("checked")
  522. } else {
  523. $(this).attr("checked", "checked")
  524. }
  525. if ($('#' + id + '_gusuan').attr("checked")) fileTypes.push(15);
  526. if ($('#' + id + '_estimate').attr("checked")) fileTypes.push(5);
  527. if ($('#' + id + '_submission').attr("checked")) fileTypes.push(1);
  528. if ($('#' + id + '_changeBudget').attr("checked")) fileTypes.push(4);
  529. if($('#'+id+'_settlement').attr("checked")) fileTypes.push(10);
  530. let current = $(this);
  531. console.log(id, this);
  532. $.ajax({
  533. url: '/compilation/valuation/' + section + '/fileTypes',
  534. type: 'post',
  535. dataType: "json",
  536. data: { id: id, fileTypes: fileTypes },
  537. error: function () {
  538. //恢复原值
  539. if (oldVal) {
  540. current.attr("checked", "checked")
  541. } else {
  542. current.removeAttr("checked")
  543. }
  544. },
  545. success: function (response) {
  546. if (response.err !== 0) {
  547. switchChange($(this));
  548. alert('更改失败');
  549. }
  550. }
  551. });
  552. });
  553. //计价规则删除
  554. $('#delete-confirm').click(function () {
  555. let id = $('#del').attr('selectedId');
  556. if (id === undefined || id === '') {
  557. return false;
  558. }
  559. window.location.href = `/compilation/valuation/bill/delete/${id}`;
  560. });
  561. // 发布编办
  562. $("#release").click(function () {
  563. let id = $(this).data("id");
  564. let status = $(this).data("status");
  565. status = parseInt(status);
  566. if (isAdding || id === '' || isNaN(status)) {
  567. return false;
  568. }
  569. $.ajax({
  570. url: '/compilation/release',
  571. type: 'post',
  572. data: { id: id, status: status },
  573. dataType: "json",
  574. error: function () {
  575. isAdding = false;
  576. },
  577. beforeSend: function () {
  578. isAdding = true;
  579. },
  580. success: function (response) {
  581. isAdding = false;
  582. if (response.err === 0) {
  583. window.location.reload();
  584. } else {
  585. let msg = response.msg === undefined ? "未知错误" : response.msg;
  586. alert(msg);
  587. }
  588. }
  589. });
  590. });
  591. //添加工程专业
  592. $("#addEngineerConfirm").click(async function () {
  593. if ($('#name').val() == '') {
  594. $("#nameError").show();
  595. return;
  596. }
  597. if ($('#feeName').val() == '') {
  598. $("#feeNameError").show();
  599. return;
  600. }
  601. if ($('#engineeringInput').val() == '') {
  602. $("#engineeringError").show();
  603. return;
  604. }
  605. if ($('#projectEngineering').val() == '') {
  606. $("#projectError").show();
  607. return;
  608. }
  609. $("#addEngineerConfirm").attr("disabled", true);//防止重复提交
  610. $("#addEngineerForm").submit();
  611. });
  612. //
  613. // CLD 办事处选择
  614. $('#category-select').change(function () {
  615. $.ajax({
  616. url: '/compilation/changeCategory',
  617. type: 'post',
  618. data: { id: id, category: $(this).val() },
  619. dataType: "json",
  620. success: function (response) {
  621. if (response.error !== 0) {
  622. alert('更改失败');
  623. }
  624. }
  625. });
  626. })
  627. // 选择默认所在地
  628. $('#location-select').change(function () {
  629. $.ajax({
  630. url: '/compilation/changeLocation',
  631. type: 'post',
  632. data: {id: id, location: $(this).val()},
  633. dataType: "json",
  634. success: function(response) {
  635. if (response.error !== 0) {
  636. alert('更改失败');
  637. }
  638. }
  639. });
  640. })
  641. // 修改是否提供免费版
  642. $('#freeUse').change(function () {
  643. $.ajax({
  644. url: '/compilation/changeFreeUse',
  645. type: 'post',
  646. data: {id: id, freeUse: $(this).val()},
  647. dataType: "json",
  648. success: function(response) {
  649. if (response.error !== 0) {
  650. alert('更改失败');
  651. }
  652. }
  653. });
  654. })
  655. });
  656. /**
  657. * 初始化
  658. *
  659. * @return {void|boolean}
  660. */
  661. function initCompilation() {
  662. let billListData = billList === undefined ? [] : JSON.parse(billList);
  663. let rationLibData = rationList === undefined ? [] : JSON.parse(rationList);
  664. let gljLibData = gljList === undefined ? [] : JSON.parse(gljList);
  665. let feeLibData = feeRateList === undefined ? [] : JSON.parse(feeRateList);
  666. let artificialCoefficientData = artificialCoefficientList === undefined ? [] : JSON.parse(artificialCoefficientList);
  667. let programData = programList === undefined ? [] : JSON.parse(programList);
  668. let billsGuidanceData = billsGuidanceList === undefined ? [] : JSON.parse(billsGuidanceList);
  669. let billTemplateData = billTemplateList == undefined ? [] : JSON.parse(billTemplateList);
  670. let mainTreeColData = mainTreeColList == undefined ? [] : JSON.parse(mainTreeColList);
  671. let featureData = featureList == undefined ? [] : JSON.parse(featureList);
  672. let infoData = infoList == undefined ? [] : JSON.parse(infoList);
  673. let progressiveData = progressiveList == undefined ? [] : JSON.parse(progressiveList);
  674. let engineerInfoData = engineerInfoList == undefined ? [] : JSON.parse(engineerInfoList);
  675. let engineerFeatureData = engineerFeatureList == undefined ? [] : JSON.parse(engineerFeatureList);
  676. let materialData = materialList == undefined ? [] : JSON.parse(materialList);
  677. let mainQuantityData = mainQuantityList == undefined ? [] : JSON.parse(mainQuantityList);
  678. let economicData = economicList == undefined ? [] : JSON.parse(economicList);
  679. let overHeightData = overHeightList == undefined ? [] : JSON.parse(overHeightList);
  680. /*mainTreeCol = mainTreeCol !== '' ? mainTreeCol.replace(/\n/g, '\\n') : mainTreeCol;
  681. billsTemplateData = billsTemplateData.replace(/\n/g, '\\n');
  682. let mainTreeColObj = mainTreeCol === '' ? {} : JSON.parse(mainTreeCol);
  683. // 初始化 造价书列设置
  684. colSpread = TREE_SHEET_HELPER.createNewSpread($('#main-tree-col')[0]);
  685. let billsTemplateTree = idTree.createNew({id: 'ID', pid: 'ParentID', nid: 'NextSiblingID', rootId: -1});
  686. billsTemplateTree.loadDatas(JSON.parse(billsTemplateData));
  687. if (mainTreeCol !== '' && mainTreeColObj.cols.length > 0) {
  688. TREE_SHEET_HELPER.loadSheetHeader(mainTreeColObj, colSpread.getActiveSheet());
  689. TREE_SHEET_HELPER.showTreeData(mainTreeColObj, colSpread.getActiveSheet(), billsTemplateTree);
  690. }*/
  691. /* if (billListData.length <= 0 || rationLibData.length <= 0 || gljLibData.length <= 0) {
  692. return false;
  693. } */
  694. // 标准清单
  695. let html = '';
  696. for (let tmp of billListData) {
  697. let tmpHtml = '<option value="' + tmp.id + '">' + tmp.name + '</option>';
  698. html += tmpHtml;
  699. }
  700. $("select[name='standard_bill']").children("option").first().after(html);
  701. // 定额库
  702. html = '';
  703. for (let tmp of rationLibData) {
  704. let tmpHtml = '<option value="' + tmp.id + '">' + tmp.name + '</option>';
  705. html += tmpHtml;
  706. }
  707. $("select[name='ration_lib']").html(html);
  708. // 工料机库
  709. html = '';
  710. for (let tmp of gljLibData) {
  711. let tmpHtml = '<option value="' + tmp.id + '">' + tmp.name + '</option>';
  712. html += tmpHtml;
  713. }
  714. $("select[name='glj_lib']").children("option").first().after(html);
  715. // 清单指引库
  716. html = '';
  717. for (let tmp of billsGuidanceData) {
  718. let tmpHtml = '<option value="' + tmp.ID + '">' + tmp.name + '</option>';
  719. html += tmpHtml;
  720. }
  721. $("select[name='billsGuidance_lib']").children("option").first().after(html);
  722. // 人工系数标准库
  723. html = '';
  724. for (let tmp of artificialCoefficientData) {
  725. let tmpHtml = '<option value="' + tmp.id + '">' + tmp.name + '</option>';
  726. html += tmpHtml;
  727. }
  728. $("select[name='artificial_lib']").children("option").first().after(html);
  729. // 计算程序标准库
  730. html = '';
  731. for (let tmp of programData) {
  732. let tmpHtml = '<option value="' + tmp.id + '">' + tmp.displayName + '</option>';
  733. html += tmpHtml;
  734. }
  735. $("select[name='program_lib']").children("option").first().after(html);
  736. //模板库
  737. html = '';
  738. for (let tmp of billTemplateData) {
  739. let tmpHtml = '<option value="' + tmp.ID + '">' + tmp.name + '</option>';
  740. html += tmpHtml;
  741. }
  742. $("select[name='template_lib']").children("option").first().after(html);
  743. //列设置
  744. html = '';
  745. for (let tmp of mainTreeColData) {
  746. let tmpHtml = '<option value="' + tmp.ID + '">' + tmp.name + '</option>';
  747. html += tmpHtml;
  748. }
  749. $("select[name='col_lib']").children("option").first().after(html);
  750. // 费率标准库
  751. html = '';
  752. for (let tmp of feeLibData) {
  753. let tmpHtml = '<option value="' + tmp.id + '">' + tmp.name + '</option>';
  754. html += tmpHtml;
  755. }
  756. $("select[name='fee_lib']").children("option").first().after(html);
  757. //工程特征库
  758. html = '';
  759. for (let tmp of featureData) {
  760. let tmpHtml = '<option value="' + tmp.ID + '">' + tmp.name + '</option>';
  761. html += tmpHtml;
  762. }
  763. $("select[name='feature_lib']").children("option").first().after(html);
  764. //基本信息库
  765. html = '';
  766. for (let tmp of infoData) {
  767. let tmpHtml = '<option value="' + tmp.ID + '">' + tmp.name + '</option>';
  768. html += tmpHtml;
  769. }
  770. $("select[name='info_lib']").children("option").first().after(html);
  771. //累进区间库
  772. html = '';
  773. for (let tmp of progressiveData) {
  774. let tmpHtml = '<option value="' + tmp.ID + '">' + tmp.name + '</option>';
  775. html += tmpHtml;
  776. }
  777. $("select[name='progressive_lib']").children("option").first().after(html);
  778. //工程信息库
  779. html = '';
  780. for (let tmp of engineerInfoData) {
  781. let tmpHtml = '<option value="' + tmp.ID + '">' + tmp.name + '</option>';
  782. html += tmpHtml;
  783. }
  784. $("select[name='engineer_info_lib']").children("option").first().after(html);
  785. //工程特征指标库
  786. html = '';
  787. for (let tmp of engineerFeatureData) {
  788. let tmpHtml = '<option value="' + tmp.ID + '">' + tmp.name + '</option>';
  789. html += tmpHtml;
  790. }
  791. $("select[name='engineer_feature_lib']").children("option").first().after(html);
  792. //主要工料指标库
  793. html = '';
  794. for (let tmp of materialData) {
  795. let tmpHtml = '<option value="' + tmp.ID + '">' + tmp.name + '</option>';
  796. html += tmpHtml;
  797. }
  798. $("select[name='material_lib']").children("option").first().after(html);
  799. //主要工程量指标库
  800. html = '';
  801. for (let tmp of mainQuantityData) {
  802. let tmpHtml = '<option value="' + tmp.ID + '">' + tmp.name + '</option>';
  803. html += tmpHtml;
  804. }
  805. $("select[name='main_quantity_lib']").children("option").first().after(html);
  806. //主要经济指标库
  807. html = '';
  808. for (let tmp of economicData) {
  809. let tmpHtml = '<option value="' + tmp.ID + '">' + tmp.name + '</option>';
  810. html += tmpHtml;
  811. }
  812. $("select[name='economic_lib']").children("option").first().after(html);
  813. //超高降效
  814. html = '';
  815. for (let tmp of overHeightData) {
  816. let tmpHtml = '<option value="' + tmp.ID + '">' + tmp.name + '</option>';
  817. html += tmpHtml;
  818. }
  819. $("select[name='over_height_lib']").children("option").first().after(html);
  820. }
  821. /**
  822. * 校验数据
  823. *
  824. * @param {String} model
  825. * @return {Object}
  826. */
  827. function getAndValidData(model) {
  828. let name = $("input[name='compilation_name']").val();
  829. let standardBill = $("select[name='standard_bill']").children("option:selected").val();
  830. let rationLib = $("select[name='ration_lib']").children("option:selected").val();
  831. let gljLib = $("select[name='glj_lib']").children("option:selected").val();
  832. // let feeLib = $("select[name='fee_lib']").children("option:selected").val();
  833. let artificialLib = $("select[name='artificial_lib']").children("option:selected").val();
  834. let programLib = $("select[name='program_lib']").children("option:selected").val();
  835. let billsGuidanceLib = $("select[name='billsGuidance_lib']").children("option:selected").val();
  836. let featureLib = $("select[name='feature_lib']").children("option:selected").val();
  837. let infoLib = $("select[name='info_lib']").children("option:selected").val();
  838. let progressiveLib = $("select[name='progressive_lib']").children("option:selected").val();
  839. let engineerInfoLib = $("select[name='engineer_info_lib']").children("option:selected").val();
  840. let engineerFeatureLib = $("select[name='engineer_feature_lib']").children("option:selected").val();
  841. let materialLib = $("select[name='material_lib']").children("option:selected").val();
  842. let mainQuantityLib = $("select[name='main_quantity_lib']").children("option:selected").val();
  843. let economicLib = $("select[name='economic_lib']").children("option:selected").val();
  844. let overHeightLib = $("select[name='over_height_lib']").children("option:selected").val();
  845. if (name === '' && model === 'all') {
  846. throw '编办名字不能为空';
  847. }
  848. if (model === 'bill' && (standardBill === '' || standardBill === undefined)) {
  849. throw '请选择标准清单库';
  850. }
  851. if (model === 'ration' && (rationLib === '' || rationLib === undefined)) {
  852. throw '请选择定额库';
  853. }
  854. if (model === 'feature' && (featureLib === '' || featureLib === undefined)) {
  855. throw '请选择工程特征库';
  856. }
  857. if (model === 'glj' && (gljLib === '' || gljLib === undefined)) {
  858. throw '请选择人材机库';
  859. }
  860. if (model === 'artificial' && (artificialLib === '' || artificialLib === undefined)) {
  861. throw '请选择人工系数库';
  862. }
  863. if (model === 'program' && (programLib === '' || programLib === undefined)) {
  864. throw '请选择计算程序';
  865. }
  866. if (model === 'billsGuidance' && (billsGuidanceLib === '' || billsGuidanceLib === undefined)) {
  867. throw '请选择清单指引库';
  868. }
  869. let standardBillString = $("select[name='standard_bill']").children("option:selected").text();
  870. let rationLibString = $("select[name='ration_lib']").children("option:selected").text();
  871. let gljLibString = $("select[name='glj_lib']").children("option:selected").text();
  872. // let feeLibString = $("select[name='fee_lib']").children("option:selected").text();
  873. let artificialString = $("select[name='artificial_lib']").children("option:selected").text();
  874. let programString = $("select[name='program_lib']").children("option:selected").text();
  875. let billsGuidanceString = $("select[name='billsGuidance_lib']").children("option:selected").text();
  876. let featrueString = $("select[name='feature_lib']").children("option:selected").text();
  877. let infoString = $("select[name='info_lib']").children("option:selected").text();
  878. let progressiveString = $("select[name='progressive_lib']").children("option:selected").text();
  879. let engineerInfoString = $("select[name='engineer_info_lib']").children("option:selected").text();
  880. let engineerFeatureString = $("select[name='engineer_feature_lib']").children("option:selected").text();
  881. let materialString = $("select[name='material_lib']").children("option:selected").text();
  882. let mainQuantityString = $("select[name='main_quantity_lib']").children("option:selected").text();
  883. let economicString = $("select[name='economic_lib']").children("option:selected").text();
  884. let overHeightString = $("select[name='over_height_lib']").children("option:selected").text();
  885. let result = {
  886. name: name,
  887. bill: {
  888. id: standardBill,
  889. name: standardBillString
  890. },
  891. ration: {
  892. id: rationLib,
  893. name: rationLibString
  894. },
  895. glj: {
  896. id: gljLib,
  897. name: gljLibString
  898. },
  899. /* fee: {
  900. id: feeLib,
  901. name: feeLibString
  902. },*/
  903. artificial: {
  904. id: artificialLib,
  905. name: artificialString
  906. },
  907. program: {
  908. id: programLib,
  909. name: programString
  910. },
  911. billsGuidance: {
  912. id: billsGuidanceLib,
  913. name: billsGuidanceString
  914. },
  915. feature: {
  916. id: featureLib,
  917. name: featrueString
  918. },
  919. info: {
  920. id: infoLib,
  921. name: infoString
  922. },
  923. progressive: {
  924. id: progressiveLib,
  925. name: progressiveString
  926. },
  927. engineer_info: {
  928. id: engineerInfoLib,
  929. name: engineerInfoString
  930. },
  931. engineer_feature: {
  932. id: engineerFeatureLib,
  933. name: engineerFeatureString
  934. },
  935. material: {
  936. id: materialLib,
  937. name: materialString
  938. },
  939. main_quantity: {
  940. id: mainQuantityLib,
  941. name: mainQuantityString
  942. },
  943. economic: {
  944. id: economicLib,
  945. name: economicString
  946. },
  947. over_height: {
  948. id: overHeightLib,
  949. name: overHeightString
  950. }
  951. };
  952. return result;
  953. }
  954. /**
  955. * 验证标准库数据
  956. *
  957. * @return {boolean}
  958. */
  959. function validLib() {
  960. let result = false;
  961. try {
  962. let valuationName = $("input[name='name']").val();
  963. if (valuationName === '') {
  964. throw '请填写计价规则名称';
  965. }
  966. let engineering = $("select[name='engineering']").val();
  967. if (engineering === '' || engineering <= 0) {
  968. throw '请选择工程专业';
  969. }
  970. //按新需求,清单库、定额库等不做非空验证
  971. /* if ($("input:hidden[name='bill_lib']").length <= 0) {
  972. throw '请添加标准清单';
  973. }
  974. if ($("input:hidden[name='ration_lib']").length <= 0) {
  975. throw '请添加定额库';
  976. }
  977. if ($("input:hidden[name='glj_lib']").length <= 0) {
  978. throw '请添加人材机库';
  979. }
  980. if ($("input:hidden[name='fee_lib']").length <= 0) {
  981. throw '请添加费率标准';
  982. }
  983. if ($("input:hidden[name='artificial_lib']").length <= 0) {
  984. throw '请添加人工系数';
  985. }
  986. if ($("input:hidden[name='program_lib']").length <= 0) {
  987. throw '请添加计算程序';
  988. }
  989. if ($("input:hidden[name='billsGuidance_lib']").length <= 0) {
  990. throw '请添加清单指引库';
  991. }*/
  992. result = true;
  993. } catch (error) {
  994. alert(error);
  995. result = false;
  996. }
  997. return result;
  998. }
  999. /**
  1000. * 切换switch效果
  1001. *
  1002. * @param {Object} element
  1003. * @return {boolean}
  1004. */
  1005. function switchChange(element) {
  1006. // 第一个元素判断当前的状态
  1007. let firstButton = element.children("button").first();
  1008. let secondButton = element.children("button").eq(1);
  1009. let currentStatus = firstButton.is(":disabled");
  1010. if (currentStatus) {
  1011. // 当前为true切换到false
  1012. firstButton.removeClass('btn-success').removeClass('disabled').addClass('btn-default').removeAttr("disabled");
  1013. firstButton.text('开启');
  1014. secondButton.removeClass("btn-default").addClass("btn-danger").addClass("disabled").attr("disabled", "disabled");
  1015. secondButton.text('已禁用');
  1016. } else {
  1017. // 当前false切换到true
  1018. firstButton.removeClass("btn-default").addClass("btn-success").addClass("disabled").attr("disabled", "disabled");
  1019. firstButton.text('已开启');
  1020. secondButton.removeClass('btn-danger').removeClass('disabled').addClass('btn-default').removeAttr("disabled");
  1021. secondButton.text('禁用');
  1022. }
  1023. return !currentStatus;
  1024. }
  1025. function editEngineer(selector, key) {
  1026. let editText = $(selector).prev("span").text();
  1027. let parentDiv = $(selector).parent("div");
  1028. let width = key == 'seq' ? 70 : 200;
  1029. parentDiv.next("div").css('width', width);
  1030. parentDiv.next("div").find("input").val(editText);
  1031. parentDiv.hide();
  1032. parentDiv.next("div").show();
  1033. }
  1034. function confirmUpdate(selector, engineerID) {
  1035. let inputDiv = $(selector).parents(".input_group_div");
  1036. let input = $(selector).parent(".input-group-btn").prev("input");
  1037. let oldValue = inputDiv.prev("div").find("span").text();
  1038. let newValue = input.val();
  1039. let key = input.attr("name");
  1040. if (newValue == oldValue || !engineerID) {//不做非空判断
  1041. inputDiv.prev("div").show();
  1042. inputDiv.hide();
  1043. return;
  1044. }
  1045. let updateData = {};
  1046. updateData[key] = newValue;
  1047. updateEngineer(engineerID, updateData, function () {
  1048. if (key == 'seq') {
  1049. window.location.reload();
  1050. } else {
  1051. inputDiv.prev("div").find("span").text(newValue);
  1052. }
  1053. });
  1054. inputDiv.prev("div").show();
  1055. inputDiv.hide();
  1056. }
  1057. function deleteEngineerClick(engineerID, element) {
  1058. hintBox.infoBox('操作确认', '是否删除所选工程专业?', 2, async function () {
  1059. try {
  1060. let result = await ajaxPost('/compilation/delete-engineer', { id: engineerID });
  1061. $(element).parent("td").parent("tr").remove();
  1062. } catch (err) {
  1063. console.log(err);
  1064. }
  1065. }, null, ['确定', '取消'], false);
  1066. }
  1067. function engineerVisibleChange(checkBox, engineerID) {
  1068. if (engineerID) {
  1069. updateEngineer(engineerID, { visible: checkBox.checked });
  1070. }
  1071. }
  1072. function updateEngineer(engineerID, data, callback) {
  1073. CommonAjax.post('/compilation/update-engineer', { id: engineerID, updateData: data }, function (data) {
  1074. if (callback) {
  1075. callback();
  1076. }
  1077. })
  1078. }
  1079. function editTaxGroup(ele) {
  1080. $('#groupEditType').val("modify");
  1081. let groupData = $(ele).nextAll("input[name = 'tax_group']").val();
  1082. groupData = JSON.parse(groupData);
  1083. if (!_.isEmpty(groupData)) {
  1084. $("#taxType").val(groupData.taxType ? groupData.taxType : "");
  1085. $("#program_lib").val(groupData.program_lib ? groupData.program_lib.id : "");
  1086. $("#norm_lib").val(groupData.norm_lib ? groupData.norm_lib : "");
  1087. $("#template_lib").val(groupData.template_lib ? groupData.template_lib.id : "");
  1088. $("#col_lib").val(groupData.col_lib ? groupData.col_lib.id : "");
  1089. $("#fee_lib").val(groupData.fee_lib ? groupData.fee_lib.id : "");
  1090. } else {
  1091. $("#taxType").val("");
  1092. $("#program_lib").val("");
  1093. $("#template_lib").val("");
  1094. $("#col_lib").val("");
  1095. $("#fee_lib").val("");
  1096. $("#norm_lib").val("");
  1097. }
  1098. $("#groupIndex").val(getGroupIndex(groupData));
  1099. $("#addTaxGroup").modal({ show: true });
  1100. }
  1101. function deleteTableTr(ele, classString) {
  1102. let parentTr = $(ele).parents(`.${classString}`);
  1103. parentTr.remove();
  1104. }
  1105. function getGroupIndex(groupData) {//用来做唯一标识
  1106. let index = "";
  1107. if (groupData) {
  1108. if (groupData.taxType) index = index + groupData.taxType;
  1109. if (groupData.program_lib) index = index + groupData.program_lib.id;
  1110. if (groupData.norm_lib) index = index + groupData.norm_lib;
  1111. if (groupData.template_lib) index = index + groupData.template_lib.id;
  1112. if (groupData.col_lib) index = index + groupData.col_lib.id;
  1113. if (groupData.fee_lib) index = index + groupData.fee_lib.id;
  1114. }
  1115. return index;
  1116. }
  1117. function getTaxGroupData() {
  1118. let programData = programList === undefined ? [] : _.keyBy(JSON.parse(programList), 'id');
  1119. let billTemplateData = billTemplateList == undefined ? [] : _.keyBy(JSON.parse(billTemplateList), 'ID');
  1120. let mainTreeColData = mainTreeColList == undefined ? [] : _.keyBy(JSON.parse(mainTreeColList), 'ID');
  1121. let feeLibData = feeRateList === undefined ? [] : _.keyBy(JSON.parse(feeRateList), 'id');
  1122. let groupData = {};
  1123. if ($("#taxType").val() !== "") {
  1124. groupData.taxType = $("#taxType").val();
  1125. }
  1126. if ($("#norm_lib").val() !== "") {
  1127. groupData.norm_lib = $('#norm_lib').val();
  1128. }
  1129. if ($("#program_lib").val() !== "") {
  1130. let program = programData[$("#program_lib").val()];
  1131. if (program) {
  1132. groupData.program_lib = {
  1133. id: program.id,
  1134. name: program.name,
  1135. displayName: program.displayName
  1136. }
  1137. }
  1138. }
  1139. if ($("#template_lib").val() !== "") {
  1140. let template = billTemplateData[$("#template_lib").val()];
  1141. if (template) {
  1142. groupData.template_lib = {
  1143. id: template.ID,
  1144. name: template.name
  1145. }
  1146. }
  1147. }
  1148. if ($("#col_lib").val() !== "") {
  1149. let col = mainTreeColData[$("#col_lib").val()];
  1150. if (col) {
  1151. groupData.col_lib = {
  1152. id: col.ID,
  1153. name: col.name
  1154. }
  1155. }
  1156. }
  1157. if ($("#fee_lib").val() !== "") {
  1158. let feeRate = feeLibData[$("#fee_lib").val()];
  1159. if (feeRate) {
  1160. groupData.fee_lib = {
  1161. id: feeRate.id,
  1162. name: feeRate.name
  1163. }
  1164. }
  1165. }
  1166. return groupData;
  1167. }
  1168. function intChecking(e, elemt) {//限制输入正整数
  1169. let code = e.which || e.keyCode;
  1170. if (code == 46 || code == 45) {//不能输入小数点和-号
  1171. e.preventDefault();
  1172. }
  1173. if (elemt.value == "" && code == 48) {//当输入框为空时不能输入0
  1174. e.preventDefault();
  1175. }
  1176. }