| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342 |
- <%@ page language="java" contentType="text/html;charset=GBK"
- pageEncoding="GBK"%>
- <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html;charset=GBK">
- <title>维修登记</title>
- <link href="${pageContext.request.contextPath }/liger/lib/ligerUI/skins/${sessionScope.css}/css/ligerui-all.css" rel="stylesheet" type="text/css" />
- <script src="${pageContext.request.contextPath }/liger/lib/jquery/jquery-1.3.2.min.js" type="text/javascript"></script>
- <script src="${pageContext.request.contextPath}/liger/lib/ligerUI/js/ligerui.all.js" type="text/javascript"></script>
- <link href="${pageContext.request.contextPath}/main.css" rel="stylesheet" type="text/css" />
- <script type="text/javascript" src="/shares/js/constant.js"></script>
- <script type="text/javascript" src="/shares/js/common.js"></script>
- <script type="text/javascript">
- $(function() {
- $("#start_time").ligerDateEditor({ showTime: true, width:160, labelAlign: 'left'});
- $("#end_time").ligerDateEditor({ showTime: true, width:160, labelAlign: 'left'});
- loadMaintenanceList();
- });
- var grid = null;
- function loadMaintenanceList(params1,params2,params3) {
- grid = $("#maintenanceList")
- .ligerGrid({columns : [
- {display : '车牌号',name : 'plate_number',width : 120},
- {display : '驾驶员',name : 'driver_name',width : 100},
- {display : '维保类型',name : 'if_maintain',width : 60,
- render :function(a,b){
- var s = a["if_maintain"];
- if(s=="1"){return '维修';}else{return '保养';}}},
- /* {display : '维修地点',name : 'within_outer_factory',width : 120,
- render :function(a,b){
- var s = a["within_outer_factory"];if(s=="1"){return '厂外';}else{return '厂内';}}}, */
- /* {display : '维修厂',name : 'repair_factory',width : 120,
- render : function(row){
- if(null !=row.repair_factory){
- var place = "";
- $.ajax({
- url:'carMaintenanceAction.do?task=tolook',
- async: false,
- type: 'post',
- data: {"within_outer_factory":row.within_outer_factory,"repair_factory":row.repair_factory},
- cache: false,
- error: function(obj){
- },
- success: function(obj){
- if(obj!=""){
- place = obj;
- }
- }
- });
- return place;
- }
- }}, */
- {display : '送修日期',name : 'repair_date',width : 140},
- {display : '预计取车日期',name : 'predict_date',width : 140},
- {display : '维保里程',name : 'maintenance_mileage',width : 120},
- {display : '下次保养里程',name : 'next_mileage',width : 120},
- {display : '审核状态',name : 'audit_state',width : 120,
- render :function(row){
- var html = '';
- if(row.audit_status=="1"){
- html = '<a href=\"#\" onclick=\"viewflow('+ row.flow_ins_id + ')\"><font color=blue>审核中</font></a> ';
- }else if(row.audit_status=="2"){
- html = '<a href=\"#\" onclick=\"viewflow('+ row.flow_ins_id + ')\"><font color=blue>审核通过</font></a> ';
- }else if(row.audit_status=="3"){
- html = '<a href=\"#\" onclick=\"viewflow('+ row.flow_ins_id + ')\"><font color=blue>驳回</font></a> ';
- }else if(row.audit_status=="4"){
- html = '未审核';
- }
- return html;
- }},
- {display : '操作',isAllowHide : false,
- render : function(row) {
- var html = '<a href=\"#\" onclick=\"viewMaintenance('+ row.universalid+ ')\">查看</a> ';
- return html;
- }
- } ],
- pageSizeOptions: [5,10, 20, 30, 40, 50, 100],
- url : 'carMaintenanceAction.do?task=toMaintenanceList&query=1&user_id=${session.loginID}&time='+ new Date().getTime() + params1 +params2 +params3,
- pageParmName : 'p', //页索引参数名,(提交给服务器)
- pagesizeParmName : 'pSize', //页记录数参数名,(提交给服务器)
- width : '99.7%',
- height : '99%'});
- $("#pageloading").hide();
- }
-
- function viewflow(insId){
- var url="${pageContext.request.contextPath}/workFlowAction.do?task=viewflow&insId="+insId+"&tabid="+stripscript(getCurrentTabId());
- openODialog(url,"查看流程信息");
- }
- function openODialog(owurl, name) {
- oDialog = openTopDialog({
- height : $("body", window.top.document).height() - 50,
- width : $("body", window.top.document).width() - 50,
- url : owurl,
- showMax : false,
- showToggle : false,
- showMin : false,
- isResize : false,
- modal : false,
- title : name,
- allowClose : true
- });
- }
- function closeODialog() {
- oDialog.close();
- }
-
- /**
- * js过滤特殊字符
- * @param s
- * @returns {String}
- */
- function stripscript(s) {
- var pattern = new RegExp("[&]");
- var rs = "";
- for (var i = 0; i < s.length; i++) {
- rs = rs + s.substr(i, 1).replace(pattern, '_');
- }
- return rs;
- }
-
- function searchByKword() {
- grid.set("newPage","1");
- var plate_number= document.getElementById("plate_number");//车牌号
- var s1 = "";
- if (plate_number.value != "" && typeof (plate_number.value) != "undefined") {
- s1 += "&plate_number=" + encodeURI(encodeURI(plate_number.value));
- }
- var start_time= document.getElementById("start_time");//时间
- var s2 = "";
- if (start_time.value != "" && typeof (start_time.value) != "undefined") {
- s2 += "&start_time=" + encodeURI(encodeURI(start_time.value));
- }
- var end_time= document.getElementById("end_time");//时间
- var s3 = "";
- if (end_time.value != "" && typeof (end_time.value) != "undefined") {
- s3 += "&end_time=" + encodeURI(encodeURI(end_time.value));
- }
- $(function() {
- loadMaintenanceList(s1,s2,s3);
- });
- }
- var dialog = "";
- function addMaintenance() {
- var isStart = "${requestScope.start }";
- if(isStart == "false"){
- initDialog = $.ligerDialog({content:"对不起,维保审批流程未配置,请通知流程管理员配置后,再申请!", title:"系统提示",type:"warn",width:300,height:70,allowClose : false,
- buttons:[ { text:"确定",onclick:function(){initDialog.close();}}
- ]
- });
- return;
- }
- window.parent.f_addTab('addMaintenance', '维修保养登记',
- 'carMaintenanceAction.do?task=addMaintenances&tabid=' + getCurrentTabId());
- }
- //撤销档案流程
- var initDialog;
- function revocationFlow(id,state,car_id){
- $(function() {
- initDialog = $.ligerDialog({content:"是否撤销该流程?", title:"系统提示",type:"question",width:300,height:70,allowClose : false,
- buttons:[ { text:"是",onclick:function(){revocation(id,state,car_id);} } ,
- {text:"否",onclick:function(btn){initDialog.close();} }
- ]
- });
- });
- }
- function revocation(id,state,car_id){
- initDialog.close();
- $.ligerDialog.waitting('正在撤销中,请稍候...');
- $.ajax({
- type : "POST",
- url : "carMaintenanceAction.do?task=revocationFlow&time=" + new Date().getTime(),
- data : {"ma_id" : id,"car_id":car_id},
- timeout : 10000,
- cache : false,
- dataType : "json",
- success : function(data) {
- var success = data.success;
- if (success != undefined) {
- $.ligerDialog.success(success);
- $.ligerDialog.closeWaitting();
- loadMaintenanceList();
- }else{
- $.ligerDialog.closeWaitting();
- showAjaxError(null, data.error);
- }
- },
- error : showAjaxError
- });
- }
-
- function editMaintenance(maintenance_id,audit_state) {
- if(audit_state == "2"){
- $.ligerDialog.alert('审核成功不能编辑!', '提示', 'warn');
- return;
- }
- window.parent.f_addTab(''+maintenance_id+'editMaintenance', '编辑维保登记',
- 'carMaintenanceAction.do?task=editMaintenance&maintenance_id=' + maintenance_id+ '&tabid=' + getCurrentTabId());
- }
- function viewMaintenance(maintenance_id) {
- window.parent.f_addTab(''+maintenance_id+'viewMaintenance', '查看维保登记',
- 'carMaintenanceAction.do?task=viewMaintenance&maintenance_id=' + maintenance_id+ '&tabid=' + getCurrentTabId());
- }
-
- //提交维保申请
- function sumWBCar(wB_id,state,car_id) {
- var myDate = new Date();
- var myDate3 =myDate.getFullYear(); //获取完整的年份(4位,1970-????)
- var myDate4 =myDate.getMonth(); //获取当前月份(0-11,0代表1月)
- var myDate5 =myDate.getDate(); //获取当前日(1-31)
- var time = myDate3+"-"+myDate4+"-"+myDate5;
- var name = '${session.name}';
- var title = "流程:维保申请流程("+time+")"+name+"";
- var manager = $.ligerDialog.prompt('维保申请名',''+title+'',
- function (yes, value){
- if (yes) {
- $("#flowTitle").val(value);
- var flowTitles= document.getElementById("flowTitle");//标题
- var flowTitle = "";
- if (flowTitles.value != "" && typeof (flowTitles.value) != "undefined") {
- flowTitle = encodeURI(encodeURI(flowTitles.value));
- }
- var tmodelId= $("#tmodelId").val();
- var modelId = $("#modelId").val();
- $.ajax({
- type : "POST",
- url : "carMaintenanceAction.do?task=sumOutCar&flowTitle="+flowTitle+"",
- data : {"universalid" : wB_id,"car_id" : car_id,"state" : state,"tmodelId":tmodelId,"modelId":modelId},
- timeout : 10000,
- cache : false,
- dataType : "json",
- success : function(data) {
- var success = data.success;
- if (success == 1) {
- $.ligerDialog.success("申请提交成功");
- }else if(success == 2){
- $.ligerDialog.warn("该车已被占用,请申请其他车辆");
- }else{
- showAjaxError(null, data.error);
- }
- loadMaintenanceList();
- },
- error : showAjaxError
- });
- }else{
- manager.close();
- }
- });
-
- }
- var sq = ${requestScope.CAR_SQ};
- var wx = ${requestScope.CAR_WX};
- function delMaintenance(maintenance_id,audit_state,car_state,if_dispose,car_id) {
- //if(if_dispose == 1){
- // $.ligerDialog.alert('该车维保还未取车,不能删除!', '提示', 'warn');
- // return;
- //}
- if (confirm("确定要删除吗?")) {
- $.ajax({
- type : "POST",
- url : "carMaintenanceAction.do?task=delMaintenance",
- data : {"universalid" : maintenance_id,"audit_state" : audit_state,"car_id":car_id},
- timeout : 10000,
- cache : false,
- dataType : "json",
- success : function(data) {
- var success = data.success;
- if (success != undefined) {
- $.ligerDialog.success("删除成功");
- } else {
- showAjaxError(null, data.error);
- }
- loadMaintenanceList();
- },
- error : showAjaxError
- });
- }
- }
-
- //获取选中的行信息
- function f_select() {
- var rows = grid.getCheckedRows();
- return rows;
- }
-
- $(document).ready(function() {
- $("[name='plate_number']").focus();
- });
- </script>
- </head>
- <body>
- <%@ include file="/include/message.jsp"%>
- <form action="carOutCarAction.do" method="post">
- <input type="hidden" id="tabid" name="tabid" value="getCurrentTabId()">
- <input type="hidden" id="user_id" name="user_id" value="">
- <input type="hidden" id="task" name="task" value="exportExcel">
- <!-- 流程ID -->
- <input type="hidden" id="flowTitle" name="flowTitle" value="">
- <input type="hidden" id="tmodelId" name="tmodelId" value="${requestScope.tmodel.tmodelId }">
- <input type="hidden" id="modelId" name="modelId" value="${requestScope.fmodel.modelId }">
- <div class="default_search" style="margin: 0;">
- <ul class="list_search">
- <li class="title">车牌号:</li>
- <li class="text">
- <input type="text" name="plate_number" id="plate_number">
- </li>
- </ul>
- <ul class="list_search" >
- <li class="title">送修时间:</li>
- <li class="text" >
- <input type="text" id="start_time" name="start_time" value="">
- </li>
- <li class="title title_rqjg">
- 至
- </li>
-
- <li class="text" >
- <input type="text" id="end_time" name="end_time" value="">
- </li>
- </ul>
- <ul class="list_search">
- <li class="search-button"><input type="button" class='l-button'
- name="search" onclick="searchByKword()" value="查询" /></li>
- </ul>
- </div>
- <div style="clear:both;"></div>
- <div style="overflow: hidden; clear: both;">
- <div id="maintenanceList" style="margin: 0; padding: 0"></div>
- </div>
- </div>
- </form>
- </body>
- </html>
|