change_information_approval.js 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472
  1. 'use strict';
  2. /**
  3. * 变更令详细页js
  4. *
  5. * @author EllisRan.
  6. * @date 2018/11/22
  7. * @version
  8. */
  9. function getPasteHint (str, row = '') {
  10. let returnObj = str;
  11. if (row) {
  12. returnObj.msg = '清单第' + (row+1) + '行' + str.msg;
  13. }
  14. return returnObj;
  15. }
  16. $(document).ready(() => {
  17. const changeSpreadSetting = {
  18. cols: [
  19. {title: '清单编号', colSpan: '1', rowSpan: '2', field: 'code', hAlign: 0, width: 80, formatter: '@', readOnly: true},
  20. {title: '名称', colSpan: '1', rowSpan: '2', field: 'name', hAlign: 0, width: 120, formatter: '@', readOnly: true},
  21. {title: '单位', colSpan: '1', rowSpan: '2', field: 'unit', hAlign: 1, width: 60, formatter: '@', readOnly: true},
  22. {title: '单价', colSpan: '1', rowSpan: '2', field: 'unit_price', hAlign: 2, width: 60, type: 'Number', getValue: 'getValue.unit_price', readOnly: true},
  23. {title: '变更部位', colSpan: '1', rowSpan: '2', field: 'bwmx', hAlign: 0, width: 120, formatter: '@', readOnly: true},
  24. {title: '变更详情', colSpan: '1', rowSpan: '2', field: 'detail', hAlign: 0, width: 120, formatter: '@', readOnly: true},
  25. {title: '原设计|数量', colSpan: '2|1', rowSpan: '1|1', field: 'oamount', hAlign: 2, width: 60, type: 'Number', getValue: 'getValue.oamount', readOnly: true},
  26. {title: '|金额', colSpan: '|1', rowSpan: '|1', field: 'oa_tp', hAlign: 2, width: 80, type: 'Number', getValue: 'getValue.oa_tp', readOnly: true},
  27. {title: '申请变更增(+)减(-)|数量', colSpan: '2|1', rowSpan: '1|1', field: 'camount', hAlign: 2, width: 60, type: 'Number', getValue: 'getValue.camount', readOnly: true},
  28. {title: '|金额', colSpan: '|1', rowSpan: '|1', field: 'ca_tp', hAlign: 2, width: 80, type: 'Number', getValue: 'getValue.ca_tp', readOnly: true},
  29. ],
  30. emptyRows: 0,
  31. headRows: 2,
  32. headRowHeight: [25, 25],
  33. defaultRowHeight: 21,
  34. headerFont: '12px 微软雅黑',
  35. font: '12px 微软雅黑',
  36. // readOnly: true,
  37. rowHeader:[
  38. {
  39. rowHeaderType: 'circle',
  40. setting: {
  41. size: 5,
  42. indent: 16,
  43. getColor: function (index, data) {
  44. if (!data) return;
  45. if (_.findIndex(changeLedgerList, { id: data.gcl_id }) !== -1 || _.findIndex(changePosList, { id: data.mx_id }) !== -1) {
  46. return '#dc3545';
  47. }
  48. if(data.lid != 0) return;
  49. return '#007bff';
  50. }
  51. },
  52. },
  53. ],
  54. localCache: {
  55. key: 'changes-spread',
  56. colWidth: true,
  57. }
  58. };
  59. for (const aid of aidList) {
  60. const userinfo = _.find(auditList2, { 'uid': aid });
  61. const newColcount = {
  62. title: userinfo.name + ' 审批|数量',
  63. colSpan: '2|1', rowSpan: '1|1',
  64. field: 'audit_amount_' + aid,
  65. hAlign: 2, width: 60, type: 'Number',
  66. readOnly: aid !== parseInt(accountId)
  67. };
  68. const newColTp = {
  69. title: '|金额',
  70. colSpan: '|1', rowSpan: '|1',
  71. field: 'sa_tp_' + aid,
  72. hAlign: 2, width: 80, type: 'Number',
  73. readOnly: true
  74. };
  75. changeSpreadSetting.cols.push(newColcount);
  76. changeSpreadSetting.cols.push(newColTp);
  77. }
  78. const changeCol = {
  79. getValue: {
  80. unit_price: function(data) {
  81. return ZhCalc.round(data.unit_price, unitPriceUnit);
  82. },
  83. oa_tp: function (data) {
  84. return ZhCalc.round(ZhCalc.mul(ZhCalc.round(data.unit_price, unitPriceUnit), ZhCalc.round(data.oamount, findDecimal(data.unit))), totalPriceUnit);
  85. },
  86. ca_tp: function (data) {
  87. return ZhCalc.round(ZhCalc.mul(ZhCalc.round(data.unit_price, unitPriceUnit), ZhCalc.round(data.camount, findDecimal(data.unit))), totalPriceUnit);
  88. },
  89. oamount: function (data) {
  90. return ZhCalc.round(data.oamount, findDecimal(data.unit));
  91. },
  92. camount: function (data) {
  93. return ZhCalc.round(data.camount, findDecimal(data.unit));
  94. },
  95. },
  96. };
  97. const changeSpreadObj = {
  98. makeSjsFooter: function () {
  99. // 增加汇总行并设为锁定禁止编辑状态
  100. changeSpreadSheet.addRows(changeSpreadSheet.getRowCount(), 1);
  101. changeSpreadSheet.setValue(changeSpreadSheet.getRowCount() - 1, 0, '合计');
  102. changeSpreadSheet.setStyle(changeSpreadSheet.getRowCount() - 1, -1, style1);
  103. changeSpreadObj.countSum();
  104. },
  105. setAuditValue: function () {
  106. for (const c of changeList) {
  107. for (const j of aidList) {
  108. c['audit_amount_' + j] = ZhCalc.round(c['audit_amount_' + j], findDecimal(c.unit));
  109. c['sa_tp_' + j] = ZhCalc.round(ZhCalc.mul(c['audit_amount_' + j], ZhCalc.round(c.unit_price, unitPriceUnit)), totalPriceUnit);
  110. }
  111. }
  112. // const rowCount = changeSpreadSheet.getRowCount();
  113. // // 用户的数据合计
  114. // for (const j in aidList) {
  115. // for(let i = 0; i <= rowCount - 1; i++){
  116. // const data = {
  117. // unit_price: changeSpreadSheet.getValue(i, 5),
  118. // amount: parseFloat(changeSpreadSheet.getValue(i, 10 + parseInt(j)*2)),
  119. // };
  120. // const sum = ZhCalc.round(ZhCalc.mul(data.unit_price, data.amount), totalPriceUnit);
  121. // changeSpreadSheet.setValue(i, 11 + j*2, sum !== 0 ? sum : null);
  122. // }
  123. // }
  124. },
  125. resetXmjSpread: function(data = null) {
  126. const xmj = [];
  127. if (data && data.lid != 0 && data.xmj_code !== '' && data.xmj_code !== null) {
  128. if (data.bwmx === data.xmj_jldy) {
  129. data.bwmx = '';
  130. }
  131. xmj.push(data);
  132. }
  133. SpreadJsObj.loadSheetData(xmjSpread.getActiveSheet(), SpreadJsObj.DataType.Data, xmj);
  134. },
  135. selectionChanged: function (e, info) {
  136. const data = SpreadJsObj.getSelectObject(info.sheet);
  137. changeSpreadObj.resetXmjSpread(data);
  138. },
  139. setRowValueAndSum: function (data, row, col) {
  140. for (const j in aidList) {
  141. const sum = ZhCalc.round(ZhCalc.mul(data.unit_price, parseFloat(changeSpreadSheet.getValue(row, 10 + parseInt(j)*2))), totalPriceUnit);
  142. changeSpreadSheet.setValue(row, 11 + j*2, sum !== 0 ? sum : null);
  143. }
  144. // const sum = ZhCalc.round(ZhCalc.mul(data.unit_price, data.spamount), totalPriceUnit);
  145. // changeSpreadSheet.setValue(row, col+1, sum !== 0 ? sum : null);
  146. const rowCount = changeSpreadSheet.getRowCount();
  147. // 用户的数据合计
  148. let audit_sum = 0;
  149. for(let i = 0; i < rowCount - 1; i++){
  150. audit_sum = ZhCalc.add(audit_sum, changeSpreadSheet.getValue(i, col+1));
  151. }
  152. changeSpreadSheet.setValue(changeSpreadSheet.getRowCount() - 1, col+1, audit_sum !== 0 ? audit_sum : null);
  153. },
  154. countSum: function() {
  155. const rowCount = changeSpreadSheet.getRowCount();
  156. let oSum = 0,
  157. cSum = 0;
  158. for(let i = 0; i < rowCount - 1; i++){
  159. oSum = ZhCalc.add(oSum, changeSpreadSheet.getValue(i, 7));
  160. cSum = ZhCalc.add(cSum, changeSpreadSheet.getValue(i, 9));
  161. }
  162. changeSpreadSheet.setValue(changeSpreadSheet.getRowCount() - 1, 7, oSum !== 0 ? oSum : null);
  163. changeSpreadSheet.setValue(changeSpreadSheet.getRowCount() - 1, 9, cSum !== 0 ? cSum : null);
  164. // 用户的数据合计
  165. for (const j in aidList) {
  166. let audit_sum = 0;
  167. for(let i = 0; i < rowCount - 1; i++){
  168. audit_sum = ZhCalc.add(audit_sum, changeSpreadSheet.getValue(i, 11 + j*2));
  169. }
  170. changeSpreadSheet.setValue(changeSpreadSheet.getRowCount() - 1, 11 + j*2, audit_sum !== 0 ? audit_sum : null);
  171. }
  172. },
  173. deletePress: function (sheet) {
  174. return;
  175. },
  176. editEnded: function (e, info) {
  177. if (info.sheet.zh_setting) {
  178. const select = SpreadJsObj.getSelectObject(info.sheet);
  179. const col = info.sheet.zh_setting.cols[info.col];
  180. // 未改变值则不提交
  181. let validText = is_numeric(info.editingText) ? parseFloat(info.editingText) : (info.editingText ? trimInvalidChar(info.editingText) : '');
  182. const orgValue = select[col.field];
  183. if (orgValue == validText || ((!orgValue || orgValue === '') && (validText === ''))) {
  184. SpreadJsObj.reLoadRowData(info.sheet, info.row);
  185. changeSpreadObj.setRowValueAndSum(select, info.row, info.col);
  186. return;
  187. }
  188. // 判断部分值是否输入的是数字判断和数据计算
  189. if (col.type === 'Number') {
  190. if (isNaN(validText)) {
  191. toastr.error('不能输入其它非数字类型字符');
  192. SpreadJsObj.reLoadRowData(info.sheet, info.row);
  193. changeSpreadObj.setRowValueAndSum(select, info.row, info.col);
  194. return;
  195. }
  196. validText = ZhCalc.round(validText, findDecimal(select.unit)) || 0;
  197. // 判断是否 正数必须大于等于限制值,负数必须小于等于限制值,否则无法更改
  198. const usedInfo = _.find(changeUsedData, { id: select.id });
  199. if (usedInfo && validText >= 0 && validText < usedInfo.qty) {
  200. toastr.error('清单变更数值必须大于等于已调用值 ' + usedInfo.qty);
  201. SpreadJsObj.reLoadRowData(info.sheet, info.row);
  202. changeSpreadObj.setRowValueAndSum(select, info.row, info.col);
  203. return;
  204. } else if (usedInfo && validText < 0 && validText > usedInfo.qty) {
  205. toastr.error('清单变更数值必须小于等于已调用值 ' + usedInfo.qty);
  206. SpreadJsObj.reLoadRowData(info.sheet, info.row);
  207. changeSpreadObj.setRowValueAndSum(select, info.row, info.col);
  208. return;
  209. }
  210. }
  211. select[col.field] = validText;
  212. select.spamount = ZhCalc.round(validText, findDecimal(select.unit)) || 0;
  213. const data = {
  214. id: select.id,
  215. spamount: select.spamount,
  216. };
  217. console.log(data);
  218. // 更新至服务器
  219. postData(window.location.pathname + '/save', { type:'update', updateData: data }, function (result) {
  220. changeList.splice(info.row, 1, select);
  221. SpreadJsObj.reLoadRowData(info.sheet, info.row);
  222. changeSpreadObj.setRowValueAndSum(select, info.row, info.col);
  223. }, function () {
  224. select[col.field] = orgValue;
  225. select.spamount = orgValue;
  226. SpreadJsObj.reLoadRowData(info.sheet, info.row);
  227. changeSpreadObj.setRowValueAndSum(select, info.row, info.col);
  228. });
  229. }
  230. },
  231. clipboardPasted(e, info) {
  232. const hint = {
  233. cellError: {type: 'error', msg: '粘贴内容超出了表格范围'},
  234. numberExpr: {type: 'error', msg: '不能粘贴其它非数字类型字符'},
  235. qtyError: {type: 'error', msg: '变更数值必须大于等于已调用值'},
  236. };
  237. const range = info.cellRange;
  238. const sortData = info.sheet.zh_data || [];
  239. // console.log(info, range);
  240. // if (info.cellRange.row + info.cellRange.rowCount > sortData.length) {
  241. // toastMessageUniq(hint.cellError);
  242. // // SpreadJsObj.loadSheetData(materialSpread.getActiveSheet(), SpreadJsObj.DataType.Data, materialBillsData);
  243. // SpreadJsObj.reLoadSheetHeader(changeSpreadSheet);
  244. // SpreadJsObj.reLoadSheetData(changeSpreadSheet);
  245. // changeSpreadObj.setAuditValue();
  246. // changeSpreadObj.makeSjsFooter();
  247. // return;
  248. // }
  249. // if (sortData.length > 0 && range.col + range.colCount > 10) {
  250. // toastMessageUniq(hint.cellError);
  251. // SpreadJsObj.reLoadSheetHeader(changeSpreadSheet);
  252. // SpreadJsObj.reLoadSheetData(changeSpreadSheet);
  253. // changeSpreadObj.setAuditValue();
  254. // changeSpreadObj.makeSjsFooter();
  255. // return;
  256. // }
  257. const data = [];
  258. // const rowData = [];
  259. for (let iRow = 0; iRow < range.rowCount; iRow++) {
  260. let bPaste = true;
  261. const curRow = range.row + iRow;
  262. // const materialData = JSON.parse(JSON.stringify(sortData[curRow]));
  263. const cLData = { id: sortData[curRow].id };
  264. const hintRow = range.rowCount > 1 ? curRow : '';
  265. let sameCol = 0;
  266. for (let iCol = 0; iCol < range.colCount; iCol++) {
  267. const curCol = range.col + iCol;
  268. const colSetting = info.sheet.zh_setting.cols[curCol];
  269. if (!colSetting) continue;
  270. let validText = info.sheet.getText(curRow, curCol);
  271. validText = is_numeric(validText) ? parseFloat(validText) : (validText ? trimInvalidChar(validText) : null);
  272. const orgValue = sortData[curRow][colSetting.field];
  273. if (orgValue == validText || ((!orgValue || orgValue === '') && (validText === ''))) {
  274. sameCol++;
  275. if (range.colCount === sameCol) {
  276. bPaste = false;
  277. }
  278. continue;
  279. }
  280. if (colSetting.type === 'Number') {
  281. if (isNaN(validText)) {
  282. toastMessageUniq(getPasteHint(hint.numberExpr, hintRow));
  283. bPaste = false;
  284. continue;
  285. }
  286. validText = ZhCalc.round(validText, findDecimal(sortData[curRow].unit)) || 0;
  287. // 判断是否 正数必须大于等于限制值,负数必须小于等于限制值,否则无法更改
  288. const usedInfo = _.find(changeUsedData, { id: sortData[curRow].id });
  289. if (usedInfo && usedInfo.qty >= 0 && validText < usedInfo.qty) {
  290. toastr.error(hintRow ? '清单' + (hintRow+1) + '行变更数值必须大于等于已调用值 ' + usedInfo.qty : '清单变更数值必须大于等于已调用值 ' + usedInfo.qty);
  291. SpreadJsObj.reLoadRowData(info.sheet, curRow);
  292. changeSpreadObj.setRowValueAndSum(sortData[curRow], curRow, curCol);
  293. bPaste = false;
  294. continue;
  295. } else if (usedInfo && usedInfo.qty < 0 && validText > usedInfo.qty) {
  296. toastr.error(hintRow ? '清单' + (hintRow+1) + '行变更数值必须小于等于已调用值 ' + usedInfo.qty : '清单变更数值必须小于等于已调用值 ' + usedInfo.qty);
  297. SpreadJsObj.reLoadRowData(info.sheet, curRow);
  298. changeSpreadObj.setRowValueAndSum(sortData[curRow], curRow, curCol);
  299. bPaste = false;
  300. continue;
  301. }
  302. }
  303. // cLData[colSetting.field] = validText;
  304. sortData[curRow][colSetting.field] = validText;
  305. cLData.spamount = validText;
  306. }
  307. if (bPaste) {
  308. data.push(cLData);
  309. // rowData.push(curRow);
  310. } else {
  311. // SpreadJsObj.reLoadRowData(info.sheet, curRow);
  312. }
  313. }
  314. if (data.length === 0) {
  315. // SpreadJsObj.reLoadRowData(info.sheet, info.cellRange.row, info.cellRange.rowCount);
  316. return;
  317. }
  318. console.log(data);
  319. // 更新至服务器
  320. postData(window.location.pathname + '/save', { type:'paste_amount_rows', updateData: data }, function (result) {
  321. changeList = result;
  322. changeSpreadObj.setAuditValue();
  323. SpreadJsObj.loadSheetData(changeSpreadSheet, SpreadJsObj.DataType.Data, changeList);
  324. changeSpreadObj.makeSjsFooter();
  325. changeSpreadObj.resetXmjSpread(SpreadJsObj.getSelectObject(changeSpreadSheet));
  326. }, function () {
  327. changeSpreadObj.setAuditValue();
  328. SpreadJsObj.reLoadRowData(info.sheet, info.cellRange.row, info.cellRange.rowCount);
  329. return;
  330. });
  331. },
  332. };
  333. SpreadJsObj.initSpreadSettingEvents(changeSpreadSetting, changeCol);
  334. SpreadJsObj.initSheet(changeSpreadSheet, changeSpreadSetting);
  335. changeSpreadObj.setAuditValue();
  336. SpreadJsObj.loadSheetData(changeSpreadSheet, SpreadJsObj.DataType.Data, changeList);
  337. console.log(changeList);
  338. changeSpreadObj.makeSjsFooter();
  339. changeSpreadObj.resetXmjSpread(SpreadJsObj.getSelectObject(changeSpreadSheet));
  340. const userIndex = aidList.indexOf(parseInt(accountId));
  341. changeSpread.bind(spreadNS.Events.EditEnded, changeSpreadObj.editEnded);
  342. changeSpread.bind(spreadNS.Events.ClipboardPasted, changeSpreadObj.clipboardPasted);
  343. changeSpread.bind(spreadNS.Events.SelectionChanged, changeSpreadObj.selectionChanged);
  344. SpreadJsObj.addDeleteBind(changeSpread, changeSpreadObj.deletePress);
  345. // 审批提交与判断
  346. $('.approval-btn').on('click', function () {
  347. // 判断审批状态
  348. let returnflag = true;
  349. if ($(this).hasClass('btn-success')) {
  350. const sdesc = $('#success-approval').find('textarea').val();
  351. if (sdesc === '') {
  352. toastr.error('审批意见不能为空!');
  353. returnflag = false;
  354. }
  355. if ($('input[name="p_code"]').val() === '') {
  356. toastr.error('变更令号(批复编号)不能为空!');
  357. returnflag = false;
  358. } else if ($('input[name="p_code"]').val() !== undefined) {
  359. $('input[name="p_code"]').val($.trim($('input[name="p_code"]').val()));
  360. const postData = {
  361. p_code: $('input[name="p_code"]').val(),
  362. };
  363. postDataWithAsync('/tender/' + $('#tenderId').val() + '/change/' + $('#changeId').val() + '/check/codeRepeat',postData, function (result) {
  364. }, function (data) {
  365. returnflag = false;
  366. });
  367. }
  368. // 判断并提交变更清单表格数据到表单中
  369. const clist = [];
  370. for(const [i,cl] of changeList.entries()) {
  371. // if (cl['audit_amount_' + accountId] === null || cl['audit_amount_' + accountId] === '') {
  372. // toastr.error('清单第' + (i+1) + '行审批变更数量不能为空');
  373. // returnflag = false;
  374. // } else {
  375. clist.push(cl.id + '_' + cl['audit_amount_' + accountId]);
  376. // }
  377. }
  378. $('#change-list-approval').val(clist.join(','));
  379. if(returnflag) {
  380. $('input[name="w_code"]').val($.trim($('#w_code').val()));
  381. $('#success-approval').find('textarea').val(sdesc.replace(/\r\n/g, '<br/>').replace(/\n/g, '<br/>').replace(/\s/g, ' '));
  382. if ($('#warning-text').length) $('#warning-text').remove()
  383. $('#success-approval').submit();
  384. }
  385. } else {
  386. const sdesc = $('#fail-approval').find('textarea').val();
  387. if (sdesc === '') {
  388. toastr.error('审批意见不能为空!');
  389. returnflag = false;
  390. }
  391. const type = $('#fail-approval').find('input[name="status"]:checked').val();
  392. if (type === undefined) {
  393. // toastr.error('请选择退回类型!');
  394. if (!$('#warning-text').length) {
  395. $('#change-back-content').prepend('<p id="warning-text" style="color: red; margin: 0;">请选择退回流程</p>');
  396. }
  397. returnflag = false;
  398. }
  399. if(returnflag) {
  400. $('#fail-approval').find('textarea').val(sdesc.replace(/\r\n/g, '<br/>').replace(/\n/g, '<br/>').replace(/\s/g, ' '));
  401. $('input[name="w_code"]').val($.trim($('#w_code').val()));
  402. $('#fail-approval').submit();
  403. }
  404. }
  405. })
  406. });
  407. const postDataWithAsync = function (url, data, successCallback, errorCallBack, showWaiting = true) {
  408. if (showWaiting) showWaitingView();
  409. $.ajax({
  410. type:"POST",
  411. url: url,
  412. data: {'data': JSON.stringify(data)},
  413. dataType: 'json',
  414. cache: false,
  415. async: false,
  416. timeout: 60000,
  417. beforeSend: function(xhr) {
  418. let csrfToken = Cookies.get('csrfToken_j');
  419. xhr.setRequestHeader('x-csrf-token', csrfToken);
  420. },
  421. success: function(result){
  422. if (result.err === 0) {
  423. if (successCallback) {
  424. successCallback(result.data);
  425. }
  426. } else {
  427. toastr.error(result.msg);
  428. if (errorCallBack) {
  429. errorCallBack(result.msg);
  430. }
  431. }
  432. if (showWaiting) closeWaitingView();
  433. },
  434. error: function(jqXHR, textStatus, errorThrown){
  435. toastr.error('error: ' + textStatus + " " + errorThrown);
  436. if (errorCallBack) {
  437. errorCallBack();
  438. }
  439. if (showWaiting) closeWaitingView();
  440. }
  441. });
  442. };
  443. function auditCheck(i) {
  444. const inlineRadio1 = $('#change-back:checked').val()
  445. const inlineRadio2 = $('#chagne-backnew:checked').val()
  446. const opinion = $('textarea[name="sdesc"]').eq(i).val().replace(/\r\n/g, '<br/>').replace(/\n/g, '<br/>').replace(/\s/g, ' ');
  447. $('textarea[name="sdesc"]').eq(i).val(opinion);
  448. if (i === 1) {
  449. if (!inlineRadio1 && !inlineRadio2) {
  450. if (!$('#warning-text').length) {
  451. $('#reject-process').prepend('<p id="warning-text" style="color: red; margin: 0;">请选择退回流程</p>');
  452. }
  453. return false;
  454. }
  455. if ($('#warning-text').length) $('#warning-text').remove()
  456. }
  457. return true;
  458. }