<!doctype html>
|
<html>
|
<head>
|
[#include "/business/wechat/include/title.html" /]
|
[#include "/business/wechat/include/wheader.html" /]
|
<script type="text/javascript" src="${common_static}/static/wechat/style/js/project.js"></script>
|
[#include "/business/wechat/include/mobiscroll.html" /]
|
|
</head>
|
|
<body>
|
<header class="kltit">
|
<label class="dropmenu"></label><a href="${base}/ewyw/ewWorkplan/emyDailyCheck.html" ><span></span></a>日常巡检
|
<div class="wlsdrop2">
|
<a href="javascript:savedaily(1);"><p class="baocun">保存</p></a>
|
<a href="javascript:saveshdaily();"><p class="shenhe">提交审核</p></a>
|
</div>
|
</header>
|
<nav class="kltwo clearfix">
|
<div class="kltwowrap">
|
<a href="#" hidefocus="true" class="active">基本信息</a>
|
<a href="#" hidefocus="true">巡检类型</a>
|
<a href="#" hidefocus="true">巡检配置</a>
|
<a href="#" hidefocus="true">关联工单</a>
|
</div>
|
</nav>
|
<form id="myform" action="" method="post">
|
<input type="hidden" id="state" name="state"/>
|
<input type="hidden" id="orderId" name="orderId" value="${resultMap.orderId}"/>
|
<input type="hidden" id="commonJsonList" name="commonJsonList"/>
|
<input type="hidden" id="ciJsonList" name="ciJsonList"/>
|
<input type="hidden" id="note" name="${resultMap.note}"/>
|
<div class="swiper-container" id="swiper-pages">
|
<div class="swiper-wrapper">
|
<div class="swiper-slide">
|
<section class="wlresponse">
|
<a href="javascript:selectcus();"><p class="next2">
|
<span>${Constants.CUSTOMER_CONSTANTS}名称</span>
|
<i id="showcus" >${resultMap.customer_name}</i>
|
<input name="customer_id" id="customer_id" type="hidden" class="enter" value="${resultMap.customer_id}">
|
<input name="customer_name" id="customer_name" type="hidden" class="enter" value="${resultMap.customer_name}">
|
</p></a>
|
|
<a href="#"><p class="next2">
|
<span>报告日期</span>
|
<i>
|
<input class="enter" type="text" name="patrol_date" id="patrol_date" value="${DateUtil.format('yyyy-MM-dd',resultMap.patrol_date)}"/>
|
</i>
|
</p></a>
|
<a href="#"><p class="next2">
|
<span>开始时间</span>
|
<i>
|
<input class="enter" type="text" name="begin_time" id="begin_time" value="${DateUtil.format('yyyy-MM-dd HH:mm',resultMap.begin_time)}"/>
|
</i>
|
</p></a>
|
|
<a href="#"><p class="next2">
|
<span>结束时间</span>
|
<i>
|
<input class="enter" type="text" name="end_time" id="end_time" value="${DateUtil.format('yyyy-MM-dd HH:mm',resultMap.end_time)}"/>
|
</i>
|
</p></a>
|
<p>
|
<span>联系方式</span>
|
<i><input name="user_phone" id="user_phone" placeholder="请输入联系方式" type="text" class="enter" value="${resultMap.user_phone}"></i>
|
</p>
|
<p>
|
<span>巡检总结</span>
|
<i><textarea name="summary" id="summary" placeholder="请填写巡检总结" cols="" rows="3" class="event-text">${resultMap.summary}</textarea></i>
|
</p>
|
</section>
|
</div>
|
<div class="swiper-slide">
|
|
|
[#if resultMap.categoryList??&&resultMap.categoryList?size>0]
|
[#list resultMap.categoryList as category]
|
<div class="inspection-box">
|
<input name="categoryId" type="hidden" value="${category.ID}"/>
|
<input name="categoryName" type="hidden" value="${category.NAME}"/>
|
<div class="inspection-bg">${category.NAME}</div>
|
[#if category.dataList??&&category.dataList?size>0]
|
[#list category.dataList as item]
|
<a class="category"><p>
|
<span>${item.ITEM_NAME}</span>
|
<input name="itemId" type="hidden" value="${item.ITEM_ID}"/>
|
<input name="itemName" type="hidden" value="${item.ITEM_NAME}"/>
|
<input name="${category.ID}" type="hidden" value="${item.ITEM_ID}&${item.ITEM_NAME}"/>
|
<label>
|
<select class="select tr10" id="${category.ID}-${item.ITEM_ID}" name="${category.ID}-${item.ITEM_ID}">
|
<option [#if item.RESULT==1] selected [/#if] value="1">正常</option>
|
<option [#if item.RESULT==2] selected [/#if] value="2">告警</option>
|
<option [#if item.RESULT==3] selected [/#if] value="3">异常</option>
|
</select>
|
</label>
|
</p>
|
</a>
|
[/#list]
|
[/#if]
|
</div>
|
[/#list]
|
[/#if]
|
</div>
|
<div class="swiper-slide">
|
[#if resultMap.ciList??&&resultMap.ciList?size>0]
|
[#list resultMap.ciList as ci]
|
<div class="inspection-box">
|
<input name="ciId" type="hidden" value="${ci.id}&${ci.ciname}&${ci.searchcode}"/>
|
<div class="bg2">${ci.ciname}(${ci.searchcode})</div>
|
[#if ci.xjxlist?? && ci.xjxlist?size > 0]
|
[#list ci.xjxlist as xjx]
|
<a class="ci"><p><span>${xjx.item_name}</span>
|
<input class="${ci.id}" v="${xjx.item_name}" name="itemIdresult" type="hidden" value="${ci.id}-${xjx.id}"/>
|
<input name="${ci.id}" type="hidden" value="${xjx.id}&${xjx.item_name}"/>
|
<label>
|
<select class="select tr10" id="${ci.id}-${xjx.id}" name="${ci.id}-${xjx.id}">
|
<option [#if xjx.result==1 || xjx.result==''] selected [/#if] value="1">正常</option>
|
<option [#if xjx.result==2] selected [/#if] value="2">告警</option>
|
<option [#if xjx.result==3] selected [/#if] value="3">异常</option>
|
</select>
|
</label></p></a>
|
[/#list]
|
[/#if]
|
</div>
|
[/#list]
|
[/#if]
|
</div>
|
<div class="swiper-slide"><button type="button" id="button" class="add" onclick="linkOrder()" /><span>添加关联工单</span></button>
|
[#if resultMap.orderList?? && resultMap.orderList?size > 0]
|
[#list resultMap.orderList as order]
|
<section class="worklist clearfix">
|
<h2>
|
<a href="#"><em class="deletes"></em></a>
|
${order.order_code}
|
</h2>
|
<input type="hidden" name="linkOrderId" value="${order.orderId}">
|
<input type="hidden" name="orders" value="${order.orderId}&${order.businesstype}&${order.order_code}&${order.wfname}&${order.customer_name}&${order.createtime}&${order.creatername}">
|
<div class="worklistcon clearfix">
|
<span>${Constants.mapWORKFLOW_BUSINESS_TYPE_Label(order.businesstype+"")}</span>
|
<p>工单名称:${order.wfname}</p>
|
<p>${Constants.CUSTOMER_CONSTANTS}名称:${order.customer_name}</p>
|
<p>创建时间:<em>${DateUtil.format("yyyy-MM-dd HH:mm:ss",order.createtime)}</em></p>
|
<label>${order.creatername}</label>
|
</div>
|
</section>
|
[/#list]
|
[/#if]
|
</div>
|
</div>
|
</div>
|
</form>
|
<script type="text/javascript">
|
n=$('.kltwowrap a').size();
|
var wh=100*n+"%";
|
$('.kltwowrap').width(wh);
|
var lt=(100/n/4);
|
var lt_li=lt+"%";
|
$('.kltwowrap a').width(lt_li);
|
$(".kltwowrap a").on('touchstart mousedown',function(e){
|
e.preventDefault()
|
$(".kltwowrap .active").removeClass('active');
|
$(this).addClass('active');
|
tabsSwiper.slideTo($(this).index());
|
});
|
|
$(".kltwowrap a").click(function(e){
|
e.preventDefault();
|
});
|
|
var tabsSwiper = new Swiper(".swiper-container",{
|
setWrapperSize :true,
|
onSlideChangeStart: function(sw){
|
$(".kltwowrap .active").removeClass('active');
|
$(".kltwowrap a").eq(tabsSwiper.activeIndex).addClass('active');
|
|
//sw.width
|
var currTab = $(".kltwowrap a").eq(tabsSwiper.activeIndex);
|
/*if(currTab.width()*sw.activeIndex +10 > sw.width){
|
currTab.parent().css("left",-currTab.width()*sw.activeIndex);
|
}else{
|
currTab.parent().css("left",0);
|
}*/
|
currTab.parent().css("left",-parseInt(sw.activeIndex/4)*sw.width);
|
}
|
});
|
|
function selectcus() {
|
var patrol_date = $("#patrol_date").val();
|
patrol_date = patrol_date.replace("-","").replace("-","");
|
$("#patrol_date").val(patrol_date);
|
var begin_time = $("#begin_time").val();
|
begin_time = begin_time.replace("-","").replace("-","").replace(" ","").replace(":","");
|
$("#begin_time").val(begin_time);
|
var end_time = $("#end_time").val();
|
end_time = end_time.replace("-","").replace("-","").replace(" ","").replace(":","");
|
$("#end_time").val(end_time);
|
$.post("${base}/ewyw/ewWorkplan/savetempDailyCheck.html",$("#myform").serialize(),function(data,textStatus) {
|
var customer_id = $("#customer_id").val();
|
window.location.href = "${base}/ewyw/ewIncident/ewsubCus.html?customerId="+customer_id+"&rcxj=1";
|
});
|
|
}
|
|
var patrol_date = '${DateUtil.format("yyyy-MM-dd",resultMap.patrol_date)}';
|
var begin_time = '${DateUtil.format("yyyy-MM-dd HH:mm",resultMap.begin_time)}';
|
var end_time = '${DateUtil.format("yyyy-MM-dd HH:mm",resultMap.end_time)}';
|
var sh = '${RequestParameters.sh}';
|
$(function() {
|
|
var currYear = (new Date()).getFullYear();
|
var opt={};
|
opt.date = {preset : 'date'};
|
opt.datetime = {preset : 'datetime'};
|
opt.time = {preset : 'time'};
|
opt.default = {
|
theme: 'android-ics light', //皮肤样式
|
display: 'modal', //显示方式
|
mode: 'scroller', //日期选择模式
|
dateFormat: 'yyyy-mm-dd',
|
lang: 'zh',
|
showNow: true,
|
nowText: "今天",
|
startYear: currYear - 50, //开始年份
|
endYear: currYear + 50//结束年份
|
};
|
|
$("#patrol_date").scroller($.extend(opt['date'], opt['default']));
|
if(!$.util.isEmpty(patrol_date)){
|
$("#patrol_date").scroller('setDate', new Date(patrol_date), true);
|
}else{
|
$("#patrol_date").scroller('setDate', new Date(), true);
|
}
|
$("#begin_time").scroller($.extend(opt['datetime'], opt['default']));
|
if(!$.util.isEmpty(begin_time)){
|
$("#begin_time").scroller('setDate', new Date(begin_time), true);
|
}else{
|
$("#begin_time").scroller('setDate', new Date(), true);
|
}
|
$("#end_time").scroller($.extend(opt['datetime'], opt['default']));
|
if(!$.util.isEmpty(end_time)){
|
$("#end_time").scroller('setDate', new Date(end_time), true);
|
}else{
|
$("#end_time").scroller('setDate', new Date(), true);
|
}
|
|
$(".deletes").click(function(){
|
$(this).parent().parent().parent().remove();
|
});
|
|
|
if(sh == 1){
|
savedaily(2);
|
}
|
|
});
|
function linkOrder() {
|
var customerid = $("#customer_id").val();
|
|
if($.util.isEmpty(customerid)) {
|
popupTips("请先选择${Constants.CUSTOMER_CONSTANTS}");
|
return;
|
}
|
var orderIds = new Array();
|
var $orderId = $(":hidden[name='orderId']");
|
if($orderId.length>0) {
|
$orderId.each(function() {
|
orderIds.push($(this).val());
|
})
|
}
|
var order = orderIds.join("-");
|
var patrol_date = $("#patrol_date").val();
|
patrol_date = patrol_date.replace("-","").replace("-","");
|
$("#patrol_date").val(patrol_date);
|
var begin_time = $("#begin_time").val();
|
begin_time = begin_time.replace("-","").replace("-","").replace(" ","").replace(":","");
|
$("#begin_time").val(begin_time);
|
var end_time = $("#end_time").val();
|
end_time = end_time.replace("-","").replace("-","").replace(" ","").replace(":","");
|
$("#end_time").val(end_time);
|
$.post("${base}/ewyw/ewWorkplan/savetempDailyCheck.html",$("#myform").serialize(),function(data,textStatus) {
|
window.location.href = "${base}/ewyw/ewIncident/ewOrder.html?customerId="+customerid+"&orderids="+order+"&rcxj=1";
|
});
|
}
|
function savedaily(index) {
|
var customerid = $("#customer_id").val();
|
|
if($.util.isEmpty(customerid)) {
|
popupTips("请选择${Constants.CUSTOMER_CONSTANTS}");
|
return;
|
}
|
var begin_time = $("#begin_time").val();
|
var end_time = $("#end_time").val();
|
if(begin_time!=''&&end_time!=''){
|
if(begin_time>end_time){
|
popupTips("巡检开始时间不能大于结束时间");
|
return;
|
}
|
}
|
var value = $("#user_phone").val();
|
if($.util.isEmpty(value)) {
|
popupTips("请填写联系方式");
|
return;
|
}
|
if(!$.util.isMobile(value) && !$.util.isTelphone(value)) {
|
popupTips("联系方式格式不正确");
|
return;
|
}
|
var summary = $("#summary").val();
|
if($.util.isEmpty(summary)) {
|
popupTips("请填写巡检总结");
|
return;
|
}
|
$('#state').val(index);
|
setCommonListJson();
|
setCiListJson();
|
var patrol_date = $("#patrol_date").val();
|
patrol_date = patrol_date.replace("-","").replace("-","");
|
$("#patrol_date").val(patrol_date);
|
var begin_time = $("#begin_time").val();
|
begin_time = begin_time.replace("-","").replace("-","").replace(" ","").replace(":","");
|
$("#begin_time").val(begin_time);
|
var end_time = $("#end_time").val();
|
end_time = end_time.replace("-","").replace("-","").replace(" ","").replace(":","");
|
$("#end_time").val(end_time);
|
$.post("${base}/ewyw/ewWorkplan/saveDailyCheck.html",$("#myform").serialize(),function(data,textStatus) {
|
window.location.href = "${base}/ewyw/ewWorkplan/ewoption.html?result="+data;
|
});
|
}
|
//获取选择的通用巡检项信息
|
function setCommonListJson(){
|
var commonJsonList = [];
|
if($(".category").find("input").length>0){
|
$(".category").each(function(index){
|
var categoryId = $(this).parent().find("input[name=categoryId]").val();
|
var categoryName = $(this).parent().find("input[name=categoryName]").val();
|
var itemId = $(this).find("input[name=itemId]").val();
|
var itemName = $(this).find("input[name=itemName]").val();
|
var result = $(this).find(".select").val();
|
var obj = {};
|
obj["categoryId"] = categoryId;
|
obj["categoryName"] = categoryName;
|
obj["itemId"] = itemId;
|
obj["itemName"] = itemName;
|
obj["result"] = result;
|
commonJsonList.push(obj);
|
});
|
}
|
$("#commonJsonList").val(JSON.stringify(commonJsonList));
|
}
|
|
//获取选择的异常配置信息
|
function setCiListJson(){
|
var ciJsonList = [];
|
if($(".ci").find("input").length>0){
|
$(".ci").each(function(index){
|
var obj = {};
|
var itemId = $(this).find("input[name=itemIdresult]").val();
|
var result = $(this).find(".select").val();
|
obj["itemId"] = itemId;
|
obj["result"] = result;
|
ciJsonList.push(obj);
|
});
|
}
|
$("#ciJsonList").val(JSON.stringify(ciJsonList));
|
}
|
|
function saveshdaily(){
|
var customerid = $("#customer_id").val();
|
|
if($.util.isEmpty(customerid)) {
|
popupTips("请选择${Constants.CUSTOMER_CONSTANTS}");
|
return;
|
}
|
var begin_time = $("#begin_time").val();
|
var end_time = $("#end_time").val();
|
if(begin_time!=''&&end_time!=''){
|
if(begin_time>end_time){
|
popupTips("巡检开始时间不能大于结束时间");
|
return;
|
}
|
}
|
var value = $("#user_phone").val();
|
if($.util.isEmpty(value)) {
|
popupTips("请填写联系方式");
|
return;
|
}
|
if(!$.util.isMobile(value) && !$.util.isTelphone(value)) {
|
popupTips("联系方式格式不正确");
|
return;
|
}
|
var summary = $("#summary").val();
|
if($.util.isEmpty(summary)) {
|
popupTips("请填写巡检总结");
|
return;
|
}
|
var patrol_date = $("#patrol_date").val();
|
patrol_date = patrol_date.replace("-","").replace("-","");
|
$("#patrol_date").val(patrol_date);
|
var begin_time = $("#begin_time").val();
|
begin_time = begin_time.replace("-","").replace("-","").replace(" ","").replace(":","");
|
$("#begin_time").val(begin_time);
|
var end_time = $("#end_time").val();
|
end_time = end_time.replace("-","").replace("-","").replace(" ","").replace(":","");
|
$("#end_time").val(end_time);
|
$.post("${base}/ewyw/ewWorkplan/savetempDailyCheck.html",$("#myform").serialize(),function(data,textStatus) {
|
window.location.href = "${base}/ewyw/ewWorkplan/ewshbz.html";
|
});
|
|
}
|
</script>
|
</body>
|
</html>
|