modifyCylinderInfo.jsp 38 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057
  1. <%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
  2. <%
  3. String path = request.getContextPath();
  4. String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
  5. %>
  6. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  7. <html>
  8. <head>
  9. <%-- <base href="<%=basePath%>"> --%>
  10. <title>修改气瓶信息</title>
  11. <meta http-equiv="pragma" content="no-cache">
  12. <meta http-equiv="cache-control" content="no-cache">
  13. <meta http-equiv="expires" content="0">
  14. <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
  15. <meta http-equiv="description" content="This is my page">
  16. <meta http-equiv="X-UA-Compatible" content="IE=9"/>
  17. <meta http-equiv="X-UA-Compatible" content="IE=10"/>
  18. <link rel="stylesheet" type="text/css" href="css/easyui/themes/default/easyui.css">
  19. <link rel="stylesheet" type="text/css" href="css/easyui/themes/icon.css">
  20. <link rel="stylesheet" type="text/css" href="css/easyui/demo/demo.css">
  21. <script type="text/javascript" src="css/easyui/jquery.min.js"></script>
  22. <script type="text/javascript" src="css/easyui/jquery.easyui.min.js" charset="utf-8"></script>
  23. <script type="text/javascript" src="css/easyui/locale/easyui-lang-zh_CN.js" charset="utf-8"></script>
  24. <link rel="stylesheet" type="text/css" href="css/common/hzbstyle.css">
  25. <!-- <script type="text/javascript" src="js/tool.js"></script> -->
  26. <script type="text/javascript" src="js/beforeDatagrid.js"></script>
  27. <script type="text/javascript">
  28. function isNull(exp){
  29. if(!exp || typeof exp=="undefined" || exp.length==0){
  30. return true;
  31. }else{
  32. return false;
  33. }
  34. }
  35. function confirm(okStr,cancelStr,tip,content,unitNo){
  36. $.messager.defaults = { ok: okStr, cancel: cancelStr };
  37. $.messager.confirm(tip, content,function (data) {
  38. if (data) {
  39. }else {
  40. if(isNull(unitNo)){
  41. showMsg("提示", "未获取到此单位的编号,操作失败!", 5000);
  42. }else{
  43. $.ajax({
  44. type: 'POST',
  45. url: "updateUnitTip",
  46. data: {
  47. "unitNo":unitNo
  48. },
  49. dataType:'text',
  50. success: function (data) {
  51. var pData = $.parseJSON(data);
  52. switch (pData.result) {
  53. case 0:
  54. showMsg("提示","操作失败",5000);
  55. break;
  56. case 1:
  57. showMsg("提示","操作成功",2000);
  58. break;
  59. }
  60. }
  61. });
  62. }
  63. }
  64. });
  65. }
  66. function showMsg(title,msg,out){
  67. $.messager.show({
  68. title: title,
  69. msg: msg,
  70. timeout:out
  71. });
  72. }
  73. function showProgress(title,msg,text){
  74. $.messager.progress({
  75. title: title,
  76. msg: msg,
  77. text: text
  78. });
  79. }
  80. function checkedbox(name){
  81. var arr=new Array();
  82. var checkbox=document.getElementsByName(name);
  83. for(var i=0;i<checkbox.length;i++){
  84. if(checkbox[i].checked==true){
  85. arr.push(checkbox[i].value);
  86. }
  87. }
  88. return arr;
  89. }
  90. function getCheckTree(id){
  91. var nodes = $("#"+id).tree('getChecked', ['checked']);
  92. var arr=new Array();
  93. for(var i=0; i<nodes.length; i++){
  94. if(nodes[i].checked==true){
  95. if(nodes[i].id.length==1){
  96. arr.push("0"+nodes[i].id);
  97. }else if(nodes[i].id.length==2){
  98. arr.push(nodes[i].id+"0000");
  99. }else if(nodes[i].id.length==4){
  100. arr.push(nodes[i].id+"00");
  101. }else{
  102. arr.push(nodes[i].id);
  103. }
  104. }
  105. }
  106. return arr;
  107. }
  108. function getCheckTreeName(id){
  109. var nodes = $("#"+id).tree('getChecked', ['checked']);
  110. var arr=new Array();
  111. for(var i=0; i<nodes.length; i++){
  112. if(nodes[i].checked==true){
  113. arr.push(nodes[i].text);
  114. }
  115. }
  116. return arr;
  117. }
  118. function isCarNo(str) {//验证车牌号
  119. return /(^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领]{1}[A-Z0-9]{6}$)|(^[A-Z]{2}[A-Z0-9]{2}[A-Z0-9\u4E00-\u9FA5]{1}[A-Z0-9]{4}$)|(^[\u4E00-\u9FA5]{1}[A-Z0-9]{5}[挂学警军港澳]{1}$)|(^[A-Z]{2}[0-9]{5}$)|(^(08|38){1}[A-Z0-9]{4}[A-Z0-9挂学警军港澳]{1}$)/.test(str);
  120. //return /(^[\u4E00-\u9FA5]{1}[A-Z0-9]{6}$)|(^[A-Z]{2}[A-Z0-9]{2}[A-Z0-9\u4E00-\u9FA5]{1}[A-Z0-9]{4}$)|(^[\u4E00-\u9FA5]{1}[A-Z0-9]{5}[挂学警军港澳]{1}$)|(^[A-Z]{2}[0-9]{5}$)|(^(08|38){1}[A-Z0-9]{4}[A-Z0-9挂学警军港澳]{1}$)/.test(str);
  121. }
  122. function isCarNo1(str){
  123. return /(^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}(([0-9]{5}[DF])|([DF]([A-HJ-NP-Z0-9])[0-9]{4})))|([京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}[A-HJ-NP-Z0-9]{4}[A-HJ-NP-Z0-9挂学警港澳]{1}$)/.test(str);
  124. }
  125. /**
  126. * 获取上一个月
  127. *
  128. * @date 格式为yyyy-mm-dd的日期,如:2014-01-25
  129. */
  130. function getPreMonth(date) {
  131. var arr = date.split('-');
  132. var year = arr[0]; //获取当前日期的年份
  133. var month = arr[1]; //获取当前日期的月份
  134. var day = arr[2]; //获取当前日期的日
  135. var days = new Date(year, month, 0);
  136. days = days.getDate(); //获取当前日期中月的天数
  137. var year2 = year;
  138. var month2 = parseInt(month) - 1;
  139. if (month2 == 0) {//如果是1月份,则取上一年的12月份
  140. year2 = parseInt(year2) - 1;
  141. month2 = 12;
  142. }
  143. var day2 = day;
  144. var days2 = new Date(year2, month2, 0);
  145. days2 = days2.getDate();
  146. if (day2 > days2) {//如果原来日期大于上一月的日期,则取当月的最大日期。比如3月的30日,在2月中没有30
  147. day2 = days2;
  148. }
  149. if (month2 < 10) {
  150. month2 = '0' + month2;//月份填补成2位。
  151. }
  152. var date11 = new Date();
  153. var hor = date11.getHours()>9?date11.getHours():"0"+date11.getHours();
  154. var min = date11.getMinutes()>9?date11.getMinutes():"0"+date11.getMinutes();
  155. var sec = date11.getSeconds()>9?date11.getSeconds():"0"+date11.getSeconds();
  156. var t2 = year2 + '-' + month2 + '-' + day2+" "+hor+":"+min+":"+sec;
  157. return t2;
  158. }
  159. /**
  160. * 获取上一个月
  161. *
  162. * @date 格式为yyyy-mm-dd的日期,如:2014-01-25
  163. */
  164. function getPreMonth1(date) {
  165. var arr = date.split('-');
  166. var year = arr[0]; //获取当前日期的年份
  167. var month = arr[1]; //获取当前日期的月份
  168. var day = arr[2]; //获取当前日期的日
  169. var days = new Date(year, month, 0);
  170. days = days.getDate(); //获取当前日期中月的天数
  171. var year2 = year;
  172. var month2 = parseInt(month) - 1;
  173. if (month2 == 0) {//如果是1月份,则取上一年的12月份
  174. year2 = parseInt(year2) - 1;
  175. month2 = 12;
  176. }
  177. var day2 = day;
  178. var days2 = new Date(year2, month2, 0);
  179. days2 = days2.getDate();
  180. if (day2 > days2) {//如果原来日期大于上一月的日期,则取当月的最大日期。比如3月的30日,在2月中没有30
  181. day2 = days2;
  182. }
  183. if (month2 < 10) {
  184. month2 = '0' + month2;//月份填补成2位。
  185. }
  186. var hor = "00";
  187. var min = "00";
  188. var sec = "00";
  189. var t2 = year2 + '-' + month2 + '-' + day2+" "+hor+":"+min+":"+sec;
  190. return t2;
  191. }
  192. function getPreMonth2(date) {
  193. var arr = date.split('-');
  194. var year = arr[0]; //获取当前日期的年份
  195. var month = arr[1]; //获取当前日期的月份
  196. var day = arr[2]; //获取当前日期的日
  197. var days = new Date(year, month, 0);
  198. days = days.getDate(); //获取当前日期中月的天数
  199. var year2 = year;
  200. var month2 = parseInt(month) - 1;
  201. if (month2 == 0) {//如果是1月份,则取上一年的12月份
  202. year2 = parseInt(year2) - 1;
  203. month2 = 12;
  204. }
  205. var day2 = day;
  206. var days2 = new Date(year2, month2, 0);
  207. days2 = days2.getDate();
  208. if (day2 > days2) {//如果原来日期大于上一月的日期,则取当月的最大日期。比如3月的30日,在2月中没有30
  209. day2 = days2;
  210. }
  211. if (month2 < 10) {
  212. month2 = '0' + month2;//月份填补成2位。
  213. }
  214. var hor = "00";
  215. var min = "00";
  216. var sec = "00";
  217. day2 = "01";
  218. var t2 = year2 + '-' + month2 + '-' + day2+" "+hor+":"+min+":"+sec;
  219. return t2;
  220. }
  221. function getNowDay(date) {
  222. var arr = date.split('-');
  223. var year = arr[0]; //获取当前日期的年份
  224. var month = arr[1]; //获取当前日期的月份
  225. var day = arr[2]; //获取当前日期的日
  226. var days = new Date(year, month, 0);
  227. days = days.getDate(); //获取当前日期中月的天数
  228. var year2 = year;
  229. var month2 = parseInt(month) - 0;
  230. if (month2 == 0) {//如果是1月份,则取上一年的12月份
  231. year2 = parseInt(year2) - 1;
  232. month2 = 12;
  233. }
  234. var day2 = day;
  235. var days2 = new Date(year2, month2, 0);
  236. days2 = days2.getDate();
  237. if (day2 > days2) {//如果原来日期大于上一月的日期,则取当月的最大日期。比如3月的30日,在2月中没有30
  238. day2 = days2;
  239. }
  240. if (month2 < 10) {
  241. month2 = '0' + month2;//月份填补成2位。
  242. }
  243. var date11 = new Date();
  244. var hor = date11.getHours()>9?date11.getHours():"0"+date11.getHours();
  245. var min = date11.getMinutes()>9?date11.getMinutes():"0"+date11.getMinutes();
  246. var sec = date11.getSeconds()>9?date11.getSeconds():"0"+date11.getSeconds();
  247. var t2 = year2 + '-' + month2 + '-' + day2;
  248. return t2;
  249. }
  250. function getBeforeDate(number) {
  251. const num = number;
  252. const date = new Date();
  253. let year = date.getFullYear();
  254. let mon = date.getMonth() + 1;
  255. let day = date.getDate();
  256. if (day <= num) {
  257. if (mon > 1) {
  258. mon = mon - 1;
  259. } else {
  260. year = year - 1;
  261. mon = 12;
  262. }
  263. }
  264. date.setDate(date.getDate() - num);
  265. year = date.getFullYear();
  266. mon = date.getMonth() + 1;
  267. day = date.getDate();
  268. const s = year + '-' + (mon < 10 ? ('0' + mon) : mon) + '-' + (day < 10 ? ('0' + day) : day);
  269. return s;
  270. }
  271. function compareDate(date1,date2){
  272. var oDate1 = new Date(date1);
  273. var oDate2 = new Date(date2);
  274. if(oDate1.getTime() >= oDate2.getTime()){
  275. return true;
  276. } else {
  277. return false;
  278. }
  279. }
  280. function fnKeyUp(){
  281. this.value=this.value.toUpperCase();
  282. }
  283. function getDateAA(aa,dat){
  284. // var date1 = new Date(),
  285. // time1=date1.getFullYear()+"-"+(date1.getMonth()+1)+"-"+date1.getDate();//time1表示当前时间
  286. var date2 = new Date(dat);
  287. date2.setDate(date2.getDate()+aa);
  288. var time2 = date2.getFullYear()+"-"+(date2.getMonth()+1)+"-"+date2.getDate();
  289. return time2;
  290. }
  291. /**
  292. * 加密(需要先加载aes.min.js文件)
  293. * @param word
  294. * @returns {*}
  295. */
  296. function aesMinEncrypt(word){
  297. var _word = CryptoJS.enc.Utf8.parse(word),
  298. _key = CryptoJS.enc.Utf8.parse("hizimahzb2021Key"),
  299. _iv = CryptoJS.enc.Utf8.parse("hizimahzb2Key_Iv");
  300. var encrypted = CryptoJS.AES.encrypt(_word, _key, {
  301. iv: _iv,
  302. mode: CryptoJS.mode.CBC,
  303. padding: CryptoJS.pad.Pkcs7
  304. });
  305. return encrypted.toString();
  306. }
  307. /**
  308. * 解密(需要先加载aes.min.js文件)
  309. * @param word
  310. * @returns {*}
  311. */
  312. function aesDecrypt(word) {
  313. var _key = CryptoJS.enc.Utf8.parse("hizimahzb2021Key"),
  314. _iv = CryptoJS.enc.Utf8.parse("hizimahzb2Key_Iv");
  315. var decrypted = CryptoJS.AES.decrypt(word, _key, {
  316. iv: _iv,
  317. mode: CryptoJS.mode.CBC,
  318. padding: CryptoJS.pad.Pkcs7
  319. });
  320. return decrypted.toString(CryptoJS.enc.Utf8);
  321. }
  322. function addstr(ps){
  323. if(ps.length<16){
  324. ps = ps.padEnd(16, '0');
  325. }else if(ps.length>16&&ps.length>32){
  326. ps = ps.padEnd(32, '0');
  327. }else if(ps.length>32&&ps.length>48){
  328. ps = ps.padEnd(48, '0');
  329. }else if(ps.length>48&&ps.length>60){
  330. ps = ps.padEnd(60, '0');
  331. }
  332. return ps;
  333. }
  334. function encrypt(word){
  335. //这里传入自己定义的密钥,后端解密时也需要使用一样的密钥
  336. var key = CryptoJS.enc.Utf8.parse("abcdeabcde123456");
  337. var srcs = CryptoJS.enc.Utf8.parse(word);
  338. var encrypted = CryptoJS.AES.encrypt(srcs, key, {mode:CryptoJS.mode.ECB,padding: CryptoJS.pad.Pkcs7});
  339. return encrypted.toString();
  340. }
  341. </script>
  342. <style type="text/css">
  343. table tr td{
  344. font-size: 16px;
  345. }
  346. .tdclass{
  347. padding-left: 20px;
  348. font-size: 12px;
  349. }
  350. .tdclass1{
  351. font-size: 12px;
  352. }
  353. .colorRed{
  354. color: red;
  355. }
  356. .radiusDiv{
  357. margin-top: 0px;
  358. }
  359. .cylinderInput{
  360. width: 150px;
  361. }
  362. </style>
  363. <script type="text/javascript">
  364. var cylinderEdit = true;
  365. var selectedCityId="00";
  366. function getNowFormatDate() {
  367. var date = new Date();
  368. var seperator1 = "-";
  369. var year = date.getFullYear();
  370. var month = date.getMonth() + 1;
  371. var strDate = date.getDate();
  372. if (month >= 1 && month <= 9) {
  373. month = "0" + month;
  374. }
  375. if (strDate >= 0 && strDate <= 9) {
  376. strDate = "0" + strDate;
  377. }
  378. var currentdate = year + seperator1 + month + seperator1 + strDate;
  379. return currentdate;
  380. }
  381. window.onload = function() {
  382. var currentLoign = '<%=session.getAttribute("openid")%>';
  383. if(currentLoign&&currentLoign!="null"){
  384. }else{
  385. //window.location.replace('jsp/login/loginre.jsp' + window.location.search);
  386. }
  387. carGuid ='<%=request.getParameter("carGuid")%>';
  388. document.getElementById("carGuid").value = carGuid;
  389. document.getElementById("carNo").value = '<%=request.getParameter("carNo")%>';
  390. //document.getElementById("gettedCarNo").innerText = '<%=request.getParameter("carNo")%>';
  391. document.getElementById("cylinderinfotip").innerHTML="修改"+'<%=request.getParameter("carNo")%>'+"的气瓶信息";
  392. loadData(carGuid,1,100);
  393. }
  394. function compareDate(date1,date2){
  395. var oDate1 = new Date(date1);
  396. var oDate2 = new Date(date2);
  397. if(oDate1.getTime() >= oDate2.getTime()){
  398. return true;
  399. } else {
  400. return false;
  401. }
  402. }
  403. var installNum=0;
  404. var operType123=0;
  405. var carType=0;
  406. var installStationNo1="";
  407. var installStationNo2="";
  408. var installStationNo3="";
  409. var installStationNo4="";
  410. var installStationNo5="";
  411. var installStationNo6="";
  412. var installStationNo7="";
  413. var installStationNo8="";
  414. var examineCy=0;
  415. function loadData(carGuid,page,size){
  416. examineCy=0;
  417. installStationNo1="";
  418. installStationNo2="";
  419. installStationNo3="";
  420. installStationNo4="";
  421. installStationNo5="";
  422. installStationNo6="";
  423. installStationNo7="";
  424. installStationNo8="";
  425. showProgress('提示','请等待','请求源数据中……');
  426. $.ajax({
  427. type: 'POST',
  428. url: "ajax/getCylinderInfo",
  429. data: {
  430. "carGuid":carGuid,
  431. "page":page,
  432. "size":size
  433. },
  434. dataType:'text',
  435. success: function (data) {
  436. $.messager.progress('close');
  437. var vData = $.parseJSON(data);
  438. //installNum='<%=request.getParameter("installNum") %>';
  439. installNum = vData.installNum;
  440. for(var i=1;i<=installNum;i++){
  441. if(i==installNum){
  442. addCylinder(i,1);
  443. }else{
  444. addCylinder(i,0);
  445. }
  446. }
  447. $.each(vData.rows, function(i,item){
  448. //alert(item.carGuid);
  449. if(i>=installNum) return;
  450. if(item.cylinderGuid){
  451. operType123=1;
  452. }
  453. var j=i+1;
  454. carType = item.plateType;
  455. document.getElementById("cylinderGuid"+j).value=item.cylinderGuid;
  456. //第一行
  457. $("#cylinderNo"+j).textbox('setValue',item.cylinderNo);
  458. $("#cylinderType"+j).combobox('select', item.cylinderType);
  459. $("#manufacturer"+j).combobox('select', item.productNo);
  460. $("#productLicense"+j).textbox('setValue',item.productLicence);
  461. $("#productDate"+j).datebox('setValue',item.productDate1);
  462. //$("#installUnit"+j).combobox('select', item.installStationNo);
  463. switch(j){
  464. case 1:installStationNo1=item.installStationNo;break;
  465. case 2:installStationNo2=item.installStationNo;break;
  466. case 3:installStationNo3=item.installStationNo;break;
  467. case 4:installStationNo4=item.installStationNo;break;
  468. case 5:installStationNo5=item.installStationNo;break;
  469. case 6:installStationNo6=item.installStationNo;break;
  470. case 7:installStationNo7=item.installStationNo;break;
  471. case 8:installStationNo8=item.installStationNo;break;
  472. }
  473. //第二行
  474. $("#installLicense"+j).textbox('setValue',item.installLicence);
  475. $("#installCert"+j).textbox('setValue',item.installCert);
  476. $("#installType"+j).combobox('select', item.installType);
  477. if(item.installLoc){
  478. if(item.installLoc=="后备箱"){
  479. $("#installLocation"+j).combobox('select', 0);
  480. }else if(item.installLoc=="底部"){
  481. $("#installLocation"+j).combobox('select', 1);
  482. }else if(item.installLoc=="顶部"){
  483. $("#installLocation"+j).combobox('select', 2);
  484. }else if(item.installLoc=="货厢"){
  485. $("#installLocation"+j).combobox('select', 3);
  486. }else if(item.installLoc=="中部"){
  487. $("#installLocation"+j).combobox('select', 4);
  488. }
  489. }
  490. $("#installOper"+j).textbox('setValue',item.installWorkerName);
  491. //第三行
  492. $("#thirdInstall"+j).textbox('setValue',item.thirdPartyIntall);
  493. if(item.installDate1){
  494. $("#refitDate"+j).datebox('setValue',item.installDate1);
  495. }
  496. if(item.startUseDate1){
  497. $("#firstUseCK"+j).prop("checked", true);
  498. $("#firstUseDate"+j).datebox('setValue', item.startUseDate1);
  499. }
  500. if(item.nextCheckDate1){
  501. $("#nextCheckCK"+j).prop("checked", true);
  502. $("#nextCheckDate"+j).datebox('setValue', item.nextCheckDate1);
  503. }
  504. $("#vol"+j).textbox('setValue', item.vol);
  505. $("#yearLimit"+j).textbox('setValue',item.yearLimit==0?"不限制":item.yearLimit);
  506. //第四行
  507. $("#count"+j).textbox('setValue',item.timesAvailable==0?"不限制":item.timesAvailable);
  508. $("#productType"+j).textbox('setValue',item.productType);
  509. $("#weight"+j).textbox('setValue', item.weight);
  510. $("#wall"+j).textbox('setValue', item.thickness);
  511. $("#vol"+j).textbox('setValue', item.vol);
  512. $("#press"+j).textbox('setValue',item.press);
  513. //第五行
  514. $("#material"+j).textbox('setValue',item.material);
  515. $("#fibre"+j).textbox('setValue',item.fibre);
  516. $("#resin"+j).textbox('setValue', item.resin);
  517. $("#deviceCode"+j).textbox('setValue', item.EQUIPMENTNO);
  518. $("#mechanism1"+j).textbox('setValue', item.PRODUCTMONITOR);
  519. $("#mechanism2"+j).textbox('setValue',item.TYPETEST);
  520. //第六行
  521. $("#valveManufacturer"+j).textbox('setValue',item.VALVEPRODUCT);
  522. $("#valveModel"+j).textbox('setValue',item.VALVETYPE);
  523. $("#valveBatch"+j).textbox('setValue', item.VALVETYPE);
  524. $("#designUnit"+j).textbox('setValue', item.DESIGNUNIT);
  525. if(item.operState==0||item.operState==6){
  526. examineCy=1;
  527. }
  528. });
  529. if(vData.rows.length==0){
  530. examineCy=1;
  531. }
  532. if(examineCy==0){
  533. $('#saveCylinder').linkbutton('disable');
  534. $.messager.alert('提示','该车辆气瓶已被审核,不可修改');
  535. cylinderEdit = false;
  536. setTimeout(function(){
  537. window.close();
  538. }, 2000);
  539. }
  540. },
  541. error:function(e){
  542. $.messager.progress('close');
  543. console.log(e);
  544. }
  545. });
  546. }
  547. function addCylinder(num,secondP){
  548. if(num>8){
  549. //showMsg('提示', '最多增加8只气瓶,如需要更改,可重新打开此页面', 5000);
  550. $.messager.alert('提示','最多增加8只气瓶,如需更改,可返回车辆信息进行修改气瓶安装数量');
  551. return;
  552. }
  553. var content='<input type="text" style="display:none;" id="cylinderGuid'+num+'" name="cylinderGuid'+num+'" />';
  554. content+='<table id="table'+num+'" style="margin-top:20px">';
  555. content+='<tr>';
  556. content+='<td class="tdclass title">气瓶'+num+':</td>';
  557. content+='</tr><tr><td>&nbsp;</td></tr><tr>';
  558. content+='<td class="tdclass colorRed">气瓶编号:<br/>'+'<input id="cylinderNo'+num+'" name="cylinderNo'+num+'" style="height:34px;" class="easyui-textbox cylinderInput" />'+'</td>';
  559. var op='<option value="0">其他</option><option value="1">钢质气瓶</option><option value="2">钢质内胆环向缠绕气瓶</option><option value="3">铝合金内胆全缠绕气瓶</option><option value="4">塑料内胆全缠绕气瓶</option><option value="5" selected="selected">LNG液化天然气气瓶</option>';
  560. content+='<td class="tdclass colorRed">类&nbsp;&nbsp;&nbsp;&nbsp;型:<br/>'+'<select id="cylinderType'+num+'" name="cylinderType'+num+'" style="height:34px;" class="easyui-combobox cylinderInput">'+op+'</select>'+'</td>';
  561. content+='<td class="tdclass colorRed">制造单位:<br/>'+'<select id="manufacturer'+num+'" name="manufacturer'+num+'" style="height:34px;" class="easyui-combobox cylinderInput"></select>'+'</td>';
  562. content+='<td class="tdclass">生产许可:<br/>'+'<input id="productLicense'+num+'" name="productLicense'+num+'" style="height:34px;" class="easyui-datebox cylinderInput"/>'+'</td>';
  563. content+='<td class="tdclass colorRed">制造日期:<br/>'+'<input id="productDate'+num+'" name="productDate'+num+'" style="height:34px;" class="easyui-datebox cylinderInput"/>'+'</td>';
  564. content+='<td class="tdclass">安装单位:<br/>'+'<select id="installUnit'+num+'" name="installUnit'+num+'" style="height:34px;" class="easyui-combobox cylinderInput"></select>'+'</td>';
  565. content+='</tr><tr>';
  566. content+='<td class="tdclass">安装许可证:<br/>'+'<select id="installLicense'+num+'" name="installLicense'+num+'" style="height:34px;" class="easyui-combobox cylinderInput"></select>'+'</td>';
  567. content+='<td class="tdclass">安装合格证:<br/>'+'<select id="installCert'+num+'" name="installCert'+num+'" style="height:34px;" class="easyui-combobox cylinderInput"></select>'+'</td>';
  568. var op1='<option value="0">安装</option><option value="1">复装</option><option value="2">整车出厂</option>';
  569. content+='<td class="tdclass colorRed">安装类型:<br/>'+'<select id="installType'+num+'" name="installType'+num+'" style="height:34px;" class="easyui-combobox cylinderInput">'+op1+'</select>'+'</td>';
  570. var op2='<option value="0">后备箱</option><option value="1">底部</option><option value="2">顶部</option><option value="3">货厢</option><option value="4">中部</option>';
  571. content+='<td class="tdclass">安装位置:<br/>'+'<select id="installLocation'+num+'" name="installLocation'+num+'" style="height:34px;" class="easyui-combobox cylinderInput">'+op2+'</select>'+'</td>';
  572. content+='<td class="tdclass">安装人员:<br/>'+'<select id="installOper'+num+'" name="installOper'+num+'" style="height:34px;" class="easyui-combobox cylinderInput"></select>'+'</td>';
  573. content+='</tr><tr>';
  574. content+='<td class="tdclass">第三方安装:<br/>'+'<select id="thirdInstall'+num+'" name="thirdInstall'+num+'" style="height:34px;" class="easyui-combobox cylinderInput"></select>'+'</td>';
  575. content+='<td class="tdclass colorRed">改装出厂时间:<br/>'+'<input id="refitDate'+num+'" name="refitDate'+num+'" style="height:34px;" class="easyui-datebox cylinderInput"/>'+'</td>';
  576. content+='<td class="tdclass colorRed">初次投用时间(勾选复选框有效):<br/>'+'<input type="checkbox" name="firstUseCK'+num+'" id="firstUseCK'+num+'" /><input id="firstUseDate'+num+'" name="firstUseDate'+num+'" style="height:34px;" class="easyui-datebox cylinderInput"/>'+'</td>';
  577. content+='<td class="tdclass colorRed">下次检验时间(勾选复选框有效):<br/>'+'<input type="checkbox" name="nextCheckCK'+num+'" id="nextCheckCK'+num+'" /><input id="nextCheckDate'+num+'" name="nextCheckDate'+num+'" style="height:34px;" class="easyui-datebox cylinderInput"/>'+'</td>';
  578. content+='<td class="tdclass colorRed">容&nbsp;&nbsp;积&nbsp;L:<br/>'+'<input id="vol'+num+'" name="vol'+num+'" style="height:34px;" class="easyui-textbox cylinderInput"/>'+'</td>';
  579. content+='<td class="tdclass colorRed">年&nbsp;&nbsp;&nbsp;&nbsp;限:<br/>'+'<input id="yearLimit'+num+'" name="yearLimit'+num+'" style="height:34px;" class="easyui-textbox cylinderInput"/>'+'</td>';
  580. content+='</tr><tr>';
  581. content+='<td class="tdclass colorRed">次&nbsp;&nbsp;&nbsp;&nbsp;数:<br/>'+'<input id="count'+num+'" name="count'+num+'" style="height:34px;" class="easyui-textbox cylinderInput"/>'+'</td>';
  582. content+='<td class="tdclass">产品型号:<br/>'+'<select id="productType'+num+'" name="productType'+num+'" style="height:34px;" class="easyui-combobox cylinderInput"></select>'+'</td>';
  583. content+='<td class="tdclass">重&nbsp;&nbsp;&nbsp;&nbsp;量:<br/>'+'<input id="weight'+num+'" name="weight'+num+'" style="height:34px;" class="easyui-textbox cylinderInput"/>'+'</td>';
  584. content+='<td class="tdclass">壁&nbsp;&nbsp;&nbsp;&nbsp;厚:<br/>'+'<input id="wall'+num+'" name="wall'+num+'" style="height:34px;" class="easyui-textbox cylinderInput"/>'+'</td>';
  585. content+='<td class="tdclass">公称压力:<br/>'+'<input id="press'+num+'" name="press'+num+'" style="height:34px;" class="easyui-textbox cylinderInput"/>'+'</td>';
  586. content+='</tr>';
  587. content+='</tr><tr>';
  588. content+='<td class="tdclass">材&nbsp;&nbsp;&nbsp;&nbsp;质:<br/>'+'<select id="material'+num+'" name="material'+num+'" style="height:34px;" class="easyui-combobox cylinderInput"></select>'+'</td>';
  589. content+='<td class="tdclass">纤&nbsp;&nbsp;&nbsp;&nbsp;维:<br/>'+'<select id="fibre'+num+'" name="fibre'+num+'" style="height:34px;" class="easyui-combobox cylinderInput"></select>'+'</td>';
  590. content+='<td class="tdclass">树&nbsp;&nbsp;&nbsp;&nbsp;脂:<br/>'+'<select id="resin'+num+'" name="resin'+num+'" style="height:34px;" class="easyui-combobox cylinderInput"></select>'+'</td>';
  591. content+='<td class="tdclass">设备代码:<br/>'+'<input id="deviceCode'+num+'" name="deviceCode'+num+'" style="height:34px;" class="easyui-textbox cylinderInput"/>'+'</td>';
  592. content+='<td class="tdclass">制造监管检验机构:<br/>'+'<select id="mechanism1'+num+'" name="mechanism1'+num+'" style="height:34px;" class="easyui-combobox cylinderInput"></select>'+'</td>';
  593. content+='<td class="tdclass">型式试验机构:<br/>'+'<select id="mechanism2'+num+'" name="mechanism2'+num+'" style="height:34px;" class="easyui-combobox cylinderInput"></select>'+'</td>';
  594. content+='</tr><tr>';
  595. content+='<td class="tdclass">阀门厂家:<br/>'+'<select id="valveManufacturer'+num+'" name="valveManufacturer'+num+'" style="height:34px;" class="easyui-combobox cylinderInput"></select>'+'</td>';
  596. content+='<td class="tdclass">阀门型号:<br/>'+'<select id="valveModel'+num+'" name="valveModel'+num+'" style="height:34px;" class="easyui-combobox cylinderInput"></select>'+'</td>';
  597. content+='<td class="tdclass">阀门批次:<br/>'+'<select id="valveBatch'+num+'" name="valveBatch'+num+'" style="height:34px;" class="easyui-combobox cylinderInput"></select>'+'</td>';
  598. content+='<td class="tdclass">阀门批次:<br/>'+'<select id="designUnit'+num+'" name="designUnit'+num+'" style="height:34px;" class="easyui-combobox cylinderInput"></select>'+'</td>';
  599. //content+='<td class="tdclass">资质/证件:<br/>'+'<select id="cert'+num+'" style="height:34px;" class="easyui-filebox cylinderInput"></select>'+'</td>';
  600. // content+='<td class="tdclass">资质/证件:<br/>'+'<select id="cert'+num+'" style="height:34px;" class="easyui-filebox cylinderInput"></select>'+'</td>';
  601. //content+='<td calss="tdclass">资质/证件:<br/>'+'<input type="file" class="cylinderInput" style="height:34px;" name="cert' +num +'" />';
  602. content+='</tr><tr>';
  603. //content+='<td colspan="11" align="center">'+'<img id="add'+num+'" src="images/add.png" style="cursor:pointer;" onclick="addCylinder('+(num+1)+')" />'+'<img id="remove'+num+'" src="images/delete.png" style="cursor:pointer;" onclick="removeCylinder('+(num)+')" />'+'</td>';
  604. if(secondP==1){
  605. content+='<td>&nbsp;</td></tr><tr>';
  606. content+='<td colspan="11" align="center"><span style="font-size:12px;"><input type="checkbox" id="userknow" onchange="checkboxOnclick(this)">本人承诺上传气瓶数据、图片资料信息均真实有效,如因不实所产生的安全后果,用户自行承担!</span></td></tr><tr>';
  607. content+='<td colspan="11" align="center">'+'<a id="saveCylinder" href="javascript:void(0);" class="easyui-linkbutton" iconCls="icon-save1" plain="false" style="width:250px;height:50px;" onclick="saveCylinderInfo();">保存气瓶信息</a>'+'</td>';
  608. content+='</tr><tr><td>&nbsp;</td>';
  609. }
  610. content+='</tr></table>';
  611. $("#cylinderDiv").append(content);
  612. if(secondP==1){
  613. $("#saveCylinder").linkbutton({
  614. });
  615. }
  616. $('#saveCylinder').linkbutton('disable');
  617. $("#cylinderNo"+num).textbox({
  618. required:true,
  619. editable:true,
  620. prompt:'必填',
  621. });
  622. $("#cylinderType"+num).combobox({
  623. required:true,
  624. editable:false,
  625. panelHeight:'auto',
  626. valueField:'id',
  627. textField:'name',
  628. onSelect: function (rec) {
  629. $("#yearLimit"+num).textbox({
  630. required:true,
  631. editable:false,
  632. value:'不限制',
  633. });
  634. $("#count"+num).textbox({
  635. required:true,
  636. editable:false,
  637. value:'不限制',
  638. });
  639. if(rec.id==0){
  640. $("#yearLimit"+num).textbox("setValue","8");
  641. $("#count"+num).textbox("setValue","15000");
  642. }else if(rec.id==1){
  643. $("#yearLimit"+num).textbox("setValue","5");
  644. $("#count"+num).textbox("setValue","不限制");
  645. }else if(rec.id==2||rec.id==3){
  646. $("#yearLimit"+num).textbox("setValue","8");
  647. $("#count"+num).textbox("setValue","不限制");
  648. }else if(rec.id==4){
  649. $("#yearLimit"+num).textbox("setValue","不限制");
  650. $("#count"+num).textbox("setValue","不限制");
  651. }else{
  652. $("#yearLimit"+num).textbox("setValue","不限制");
  653. $("#count"+num).textbox("setValue","不限制");
  654. }
  655. }
  656. });
  657. $("#manufacturer"+num).combobox({
  658. url:"ajax/getCylinderProduct",
  659. valueField:'id',
  660. textField:'name',
  661. required:true,
  662. editable:false,
  663. panelHeight:'150px',
  664. prompt:'必选',
  665. });
  666. $("#productLicense"+num).textbox({
  667. required:false,
  668. editable:true,
  669. });
  670. $("#productDate"+num).datebox({
  671. required:true,
  672. editable:false,
  673. prompt:'必填',
  674. value:getNowFormatDate(),
  675. });
  676. $("#installUnit"+num).combobox({
  677. url:"ajax/getUnit123?cityId="+selectedCityId+"&countryId=00&&type=3",
  678. valueField:'id',
  679. textField:'name',
  680. required:false,
  681. editable:true,
  682. panelHeight:'150px',
  683. onLoadSuccess:function(){
  684. switch(num){
  685. case 1:$("#installUnit"+num).combobox('select', installStationNo1);break;
  686. case 2:$("#installUnit"+num).combobox('select', installStationNo2);break;
  687. case 3:$("#installUnit"+num).combobox('select', installStationNo3);break;
  688. case 4:$("#installUnit"+num).combobox('select', installStationNo4);break;
  689. case 5:$("#installUnit"+num).combobox('select', installStationNo5);break;
  690. case 6:$("#installUnit"+num).combobox('select', installStationNo6);break;
  691. case 7:$("#installUnit"+num).combobox('select', installStationNo7);break;
  692. case 8:$("#installUnit"+num).combobox('select', installStationNo8);break;
  693. }
  694. }
  695. });
  696. $("#installLicense"+num).textbox({
  697. required:false,
  698. editable:true,
  699. panelHeight:'auto',
  700. });
  701. $("#installCert"+num).textbox({
  702. required:false,
  703. editable:true,
  704. panelHeight:'auto',
  705. });
  706. $("#installType"+num).combobox({
  707. required:true,
  708. editable:false,
  709. panelHeight:'auto',
  710. prompt:'必选',
  711. });
  712. $("#installLocation"+num).combobox({
  713. required:false,
  714. editable:false,
  715. prompt:'必选',
  716. panelHeight:'auto',
  717. });
  718. $("#installOper"+num).textbox({
  719. required:false,
  720. editable:true,
  721. panelHeight:'auto',
  722. });
  723. $("#thirdInstall"+num).textbox({
  724. required:false,
  725. editable:true,
  726. panelHeight:'auto',
  727. });
  728. // $('#giveCardTime').datebox('setValue', getNowFormatDate());
  729. $("#refitDate"+num).datebox({
  730. required:true,
  731. editable:false,
  732. prompt:'必选',
  733. value:getNowFormatDate(),
  734. });
  735. $("#firstUseDate"+num).datebox({
  736. required:true,
  737. editable:false,
  738. prompt:'必选',
  739. value:getNowFormatDate(),
  740. });
  741. $("#nextCheckDate"+num).datebox({
  742. required:true,
  743. editable:false,
  744. prompt:'必选',
  745. value:getNowFormatDate(),
  746. });
  747. $("#vol"+num).numberbox({
  748. required:true,
  749. editable:true,
  750. precision:2,
  751. min:0,
  752. prompt:'必填',
  753. });
  754. $("#yearLimit"+num).textbox({
  755. required:true,
  756. editable:false,
  757. value:'不限制',
  758. });
  759. $("#count"+num).textbox({
  760. required:true,
  761. editable:false,
  762. value:'不限制',
  763. });
  764. $("#productType"+num).textbox({
  765. required:false,
  766. editable:true,
  767. });
  768. $("#weight"+num).textbox({
  769. required:false,
  770. editable:true,
  771. });
  772. $("#wall"+num).textbox({
  773. required:false,
  774. editable:true,
  775. });
  776. $("#press"+num).textbox({
  777. required:false,
  778. editable:true,
  779. });
  780. $("#material"+num).textbox({
  781. required:false,
  782. editable:true,
  783. });
  784. $("#fibre"+num).textbox({
  785. required:false,
  786. editable:true,
  787. });
  788. $("#resin"+num).textbox({
  789. required:false,
  790. editable:true,
  791. });
  792. $("#deviceCode"+num).textbox({
  793. required:false,
  794. editable:true,
  795. });
  796. $("#mechanism1"+num).textbox({
  797. required:false,
  798. editable:true,
  799. });
  800. $("#mechanism2"+num).textbox({
  801. required:false,
  802. editable:true,
  803. });
  804. $("#valveManufacturer"+num).textbox({
  805. required:false,
  806. editable:true,
  807. });
  808. $("#valveModel"+num).textbox({
  809. required:false,
  810. editable:true,
  811. });
  812. $("#valveBatch"+num).textbox({
  813. required:false,
  814. editable:true,
  815. });
  816. $("#designUnit"+num).textbox({
  817. required:false,
  818. editable:true,
  819. });
  820. // $("#cert"+num).filebox({
  821. // required:false,
  822. // editable:true,
  823. // });
  824. }
  825. function removeCylinder(num){
  826. $("#table"+num).remove();
  827. }
  828. function saveCylinderInfo(){
  829. if($("#cylinderInfoFrom").form('validate')){
  830. for(var i=1;i<=installNum;i++){
  831. var productDate123=$('#productDate'+i).datebox('getValue');
  832. var refitDate123=$('#refitDate'+i).datebox('getValue');
  833. var firstUseDate123=$('#firstUseDate'+i).datebox('getValue');
  834. var nextCheckDate123=$('#nextCheckDate'+i).datebox('getValue');
  835. if(!compareDate(refitDate123, productDate123)){
  836. //showMsg('提示', '气瓶'+i+':改装出厂时间应不小于制造日期', 5000);
  837. $.messager.alert('提示','气瓶'+i+':改装出厂时间应不小于制造日期');
  838. return;
  839. }
  840. if(!compareDate(firstUseDate123, refitDate123)){
  841. //showMsg('提示', '气瓶'+i+':初次投用时间应不小于改装出厂时间', 5000);
  842. $.messager.alert('提示','气瓶'+i+':改装出厂时间应不小于制造日期');
  843. return;
  844. }
  845. if(!compareDate(nextCheckDate123, firstUseDate123)){
  846. //showMsg('提示', '气瓶'+i+':下次检验时间应不小于初次投用时间', 5000);
  847. $.messager.alert('提示','气瓶'+i+':改装出厂时间应不小于制造日期');
  848. return;
  849. }
  850. }
  851. showProgress('提示','请等待','保存中……');
  852. $("#cylinderInfoFrom").form("submit",{
  853. url: "ajax/insertCylinderInfo?cylinderNum="+installNum+"&operType="+operType123+"&carType="+carType,
  854. onsubmit: function () {
  855. return $(this).form("validate");
  856. },
  857. success: function (data) {
  858. $.messager.progress('close');
  859. var pData = $.parseJSON(data);
  860. if(pData.result=="0"){
  861. //showMsg('提示', '操作成功,气瓶信息填写成功', 5000);
  862. $.messager.alert('提示','操作成功,气瓶信息填写成功');
  863. setTimeout(function(){
  864. window.close();
  865. }, 2000);
  866. }else{
  867. //showMsg('提示', '操作失败:'+pData.retinfo, 5000);
  868. $.messager.alert('提示','操作失败:'+pData.retinfo);
  869. }
  870. },
  871. error:function(e){
  872. $.messager.progress('close');
  873. console.log(e);
  874. },
  875. xhrFields: {
  876. withCredentials: true
  877. }
  878. });
  879. }else{
  880. //showMsg('提示', '验证未通过,有必填信息未填写!', 5000);
  881. $.messager.alert('提示','验证未通过,有必填信息未填写!');
  882. }
  883. }
  884. function returnCarInfo(){
  885. document.getElementById("cylinderinfodiv").style.display='none';
  886. document.getElementById("carinfodiv").style.display='';
  887. operType=1;//1未修改
  888. }
  889. function checkboxOnclick(checkbox){
  890. if(cylinderEdit==false){
  891. $('#saveCylinder').linkbutton('disable');
  892. }else{
  893. if(checkbox.checked){
  894. $('#saveCylinder').linkbutton('enable');
  895. }else{
  896. $('#saveCylinder').linkbutton('disable');
  897. }
  898. }
  899. }
  900. </script>
  901. </head>
  902. <body>
  903. <div id="cylinderinfodiv">
  904. <fieldset>
  905. <legend id="cylinderinfotip">气瓶信息</legend>
  906. <form id="cylinderInfoFrom" method="post" action="ajax/insertCylinderInfo">
  907. <input type="text" id="carGuid" name="carGuid" style="display: none;" />
  908. <input type="text" id="carNo" name="carNo" style="display: none;" />
  909. <div class="radiusDiv" id="cylinderDiv" >
  910. </div>
  911. </form>
  912. </fieldset>
  913. </div>
  914. </body>
  915. </html>