global.js 43 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209
  1. /*全局自适应高度*/
  2. /*全局自适应高度*/
  3. const postDefaultTime = 60 * 1000 * 2;
  4. function autoFlashHeight(){
  5. const select = $(".scrollbar-auto .active");
  6. if (select.length > 0) $(".scrollbar-auto")[0].scrollTop = select[0].offsetTop - 72;
  7. function getObjHeight(select) {
  8. return select.length > 0 ? select.height() : 0;
  9. }
  10. /*侧栏高度*/
  11. var sBar1 = getObjHeight($(".sjs-bar-1"));
  12. var sBar2 = getObjHeight($(".sjs-bar-2"));
  13. var sBar3 = getObjHeight($(".sjs-bar-3"));
  14. var sBar4 = getObjHeight($(".sjs-bar-4"));
  15. var sBar5 = getObjHeight($(".sjs-bar-5"));
  16. /*侧栏高度*/
  17. var cHeader = getObjHeight($(".c-header"));
  18. var sBar = getObjHeight($(".sjs-bar"));
  19. var sBart = getObjHeight($(".sjs-bart"));
  20. var sBarz = getObjHeight($(".side-bar"));
  21. var pBarz = getObjHeight($(".toolsbar-f"));
  22. var bdtopc = getObjHeight($(".body-height-top"));
  23. var bcontent = getObjHeight($(".bcontent-wrap"));
  24. $(".sjs-height-0").height($(window).height()-cHeader-90+53);
  25. $(".sjs-height-1").height($(window).height()-cHeader-bcontent-90+53);
  26. $(".sjs-height-2").height($(window).height()-cHeader-sBarz-120);
  27. $(".sjs-height-3").height($(window).height()-cHeader-sBar-492+25+150);/*492*/
  28. $(".sjs-height-4").height($(window).height()-cHeader-pBarz-110+75);
  29. $(".sjs-height-5").height($(window).height()-cHeader-sBar-492+55);/*492*/
  30. $(".sjs-height-6").height($(window).height()-cHeader-34-sBar1);
  31. $(".sp-wrap").height(bcontent-30);
  32. /*侧栏高度*/
  33. $(".sjs-sh-1").height($(window).height()-cHeader-sBar1-92+55);
  34. $(".sjs-sh-2").height($(window).height()-cHeader-sBar2-92+55);
  35. $(".sjs-sh-3").height($(window).height()-cHeader-sBar3-92+55);
  36. $(".sjs-sh-4").height($(window).height()-cHeader-sBar4-92+55);
  37. $(".sjs-sh-5").height($(window).height()-cHeader-sBar5-92+55);
  38. for (const sh of $('.sjs-sh')) {
  39. $(sh).height($(window).height()-cHeader-getObjHeight($('.sjs-bar', sh.parentNode))-getObjHeight($('.sjs-bottom', sh.parentNode))-92+55);
  40. }
  41. /*工程变更添加清单高度*/
  42. $(".sjs-biangeng-height").height($(window).height()/3.3);
  43. };
  44. $(window).resize(autoFlashHeight);
  45. /*全局自适应高度结束*/
  46. $(function(){
  47. /*侧滑*/
  48. $(".open-sidebar").click(function(){
  49. $(".slide-sidebar").animate({width:"800"}).addClass("open");
  50. });
  51. $("body").click(function(event){
  52. var e = event || window.event; //浏览器兼容性
  53. if(!$(event.target).is('a')) {
  54. var elem = event.target || e.srcElement;
  55. while (elem) { //循环判断至跟节点,防止点击的是div子元素
  56. if (elem.className == "open-sidebar" || elem.className == 'slide-sidebar open') {
  57. return false;
  58. }
  59. elem = elem.parentNode;
  60. }
  61. $(".slide-sidebar").animate({width:"0"}).removeClass("open")// 关闭处理
  62. }
  63. });
  64. /*侧滑*/
  65. /*工具提示*/
  66. $(function () {
  67. $('[data-toggle="tooltip"]').tooltip()
  68. });
  69. /*侧栏菜单*/
  70. $(".bg-nav > li > a").click(function() {
  71. var self = $(this);
  72. var subMenu = $(this).siblings('ul.sub-menu');
  73. if(subMenu.length > 0) {
  74. if(subMenu.is(":visible")) {
  75. self.find('.menu-arrow').removeClass('fa-angle-up').addClass('fa-angle-down');
  76. subMenu.slideUp('fast');
  77. self.parent().removeClass('active');
  78. }else{
  79. self.parent().addClass('active');
  80. self.find('.menu-arrow').removeClass('fa-angle-down').addClass('fa-angle-up');
  81. subMenu.slideDown('fast');
  82. }
  83. }
  84. });
  85. // 数据提交
  86. $("#submit-form").click(function() {
  87. $("#save-form").submit();
  88. });
  89. // modal弹窗拖动
  90. // $(document).on("show.bs.modal", ".modal", function() {
  91. // $(this).draggable({
  92. // handle: ".modal-header" // 只能点击头部拖动
  93. // });
  94. // $(this).css("overflow", "hidden");
  95. // });
  96. // 动态生成datepicker
  97. $('body').on('focus', ".datepicker-here", function (e) {
  98. if ($(this).data("datepicker") != "1") {
  99. $(this).datepicker();
  100. }
  101. $(this).data("datepicker", "1");
  102. });
  103. $('a[href="/setting/user"]').each(function () {
  104. if (getLocalCache('account-pageSize')) {
  105. $(this).attr('href', $(this).attr('href') + '?pageSize=' + getLocalCache('account-pageSize'));
  106. }
  107. });
  108. $('.change_sort_link').each(function () {
  109. const tender_id = $(this).attr('href').split('/')[2];
  110. let orderSetting = getLocalCache('change-'+ tender_id +'-list-order');
  111. if(orderSetting) {
  112. const orders = orderSetting.split('|');
  113. $(this).attr('href', $(this).attr('href') + '?sort=' + orders[0] + '&order=' + orders[1]);
  114. }
  115. });
  116. $('.change_project_sort_link').each(function () {
  117. const tender_id = $(this).attr('href').split('/')[2];
  118. let orderSetting = getLocalCache('change-project-'+ tender_id +'-list-order');
  119. if(orderSetting) {
  120. const orders = orderSetting.split('|');
  121. $(this).attr('href', $(this).attr('href') + '?sort=' + orders[0] + '&order=' + orders[1]);
  122. }
  123. });
  124. $('.change_apply_sort_link').each(function () {
  125. const tender_id = $(this).attr('href').split('/')[2];
  126. let orderSetting = getLocalCache('change-apply-'+ tender_id +'-list-order');
  127. if(orderSetting) {
  128. const orders = orderSetting.split('|');
  129. $(this).attr('href', $(this).attr('href') + '?sort=' + orders[0] + '&order=' + orders[1]);
  130. }
  131. });
  132. $('.change_plan_sort_link').each(function () {
  133. const tender_id = $(this).attr('href').split('/')[2];
  134. let orderSetting = getLocalCache('change-plan-'+ tender_id +'-list-order');
  135. if(orderSetting) {
  136. const orders = orderSetting.split('|');
  137. $(this).attr('href', $(this).attr('href') + '?sort=' + orders[0] + '&order=' + orders[1]);
  138. }
  139. });
  140. $('#nav_management').click(function(e) {
  141. e.preventDefault()
  142. showWaitingView();
  143. $.ajax({
  144. type: 'GET',
  145. url: '/management/proxy/project/vertify',
  146. dataType: 'json',
  147. cache: false,
  148. timeout: 60000,
  149. success: function ({code = -1, data: { exist, is_admin, redirect } = { exist: 0, is_admin: false}}) {
  150. if (code === 0) {
  151. if (!exist && !is_admin) {
  152. toastr.error('「项目管理」系统不存在当前项目,请联系管理员进行处理。');
  153. } else if(!exist && is_admin) {
  154. $('#add-management').modal('show')
  155. } else {
  156. redirect && window.open(redirect)
  157. }
  158. }
  159. closeWaitingView()
  160. },
  161. error: function(jqXHR, textStatus, errorThrown){
  162. toastr.error('error: ' + textStatus + " " + errorThrown);
  163. closeWaitingView();
  164. }
  165. })
  166. });
  167. $('#add-management .btn-primary').click(function() {
  168. $('#add-management').modal('hide')
  169. $('#process-management').modal('show')
  170. $.ajax({
  171. tpye: 'post',
  172. url: '/management/proxy/project/add',
  173. dataType: 'json',
  174. cache: false,
  175. timeout: 60000,
  176. // beforeSend: function(xhr) {
  177. // let csrfToken = Cookies.get('csrfToken_j');
  178. // xhr.setRequestHeader('x-csrf-token', csrfToken);
  179. // },
  180. success: function ({code = -1, data = {}}) {
  181. if (code === 0) {
  182. timer = setTimeout(() => {
  183. $('#process-management .process-child').css('width', '100%')
  184. setTimeout(() => {
  185. const { redirect } = data
  186. redirect && window.open(redirect)
  187. $('#process-management').modal('hide')
  188. }, 150);
  189. }, 500);
  190. }
  191. }
  192. })
  193. })
  194. });
  195. function checkShowLast (count) {
  196. if (count > 12500) {
  197. $('a[name=showLevel][tag=last]').hide();
  198. } else {
  199. $('a[name=showLevel][tag=last]').show();
  200. }
  201. }
  202. /**
  203. * 提示框
  204. *
  205. * @param string message
  206. * @param string type
  207. * @param string icon
  208. * @return void
  209. */
  210. function toast(message, type, icon) {
  211. var toast = $(".toast");
  212. toast.addClass(type);
  213. toast.children('.message').html(message);
  214. var iconClass = 'fa-' + icon;
  215. toast.children('.icon').addClass(iconClass);
  216. toast.fadeIn(500);
  217. setTimeout(function() {
  218. toast.fadeOut('fast');
  219. toast.children('.message').text('');
  220. toast.children('.icon').removeClass(iconClass);
  221. }, 3000);
  222. }
  223. /**
  224. * 动态请求数据
  225. * @param {String} url - 请求链接
  226. * @param data - 提交数据
  227. * @param {function} successCallback - 返回成功回调
  228. * @param {function} errorCallBack - 返回失败回调
  229. */
  230. const postData = function (url, data, successCallback, errorCallBack, showWaiting = true) {
  231. if (showWaiting) showWaitingView();
  232. $.ajax({
  233. type:"POST",
  234. url: url,
  235. data: {'data': JSON.stringify(data)},
  236. dataType: 'json',
  237. cache: false,
  238. timeout: postDefaultTime,
  239. beforeSend: function(xhr) {
  240. let csrfToken = Cookies.get('csrfToken_j');
  241. xhr.setRequestHeader('x-csrf-token', csrfToken);
  242. },
  243. success: function(result){
  244. if (result.err === 0) {
  245. if (result.hpack) {
  246. result.hpack.forEach(x => {
  247. result.data[x] = hpackArrBack(result.data[x]);
  248. });
  249. }
  250. if (successCallback) {
  251. successCallback(result.data, result.msg);
  252. }
  253. } else if (result.err === 2) {
  254. toastr.error('error: ' + result.msg);
  255. setTimeout(function () {
  256. window.location.href = '/login';
  257. },1000);
  258. } else {
  259. toastr.error('error: ' + result.msg);
  260. if (errorCallBack) {
  261. errorCallBack(result.msg);
  262. }
  263. }
  264. if (showWaiting) closeWaitingView();
  265. },
  266. error: function(jqXHR, textStatus, errorThrown){
  267. toastr.error('error: ' + textStatus + " " + errorThrown);
  268. if (errorCallBack) {
  269. errorCallBack();
  270. }
  271. if (showWaiting) closeWaitingView();
  272. }
  273. });
  274. };
  275. const postDataAsync = function (url, data, showWaiting = true) {
  276. return new Promise(function (resolve, reject) {
  277. postData(url, data, result => {
  278. resolve(result);
  279. }, err => {
  280. reject(err);
  281. }, showWaiting);
  282. }).catch((e) => { console.log(e) });
  283. };
  284. /**
  285. * 动态请求数据(压缩数据)
  286. * @param {String} url - 请求链接
  287. * @param data - 提交数据
  288. * @param {function} successCallback - 返回成功回调
  289. * @param {function} errorCallBack - 返回失败回调
  290. */
  291. const postDataCompress = function (url, data, successCallback, errorCallBack, htype = 'progress') {
  292. if (htype === 'wait') showWaitingView();
  293. if (htype === 'progress') showProgress();
  294. $.ajax({
  295. type:"POST",
  296. url: url,
  297. data: {'data': LZString.compressToUTF16(JSON.stringify(data))},
  298. dataType: 'json',
  299. cache: false,
  300. timeout: postDefaultTime,
  301. beforeSend: function(xhr) {
  302. let csrfToken = Cookies.get('csrfToken_j');
  303. xhr.setRequestHeader('x-csrf-token', csrfToken);
  304. },
  305. success: function(result){
  306. if (htype === 'progress') doneProgress();
  307. if (result.err === 0) {
  308. if (successCallback) {
  309. successCallback(result.data);
  310. }
  311. } else if (result.err === 2) {
  312. toastr.error('error: ' + result.msg);
  313. setTimeout(function () {
  314. window.location.href = '/login';
  315. },1000);
  316. } else {
  317. toastr.error('error: ' + result.msg);
  318. if (errorCallBack) {
  319. errorCallBack(result.msg);
  320. }
  321. }
  322. if (htype === 'wait') closeWaitingView();
  323. if (htype === 'progress') closeProgress();
  324. },
  325. error: function(jqXHR, textStatus, errorThrown){
  326. toastr.error('error: ' + textStatus + " " + errorThrown);
  327. if (errorCallBack) {
  328. errorCallBack();
  329. }
  330. if (htype === 'wait') closeWaitingView();
  331. if (htype === 'progress') closeProgress();
  332. }
  333. });
  334. };
  335. /**
  336. * 动态请求数据
  337. * @param {String} url - 请求链接
  338. * @param data - 提交数据
  339. * @param {function} successCallback - 返回成功回调
  340. * @param {function} errorCallBack - 返回失败回调
  341. */
  342. const postDataWithFile = function (url, formData, successCallback, errorCallBack, showWaiting = true) {
  343. if (showWaiting) showWaitingView();
  344. if (formData.getAll('file[]').length > 10) {
  345. toastr.error('文件数量不能多于10个');
  346. if (showWaiting) closeWaitingView();
  347. return
  348. }
  349. $.ajax({
  350. type:"POST",
  351. url: url,
  352. data: formData,
  353. dataType: 'json',
  354. cache: false,
  355. // 告诉jQuery不要去设置Content-Type请求头
  356. contentType: false,
  357. // 告诉jQuery不要去处理发送的数据
  358. processData: false,
  359. timeout: postDefaultTime,
  360. beforeSend: function(xhr) {
  361. let csrfToken = Cookies.get('csrfToken_j');
  362. xhr.setRequestHeader('x-csrf-token', csrfToken);
  363. },
  364. success: function(result){
  365. if (result.err === 0) {
  366. if (successCallback) {
  367. successCallback(result.data);
  368. }
  369. } else if (result.err === 2) {
  370. toastr.error('error: ' + result.msg);
  371. setTimeout(function () {
  372. window.location.href = '/login';
  373. },1000);
  374. } else {
  375. toastr.error('error: ' + result.msg);
  376. if (errorCallBack) {
  377. errorCallBack();
  378. }
  379. }
  380. if (showWaiting) closeWaitingView();
  381. },
  382. error: function(jqXHR, textStatus, errorThrown){
  383. toastr.error('error: ' + textStatus + " " + errorThrown);
  384. if (errorCallBack) {
  385. errorCallBack();
  386. }
  387. if (showWaiting) closeWaitingView();
  388. }
  389. });
  390. };
  391. const postDataWithFileProgress = function (url, formData, successCallback, errorCallBack) {
  392. showUploadFileProgress();
  393. $.ajax({
  394. type:"POST",
  395. url: url,
  396. data: formData,
  397. dataType: 'json',
  398. cache: false,
  399. // 告诉jQuery不要去设置Content-Type请求头
  400. contentType: false,
  401. // 告诉jQuery不要去处理发送的数据
  402. processData: false,
  403. beforeSend: function(xhr) {
  404. let csrfToken = Cookies.get('csrfToken_j');
  405. xhr.setRequestHeader('x-csrf-token', csrfToken);
  406. },
  407. success: function(result){
  408. doneProgress();
  409. if (result.err === 0) {
  410. if (successCallback) {
  411. successCallback(result.data);
  412. }
  413. } else if (result.err === 2) {
  414. toastr.error('error: ' + result.msg);
  415. setTimeout(function () {
  416. window.location.href = '/login';
  417. },1000);
  418. } else {
  419. toastr.error('error: ' + result.msg);
  420. if (errorCallBack) {
  421. errorCallBack();
  422. }
  423. }
  424. closeProgress();
  425. },
  426. error: function(jqXHR, textStatus, errorThrown){
  427. toastr.error('error: ' + textStatus + " " + errorThrown);
  428. if (errorCallBack) {
  429. errorCallBack();
  430. }
  431. closeProgress();
  432. },
  433. xhr: function() {
  434. var xhr = new XMLHttpRequest();
  435. //使用XMLHttpRequest.upload监听上传过程,注册progress事件,打印回调函数中的event事件
  436. xhr.upload.addEventListener('progress', function (e) {
  437. console.log(e);
  438. //loaded代表上传了多少
  439. //total代表总数为多少
  440. var progressRate = (e.loaded / e.total) * 95;
  441. //通过设置进度条的宽度达到效果
  442. setUploadFileProgress(progressRate);
  443. })
  444. return xhr;
  445. }
  446. });
  447. }
  448. const postCompressFile = function (url, data, successCallback, errorCallBack) {
  449. $.ajax({
  450. type:"POST",
  451. url: url,
  452. data: {'data': JSON.stringify(data)},
  453. // dataType: 'blob',
  454. cache: false,
  455. timeout: 180000,
  456. xhrFields: {
  457. responseType: 'blob'
  458. },
  459. beforeSend: function(xhr) {
  460. let csrfToken = Cookies.get('csrfToken_j');
  461. xhr.setRequestHeader('x-csrf-token', csrfToken);
  462. },
  463. success: function(result){
  464. // if (result.err === 0) {
  465. // if (successCallback) {
  466. // successCallback(result.data);
  467. // }
  468. // } else if (result.err === 2) {
  469. // toastr.error('error: ' + result.msg);
  470. // setTimeout(function () {
  471. // window.location.href = '/login';
  472. // },1000);
  473. // } else {
  474. // toastr.error('error: ' + result.msg);
  475. // if (errorCallBack) {
  476. // errorCallBack(result.msg);
  477. // }
  478. // }
  479. if (successCallback) {
  480. successCallback(result)
  481. }
  482. },
  483. error: function(jqXHR, textStatus, errorThrown){
  484. // console.log(jqXHR, textStatus, errorThrown);
  485. // toastr.error('error: ' + textStatus + " " + errorThrown);
  486. if (errorCallBack) {
  487. errorCallBack();
  488. }
  489. }
  490. });
  491. }
  492. /**
  493. * 获取url中参数
  494. * @param variable
  495. * @returns {*}
  496. */
  497. function getQueryVariable(variable) {
  498. var query = window.location.search.substring(1);
  499. var vars = query.split("&");
  500. for (var i=0;i<vars.length;i++) {
  501. var pair = vars[i].split("=");
  502. if(pair[0] == variable){return pair[1];}
  503. }
  504. return(false);
  505. }
  506. const zeroRange = 0.00000001;
  507. function checkZero(value) {
  508. return value === null || value === undefined || (_.isNumber(value) && Math.abs(value) < zeroRange);
  509. }
  510. function checkFieldChange(o, n) {
  511. return o == n || ((!o || o === '') && (n === ''));
  512. }
  513. var bShowWaiting = false, beginWaitingTime;
  514. //关闭等待窗口
  515. function closeWaitingView() {
  516. bShowWaiting = false;
  517. const time = parseInt(new Date());
  518. setTimeout(function () {
  519. var bgDiv = document.getElementById("bgDiv");
  520. var msgDiv = document.getElementById("msgDiv");
  521. //移除背景遮罩层div
  522. if(bgDiv != null){
  523. document.body.removeChild(bgDiv);
  524. }
  525. //移除中间信息提示层div
  526. if(msgDiv != null){
  527. document.body.removeChild(msgDiv);
  528. }
  529. }, Math.max(beginWaitingTime - time + 500, 0));
  530. }
  531. //显示等待窗口
  532. function showWaitingView() {
  533. // bShowWaiting = true;
  534. // setTimeout(function () {
  535. // if (!bShowWaiting) return;
  536. // beginWaitingTime = parseInt(new Date());
  537. // var msgw = 300; //提示窗口的宽度
  538. // var msgh = 100; //提示窗口的高度
  539. //
  540. // var sWidth, sHeight;
  541. // sWidth = document.body.clientWidth;
  542. // sHeight = document.body.clientHeight;
  543. //
  544. // //背景遮罩层div
  545. // var bgObj = document.createElement("div");
  546. // bgObj.setAttribute('id', 'bgDiv');
  547. // bgObj.style.zIndex = '9998';
  548. // bgObj.style.position = "absolute";
  549. // bgObj.style.top = "0px";
  550. // bgObj.style.background = "#888";
  551. // bgObj.style.filter = "progid:DXImageTransform.Microsoft.Alpha(style=3,opacity=25,finishOpacity=75";
  552. // bgObj.style.opacity = "0.6";
  553. // bgObj.style.left = "0px";
  554. // bgObj.style.width = sWidth + "px";
  555. // bgObj.style.height = sHeight + "px";
  556. // document.body.appendChild(bgObj);
  557. //
  558. // //信息提示层div
  559. // var msgObj = document.createElement("div");
  560. // msgObj.style.zIndex = '9999';
  561. // msgObj.setAttribute("id", "msgDiv");
  562. // msgObj.setAttribute("align", "center");
  563. // msgObj.style.position = "absolute";
  564. // msgObj.style.font = "12px/1.6em Verdana, Geneva, Arial, Helvetica, sans-serif";
  565. // msgObj.style.width = msgw + "px";
  566. // msgObj.style.height = msgh + "px";
  567. // msgObj.style.top = (document.documentElement.scrollTop + (sHeight - msgh) / 2) + "px";
  568. // msgObj.style.left = (sWidth - msgw) / 2 + "px";
  569. // document.body.appendChild(msgObj);
  570. //
  571. // //中间等待图标
  572. // document.getElementById("msgDiv").innerHTML = '<i class="fa fa-spinner fa-pulse fa-3x fa-fw"></i>';
  573. // }, 1000);
  574. beginWaitingTime = parseInt(new Date());
  575. var msgw = 300; //提示窗口的宽度
  576. var msgh = 100; //提示窗口的高度
  577. var sWidth, sHeight;
  578. sWidth = document.body.clientWidth;
  579. sHeight = document.body.clientHeight;
  580. //背景遮罩层div
  581. var bgObj = document.createElement("div");
  582. bgObj.setAttribute('id', 'bgDiv');
  583. bgObj.style.zIndex = '9998';
  584. bgObj.style.position = "absolute";
  585. bgObj.style.top = "0px";
  586. // bgObj.style.background = "#888";
  587. bgObj.style.filter = "progid:DXImageTransform.Microsoft.Alpha(style=3,opacity=25,finishOpacity=75";
  588. bgObj.style.opacity = "0.6";
  589. bgObj.style.left = "0px";
  590. bgObj.style.width = sWidth + "px";
  591. bgObj.style.height = sHeight + "px";
  592. document.body.appendChild(bgObj);
  593. //信息提示层div
  594. var msgObj = document.createElement("div");
  595. msgObj.style.zIndex = '9999';
  596. msgObj.setAttribute("id", "msgDiv");
  597. msgObj.setAttribute("align", "center");
  598. msgObj.style.position = "absolute";
  599. msgObj.style.font = "12px/1.6em Verdana, Geneva, Arial, Helvetica, sans-serif";
  600. msgObj.style.width = msgw + "px";
  601. msgObj.style.height = msgh + "px";
  602. msgObj.style.top = (document.documentElement.scrollTop + (sHeight - msgh) / 2) + "px";
  603. msgObj.style.left = (sWidth - msgw) / 2 + "px";
  604. document.body.appendChild(msgObj);
  605. //中间等待图标
  606. document.getElementById("msgDiv").innerHTML = '<i class="fa fa-spinner fa-pulse fa-3x fa-fw"></i>';
  607. }
  608. let progressInterval;
  609. function showProgress() {
  610. var sWidth, sHeight;
  611. sWidth = document.body.clientWidth;
  612. sHeight = document.body.clientHeight;
  613. //背景遮罩层div
  614. var bgObj = document.createElement("div");
  615. bgObj.setAttribute('id', 'bgDiv');
  616. bgObj.style.zIndex = '9998';
  617. bgObj.style.position = "absolute";
  618. bgObj.style.top = "0px";
  619. bgObj.style.background = "#888";
  620. bgObj.style.filter = "progid:DXImageTransform.Microsoft.Alpha(style=3,opacity=25,finishOpacity=75";
  621. bgObj.style.opacity = "0.6";
  622. bgObj.style.left = "0px";
  623. bgObj.style.width = sWidth + "px";
  624. bgObj.style.height = sHeight + "px";
  625. document.body.appendChild(bgObj);
  626. //信息提示层div
  627. var msgObj = document.createElement("div");
  628. msgObj.classList.add('progress');
  629. msgObj.style.zIndex = '9999';
  630. msgObj.style.position = "absolute";
  631. msgObj.setAttribute("id", "progressDiv");
  632. msgObj.style.height = "2px";
  633. msgObj.style.width = "600px";
  634. msgObj.style.top = (document.documentElement.scrollTop + sHeight / 2) + "px";
  635. msgObj.style.left = (sWidth - 600) / 2 + "px";
  636. document.body.appendChild(msgObj);
  637. msgObj.innerHTML = '<div class="progress-bar" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100"></div>';
  638. const processObj = $('.progress-bar');
  639. let count = 0;
  640. progressInterval = setInterval(function () {
  641. const pos = parseInt(processObj.attr('aria-valuenow'));
  642. if (pos < 20) { // 1
  643. processObj.attr('aria-valuenow', pos + 2);
  644. processObj.width((pos + 2) + '%');
  645. } else if (pos < 40) { // 2
  646. processObj.attr('aria-valuenow', pos + 1);
  647. processObj.width((pos + 1) + '%');
  648. } else if (pos < 60) { // 4
  649. count += 1;
  650. if (count % 2 === 0) {
  651. processObj.attr('aria-valuenow', pos + 1);
  652. processObj.width((pos + 1) + '%');
  653. }
  654. } else if (pos < 80) { // 10
  655. count += 1;
  656. if (count % 5 === 0) {
  657. processObj.attr('aria-valuenow', pos + 1);
  658. processObj.width((pos + 1) + '%');
  659. }
  660. } else if (pos < 90) { // 15
  661. count += 1;
  662. if (count % 15 === 0) {
  663. processObj.attr('aria-valuenow', pos + 1);
  664. processObj.width((pos + 1) + '%');
  665. }
  666. } else if (pos < 95) { // 20
  667. count += 1;
  668. if (count % 40 === 0) {
  669. processObj.attr('aria-valuenow', pos + 1);
  670. processObj.width((pos + 1) + '%');
  671. }
  672. } else if (pos < 100) { // 30
  673. count += 1;
  674. if (count % 60 === 0) {
  675. processObj.attr('aria-valuenow', pos + 1);
  676. }
  677. }
  678. }, 100);
  679. }
  680. function doneProgress() {
  681. clearInterval(progressInterval);
  682. $('.progress-bar').attr('aria-valuenow', 100).width('100%');
  683. }
  684. function closeProgress() {
  685. setTimeout(function () {
  686. var bgDiv = document.getElementById("bgDiv");
  687. var msgDiv = document.getElementById("progressDiv");
  688. //移除背景遮罩层div
  689. if(bgDiv != null){
  690. document.body.removeChild(bgDiv);
  691. }
  692. //移除中间信息提示层div
  693. if(msgDiv != null){
  694. document.body.removeChild(msgDiv);
  695. }
  696. }, 500);
  697. }
  698. function showUploadFileProgress() {
  699. var sWidth, sHeight;
  700. sWidth = document.body.clientWidth;
  701. sHeight = document.body.clientHeight;
  702. //背景遮罩层div
  703. var bgObj = document.createElement("div");
  704. bgObj.setAttribute('id', 'bgDiv');
  705. bgObj.style.zIndex = '9998';
  706. bgObj.style.position = "absolute";
  707. bgObj.style.top = "0px";
  708. bgObj.style.background = "#888";
  709. bgObj.style.filter = "progid:DXImageTransform.Microsoft.Alpha(style=3,opacity=25,finishOpacity=75";
  710. bgObj.style.opacity = "0.6";
  711. bgObj.style.left = "0px";
  712. bgObj.style.width = sWidth + "px";
  713. bgObj.style.height = sHeight + "px";
  714. document.body.appendChild(bgObj);
  715. //信息提示层div
  716. var msgObj = document.createElement("div");
  717. msgObj.classList.add('progress');
  718. msgObj.style.zIndex = '9999';
  719. msgObj.style.position = "absolute";
  720. msgObj.setAttribute("id", "progressDiv");
  721. msgObj.style.height = "2px";
  722. msgObj.style.width = "600px";
  723. msgObj.style.top = (document.documentElement.scrollTop + sHeight / 2) + "px";
  724. msgObj.style.left = (sWidth - 600) / 2 + "px";
  725. document.body.appendChild(msgObj);
  726. msgObj.innerHTML = '<div class="progress-bar" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100"></div>';
  727. }
  728. function setUploadFileProgress(pos) {
  729. const processObj = $('.progress-bar');
  730. processObj.attr('aria-valuenow', pos);
  731. processObj.width(pos + '%');
  732. }
  733. /**
  734. * 设置本地缓存
  735. *
  736. * @param {String} key
  737. * @param {String|Number} value
  738. * @return {void}
  739. */
  740. function setLocalCache(key, value) {
  741. const storage = window.localStorage;
  742. if (!storage || key === '' || value === '') {
  743. return;
  744. }
  745. storage.setItem(key, value);
  746. }
  747. /**
  748. * 获取本地缓存
  749. *
  750. * @param {String} key
  751. * @return {String}
  752. */
  753. function getLocalCache(key) {
  754. const storage = window.localStorage;
  755. if (!storage || key === '') {
  756. return null;
  757. }
  758. return storage.getItem(key);
  759. }
  760. /**
  761. * 移除本地缓存
  762. * @param {String} key
  763. * @returns {Boolean}
  764. */
  765. function removeLocalCache(key) {
  766. const storage = window.localStorage;
  767. if (!storage || key === '') {
  768. return null;
  769. }
  770. return storage.removeItem(key);
  771. }
  772. //params: 需要复制的对象(元素)
  773. function copyToClipboard( text ) {
  774. var isRTL = document.documentElement.getAttribute('dir') == 'rtl';
  775. var aux = document.createElement('textarea');// 创建元素用于复制
  776. // Prevent zooming on iOS
  777. aux.style.fontSize = '12pt';
  778. // Reset box model
  779. aux.style.border = '0';
  780. aux.style.padding = '0';
  781. aux.style.margin = '0';
  782. // Move element out of screen horizontally
  783. aux.style.position = 'absolute';
  784. aux.style[isRTL ? 'right' : 'left'] = '-9999px';
  785. // Move element to the same position vertically
  786. var yPosition = window.pageYOffset || document.documentElement.scrollTop;
  787. aux.style.top = yPosition + 'px';
  788. aux.setAttribute('readonly', '');
  789. // 设置元素内容
  790. aux.value = text;
  791. // 将元素插入页面进行调用
  792. document.body.appendChild(aux);
  793. // 复制内容
  794. aux.select();
  795. aux.setSelectionRange(0, text.length);
  796. // 将内容复制到剪贴板
  797. document.execCommand("copy", true);
  798. // 删除创建元素
  799. document.body.removeChild(aux);
  800. }
  801. function toastMessageUniq (obj) {
  802. if (!obj.msg || !obj.type) return;
  803. if (!obj.once) {
  804. switch (obj.type) {
  805. case 'error':
  806. toastr.error(obj.msg);
  807. break;
  808. case 'warning':
  809. toastr.warning(obj.msg);
  810. break;
  811. case 'info':
  812. toastr.info(obj.msg);
  813. break;
  814. case 'success':
  815. toastr.success(obj.msg);
  816. break;
  817. }
  818. obj.once = true;
  819. }
  820. }
  821. function trimInvalidChar(str) {
  822. return $.trim(str).replace(/\n/g, '').replace(/\r/g, '').replace(/\t/g, '');
  823. }
  824. function cleanSymbols(str) {
  825. return $.trim(str).replace(/\\/g, '').replace(/\'/g, '').replace(/\"/g, '').replace(/\</g, '').replace(/\|/g, '');
  826. }
  827. jQuery.bootstrapLoading = {
  828. isLoading: function () {
  829. return $('#loadingPage').is(':visible');
  830. },
  831. start: function (options) {
  832. if(this.isLoading()){
  833. return;
  834. }
  835. var defaults = {
  836. opacity: 0.5,
  837. //loading页面透明度
  838. // backgroundColor: "#FFFFFF",
  839. //loading页面背景色
  840. borderColor: "#bbb",
  841. //提示边框颜色
  842. borderWidth: 1,
  843. //提示边框宽度
  844. borderStyle: "solid",
  845. //提示边框样式
  846. loadingTips: "Loading, please wait...",
  847. //提示文本
  848. TipsColor: "#fff",
  849. //提示颜色
  850. delayTime: 500,
  851. //页面加载完成后,加载页面渐出速度
  852. zindex: 2000,
  853. //loading页面层次
  854. sleep: 0
  855. //设置挂起,等于0时则无需挂起
  856. }
  857. var options = $.extend(defaults, options);
  858. //获取页面宽高
  859. var _PageHeight = document.documentElement.clientHeight,
  860. _PageWidth = document.documentElement.clientWidth;
  861. //在页面未加载完毕之前显示的loading Html自定义内容
  862. //var _LoadingHtml = '<div id="loadingPage" style="position:fixed;left:0;top:0;_position: absolute;width:100%;height:' + _PageHeight + 'px;background:' + options.backgroundColor + ';opacity:' + options.opacity + ';filter:alpha(opacity=' + options.opacity * 100 + ');z-index:' + options.zindex + ';"><div id="loadingTips" style="position: absolute; cursor1: wait; width: auto;border-color:' + options.borderColor + ';border-style:' + options.borderStyle + ';border-width:' + options.borderWidth + 'px; height:80px; line-height:80px; padding-left:80px; padding-right: 5px;border-radius:10px; background: ' + options.backgroundColor + ' url(/Content/bootstrap-loading/images/loading.gif) no-repeat 5px center; color:' + options.TipsColor + ';font-size:20px;">' + options.loadingTips + '</div></div>';
  863. var _LoadingHtml = '<div id="loadingPage" style="position:fixed;left:0;top:0;_position: absolute;width:100%;height:' + _PageHeight + 'px;background:' + options.backgroundColor + ';opacity:' + options.opacity + ';filter:alpha(opacity=' + options.opacity * 100 + ');z-index:' + options.zindex + ';"><div id="loadingTips" style="position: absolute; cursor1: wait; width: auto;">' +'<div class="text-green"><i class="fa fa-spinner fa-pulse fa-3x fa-fw"></i> <span class="sr-only">Loading...</span> </div> </div></div>';
  864. //呈现loading效果
  865. $("body").append(_LoadingHtml);
  866. //获取loading提示框宽高
  867. var _LoadingTipsH = document.getElementById("loadingTips").clientHeight,
  868. _LoadingTipsW = document.getElementById("loadingTips").clientWidth;
  869. //计算距离,让loading提示框保持在屏幕上下左右居中
  870. var _LoadingTop = _PageHeight > _LoadingTipsH ? (_PageHeight - _LoadingTipsH) / 2 : 0,
  871. _LoadingLeft = _PageWidth > _LoadingTipsW ? (_PageWidth - _LoadingTipsW) / 2 : 0;
  872. $("#loadingTips").css({
  873. "left": _LoadingLeft + "px",
  874. "top": _LoadingTop + "px"
  875. });
  876. //监听页面加载状态
  877. document.onreadystatechange = PageLoaded;
  878. //当页面加载完成后执行
  879. function PageLoaded() {
  880. if (document.readyState == "complete") {
  881. var loadingMask = $('#loadingPage');
  882. setTimeout(function () {
  883. loadingMask.animate({
  884. "opacity": 0
  885. },
  886. options.delayTime,
  887. function () {
  888. $(this).hide();
  889. });
  890. },
  891. options.sleep);
  892. }
  893. }
  894. },
  895. end: function () {
  896. $("#loadingPage").remove();
  897. },
  898. progressStop:true,
  899. progressStart:async function(title="导出文件",autoBar = false){
  900. if($("#progressModal").length == 0){
  901. let phtml = `<div class="modal fade" id="progressModal" data-backdrop="static">
  902. <div class="modal-dialog" role="document">
  903. <div class="modal-content">
  904. <div class="modal-header">
  905. <h5 class="modal-title" id="progress_modal_title">${title}</h5>
  906. </div>
  907. <div class="modal-body">
  908. <!--正在生成-->
  909. <h5 class="my-3" id="progress_modal_body">正在${title}</h5>
  910. <div class="progress mb-3">
  911. <div id="progress_modal_bar" class="progress-bar progress-bar-striped progress-bar-animated" role="progressbar" aria-valuenow="75" aria-valuemin="0" aria-valuemax="100" style="width: 10%"></div>
  912. </div>
  913. </div>
  914. </div>
  915. </div>
  916. </div>`;
  917. $("body").append(phtml);
  918. }else {
  919. $("#progress_modal_title").text(title);
  920. $("#progress_modal_body").text(`正在${title}`);
  921. }
  922. $("#progress_modal_bar").css('width','0%');
  923. $("#progressModal").modal('show');
  924. if(autoBar == true){//假的进度条
  925. $.bootstrapLoading.progressStop = false;
  926. let width = 0;
  927. while ($.bootstrapLoading.progressStop == false){
  928. await setTimeoutSync(null,1000);
  929. width += 5;
  930. if(width > 90) width -= 50;
  931. $("#progress_modal_bar").css('width',`${width}%`);
  932. }
  933. }
  934. },
  935. progressEnd:function () {
  936. $("#progress_modal_bar").css('width','100%');
  937. $.bootstrapLoading.progressStop = true;
  938. $("#progressModal").modal('hide');
  939. }
  940. };
  941. // 光标插入button内容
  942. $.fn.extend({
  943. insertAtCaret: function(myValue){
  944. var $t=$(this)[0];
  945. if (document.selection) {
  946. this.focus();
  947. sel = document.selection.createRange();
  948. sel.text = myValue;
  949. this.focus();
  950. }
  951. else
  952. if ($t.selectionStart || $t.selectionStart == '0') {
  953. var startPos = $t.selectionStart;
  954. var endPos = $t.selectionEnd;
  955. var scrollTop = $t.scrollTop;
  956. $t.value = $t.value.substring(0, startPos) + myValue + $t.value.substring(endPos, $t.value.length);
  957. this.focus();
  958. $t.selectionStart = startPos + myValue.length;
  959. $t.selectionEnd = startPos + myValue.length;
  960. $t.scrollTop = scrollTop;
  961. }
  962. else {
  963. this.value += myValue;
  964. this.focus();
  965. }
  966. }
  967. });
  968. const checkUtils = {
  969. posOver(data) {
  970. if (!data) return false;
  971. if (!data.quantity) return !!data.end_contract_qty;
  972. return data.quantity > 0
  973. ? data.end_contract_qty > data.final_1_qty
  974. : data.end_contract_qty < data.final_1_qty || data.end_contract_qty > 0;
  975. },
  976. billsOver(data, isTz, relaPos) {
  977. if (!data) return false;
  978. if (isTz) {
  979. const posRange = relaPos.ledgerPos[itemsPre + data.id] || [];
  980. if (posRange.length > 0) {
  981. for (const p of posRange) {
  982. if (checkUtils.posOver(p)) return true;
  983. }
  984. }
  985. if (data.is_tp) {
  986. if (!data.total_price) return !!data.end_contract_tp;
  987. return data.total_price > 0
  988. ? data.end_contract_tp > data.total_price
  989. : data.end_contract_tp < data.total_price || data.end_contract_tp > 0;
  990. } else {
  991. if (!data.quantity) return !!data.end_contract_qty;
  992. return data.quantity > 0
  993. ? data.end_contract_qty > data.final_1_qty
  994. : data.end_contract_qty < data.final_1_qty || data.end_contract_qty > 0;
  995. }
  996. } else {
  997. if (data.is_tp) {
  998. if (!data.deal_tp) return !!data.end_contract_tp;
  999. return data.deal_tp > 0
  1000. ? data.end_contract_tp > data.deal_tp
  1001. : data.end_contract_tp < data.deal_tp || data.end_contract_tp > 0;
  1002. } else {
  1003. if (!data.deal_qty) return !!data.end_contract_qty;
  1004. return data.deal_qty > 0
  1005. ? data.end_contract_qty > data.deal_final_1_qty
  1006. : data.end_contract_qty < data.deal_final_1_qty || data.end_contract_qty > 0;
  1007. }
  1008. }
  1009. },
  1010. compareCode(str1, str2, symbol = '-') {
  1011. if (!str1) {
  1012. return 1;
  1013. } else if (!str2) {
  1014. return -1;
  1015. }
  1016. function compareSubCode(code1, code2) {
  1017. if (numReg.test(code1)) {
  1018. if (numReg.test(code2)) {
  1019. return parseInt(code1) - parseInt(code2);
  1020. } else {
  1021. return -1
  1022. }
  1023. } else {
  1024. if (numReg.test(code2)) {
  1025. return 1;
  1026. } else {
  1027. return code1 === code2 ? 0 : (code1 < code2 ? -1 : 1); //code1.localeCompare(code2);
  1028. }
  1029. }
  1030. }
  1031. const numReg = /^[0-9]+$/;
  1032. const aCodes = str1.split(symbol), bCodes = str2.split(symbol);
  1033. for (let i = 0, iLength = Math.min(aCodes.length, bCodes.length); i < iLength; ++i) {
  1034. const iCompare = compareSubCode(aCodes[i], bCodes[i]);
  1035. if (iCompare !== 0) {
  1036. return iCompare;
  1037. }
  1038. }
  1039. return aCodes.length - bCodes.length;
  1040. },
  1041. };
  1042. Number.prototype.format2Str = function (pattern) {
  1043. var strarr = this?this.toString().split('.'):['0'];
  1044. var fmtarr = pattern?pattern.split('.'):[''];
  1045. var retstr='';
  1046. // 整数部分
  1047. var str = strarr[0];
  1048. var fmt = fmtarr[0];
  1049. var i = str.length-1;
  1050. var comma = false;
  1051. for(var f=fmt.length-1;f>=0;f--){
  1052. switch(fmt.substr(f,1)){
  1053. case '#':
  1054. if(i>=0 ) retstr = str.substr(i--,1) + retstr;
  1055. break;
  1056. case '0':
  1057. if(i>=0) retstr = str.substr(i--,1) + retstr;
  1058. else retstr = '0' + retstr;
  1059. break;
  1060. case ',':
  1061. comma = true;
  1062. retstr=','+retstr;
  1063. break;
  1064. }
  1065. }
  1066. if(i>=0){
  1067. if(comma){
  1068. var l = str.length;
  1069. for(;i>=0;i--){
  1070. retstr = str.substr(i,1) + retstr;
  1071. if(i>0 && ((l-i)%3)==0) retstr = ',' + retstr;
  1072. }
  1073. }
  1074. else retstr = str.substr(0,i+1) + retstr;
  1075. }
  1076. retstr = retstr+'.';
  1077. // 处理小数部分
  1078. str=strarr.length>1?strarr[1]:'';
  1079. fmt=fmtarr.length>1?fmtarr[1]:'';
  1080. i=0;
  1081. for(var f=0;f<fmt.length;f++){
  1082. switch(fmt.substr(f,1)){
  1083. case '#':
  1084. if(i<str.length) retstr+=str.substr(i++,1);
  1085. break;
  1086. case '0':
  1087. if(i<str.length) retstr+= str.substr(i++,1);
  1088. else retstr+='0';
  1089. break;
  1090. }
  1091. }
  1092. return retstr.replace(/^,+/,'').replace(/\.$/,'');
  1093. };
  1094. function transFormToChinese(num) {
  1095. const changeNum = ['零', '一', '二', '三', '四', '五', '六', '七', '八', '九'];
  1096. const unit = ["", "十", "百", "千", "万"];
  1097. num = parseInt(num);
  1098. let getWan = (temp) => {
  1099. let strArr = temp.toString().split("").reverse();
  1100. let newNum = "";
  1101. for (var i = 0; i < strArr.length; i++) {
  1102. newNum = (i == 0 && strArr[i] == 0 ? "" : (i > 0 && strArr[i] == 0 && strArr[i - 1] == 0 ? "" : changeNum[strArr[i]] + (strArr[i] == 0 ? unit[0] : unit[i]))) + newNum;
  1103. }
  1104. return strArr.length === 2 && newNum.indexOf("一十") !== -1 ? newNum.replace('一十', '十') : newNum;
  1105. }
  1106. let overWan = Math.floor(num / 10000);
  1107. let noWan = num % 10000;
  1108. if (noWan.toString().length < 4) noWan = "0" + noWan;
  1109. return overWan ? getWan(overWan) + "万" + getWan(noWan) : getWan(num);
  1110. }
  1111. function hpackArrBack(data) {
  1112. if (data.length === 0) return data;
  1113. if (data.length === 1) throw '数据错误';
  1114. const result = [];
  1115. //const keyIndex = {};
  1116. // data[0].forEach((x, i) => {
  1117. // keyIndex[x] = i;
  1118. // });
  1119. const key = data[0];
  1120. data.forEach((d, i) => {
  1121. if (i === 0) return;
  1122. const obj = {};
  1123. d.forEach((v, j) => {
  1124. if (v === undefined) return;
  1125. obj[key[j]] = v;
  1126. });
  1127. result.push(obj);
  1128. });
  1129. return result;
  1130. }
  1131. const spreadColor = {
  1132. stage: {
  1133. over: '#FF9595', //'#ff6f5c', '#f8d7da'
  1134. differ: '#F2DEDE',
  1135. },
  1136. gcl: {
  1137. differ: '#FFE699', // 同编号时,名称、单位、单价存在不同
  1138. calc_differ: '#f8d7da', //
  1139. },
  1140. pay: {
  1141. expr_err: '#FF9595',
  1142. pause: '#f2f2f2',
  1143. yf_without: '#d6d8db',
  1144. cur_add: '#FFFFE1',
  1145. }
  1146. };
  1147. $(document).ready(function () {
  1148. $('.modal').draggable({handle: '.modal-header'});
  1149. });