maintenanceListQuery.jsp 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342
  1. <%@ page language="java" contentType="text/html;charset=GBK"
  2. pageEncoding="GBK"%>
  3. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  4. <html>
  5. <head>
  6. <meta http-equiv="Content-Type" content="text/html;charset=GBK">
  7. <title>维修登记</title>
  8. <link href="${pageContext.request.contextPath }/liger/lib/ligerUI/skins/${sessionScope.css}/css/ligerui-all.css" rel="stylesheet" type="text/css" />
  9. <script src="${pageContext.request.contextPath }/liger/lib/jquery/jquery-1.3.2.min.js" type="text/javascript"></script>
  10. <script src="${pageContext.request.contextPath}/liger/lib/ligerUI/js/ligerui.all.js" type="text/javascript"></script>
  11. <link href="${pageContext.request.contextPath}/main.css" rel="stylesheet" type="text/css" />
  12. <script type="text/javascript" src="/shares/js/constant.js"></script>
  13. <script type="text/javascript" src="/shares/js/common.js"></script>
  14. <script type="text/javascript">
  15. $(function() {
  16. $("#start_time").ligerDateEditor({ showTime: true, width:160, labelAlign: 'left'});
  17. $("#end_time").ligerDateEditor({ showTime: true, width:160, labelAlign: 'left'});
  18. loadMaintenanceList();
  19. });
  20. var grid = null;
  21. function loadMaintenanceList(params1,params2,params3) {
  22. grid = $("#maintenanceList")
  23. .ligerGrid({columns : [
  24. {display : '车牌号',name : 'plate_number',width : 120},
  25. {display : '驾驶员',name : 'driver_name',width : 100},
  26. {display : '维保类型',name : 'if_maintain',width : 60,
  27. render :function(a,b){
  28. var s = a["if_maintain"];
  29. if(s=="1"){return '维修';}else{return '保养';}}},
  30. /* {display : '维修地点',name : 'within_outer_factory',width : 120,
  31. render :function(a,b){
  32. var s = a["within_outer_factory"];if(s=="1"){return '厂外';}else{return '厂内';}}}, */
  33. /* {display : '维修厂',name : 'repair_factory',width : 120,
  34. render : function(row){
  35. if(null !=row.repair_factory){
  36. var place = "";
  37. $.ajax({
  38. url:'carMaintenanceAction.do?task=tolook',
  39. async: false,
  40. type: 'post',
  41. data: {"within_outer_factory":row.within_outer_factory,"repair_factory":row.repair_factory},
  42. cache: false,
  43. error: function(obj){
  44. },
  45. success: function(obj){
  46. if(obj!=""){
  47. place = obj;
  48. }
  49. }
  50. });
  51. return place;
  52. }
  53. }}, */
  54. {display : '送修日期',name : 'repair_date',width : 140},
  55. {display : '预计取车日期',name : 'predict_date',width : 140},
  56. {display : '维保里程',name : 'maintenance_mileage',width : 120},
  57. {display : '下次保养里程',name : 'next_mileage',width : 120},
  58. {display : '审核状态',name : 'audit_state',width : 120,
  59. render :function(row){
  60. var html = '';
  61. if(row.audit_status=="1"){
  62. html = '<a href=\"#\" onclick=\"viewflow('+ row.flow_ins_id + ')\"><font color=blue>审核中</font></a>&nbsp;';
  63. }else if(row.audit_status=="2"){
  64. html = '<a href=\"#\" onclick=\"viewflow('+ row.flow_ins_id + ')\"><font color=blue>审核通过</font></a>&nbsp;';
  65. }else if(row.audit_status=="3"){
  66. html = '<a href=\"#\" onclick=\"viewflow('+ row.flow_ins_id + ')\"><font color=blue>驳回</font></a>&nbsp;';
  67. }else if(row.audit_status=="4"){
  68. html = '未审核';
  69. }
  70. return html;
  71. }},
  72. {display : '操作',isAllowHide : false,
  73. render : function(row) {
  74. var html = '<a href=\"#\" onclick=\"viewMaintenance('+ row.universalid+ ')\">查看</a>&nbsp;';
  75. return html;
  76. }
  77. } ],
  78. pageSizeOptions: [5,10, 20, 30, 40, 50, 100],
  79. url : 'carMaintenanceAction.do?task=toMaintenanceList&query=1&user_id=${session.loginID}&time='+ new Date().getTime() + params1 +params2 +params3,
  80. pageParmName : 'p', //页索引参数名,(提交给服务器)
  81. pagesizeParmName : 'pSize', //页记录数参数名,(提交给服务器)
  82. width : '99.7%',
  83. height : '99%'});
  84. $("#pageloading").hide();
  85. }
  86. function viewflow(insId){
  87. var url="${pageContext.request.contextPath}/workFlowAction.do?task=viewflow&insId="+insId+"&tabid="+stripscript(getCurrentTabId());
  88. openODialog(url,"查看流程信息");
  89. }
  90. function openODialog(owurl, name) {
  91. oDialog = openTopDialog({
  92. height : $("body", window.top.document).height() - 50,
  93. width : $("body", window.top.document).width() - 50,
  94. url : owurl,
  95. showMax : false,
  96. showToggle : false,
  97. showMin : false,
  98. isResize : false,
  99. modal : false,
  100. title : name,
  101. allowClose : true
  102. });
  103. }
  104. function closeODialog() {
  105. oDialog.close();
  106. }
  107. /**
  108. * js过滤特殊字符
  109. * @param s
  110. * @returns {String}
  111. */
  112. function stripscript(s) {
  113. var pattern = new RegExp("[&]");
  114. var rs = "";
  115. for (var i = 0; i < s.length; i++) {
  116. rs = rs + s.substr(i, 1).replace(pattern, '_');
  117. }
  118. return rs;
  119. }
  120. function searchByKword() {
  121. grid.set("newPage","1");
  122. var plate_number= document.getElementById("plate_number");//车牌号
  123. var s1 = "";
  124. if (plate_number.value != "" && typeof (plate_number.value) != "undefined") {
  125. s1 += "&plate_number=" + encodeURI(encodeURI(plate_number.value));
  126. }
  127. var start_time= document.getElementById("start_time");//时间
  128. var s2 = "";
  129. if (start_time.value != "" && typeof (start_time.value) != "undefined") {
  130. s2 += "&start_time=" + encodeURI(encodeURI(start_time.value));
  131. }
  132. var end_time= document.getElementById("end_time");//时间
  133. var s3 = "";
  134. if (end_time.value != "" && typeof (end_time.value) != "undefined") {
  135. s3 += "&end_time=" + encodeURI(encodeURI(end_time.value));
  136. }
  137. $(function() {
  138. loadMaintenanceList(s1,s2,s3);
  139. });
  140. }
  141. var dialog = "";
  142. function addMaintenance() {
  143. var isStart = "${requestScope.start }";
  144. if(isStart == "false"){
  145. initDialog = $.ligerDialog({content:"对不起,维保审批流程未配置,请通知流程管理员配置后,再申请!", title:"系统提示",type:"warn",width:300,height:70,allowClose : false,
  146. buttons:[ { text:"确定",onclick:function(){initDialog.close();}}
  147. ]
  148. });
  149. return;
  150. }
  151. window.parent.f_addTab('addMaintenance', '维修保养登记',
  152. 'carMaintenanceAction.do?task=addMaintenances&tabid=' + getCurrentTabId());
  153. }
  154. //撤销档案流程
  155. var initDialog;
  156. function revocationFlow(id,state,car_id){
  157. $(function() {
  158. initDialog = $.ligerDialog({content:"是否撤销该流程?", title:"系统提示",type:"question",width:300,height:70,allowClose : false,
  159. buttons:[ { text:"是",onclick:function(){revocation(id,state,car_id);} } ,
  160. {text:"否",onclick:function(btn){initDialog.close();} }
  161. ]
  162. });
  163. });
  164. }
  165. function revocation(id,state,car_id){
  166. initDialog.close();
  167. $.ligerDialog.waitting('正在撤销中,请稍候...');
  168. $.ajax({
  169. type : "POST",
  170. url : "carMaintenanceAction.do?task=revocationFlow&time=" + new Date().getTime(),
  171. data : {"ma_id" : id,"car_id":car_id},
  172. timeout : 10000,
  173. cache : false,
  174. dataType : "json",
  175. success : function(data) {
  176. var success = data.success;
  177. if (success != undefined) {
  178. $.ligerDialog.success(success);
  179. $.ligerDialog.closeWaitting();
  180. loadMaintenanceList();
  181. }else{
  182. $.ligerDialog.closeWaitting();
  183. showAjaxError(null, data.error);
  184. }
  185. },
  186. error : showAjaxError
  187. });
  188. }
  189. function editMaintenance(maintenance_id,audit_state) {
  190. if(audit_state == "2"){
  191. $.ligerDialog.alert('审核成功不能编辑!', '提示', 'warn');
  192. return;
  193. }
  194. window.parent.f_addTab(''+maintenance_id+'editMaintenance', '编辑维保登记',
  195. 'carMaintenanceAction.do?task=editMaintenance&maintenance_id=' + maintenance_id+ '&tabid=' + getCurrentTabId());
  196. }
  197. function viewMaintenance(maintenance_id) {
  198. window.parent.f_addTab(''+maintenance_id+'viewMaintenance', '查看维保登记',
  199. 'carMaintenanceAction.do?task=viewMaintenance&maintenance_id=' + maintenance_id+ '&tabid=' + getCurrentTabId());
  200. }
  201. //提交维保申请
  202. function sumWBCar(wB_id,state,car_id) {
  203. var myDate = new Date();
  204. var myDate3 =myDate.getFullYear(); //获取完整的年份(4位,1970-????)
  205. var myDate4 =myDate.getMonth(); //获取当前月份(0-11,0代表1月)
  206. var myDate5 =myDate.getDate(); //获取当前日(1-31)
  207. var time = myDate3+"-"+myDate4+"-"+myDate5;
  208. var name = '${session.name}';
  209. var title = "流程:维保申请流程("+time+")"+name+"";
  210. var manager = $.ligerDialog.prompt('维保申请名',''+title+'',
  211. function (yes, value){
  212. if (yes) {
  213. $("#flowTitle").val(value);
  214. var flowTitles= document.getElementById("flowTitle");//标题
  215. var flowTitle = "";
  216. if (flowTitles.value != "" && typeof (flowTitles.value) != "undefined") {
  217. flowTitle = encodeURI(encodeURI(flowTitles.value));
  218. }
  219. var tmodelId= $("#tmodelId").val();
  220. var modelId = $("#modelId").val();
  221. $.ajax({
  222. type : "POST",
  223. url : "carMaintenanceAction.do?task=sumOutCar&flowTitle="+flowTitle+"",
  224. data : {"universalid" : wB_id,"car_id" : car_id,"state" : state,"tmodelId":tmodelId,"modelId":modelId},
  225. timeout : 10000,
  226. cache : false,
  227. dataType : "json",
  228. success : function(data) {
  229. var success = data.success;
  230. if (success == 1) {
  231. $.ligerDialog.success("申请提交成功");
  232. }else if(success == 2){
  233. $.ligerDialog.warn("该车已被占用,请申请其他车辆");
  234. }else{
  235. showAjaxError(null, data.error);
  236. }
  237. loadMaintenanceList();
  238. },
  239. error : showAjaxError
  240. });
  241. }else{
  242. manager.close();
  243. }
  244. });
  245. }
  246. var sq = ${requestScope.CAR_SQ};
  247. var wx = ${requestScope.CAR_WX};
  248. function delMaintenance(maintenance_id,audit_state,car_state,if_dispose,car_id) {
  249. //if(if_dispose == 1){
  250. // $.ligerDialog.alert('该车维保还未取车,不能删除!', '提示', 'warn');
  251. // return;
  252. //}
  253. if (confirm("确定要删除吗?")) {
  254. $.ajax({
  255. type : "POST",
  256. url : "carMaintenanceAction.do?task=delMaintenance",
  257. data : {"universalid" : maintenance_id,"audit_state" : audit_state,"car_id":car_id},
  258. timeout : 10000,
  259. cache : false,
  260. dataType : "json",
  261. success : function(data) {
  262. var success = data.success;
  263. if (success != undefined) {
  264. $.ligerDialog.success("删除成功");
  265. } else {
  266. showAjaxError(null, data.error);
  267. }
  268. loadMaintenanceList();
  269. },
  270. error : showAjaxError
  271. });
  272. }
  273. }
  274. //获取选中的行信息
  275. function f_select() {
  276. var rows = grid.getCheckedRows();
  277. return rows;
  278. }
  279. $(document).ready(function() {
  280. $("[name='plate_number']").focus();
  281. });
  282. </script>
  283. </head>
  284. <body>
  285. <%@ include file="/include/message.jsp"%>
  286. <form action="carOutCarAction.do" method="post">
  287. <input type="hidden" id="tabid" name="tabid" value="getCurrentTabId()">
  288. <input type="hidden" id="user_id" name="user_id" value="">
  289. <input type="hidden" id="task" name="task" value="exportExcel">
  290. <!-- 流程ID -->
  291. <input type="hidden" id="flowTitle" name="flowTitle" value="">
  292. <input type="hidden" id="tmodelId" name="tmodelId" value="${requestScope.tmodel.tmodelId }">
  293. <input type="hidden" id="modelId" name="modelId" value="${requestScope.fmodel.modelId }">
  294. <div class="default_search" style="margin: 0;">
  295. <ul class="list_search">
  296. <li class="title">车牌号:</li>
  297. <li class="text">
  298. <input type="text" name="plate_number" id="plate_number">
  299. </li>
  300. </ul>
  301. <ul class="list_search" >
  302. <li class="title">送修时间:</li>
  303. <li class="text" >
  304. <input type="text" id="start_time" name="start_time" value="">
  305. </li>
  306. <li class="title title_rqjg">
  307. </li>
  308. <li class="text" >
  309. <input type="text" id="end_time" name="end_time" value="">
  310. </li>
  311. </ul>
  312. <ul class="list_search">
  313. <li class="search-button"><input type="button" class='l-button'
  314. name="search" onclick="searchByKword()" value="查询" /></li>
  315. </ul>
  316. </div>
  317. <div style="clear:both;"></div>
  318. <div style="overflow: hidden; clear: both;">
  319. <div id="maintenanceList" style="margin: 0; padding: 0"></div>
  320. </div>
  321. </div>
  322. </form>
  323. </body>
  324. </html>