Commit f600ccf3 by liuyang

2024-05-15 设备预警

parent 5cb88b85
package com.baosight.hggp.hg.sb.service;
import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.hg.sb.domain.HGSB006;
import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.contants.ACConstants;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import java.util.Arrays;
import java.util.HashMap;
/**
* @author LiuYang
* @version 1.0 2024/5/15
*/
public class ServiceHGSB006 extends ServiceEPBase {
@Override
public EiInfo initLoad(EiInfo inInfo) {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGSB006.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
inInfo = super.query(inInfo, HGSB006.QUERY, new HGSB006());
CommonMethod.initBlock(inInfo,
Arrays.asList(DdynamicEnum.COMPANY_BOX_BLOCK_ID,DdynamicEnum.DEVICE_CODE_BOX_BLOCK_ID),null
);
return inInfo;
}
@Override
public EiInfo query(EiInfo inInfo) {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGSB006.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
return super.query(inInfo,HGSB006.QUERY,new HGSB006());
}
}
package com.baosight.hggp.hg.sb.service;
import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.hg.sb.domain.HGSB007;
import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.contants.ACConstants;
import com.baosight.iplat4j.core.ei.EiBlockMeta;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import java.util.Arrays;
/**
* @author LiuYang
* @version 1.0 2024/5/15
*/
public class ServiceHGSB007 extends ServiceEPBase {
@Override
public EiInfo initLoad(EiInfo inInfo) {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGSB007.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
inInfo = super.query(inInfo, HGSB007.QUERY, new HGSB007(),false, new EiBlockMeta(), EiConstant.queryBlock, CommonConstant.Field.DETAIL, CommonConstant.Field.DETAIL);
CommonMethod.initBlock(inInfo,
Arrays.asList(DdynamicEnum.COMPANY_BOX_BLOCK_ID,DdynamicEnum.DEVICE_CODE_BOX_BLOCK_ID),null
);
return inInfo;
}
@Override
public EiInfo query(EiInfo inInfo) {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGSB007.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
return super.query(inInfo,HGSB007.QUERY,new HGSB007(),false, new EiBlockMeta(), EiConstant.queryBlock, CommonConstant.Field.DETAIL, CommonConstant.Field.DETAIL);
}
}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMap PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN" "http://ibatis.apache.org/dtd/sql-map-2.dtd">
<sqlMap namespace="HGSB006">
<typeAlias alias="HGSB006" type="com.baosight.hggp.hg.sb.domain.HGSB006"/>
<typeAlias alias="HashMap" type="java.util.HashMap"/>
<sql id="column">
A.ID as "id", <!-- ID -->
A.ACCOUNT_CODE as "accountCode", <!-- 账套 -->
A.DEP_CODE as "depCode", <!-- 部门编码 -->
A.CREATED_BY as "createdBy", <!-- 创建人 -->
A.CREATED_NAME as "createdName", <!-- 创建人名称 -->
A.CREATED_TIME as "createdTime", <!-- 创建时间 -->
A.UPDATED_BY as "updatedBy", <!-- 修改人 -->
A.UPDATED_NAME as "updatedName", <!-- 修改人名称 -->
A.UPDATED_TIME as "updatedTime", <!-- 修改时间 -->
A.DELETE_FLAG as "deleteFlag", <!-- 是否删除 0-否1-是 -->
A.PARENT_ID as "parentId", <!-- 父级ID -->
B.COMPANY_CODE as "companyCode", <!-- 公司编码 -->
B.COMPANY_NAME as "companyName", <!-- 公司名称 -->
B.INSPEC_DATE as "inspecDate", <!-- 点检日期 -->
B.INSPEC_CODE as "inspecCode", <!-- 点检单号 -->
A.GROUP_CODE as "groupCode", <!-- 设备区域编码 -->
A.GROUP_NAME as "groupName", <!-- 设备区域名称 -->
B.PLAN_CODE as "planCode", <!-- 计划单号 -->
B.PLAN_START_DATE as "planStartDate", <!-- 计划开始日期 -->
B.PLAN_END_DATE as "planEndDate", <!-- 计划结束日期 -->
A.DEVICE_TYPE as "deviceType", <!-- 设备类型 -->
A.DEVICE_CODE as "deviceCode", <!-- 设备编码 -->
A.DEVICE_NAME as "deviceName", <!-- 设备名称 -->
A.DEVICE_MODEL as "deviceModel", <!-- 设备型号 -->
A.CHECK_ITEM as "checkItem", <!-- 检查项 -->
A.CHECK_DESCRIP as "checkDescrip", <!-- 检查描述 -->
A.CHECK_RESULT as "checkResult", <!-- 检查描述结果 -->
DATEDIFF(DATE_FORMAT(B.PLAN_END_DATE, '%Y-%m-%d'), CURDATE()) as "remainderDays",
A.DOC_ID as "docId", <!-- 附件ID -->
A.DOC_NAME as "docName"
</sql>
<sql id="authCondition">
<!-- 无权限时使用 -->
<isNotEmpty prepend=" AND " property="authDepCode">
A.DEP_CODE = #authDepCode#
</isNotEmpty>
<!-- 仅本人和部门组合 -->
<isEqual prepend=" AND " property="authCombination" compareValue="1">
(A.CREATED_BY = #authOnlyPeople# OR A.DEP_CODE IN <iterate close=")" open="(" conjunction="," property="authDepCodes">#authDepCodes[]#</iterate>)
</isEqual>
<!-- 仅本人或部门 -->
<isNotEqual prepend=" AND " property="authCombination" compareValue="1">
<isNotEmpty property="authOnlyPeople">
A.CREATED_BY = #authOnlyPeople#
</isNotEmpty>
<isNotEmpty property="authDepCodes">
A.DEP_CODE IN <iterate close=")" open="(" conjunction="," property="authDepCodes">#authDepCodes[]#</iterate>
</isNotEmpty>
</isNotEqual>
</sql>
<sql id="condition">
<include refid="authCondition"/>
<isNotEmpty prepend=" AND " property="id">
A.ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="accountCode">
A.ACCOUNT_CODE = #accountCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
A.DEP_CODE = #depCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdBy">
A.CREATED_BY = #createdBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdName">
A.CREATED_NAME = #createdName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdTime">
A.CREATED_TIME = #createdTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedBy">
A.UPDATED_BY = #updatedBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedName">
A.UPDATED_NAME = #updatedName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedTime">
A.UPDATED_TIME = #updatedTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deleteFlag">
A.DELETE_FLAG = #deleteFlag#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="parentId">
A.PARENT_ID = #parentId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
B.COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyName">
B.COMPANY_NAME LIKE CONCAT('%', #companyName#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="groupCode">
A.GROUP_CODE = #groupCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="groupName">
A.GROUP_NAME LIKE CONCAT('%', #groupName#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deviceType">
A.DEVICE_TYPE = #deviceType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deviceCode">
A.DEVICE_CODE = #deviceCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deviceName">
A.DEVICE_NAME LIKE CONCAT('%', #deviceName#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deviceModel">
A.DEVICE_MODEL LIKE CONCAT('%', #deviceModel#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="checkItem">
A.CHECK_ITEM LIKE CONCAT('%', #checkItem#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="checkDescrip">
A.CHECK_DESCRIP = #checkDescrip#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="checkResult">
A.CHECK_RESULT = #checkResult#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="docId">
A.DOC_ID = #docId#
</isNotEmpty>
<isEqual prepend=" AND " property="checkStatus" compareValue="1">
trim(A.DOC_ID) ='' and trim(A.CHECK_RESULT) = ''
</isEqual>
<isEqual prepend=" AND " property="checkStatus" compareValue="2">
(trim(A.DOC_ID) !='' or trim(A.CHECK_RESULT) != '')
</isEqual>
</sql>
<select id="query" parameterClass="HashMap" resultClass="HGSB006">
SELECT
<include refid="column"/>
FROM ${hggpSchema}.HGSB004A A
LEFT JOIN ${hggpSchema}.HGSB004 B ON A.PARENT_ID = B.ID WHERE 1=1
<include refid="condition" />
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
B.PLAN_START_DATE desc,B.PLAN_END_DATE desc, A.ID asc
</isEmpty>
</dynamic>
</select>
<select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hggpSchema}.HGSB004A A
LEFT JOIN ${hggpSchema}.HGSB004 B ON A.PARENT_ID = B.ID WHERE 1=1
<include refid="condition" />
</select>
</sqlMap>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMap PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN" "http://ibatis.apache.org/dtd/sql-map-2.dtd">
<sqlMap namespace="HGSB007">
<typeAlias alias="HGSB007" type="com.baosight.hggp.hg.sb.domain.HGSB007"/>
<typeAlias alias="HashMap" type="java.util.HashMap"/>
<sql id="column">
A.ID as "id", <!-- ID -->
A.ACCOUNT_CODE as "accountCode", <!-- 账套 -->
A.DEP_CODE as "depCode", <!-- 部门编码 -->
A.CREATED_BY as "createdBy", <!-- 创建人 -->
A.CREATED_NAME as "createdName", <!-- 创建人名称 -->
A.CREATED_TIME as "createdTime", <!-- 创建时间 -->
A.UPDATED_BY as "updatedBy", <!-- 修改人 -->
A.UPDATED_NAME as "updatedName", <!-- 修改人名称 -->
A.UPDATED_TIME as "updatedTime", <!-- 修改时间 -->
A.DELETE_FLAG as "deleteFlag", <!-- 是否删除 0-否1-是 -->
A.PARENT_ID as "parentId", <!-- 父级ID -->
B.COMPANY_CODE as "companyCode", <!-- 公司编码 -->
B.COMPANY_NAME as "companyName", <!-- 公司名称 -->
A.GROUP_CODE as "groupCode", <!-- 设备区域编码 -->
A.GROUP_NAME as "groupName", <!-- 设备区域名称 -->
B.UPKEEP_DATE as "upkeepDate", <!-- 保养日期 -->
B.UPKEEP_CODE as "upkeepCode", <!-- 保养单号 -->
B.PLAN_START_DATE as "planStartDate", <!-- 计划开始日期 -->
B.PLAN_END_DATE as "planEndDate", <!-- 计划结束日期 -->
A.DEVICE_TYPE as "deviceType", <!-- 设备类型 -->
A.DEVICE_CODE as "deviceCode", <!-- 设备编码 -->
A.DEVICE_NAME as "deviceName", <!-- 设备名称 -->
A.DEVICE_MODEL as "deviceModel", <!-- 设备型号 -->
A.CHECK_ITEM as "checkItem", <!-- 检查项 -->
A.CHECK_DESCRIP as "checkDescrip", <!-- 检查描述 -->
A.CHECK_RESULT as "checkResult", <!-- 检查描述结果 -->
A.DOC_ID as "docId", <!-- 附件ID -->
A.DOC_NAME as "docName",
DATEDIFF(DATE_FORMAT(B.PLAN_END_DATE, '%Y-%m-%d'), CURDATE()) as "remainderDays"
</sql>
<sql id="authCondition">
<!-- 无权限时使用 -->
<isNotEmpty prepend=" AND " property="authDepCode">
A.DEP_CODE = #authDepCode#
</isNotEmpty>
<!-- 仅本人和部门组合 -->
<isEqual prepend=" AND " property="authCombination" compareValue="1">
(A.CREATED_BY = #authOnlyPeople# OR A.DEP_CODE IN <iterate close=")" open="(" conjunction="," property="authDepCodes">#authDepCodes[]#</iterate>)
</isEqual>
<!-- 仅本人或部门 -->
<isNotEqual prepend=" AND " property="authCombination" compareValue="1">
<isNotEmpty property="authOnlyPeople">
A.CREATED_BY = #authOnlyPeople#
</isNotEmpty>
<isNotEmpty property="authDepCodes">
A.DEP_CODE IN <iterate close=")" open="(" conjunction="," property="authDepCodes">#authDepCodes[]#</iterate>
</isNotEmpty>
</isNotEqual>
</sql>
<sql id="condition">
<include refid="authCondition"/>
<isNotEmpty prepend=" AND " property="id">
A.ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="accountCode">
A.ACCOUNT_CODE = #accountCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
DEP_CODE = #depCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdBy">
A.CREATED_BY = #createdBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdName">
A.CREATED_NAME = #createdName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdTime">
A.CREATED_TIME = #createdTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedBy">
A.UPDATED_BY = #updatedBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedName">
A.UPDATED_NAME = #updatedName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedTime">
A.UPDATED_TIME = #updatedTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deleteFlag">
A.DELETE_FLAG = #deleteFlag#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="parentId">
A.PARENT_ID = #parentId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
B.COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyName">
B.COMPANY_NAME LIKE CONCAT('%', #companyName#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="groupCode">
A.GROUP_CODE = #groupCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="groupName">
A.GROUP_NAME LIKE CONCAT('%', #groupName#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="upkeepDate">
B.UPKEEP_DATE = #upkeepDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="upkeepCode">
B.UPKEEP_CODE = #upkeepCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deviceType">
A.DEVICE_TYPE = #deviceType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deviceCode">
A.DEVICE_CODE = #deviceCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deviceName">
A.DEVICE_NAME LIKE CONCAT('%', #deviceName#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deviceModel">
A.DEVICE_MODEL LIKE CONCAT('%', #deviceModel#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="checkItem">
A.CHECK_ITEM LIKE CONCAT('%', #checkItem#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="checkDescrip">
A.CHECK_DESCRIP = #checkDescrip#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="checkResult">
A.CHECK_RESULT = #checkResult#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="docId">
A.DOC_ID = #docId#
</isNotEmpty>
<isEqual prepend=" AND " property="upkeepStatus" compareValue="1">
trim(A.DOC_ID) ='' and trim(A.CHECK_RESULT) = ''
</isEqual>
<isEqual prepend=" AND " property="upkeepStatus" compareValue="2">
(trim(A.DOC_ID) !='' or trim(A.CHECK_RESULT) != '')
</isEqual>
</sql>
<select id="query" parameterClass="HashMap" resultClass="HGSB007">
SELECT
<include refid="column"/>
FROM ${hggpSchema}.HGSB005A A
LEFT JOIN ${hggpSchema}.HGSB005 B ON A.PARENT_ID = B.ID WHERE 1=1
<include refid="condition" />
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
B.UPKEEP_DATE desc, A.CREATED_TIME desc, A.ID asc
</isEmpty>
</dynamic>
</select>
<select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hggpSchema}.HGSB005A A
LEFT JOIN ${hggpSchema}.HGSB005 B ON A.PARENT_ID = B.ID WHERE 1=1
<include refid="condition" />
</select>
</sqlMap>
\ No newline at end of file
......@@ -36,11 +36,6 @@ public class ServiceHGSJ002A extends ServiceEPBase {
String factoryCode = inInfo.getCell(EiConstant.queryBlock,ACConstants.ROW_CODE_0,HGSJ002A.FIELD_FACTORY_CODE).toString();
inInfo = super.query(inInfo, HGSJ002A.QUERY, new HGSJ002A());
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.COMPANY_BOX_BLOCK_ID,DdynamicEnum.PROCESS_CODE_BLOCK_ID),null);
CommonMethod.initBlock(inInfo, Arrays.asList(),
new HashMap<String,Object>(){{
//put(HGSJ002A.FIELD_FACTORY_CODE,factoryCode);
put(HGSJ002A.FIELD_DELETE_FLAG,CommonConstant.YesNo.NO_0);}}
);
return inInfo;
}
......
$(function () {
$(".row").children().attr("class", "col-md-3");
$("#QUERY").on("click", query);
IPLATUI.EFGrid= {
"result": {
pageable: {
pageSize: 10,
pageSizes: [10, 20, 50, 100],
},
columns: [
{
field: "remainderDays",
template: function (item) {
let template = '';
if (isBlank(item.checkResult.trim()) || isBlank(item.docId.trim())){
return item["remainderDays"];
}else {
return "0";
}
}
}, {
field: "checkStatus",
template: function (item) {
let template = '';
if (isBlank(item.checkResult.trim()) || isBlank(item.docId.trim())){
return "未点检";
}else {
return "已点检";
}
}
}, {
field: "earlyStatus",
template: function (item) {
let earlyStatus;
if (!isBlank(item.checkResult.trim()) || isBlank(!item.docId.trim())){
earlyStatus = "<span>已完成</span>";;
}else if (item.remainderDays == 0){
earlyStatus = "<span style='color: #67c20b'>点检期</span>";
}else if (item.remainderDays < 0){
earlyStatus = "<span style='color: red'>超期</span>";
}else if (item.remainderDays > 0){
earlyStatus = "<span>未到期</span>";
}
return earlyStatus;
}
}
],
exportGrid: {
exportFileName: function (gridInstance) {
// 导出的文件名包含时间戳 yyyy-MM-dd HH:mm:ss
return "设备点检详情_" + kendo.toString(new Date(), IPLAT.FORMAT.DATE_14_PR);
},
exportFileType: "xls", // 默认值是xls,可选值为pdf[规划中]
exportBlockId: "result", // 默认值和blockId相同,导出的EiInfo中的指定数据块被导出
},
loadComplete: function(grid) {
// 此 grid 对象
// 处理父子级联动,通过监听 change 事件,判断父级节点是否发生变化
grid.dataSource.bind("change", function(e) {
// 判断父级节点是否发生变化
if (e.field === "deviceType") {
loadChange(grid,e,"deviceCode");
}else if (e.field === "deviceCode") {
if (e.items[0].deviceType.length===0){
loadChange(grid,e,"deviceType");
}
//loadChange(grid,e,"userId");
}
});
},
afterEdit:function (e) {
},
onSave: function (e) {
// 阻止默认请求,使用自定义保存
e.preventDefault();
let btnNode = $(this);
//禁用按钮
btnNode.attr("disabled", true);
save(btnNode);
},
onDelete: function (e) {
// 阻止默认请求,使用自定义删除
//e.preventDefault();
//deleteFunc();
},
onSuccess: function (e) {
if (e.eiInfo.extAttr.methodName == 'save' || e.eiInfo.extAttr.methodName == 'delete') {
query();
}
},
onRowClick: function (e) {}
}
}
});
let query = function () {
resultGrid.dataSource.page(1);
}
\ No newline at end of file
<%--
Created by IntelliJ IDEA.
User: 1
Date: 2024/5/15
Time: 10:15
To change this template use File | Settings | File Templates.
--%>
<!DOCTYPE html>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="EF" tagdir="/WEB-INF/tags/EF" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<EF:EFPage title="设备点检预警">
<EF:EFRegion id="inqu" title="查询条件">
<div class="row">
<EF:EFSelect blockId="inqu_status" row="0" ename="companyCode" cname="公司名称" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="companyBox_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFInput blockId="inqu_status" row="0" ename="deviceName" cname="设备名称" placeholder="模糊查询" colWidth="3"/>
<EF:EFSelect blockId="inqu_status" row="0" ename="checkStatus" cname="点检状态" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFOption label="未点检" value="1"/>
<EF:EFOption label="已点检" value="2"/>
</EF:EFSelect>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="预警记录">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true">
<EF:EFColumn ename="id" primaryKey="true" cname="内码" hidden="true"/>
<EF:EFColumn ename="accountCode" cname="账套" hidden="true"/>
<EF:EFComboColumn ename="companyCode" cname="公司名称"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" readonly="true" width="120" required="true"
align="center" filter="contains" sort="true">
<EF:EFOptions blockId="companyBox_block_id" textField="textField" valueField="valueField"/>
</EF:EFComboColumn>
<EF:EFColumn ename="planCode" cname="计划单号" width="100" enable="false" readonly="true" align="center" required="true"/>
<EF:EFComboColumn ename="deviceCode" cname="设备名称"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" readonly="true" width="120" required="true"
align="center" filter="contains" sort="true">
<EF:EFOptions blockId="deviceCodeBox_block_id" textField="textField" valueField="valueField"/>
</EF:EFComboColumn>
<EF:EFColumn ename="planStartDate" cname="计划开始日期" width="120" align="center" editType="date"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" readonly="true" required="true"/>
<EF:EFColumn ename="planEndDate" cname="计划结束日期" width="120" align="center" editType="date"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" readonly="true" required="true"/>
<EF:EFColumn ename="remainderDays" cname="剩余点检天数" width="100" enable="false" align="center"/>
<EF:EFComboColumn ename="checkStatus" cname="点检状态"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" readonly="true" width="120"
align="center" filter="contains" sort="true">
<EF:EFOption label="未点检" value="1"/>
<EF:EFOption label="已点检" value="2"/>
</EF:EFComboColumn>
<EF:EFComboColumn ename="earlyStatus" cname="预警状态"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" readonly="true" width="120"
align="center" filter="contains" sort="true">
<EF:EFOption label="超期" value="-1"/>
<EF:EFOption label="点检期" value="0"/>
<EF:EFOption label="未到期" value="1"/>
<EF:EFOption label="已完成" value="2"/>
</EF:EFComboColumn>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
$(function () {
$(".row").children().attr("class", "col-md-3");
IPLATUI.EFGrid = {
/*"result": {
pageable: {
pageSize: 10,
pageSizes: [10, 20, 50, 100],
},
columns: [
{
field: "remainderDays",
template: function (item) {
let template = '';
if (isBlank(item.checkResult.trim()) || isBlank(item.docId.trim())){
return item["remainderDays"];
}else {
return "0";
}
}
}, {
field: "checkStatus",
template: function (item) {
let template = '';
if (isBlank(item.checkResult.trim()) || isBlank(item.docId.trim())){
return "未点检";
}else {
return "已点检";
}
}
}, {
field: "earlyStatus",
template: function (item) {
let earlyStatus;
if (!isBlank(item.checkResult.trim()) || isBlank(!item.docId.trim())){
earlyStatus = "<span>已完成</span>";;
}else if (item.remainderDays == 0){
earlyStatus = "<span style='color: #67c20b'>点检期</span>";
}else if (item.remainderDays < 0){
earlyStatus = "<span style='color: red'>超期</span>";
}else if (item.remainderDays > 0){
earlyStatus = "<span>未到期</span>";
}
return earlyStatus;
}
}
],
exportGrid: {
exportFileName: function (gridInstance) {
// 导出的文件名包含时间戳 yyyy-MM-dd HH:mm:ss
return "设备点检详情_" + kendo.toString(new Date(), IPLAT.FORMAT.DATE_14_PR);
},
exportFileType: "xls", // 默认值是xls,可选值为pdf[规划中]
exportBlockId: "result", // 默认值和blockId相同,导出的EiInfo中的指定数据块被导出
},
loadComplete: function(grid) {
// 此 grid 对象
// 处理父子级联动,通过监听 change 事件,判断父级节点是否发生变化
grid.dataSource.bind("change", function(e) {
// 判断父级节点是否发生变化
if (e.field === "deviceType") {
loadChange(grid,e,"deviceCode");
}else if (e.field === "deviceCode") {
if (e.items[0].deviceType.length===0){
loadChange(grid,e,"deviceType");
}
//loadChange(grid,e,"userId");
}
});
},
afterEdit:function (e) {
},
onSave: function (e) {
// 阻止默认请求,使用自定义保存
e.preventDefault();
let btnNode = $(this);
//禁用按钮
btnNode.attr("disabled", true);
save(btnNode);
},
onDelete: function (e) {
// 阻止默认请求,使用自定义删除
//e.preventDefault();
//deleteFunc();
},
onSuccess: function (e) {
if (e.eiInfo.extAttr.methodName == 'save' || e.eiInfo.extAttr.methodName == 'delete') {
query();
}
},
onRowClick: function (e) {}
},*/
"detail": {
pageable: {
pageSize: 10,
pageSizes: [10, 20, 50, 100],
},
columns: [
{
field: "remainderDays",
template: function (item) {
let template = '';
if (isBlank(item.checkResult.trim()) || isBlank(item.docId.trim())){
return item["remainderDays"];
}else {
return "0";
}
}
}, {
field: "upkeepStatus",
template: function (item) {
let template = '';
if (isBlank(item.checkResult.trim()) || isBlank(item.docId.trim())){
return "未保养";
}else {
return "已保养";
}
}
}, {
field: "earlyStatus",
template: function (item) {
let earlyStatus;
if (!isBlank(item.checkResult.trim()) || isBlank(!item.docId.trim())){
earlyStatus = "<span>已完成</span>";;
}else if (item.remainderDays == 0){
earlyStatus = "<span style='color: #67c20b'>保养期</span>";
}else if (item.remainderDays < 0){
earlyStatus = "<span style='color: red'>超期</span>";
}else if (item.remainderDays > 0){
earlyStatus = "<span>未到期</span>";
}
return earlyStatus;
}
}
],
exportGrid: {
exportFileName: function (gridInstance) {
// 导出的文件名包含时间戳 yyyy-MM-dd HH:mm:ss
return "设备点检详情_" + kendo.toString(new Date(), IPLAT.FORMAT.DATE_14_PR);
},
exportFileType: "xls", // 默认值是xls,可选值为pdf[规划中]
exportBlockId: "result", // 默认值和blockId相同,导出的EiInfo中的指定数据块被导出
},
loadComplete: function(grid) {
// 此 grid 对象
$("#QUERY").on("click", function () {
grid.dataSource.page(1);
});
}
}
}
});
/*
let deepblue = false;
window.onload = () => {
//switchWindow(2);
waitForLoad(0);
function waitForLoad(count) {
const orgHeight = $(window).height();
if (count < 10 && orgHeight < 300) {
setTimeout(() => {
waitForLoad(++count);
}, 200)
} else {
$("#info1").height(orgHeight - 90)
$("#info2").height(orgHeight - 90)
// 初始加载
$("#my-button-1").css("border-bottom", `2px solid #237CF0`);
$("#my-button-2").css("border-bottom", `2px solid transparent`);
const themeStr = document.body.className
if (~themeStr.indexOf("deepblue")) {
$(".my-head").css("background", "#16286b")
$("#my-text1").css("color", "#57cfff")
$("#my-text2").css("color", "#ffffff")
$("#my-button-1").css("border-bottom", `2px solid #57cfff`);
deepblue = true
}
if (~themeStr.indexOf("large")) {
$(".my-head").css("height", "2.75rem")
$(".my-text").css("font-size", "1rem")
$(".my-text").css("height", "2.75rem")
}
}
}
}
let switchWindow = (option) => {
if (option) {
$("#info1").css("display", "none")
$("#info2").css("display", "none")
$("#my-text1").css("color", `${!deepblue && "rgba(0,0,0,0.85)" || "#ffffff"}`)
$("#my-text2").css("color", `${!deepblue && "rgba(0,0,0,0.85)" || "#ffffff"}`)
$("#my-button-1").css("border-bottom", `2px solid transparent`);
$("#my-button-2").css("border-bottom", `2px solid transparent`);
switch (option) {
case 1:
break;
case 2:
// 初始加载
// 防止初始加载时切换按钮被高频反复点击,导致iframe加载不全
$(".my-head").css("pointer-events", "none");
setTimeout(() => {
$(".my-head").css("pointer-events", "");
}, 1000)
break;
}
$(`#info${option}`).css("display", "block")
$(`#my-text${option}`).css("color", `${(!deepblue && "#2f80ed") || "#57cfff"}`)
$(`#my-button-${option}`).css("border-bottom", `2px solid ${!deepblue && "#237CF0" || "#57cfff"}`);
}
}*/
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment