change.js 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532
  1. 'use strict';
  2. /**
  3. *
  4. *
  5. * @author Mai
  6. * @date 2018/8/21
  7. * @version
  8. */
  9. // 向后端请求中间计量号
  10. function getNewCode() {
  11. postData('/tender/'+ $('#tenderId').val() +'/change/newCode', null, function (code) {
  12. if (code !== '') {
  13. $('#bj-code').val(code);
  14. if (openChangePlan && changePlanList && _.findIndex(changePlanList, { code: code }) !== -1) {
  15. $('#plan-code').val(code).trigger('change');
  16. }
  17. }
  18. });
  19. }
  20. class codeRuleSet {
  21. constructor (obj) {
  22. this.body = obj;
  23. // 切换规则组件类型
  24. $('.rule-change', obj).change(function () {
  25. const codeType = this.selectedIndex-1;
  26. if (codeType === ruleConst.ruleType.addNo) {
  27. $('#format', obj).show();
  28. $('#text', obj).show();
  29. $('#text>label', obj).text('起始编号');
  30. $('#text>input', obj).val('001');
  31. const s = '0000000000' + 1;
  32. $('#text>input', obj).val(s.substr(s.length - $('#format>input', obj).val()));
  33. } else if (codeType === ruleConst.ruleType.text) {
  34. $('#format', obj).hide();
  35. $('#text', obj).show();
  36. $('#text>label', obj).text('文本');
  37. $('#text>input', obj).val('').attr('placeholder', '请在这里输入需要的文本');
  38. } else {
  39. $('#format', obj).hide();
  40. $('#text', obj).hide();
  41. }
  42. });
  43. // 修改编号位数
  44. $('#format>input', obj).change(function () {
  45. const s = '0000000000' + parseInt($('#text>input', obj).val());
  46. $('#text>input', obj).val(s.substr(s.length - $(this).val()));
  47. });
  48. // 修改连接符
  49. $('.connector-change', obj).change(function () {
  50. const connectorType = this.options[this.selectedIndex].text;
  51. const rules = $('span>span', obj), ruleText = [];
  52. for (const r of rules) {
  53. ruleText.push($.trim(r.innerText));
  54. }
  55. if (connectorType === '无') {
  56. $('#preview', obj).text(ruleText.join(''));
  57. } else {
  58. $('#preview', obj).text(ruleText.join(connectorType));
  59. }
  60. connectorRule = this.options[this.selectedIndex].value;
  61. });
  62. // 新增规则组件
  63. $('#addRule', obj).click(function () {
  64. const codeType = $('select', obj)[1].selectedIndex-1;
  65. const rule = {rule_type: codeType}, html = [];
  66. let preview;
  67. switch (codeType) {
  68. case ruleConst.ruleType.dealCode: {
  69. if ($('#dealCode').val() === '') {
  70. toastr.error('当前标段合同编号为空,请选择其他组件。');
  71. return false;
  72. }
  73. preview = $('#dealCode').val();
  74. break;
  75. }
  76. case ruleConst.ruleType.tenderName: {
  77. preview = $('#tenderName').val();
  78. break;
  79. }
  80. case ruleConst.ruleType.text: {
  81. rule.text = $('#text>input', obj).val();
  82. if (rule.text === '') {
  83. toastr.error('文本内容不允许为空。');
  84. return false;
  85. }
  86. preview = rule.text;
  87. break;
  88. }
  89. case ruleConst.ruleType.inDate: {
  90. preview = moment().format('YYYY');
  91. break;
  92. }
  93. case ruleConst.ruleType.addNo: {
  94. rule.format = parseInt($('#format>input', obj).val());
  95. rule.start = parseInt($('#text>input', obj).val());
  96. if ($('#text>input', obj).val().length !== rule.format) {
  97. toastr.error('起始编号位数和自动编号位数不一致。');
  98. return false;
  99. }
  100. const s = '0000000000';
  101. preview = s.substr(s.length - rule.format);
  102. break;
  103. }
  104. default: {
  105. toastr.error('请选择组件再添加');
  106. return false;
  107. }
  108. }
  109. // 更新规则
  110. codeRule.push(rule);
  111. // 更新规则显示
  112. html.push('<span class="badge badge-light" title="' + ruleConst.ruleString[codeType] + '" rule="' + JSON.stringify(rule) + '">');
  113. html.push('<span>' + preview + '</span>');
  114. html.push('<a href="javascript: void(0);" class="text-danger" title="移除"><i class="fa fa-remove"></i></a>');
  115. html.push('</span>');
  116. const part = $('#ruleParts', obj).append(html.join(''));
  117. // 更新规则预览
  118. const connectorType = connectorRule !== '' && parseInt(connectorRule) !== ruleConst.connectorType.nothing ? ruleConst.connectorString[connectorRule] : '';
  119. const previewtext = $.trim($('#preview', obj).text()) === '' ? preview : $.trim($('#preview', obj).text()) + connectorType + preview;
  120. $('#preview', obj).text(previewtext);
  121. });
  122. // 删除规则组件
  123. $($('#ruleParts', obj)).on('click', 'a', function () {
  124. const index = $('a', obj).index(this);
  125. codeRule.splice(index-1, 1);
  126. $(this).parent().remove();
  127. const rules = $('span>span', obj), ruleText = [];
  128. for (const r of rules) {
  129. ruleText.push($.trim(r.innerText));
  130. }
  131. const connectorType = connectorRule !== '' && parseInt(connectorRule) !== ruleConst.connectorType.nothing ? ruleConst.connectorString[connectorRule] : '';
  132. $('#preview', obj).text(ruleText.join(connectorType));
  133. });
  134. }
  135. }
  136. const getGroupAuditHtml = function (group) {
  137. return group.map(u => { return `<small class="d-inline-block text-dark mx-1" title="${u.role}" data-auditorId="${u.aid}">${u.name}</small>`; }).join('');
  138. };
  139. const getAuditTypeHtml = function (type) {
  140. if (type === auditType.key.common) return '';
  141. return `<div class="li-subscript"><span class="badge badge-pill badge-${auditType.info[type].class} p-1 badge-bg-small"><small>${auditType.info[type].short}</small></span></div>`;
  142. };
  143. const getAuditTypeText = function (type) {
  144. if (type === auditType.key.common) return '';
  145. return `<span class="text-${auditType.info[type].class}">${auditType.info[type].long}</span>`;
  146. };
  147. $(document).ready(() => {
  148. if (openChangePlan) {
  149. $('#add_plan_list').prop('checked', getLocalCache('change_add_plan_list') === 'true');
  150. }
  151. // 获取审批流程
  152. $('a[data-target="#sp-list" ]').on('click', function () {
  153. const data = {
  154. cid: $(this).attr('c-id'),
  155. };
  156. postData('/tender/' + tenderId + '/change/auditors', data, function (result) {
  157. const { auditHistory, auditors2, user } = result;
  158. let auditorsHTML = [];
  159. auditors2.forEach((group, idx) => {
  160. if (idx === 0) {
  161. auditorsHTML.push(`<li class="list-group-item d-flex justify-content-between align-items-center">
  162. <span class="mr-1"><i class="fa fa fa-play-circle fa-rotate-90"></i></span>
  163. <span class="text-muted">${getGroupAuditHtml(group)}</span>
  164. <span class="badge badge-light badge-pill ml-auto"><small>原报</small></span>
  165. </li>`);
  166. } else if(idx === auditors2.length -1 && idx !== 0) {
  167. auditorsHTML.push(`<li class="list-group-item d-flex justify-content-between align-items-center">
  168. <span class="mr-1"><i class="fa fa fa-stop-circle fa-rotate-90"></i></span>
  169. <span class="text-muted">${getGroupAuditHtml(group)}</span>
  170. <div class="d-flex ml-auto">
  171. ${getAuditTypeHtml(group[0].audit_type)}
  172. <span class="badge badge-light badge-pill ml-auto"><small>终审</small></span>
  173. </div>
  174. </li>`);
  175. } else {
  176. auditorsHTML.push(`<li class="list-group-item d-flex justify-content-between align-items-center">
  177. <span class="mr-1"><i class="fa fa fa-chevron-circle-down"></i></span>
  178. <span class="text-muted">${getGroupAuditHtml(group)}</span>
  179. <div class="d-flex ml-auto">
  180. ${getAuditTypeHtml(group[0].audit_type)}
  181. <span class="badge badge-light badge-pill"><small>${transFormToChinese(idx)}审</small></span>
  182. </div>
  183. </li>`);
  184. }
  185. });
  186. $('#auditor-list').empty();
  187. $('#auditor-list').append(auditorsHTML.join(''));
  188. let historyHTML = [];
  189. auditHistory.forEach((his, idx) => {
  190. if (idx === auditHistory.length - 1 && auditHistory.length !== 1) {
  191. historyHTML.push(`<div class="text-right"><a href="javascript: void(0);" id="fold-btn" data-target="show">展开历史审批流程</a></div>`);
  192. }
  193. historyHTML.push(`<div class="${idx < auditHistory.length - 1 ? 'fold-card' : ''}">`);
  194. historyHTML.push(`<div class="text-center text-muted">${idx+1}#</div>`);
  195. historyHTML.push(`<ul class="timeline-list list-unstyled mt-2 ${ idx === auditHistory.length - 1 && auditHistory.length !== 1 ? 'last-auditor-list' : '' }">`);
  196. his.forEach((group, index) => {
  197. historyHTML.push(`<li class="timeline-list-item pb-2 ${ group.status === auditConst.status.uncheck && idx === auditHistory.length - 1 && auditHistory.length !== 1 ? 'is_uncheck' : ''}">`);
  198. if (group.endYear) {
  199. historyHTML.push(`<div class="timeline-item-date">${group.endYear}<span>${group.endDate}</span><span>${group.endTime}</span></div>`);
  200. }
  201. if (index < his.length - 1) {
  202. historyHTML.push('<div class="timeline-item-tail"></div>');
  203. }
  204. if (group.status === auditConst.status.checked || group.status === auditConst.status.cancelRevise) {
  205. historyHTML.push('<div class="timeline-item-icon bg-success text-light"><i class="fa fa-check"></i></div>');
  206. } else if (group.status === auditConst.status.checkNo || group.status === auditConst.status.checkNoPre || group.status === auditConst.status.revise || group.status === auditConst.status.checkCancel) {
  207. historyHTML.push('<div class="timeline-item-icon bg-warning text-light"><i class="fa fa-level-up"></i></div>');
  208. } else if (group.status === auditConst.status.checking) {
  209. historyHTML.push('<div class="timeline-item-icon bg-warning text-light"><i class="fa fa-ellipsis-h"></i></div>');
  210. } else if(group.status === auditConst.status.checkAgain) {
  211. historyHTML.push('<div class="timeline-item-icon bg-warning text-light"><i class="fa fa-check"></i></div>');
  212. } else {
  213. historyHTML.push('<div class="timeline-item-icon bg-secondary text-light"></div>');
  214. }
  215. historyHTML.push('<div class="timeline-item-content">');
  216. historyHTML.push('<div class="py-1">');
  217. if (index === 0) {
  218. historyHTML.push('<span class="text-black-50">原报</span>');
  219. historyHTML.push(`<span class="pull-right text-success">${idx !== 0 ? '重新' : ''}上报审批</span>`);
  220. } else {
  221. const statuStr = group.status !== auditConst.status.uncheck ?
  222. `<span class="pull-right ${auditConst.statusClass[group.status]}">${auditConst.statusString[group.status]}</span>` : '';
  223. historyHTML.push(`
  224. <span class="text-black-50">
  225. ${ group.audit_order === 0 ? '原报' : !group.is_final ? group.audit_order + '审' : '终审' } ${getAuditTypeText(group.audit_type)}
  226. </span>
  227. ${statuStr}`);
  228. }
  229. historyHTML.push('</div>');
  230. historyHTML.push('<div class="card"><div class="card-body px-3 py-0">');
  231. for (const [i, auditor] of group.auditors.entries()) {
  232. historyHTML.push(`<div class="card-text p-2 py-3 row ${ ( i > 0 ? 'border-top' : '') }">`);
  233. let companyRolePart = '';
  234. if (group.audit_order !== 0) {
  235. const rolePart = auditor.role ? ' - ' + auditor.role : '';
  236. companyRolePart = `<span class="text-muted ml-1">${auditor.company}${rolePart}</span>`;
  237. }
  238. historyHTML.push(`<div class="col-10"><span class="h6">${auditor.name}</span>${companyRolePart}</div>`);
  239. historyHTML.push('<div class="col">');
  240. if (auditor.status === auditConst.status.checked || group.status === auditConst.status.cancelRevise) {
  241. historyHTML.push('<span class="pull-right text-success"><i class="fa fa-check-circle"></i></span>');
  242. } else if (auditor.status === auditConst.status.checkNo || auditor.status === auditConst.status.checkNoPre || group.status === auditConst.status.revise || auditor.status === auditConst.status.checkCancel) {
  243. historyHTML.push('<span class="pull-right text-warning"><i class="fa fa-share-square fa-rotate-270"></i></span>');
  244. } else if (auditor.status === auditConst.status.checking) {
  245. historyHTML.push('<span class="pull-right text-warning"><i class="fa fa-commenting"></i></span>');
  246. } else if (auditor.status === auditConst.status.checkAgain) {
  247. historyHTML.push('<span class="pull-right text-warning"><i class="fa fa-check"></i></span>');
  248. }
  249. historyHTML.push('</div>');
  250. if (auditor.sdesc) {
  251. historyHTML.push(`<div class="col-12 py-1 bg-light"><i class="fa fa-commenting-o mr-1"></i>${auditor.sdesc}</div>`);
  252. }
  253. historyHTML.push('</div>');
  254. }
  255. historyHTML.push('</div></div>');
  256. historyHTML.push('</div>');
  257. historyHTML.push('</li>');
  258. });
  259. historyHTML.push('</div>');
  260. historyHTML.push('</ul>');
  261. });
  262. $('#audit-list').empty();
  263. $('#audit-list').append(historyHTML.join(''));
  264. });
  265. });
  266. $("#change-table").colResizable({
  267. liveDrag:true,
  268. gripInnerHtml:"<div class='grip'></div>",
  269. draggingClass:"dragging",
  270. resizeMode:'fit',
  271. postbackSafe:true,
  272. partialRefresh:true
  273. });
  274. // 首次进入设置
  275. let showNoNeed = false;
  276. if (parseInt(cRuleFirst)) {
  277. codeRule = [];
  278. showNoNeed = true;
  279. // const firstSet = new codeRuleSet($('div.modal-body', '#first'));
  280. // // 确认规则上传服务器
  281. // $('#setRule', '#first').bind('click', function () {
  282. // const data = {
  283. // rule: ruleType,
  284. // connector: connectorRule,
  285. // data: JSON.stringify(codeRule),
  286. //
  287. // };
  288. // postData('/tender/rule', data, function () {
  289. // $('#first').modal('hide');
  290. // $('#add-bj').modal('show');
  291. // });
  292. // });
  293. // $('#first').modal('show');
  294. $('#setting').modal('show');
  295. } else if ($('#changList').children.length === 0) {
  296. $('#add-bj').modal('show');
  297. }
  298. // 设置
  299. const ruleSet = new codeRuleSet($('div.modal-body', '#setting'));
  300. $('#setRule', '#setting').bind('click', function () {
  301. const data = {
  302. rule: ruleType,
  303. connector: connectorRule,
  304. data: JSON.stringify(codeRule),
  305. };
  306. if (codeRule.length !== 0) {
  307. $('#autoCodeShow').show();
  308. }
  309. postData('/tender/rule', data, function () {
  310. if (parseInt(cRuleFirst) && showNoNeed) {
  311. $('#changeFirst').click();
  312. $('#add-bj').modal('show');
  313. } else {
  314. $('#setting').modal('hide');
  315. }
  316. });
  317. })
  318. $('.ml-auto').on('click', 'a', function () {
  319. const content = $(this).attr('href');
  320. if (content === '#add-bj') {
  321. $('#add-bj-modal').modal('show')
  322. getNewCode();
  323. if ($('#changeList').children.length === 0) {
  324. $('#addCancel').hide();
  325. } else {
  326. $('#addCancel').show();
  327. }
  328. $('#bj-code').removeClass('is-invalid');
  329. // if (parseInt(ledger_status) === ledgerConsts.uncheck) {
  330. // $('#warning-ledger').modal('show');
  331. // } else {
  332. // $('#add-bj-modal').modal('show')
  333. // getNewCode();
  334. // if ($('#changeList').children.length === 0) {
  335. // $('#addCancel').hide();
  336. // } else {
  337. // $('#addCancel').show();
  338. // }
  339. // $('#bj-code').removeClass('is-invalid');
  340. // }
  341. }
  342. })
  343. // 新增变更令 modal显示
  344. // $('#add-bj').on('show.bs.modal', function() {
  345. // console.log('2222222222222222')
  346. // if (parseInt(ledger_status) === ledgerConsts.checked) {
  347. // $('#add-bj').modal('hide');
  348. // $('#warning-ledger').modal('show');
  349. // }
  350. // getNewCode();
  351. // if ($('#changeList').children.length === 0) {
  352. // $('#addCancel').hide();
  353. // } else {
  354. // $('#addCancel').show();
  355. // }
  356. // $('#bj-code').removeClass('is-invalid');
  357. // });
  358. // 获取最新可用变更令号
  359. $('#autoCode').click(getNewCode);
  360. // 新增变更令 确认
  361. $('#addOk').click(function () {
  362. $(this).attr('disabled', true);
  363. if (!openChangePlan && $('#bj-name').val().length === 0) {
  364. $('#bj-name').addClass('is-invalid');
  365. $('#name_error_msg').show();
  366. $('#name_error_msg').text('变更工程名称不能为空。');
  367. $(this).attr('disabled', false);
  368. setTimeout(function () {
  369. $('#bj-name').removeClass('is-invalid');
  370. $('#name_error_msg').hide();
  371. }, 2000);
  372. return;
  373. }
  374. if (!openChangePlan && $('#bj-name').val().length > 500) {
  375. $('#bj-name').addClass('is-invalid');
  376. $('#name_error_msg').show();
  377. $('#name_error_msg').text('名称超过500个字,请缩减名称。');
  378. $(this).attr('disabled', false);
  379. setTimeout(function () {
  380. $('#bj-name').removeClass('is-invalid');
  381. $('#name_error_msg').hide();
  382. }, 2000);
  383. return;
  384. }
  385. const data = {
  386. code: $('#bj-code').val(),
  387. plan_code: $('#plan-code').val(),
  388. name: $('#bj-name').val(),
  389. add_plan_list: openChangePlan ? $('#add_plan_list').is(':checked') : false,
  390. };
  391. if (data.code || data.code !== '' || data.name || data.name !== '') {
  392. postData('/tender/'+ $('#tenderId').val() +'/change/add', data, function (rst) {
  393. $('#bj-code').removeClass('is-invalid');
  394. $('#mj-add').modal('hide');
  395. $(this).attr('disabled', false);
  396. if (openChangePlan) setLocalCache('change_add_plan_list', data.add_plan_list);
  397. window.location.href = '/tender/'+ $('#tenderId').val() +'/change/' + rst.cid + '/information';
  398. }, function () {
  399. $('#mj-code').addClass('is-invalid');
  400. $('#mj-Hint').show();
  401. $(this).attr('disabled', false);
  402. });
  403. }
  404. });
  405. $('#plan-code').change(function () {
  406. if ($(this).val() === '') {
  407. $('#bj-name').val('');
  408. } else {
  409. const info = _.find(changePlanList, { code: $(this).val() });
  410. $('#bj-name').val(info.name);
  411. }
  412. });
  413. //状态切换
  414. $('#status_select a').on('click', function () {
  415. const status = parseInt($(this).data('val'));
  416. let url = '/tender/'+ $('#tenderId').val() +'/change';
  417. if (status !== 0) {
  418. url += '/status/'+ status;
  419. }
  420. const state = parseInt($('#state_zhankai').attr('data-value')) || 0;
  421. const filterString = setChangeFilterData('change-'+ $('#tenderId').val() +'-list-order');
  422. url = filterString ? url + filterString : url;
  423. if (state) {
  424. url = filterString ? url + '&state=' + state : url + '?state=' + state;
  425. }
  426. window.location.href = url;
  427. });
  428. //变更令状态切换
  429. $('#state_select a').on('click', function () {
  430. const state = parseInt($(this).data('val'));
  431. let url = '/tender/'+ $('#tenderId').val() +'/change';
  432. const status = parseInt($('#zhankai').attr('data-value'));
  433. if (status !== 0) {
  434. url += '/status/'+ status;
  435. }
  436. const filterString = setChangeFilterData('change-'+ $('#tenderId').val() +'-list-order');
  437. url = filterString ? url + filterString : url;
  438. if (state) {
  439. url = filterString ? url + '&state=' + state : url + '?state=' + state;
  440. }
  441. window.location.href = url;
  442. });
  443. // 不再显示首次使用
  444. $('#changeFirst').click(function () {
  445. showNoNeed = false;
  446. $('#changeFirst').remove();
  447. $('#hide_modal').show();
  448. $('#setting').modal('hide');
  449. postData('/tender/'+ $('#tenderId').val() +'/rule/first', '', function () {
  450. });
  451. });
  452. // 弹出删除变更框赋值
  453. $('.delete-cid-modal').on('click', function () {
  454. $('#delete-cid').val($(this).attr('cid'));
  455. });
  456. // 排序初始化
  457. let orderSetting = getLocalCache('change-'+ $('#tenderId').val() +'-list-order');
  458. if (!orderSetting) orderSetting = 'time|desc';
  459. const orders = orderSetting.split('|');
  460. $("#sort-radio input[value='"+ orders[0] +"']").prop('checked', true);
  461. $("#order-radio input[value='"+ orders[1] +"']").prop('checked', true);
  462. if (orders[0] === 'time') {
  463. $('#bpaixu').text('排序:创建时间');
  464. } else {
  465. $('#bpaixu').text('排序:变更令号');
  466. }
  467. // let sortSetting = getLocalCache('change-'+ $('#tenderId').val() +'-list-sort');
  468. // if (sortSetting && parseInt(sortSetting) === 1) {
  469. // $('#bpaixu').click();
  470. // }
  471. // $('#sort-dropdown').on('shown.bs.dropdown', function () {
  472. // setLocalCache('change-'+ $('#tenderId').val() +'-list-sort', 1);
  473. // });
  474. // $('#sort-dropdown').on('hidden.bs.dropdown', function () {
  475. // setLocalCache('change-'+ $('#tenderId').val() +'-list-sort', 0);
  476. // });
  477. $('#sort-radio input[name="paizhi"]').click(function () {
  478. const orderStr = $(this).val() + '|' + $('#order-radio input[name="paixu"]:checked').val();
  479. setLocalCache('change-'+ $('#tenderId').val() +'-list-order', orderStr);
  480. // setLocalCache('change-'+ $('#tenderId').val() +'-list-sort', 1);
  481. let link = window.location.origin + window.location.pathname + '?sort='+ $(this).val() + '&order=' + $('#order-radio input[name="paixu"]:checked').val();
  482. if (getLocalCache('account-pageSize')) {
  483. link += '&pageSize=' + getLocalCache('account-pageSize');
  484. }
  485. window.location.href = link;
  486. });
  487. $('#order-radio input[name="paixu"]').click(function () {
  488. const orderStr = $('#sort-radio input[name="paizhi"]:checked').val() + '|' + $(this).val();
  489. setLocalCache('change-'+ $('#tenderId').val() +'-list-order', orderStr);
  490. // setLocalCache('change-'+ $('#tenderId').val() +'-list-sort', 1);
  491. let link = window.location.origin + window.location.pathname + '?sort='+ $('#sort-radio input[name="paizhi"]:checked').val() + '&order=' + $(this).val();
  492. if (getLocalCache('account-pageSize')) {
  493. link += '&pageSize=' + getLocalCache('account-pageSize');
  494. }
  495. window.location.href = link;
  496. });
  497. // 输入变更令号下方方案同步编号
  498. $('#bj-code').change(function () {
  499. const code = $(this).val();
  500. if (openChangePlan && changePlanList && _.findIndex(changePlanList, { code: code }) !== -1) {
  501. $('#plan-code').val(code).trigger('change');
  502. }
  503. });
  504. if (openChangePlan) {
  505. $('#plan-code').select2({
  506. language: 'zh-CN',
  507. theme: 'bootstrap4',
  508. selectOnClose: true,
  509. // width: '150',
  510. });
  511. }
  512. });